From: Donghyun Lee Date: Fri, 4 Sep 2015 03:46:26 +0000 (+0900) Subject: LB reviewed and updated X-Git-Tag: tizen_3.0/TD_SYNC/20161201~573 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f62b68a3ab8b4d17294444563988b382b9600c5;p=sdk%2Fonline-doc.git LB reviewed and updated --- diff --git a/org.tizen.devtools/html/common_tools/certificate_registration.htm b/org.tizen.devtools/html/common_tools/certificate_registration.htm index 38ed441..92dd408 100644 --- a/org.tizen.devtools/html/common_tools/certificate_registration.htm +++ b/org.tizen.devtools/html/common_tools/certificate_registration.htm @@ -22,7 +22,7 @@
-

Mobile Web Wearable Web Mobile native Wearable native

+

Mobile Wearable

Certificate Registration

diff --git a/org.tizen.devtools/html/common_tools/connection_explorer.htm b/org.tizen.devtools/html/common_tools/connection_explorer.htm index 40468d5..27e7fbf 100644 --- a/org.tizen.devtools/html/common_tools/connection_explorer.htm +++ b/org.tizen.devtools/html/common_tools/connection_explorer.htm @@ -18,7 +18,7 @@
-

Mobile Web Wearable Web Mobile native Wearable native

+

Mobile Wearable

Content

diff --git a/org.tizen.devtools/html/common_tools/emulator.htm b/org.tizen.devtools/html/common_tools/emulator.htm index 766bff9..b5b7bc5 100644 --- a/org.tizen.devtools/html/common_tools/emulator.htm +++ b/org.tizen.devtools/html/common_tools/emulator.htm @@ -19,7 +19,7 @@
-

Mobile Web Wearable Web Mobile native Wearable native

+

Mobile Wearable

Content

@@ -226,21 +226,22 @@
  • OpenGL® ES version -

    You can select OpenGL® ES version you want to use in Mac OS®. +

    You can select the OpenGL® ES version you want to use in Mac OS®.

      -
    • v2.0 & v3.0
    • -
    • v1.1 & v2.0
    • +
    • v2.0 & v3.0
    • +
    • v1.1 & v2.0
    + - - - - - - - - -
    Note
    If GPU acceleration is set to OFF or Disable, this option is not available.
    + + + Note + + + If GPU acceleration is set to OFF or Disable, this option is not available. + + +
  • Advanced Option @@ -248,14 +249,14 @@
    • Mobile
        -
      • Camera: Virtual, Webcam
      • +
      • Camera: virtual, Webcam
      • Sensor: accelerometer, gyroscope, geo-magnetic, proximity, light, haptic, pressure, ultraviolet, heartbeat rate meter
      • Device: battery
      • Jack: ear jack, charger, USB
    • Wearable diff --git a/org.tizen.devtools/html/images/Thumbs.db b/org.tizen.devtools/html/images/Thumbs.db new file mode 100644 index 0000000..02e945d Binary files /dev/null and b/org.tizen.devtools/html/images/Thumbs.db differ diff --git a/org.tizen.devtools/html/images/fallback_directory.png b/org.tizen.devtools/html/images/fallback_directory.png new file mode 100644 index 0000000..a86f68d Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_directory.png differ diff --git a/org.tizen.devtools/html/images/fallback_folding.png b/org.tizen.devtools/html/images/fallback_folding.png new file mode 100644 index 0000000..529b954 Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_folding.png differ diff --git a/org.tizen.devtools/html/images/fallback_hierarchy.png b/org.tizen.devtools/html/images/fallback_hierarchy.png new file mode 100644 index 0000000..f0ef99e Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_hierarchy.png differ diff --git a/org.tizen.devtools/html/images/fallback_icon.png b/org.tizen.devtools/html/images/fallback_icon.png new file mode 100644 index 0000000..e7f5c61 Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_icon.png differ diff --git a/org.tizen.devtools/html/images/fallback_lists.png b/org.tizen.devtools/html/images/fallback_lists.png new file mode 100644 index 0000000..530e20f Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_lists.png differ diff --git a/org.tizen.devtools/html/images/fallback_output.png b/org.tizen.devtools/html/images/fallback_output.png new file mode 100644 index 0000000..336aa12 Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_output.png differ diff --git a/org.tizen.devtools/html/images/fallback_resmanager.png b/org.tizen.devtools/html/images/fallback_resmanager.png new file mode 100644 index 0000000..4a544ab Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_resmanager.png differ diff --git a/org.tizen.devtools/html/images/fallback_resxml.png b/org.tizen.devtools/html/images/fallback_resxml.png new file mode 100644 index 0000000..b3f4bac Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_resxml.png differ diff --git a/org.tizen.devtools/html/images/fallback_tablist.png b/org.tizen.devtools/html/images/fallback_tablist.png new file mode 100644 index 0000000..0406215 Binary files /dev/null and b/org.tizen.devtools/html/images/fallback_tablist.png differ diff --git a/org.tizen.devtools/html/images/mn_division.png b/org.tizen.devtools/html/images/mn_division.png index 1f7e337..faecb28 100644 Binary files a/org.tizen.devtools/html/images/mn_division.png and b/org.tizen.devtools/html/images/mn_division.png differ diff --git a/org.tizen.devtools/html/images/mobile_s_n.png b/org.tizen.devtools/html/images/mobile_s_n.png new file mode 100644 index 0000000..ad8c779 Binary files /dev/null and b/org.tizen.devtools/html/images/mobile_s_n.png differ diff --git a/org.tizen.devtools/html/images/mobile_s_w.png b/org.tizen.devtools/html/images/mobile_s_w.png new file mode 100644 index 0000000..f86df29 Binary files /dev/null and b/org.tizen.devtools/html/images/mobile_s_w.png differ diff --git a/org.tizen.devtools/html/images/mobile_s_wn.png b/org.tizen.devtools/html/images/mobile_s_wn.png new file mode 100644 index 0000000..ec30fd2 Binary files /dev/null and b/org.tizen.devtools/html/images/mobile_s_wn.png differ diff --git a/org.tizen.devtools/html/images/mw_division.png b/org.tizen.devtools/html/images/mw_division.png index 8fc3efa..c4a8655 100644 Binary files a/org.tizen.devtools/html/images/mw_division.png and b/org.tizen.devtools/html/images/mw_division.png differ diff --git a/org.tizen.devtools/html/images/n_division.png b/org.tizen.devtools/html/images/n_division.png index d687bc5..5a0b8f6 100644 Binary files a/org.tizen.devtools/html/images/n_division.png and b/org.tizen.devtools/html/images/n_division.png differ diff --git a/org.tizen.devtools/html/images/nuib_ui_builder.png b/org.tizen.devtools/html/images/nuib_ui_builder.png index 54e2ed4..d158bb5 100644 Binary files a/org.tizen.devtools/html/images/nuib_ui_builder.png and b/org.tizen.devtools/html/images/nuib_ui_builder.png differ diff --git a/org.tizen.devtools/html/images/nuib_we_editor.png b/org.tizen.devtools/html/images/nuib_we_editor.png index 993e751..151f370 100644 Binary files a/org.tizen.devtools/html/images/nuib_we_editor.png and b/org.tizen.devtools/html/images/nuib_we_editor.png differ diff --git a/org.tizen.devtools/html/images/potential_bug_result.png b/org.tizen.devtools/html/images/potential_bug_result.png index 1d5932c..27c7180 100644 Binary files a/org.tizen.devtools/html/images/potential_bug_result.png and b/org.tizen.devtools/html/images/potential_bug_result.png differ diff --git a/org.tizen.devtools/html/images/properties_go_to_1.png b/org.tizen.devtools/html/images/properties_go_to_1.png index 6607a5e..8de7f1e 100644 Binary files a/org.tizen.devtools/html/images/properties_go_to_1.png and b/org.tizen.devtools/html/images/properties_go_to_1.png differ diff --git a/org.tizen.devtools/html/images/properties_specification_1.png b/org.tizen.devtools/html/images/properties_specification_1.png index 61c3d3e..7ede8bd 100644 Binary files a/org.tizen.devtools/html/images/properties_specification_1.png and b/org.tizen.devtools/html/images/properties_specification_1.png differ diff --git a/org.tizen.devtools/html/images/storyboard_add_new.png b/org.tizen.devtools/html/images/storyboard_add_new.png new file mode 100644 index 0000000..7bd62cf Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_add_new.png differ diff --git a/org.tizen.devtools/html/images/storyboard_codegen.png b/org.tizen.devtools/html/images/storyboard_codegen.png new file mode 100644 index 0000000..3a3bdc0 Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_codegen.png differ diff --git a/org.tizen.devtools/html/images/storyboard_conn_properties.png b/org.tizen.devtools/html/images/storyboard_conn_properties.png new file mode 100644 index 0000000..50425fc Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_conn_properties.png differ diff --git a/org.tizen.devtools/html/images/storyboard_contextmenu.png b/org.tizen.devtools/html/images/storyboard_contextmenu.png new file mode 100644 index 0000000..02e6825 Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_contextmenu.png differ diff --git a/org.tizen.devtools/html/images/storyboard_diagram.png b/org.tizen.devtools/html/images/storyboard_diagram.png new file mode 100644 index 0000000..74be06c Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_diagram.png differ diff --git a/org.tizen.devtools/html/images/storyboard_drag.png b/org.tizen.devtools/html/images/storyboard_drag.png new file mode 100644 index 0000000..dbcaa83 Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_drag.png differ diff --git a/org.tizen.devtools/html/images/storyboard_properties.png b/org.tizen.devtools/html/images/storyboard_properties.png new file mode 100644 index 0000000..6aa6425 Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_properties.png differ diff --git a/org.tizen.devtools/html/images/storyboard_wizard.png b/org.tizen.devtools/html/images/storyboard_wizard.png new file mode 100644 index 0000000..bcde043 Binary files /dev/null and b/org.tizen.devtools/html/images/storyboard_wizard.png differ diff --git a/org.tizen.devtools/html/images/w_division.png b/org.tizen.devtools/html/images/w_division.png index 88d9959..443a1ea 100644 Binary files a/org.tizen.devtools/html/images/w_division.png and b/org.tizen.devtools/html/images/w_division.png differ diff --git a/org.tizen.devtools/html/images/wearable_s_n.png b/org.tizen.devtools/html/images/wearable_s_n.png new file mode 100644 index 0000000..02e3791 Binary files /dev/null and b/org.tizen.devtools/html/images/wearable_s_n.png differ diff --git a/org.tizen.devtools/html/images/wearable_s_w.png b/org.tizen.devtools/html/images/wearable_s_w.png new file mode 100644 index 0000000..379a9c5 Binary files /dev/null and b/org.tizen.devtools/html/images/wearable_s_w.png differ diff --git a/org.tizen.devtools/html/images/wearable_s_wn.png b/org.tizen.devtools/html/images/wearable_s_wn.png new file mode 100644 index 0000000..280245d Binary files /dev/null and b/org.tizen.devtools/html/images/wearable_s_wn.png differ diff --git a/org.tizen.devtools/html/images/wn_division.png b/org.tizen.devtools/html/images/wn_division.png index 11a7876..dca667f 100644 Binary files a/org.tizen.devtools/html/images/wn_division.png and b/org.tizen.devtools/html/images/wn_division.png differ diff --git a/org.tizen.devtools/html/images/ww_division.png b/org.tizen.devtools/html/images/ww_division.png index 65e7ab7..5f5160c 100644 Binary files a/org.tizen.devtools/html/images/ww_division.png and b/org.tizen.devtools/html/images/ww_division.png differ diff --git a/org.tizen.devtools/html/index.htm b/org.tizen.devtools/html/index.htm index 24e4900..5842c71 100644 --- a/org.tizen.devtools/html/index.htm +++ b/org.tizen.devtools/html/index.htm @@ -79,12 +79,16 @@
  • PO File Editor
  • -
  • UI Builder
  • +
  • UI Builder + +
  • Enventor
  • Command Line Interface - +
  • Call Stack View
  • Dynamic Analyzer @@ -102,7 +106,8 @@
  • Static Analyzer
  • Valgrind
  • -
  • T-trace
  • +
  • T-trace
  • +
  • Resource Explorer
  • diff --git a/org.tizen.devtools/html/native_tools/api_privilege_checker_n.htm b/org.tizen.devtools/html/native_tools/api_privilege_checker_n.htm index 542474b..400b70f 100644 --- a/org.tizen.devtools/html/native_tools/api_privilege_checker_n.htm +++ b/org.tizen.devtools/html/native_tools/api_privilege_checker_n.htm @@ -19,7 +19,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    API and Privilege Checker

    diff --git a/org.tizen.devtools/html/native_tools/call_stack_view_n.htm b/org.tizen.devtools/html/native_tools/call_stack_view_n.htm index 779f0e9..23a3e52 100644 --- a/org.tizen.devtools/html/native_tools/call_stack_view_n.htm +++ b/org.tizen.devtools/html/native_tools/call_stack_view_n.htm @@ -19,7 +19,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Call Stack View

    diff --git a/org.tizen.devtools/html/native_tools/command_line_interface_n.htm b/org.tizen.devtools/html/native_tools/command_line_interface_n.htm index e4632b0..38278f3 100644 --- a/org.tizen.devtools/html/native_tools/command_line_interface_n.htm +++ b/org.tizen.devtools/html/native_tools/command_line_interface_n.htm @@ -19,7 +19,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Command Line Interface

    @@ -105,10 +105,11 @@ Sets the default connection timeout value. The default is 60000 milliseconds.

    $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
    -
    +> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml" + +
  • List all options for which values are set:

     $ tizen cli-config –l
    @@ -171,10 +172,10 @@ tizen create native-project [-p|--profile <profile name>] [-t|--template &
     $ tizen create native-project –p mobile-2.3 –t basic_ui –n basic -- /home/workspace
     $ cd /home/workspace/basic
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat create native-project –p mobile-2.3 –t basic_ui –n basic -- C:\Users\workspace
    -> cd C:\Users\workspace\basic
    +> tizen.bat create native-project –p mobile-2.3 –t basic_ui –n basic -- C:\Users\workspace
    +> cd C:\Users\workspace\basic
     
  • @@ -204,11 +205,12 @@ tizen build-native [-a|--arch <architecture name>] [-c|--compiler <comp $ tizen build-native -–arch x86 –-compiler llvm –-configuration Debug -- /home/workspace/basic $ ls /home/workspace/basic/Debug/ -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat build-native -–arch x86 –-compiler llvm –-configuration Debug -- C:\Users\workspace\basic
    -> dir C:\Users\workspace\basic\Debug
    -
    +> tizen.bat build-native -–arch x86 –-compiler llvm –-configuration Debug -- C:\Users\workspace\basic +> dir C:\Users\workspace\basic\Debug + +
  • Build the project with the default options:

     $ tizen cli-config –l
    @@ -218,34 +220,35 @@ default.build.configuration=Debug
     $ tizen build-native -- /home/workspace/basic
     $ ls /home/workspace/basic/Debug/
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat build-native -- C:\Users\workspace\basic
    -> dir C:\Users\workspace\basic\Debug
    +> tizen.bat build-native -- C:\Users\workspace\basic
    +> dir C:\Users\workspace\basic\Debug
     
  • - - - tizen clean - + + + + tizen clean +
     tizen clean [--]
     
    - Clean the Tizen native project. - + Clean the Tizen native project. +
    • Clean the project:

       $ tizen clean -- /home/workspace/basic
       
      -

      or for Windows,

      +

      Or for Windows:

      -> tizen.bat clean -- C:\Users\workspace\basic
      +> tizen.bat clean -- C:\Users\workspace\basic
       
    - + tizen package @@ -275,17 +278,18 @@ tizen package [-t | --type <package type>] [-s | --sign <security profi
     $ tizen cli-config –g default.profiles.path=/home/tizen-sdk/tools/ide/conf/profiles.xml
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat cli-config –g "default.profiles.path=C:\tizen-sdk\tools\ide\conf\profiles.xml"
    -
    +> tizen.bat cli-config –g "default.profiles.path=C:\tizen-sdk\tools\ide\conf\profiles.xml" + +
  • Set up the path of the profile.xml file that is created from the IDE:

     $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
    +> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
     
  • Package the profile:

    @@ -295,18 +299,20 @@ $ ls /home/workspace/basic/Debug
     
     org.tizen.basic-1.0.0-i386.tpk
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat package –-type tpk –-sign myprofile -- C:\Users\workspace\basic\Debug
    -
  • +> tizen.bat package –-type tpk –-sign myprofile -- C:\Users\workspace\basic\Debug + +
  • Re-sign the package:

     $ tizen package --type tpk --sign myprofile2 -- /home/workspace/basic/Debug/org.tizen.basic-1.0.0-i386.tpk
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat package --type tpk --sign myprofile2 -- C:\Users\workspace\basic\Debug\org.tizen.basic-1.0.0-i386.tpk
    -
  • +> tizen.bat package --type tpk --sign myprofile2 -- C:\Users\workspace\basic\Debug\org.tizen.basic-1.0.0-i386.tpk + + @@ -332,9 +338,9 @@ tizen install <-t | -target <target name>> <-n | --name <packa
     $ tizen install -–target emulator-26101 –-name org.tizen.basic-1.0.0-i386.tpk -- /home/workspace/basic/Debug
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat install -–target emulator-26101 –-name org.tizen.basic-1.0.0-i386.tpk -- C:\Users\workspace\basic\Debug
    +> tizen.bat install -–target emulator-26101 –-name org.tizen.basic-1.0.0-i386.tpk -- C:\Users\workspace\basic\Debug
     
    diff --git a/org.tizen.devtools/html/native_tools/content_assist_n.htm b/org.tizen.devtools/html/native_tools/content_assist_n.htm index 928b0d8..e388284 100644 --- a/org.tizen.devtools/html/native_tools/content_assist_n.htm +++ b/org.tizen.devtools/html/native_tools/content_assist_n.htm @@ -20,7 +20,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content Assist

    diff --git a/org.tizen.devtools/html/native_tools/da_checkpoint_n.htm b/org.tizen.devtools/html/native_tools/da_checkpoint_n.htm index 34ea149..7e1d0a1 100644 --- a/org.tizen.devtools/html/native_tools/da_checkpoint_n.htm +++ b/org.tizen.devtools/html/native_tools/da_checkpoint_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -36,13 +36,16 @@

    CheckPoint Analysis

    The CheckPoint tab of the dynamic analyzer shows the actual value of variables at specific points of code (CheckPoint). You can trace the changes in the variable value to help in the application debugging.

    The CheckPoints can be set in the IDE source editor, and the CheckPoint value is shown in the dynamic analyzer.

    -

    Figure: CheckPoint analysis

    -

    CheckPoint analysis

    +

    The tab consists of the following views:

    1. CheckPoint chart shows the values of all variables.
    2. CheckPoint list shows the values of a specific variable selected on the chart.
    + +

    Figure: CheckPoint analysis

    +

    CheckPoint analysis

    +

    Setting the CheckPoint in the IDE

    To use the CheckPoint Analysis, you must set a CheckPoint in the IDE source editor. The CheckPoint can be set on any valid point, which is a variable in an executable line:

    diff --git a/org.tizen.devtools/html/native_tools/da_file_n.htm b/org.tizen.devtools/html/native_tools/da_file_n.htm index 264b526..eab4f7b 100644 --- a/org.tizen.devtools/html/native_tools/da_file_n.htm +++ b/org.tizen.devtools/html/native_tools/da_file_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -38,15 +38,17 @@

    File Analysis

    The File tab of the dynamic analyzer shows information associated with file operations. The File tab can be enabled or disabled in runtime from the Configuration dialog. If the file analysis capabilities are disables, the file API information is not displayed.

    - -

    Figure: File analysis

    -

    File analysis

    +

    The tab consists of the following views:

    1. File chart shows file operations (open/close, read/write, lock) as a time flow chart.
    2. File API List view shows the file APIs that are associated with the file selected in the file chart.
    3. File Details view shows detail information of the file selected in the file chart.
    + +

    Figure: File analysis

    +

    File analysis

    +

    Together, the views shows the following information:

    • Name and location of the file
    • Current state of the file (closed or open)
    • diff --git a/org.tizen.devtools/html/native_tools/da_network_n.htm b/org.tizen.devtools/html/native_tools/da_network_n.htm index 9dff939..3899547 100644 --- a/org.tizen.devtools/html/native_tools/da_network_n.htm +++ b/org.tizen.devtools/html/native_tools/da_network_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -40,8 +40,6 @@

      The Network tab of the dynamic analyzer displays network information. It only supports the socket APIs of glibc.

      -

      Figure: Network analysis

      -

      Network analysis

      The tab consists of the following views:

        @@ -50,6 +48,9 @@
      1. Network Details view shows detail information of the socket selected in the socket chart.
      +

      Figure: Network analysis

      +

      Network analysis

      +

      Network Chart

      diff --git a/org.tizen.devtools/html/native_tools/da_opengl_n.htm b/org.tizen.devtools/html/native_tools/da_opengl_n.htm index 441b7ad..45dc692 100644 --- a/org.tizen.devtools/html/native_tools/da_opengl_n.htm +++ b/org.tizen.devtools/html/native_tools/da_opengl_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -40,9 +40,7 @@

      The OpenGL (Open Graphics Library) page of the dynamic analyzer displays information about OpenGL® 2.0 and EvasGL.

      -

      Figure: OpenGL® analysis

      -

      OpenGL® analysis

      - +

      The tab consists of the following views:

      • OpenGL® chart shows the elapsed time of the frame.
      • @@ -53,6 +51,9 @@
      • Program list shows all the shader program information.
      • Texture list shows texture information.
      +

      Figure: OpenGL® analysis

      +

      OpenGL® analysis

      +

      OpenGL® Chart

      The OpenGL® chart displays the elapsed frame time with 2 charts:

      diff --git a/org.tizen.devtools/html/native_tools/da_overview_n.htm b/org.tizen.devtools/html/native_tools/da_overview_n.htm index 034da08..5bd41af 100644 --- a/org.tizen.devtools/html/native_tools/da_overview_n.htm +++ b/org.tizen.devtools/html/native_tools/da_overview_n.htm @@ -23,7 +23,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Dynamic Analyzer

      You can monitor the performance and reliability of your Native application on a target device or the Emulator diff --git a/org.tizen.devtools/html/native_tools/da_range_info_n.htm b/org.tizen.devtools/html/native_tools/da_range_info_n.htm index bfae7d1..836fb4d 100644 --- a/org.tizen.devtools/html/native_tools/da_range_info_n.htm +++ b/org.tizen.devtools/html/native_tools/da_range_info_n.htm @@ -21,7 +21,7 @@

      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Range

      diff --git a/org.tizen.devtools/html/native_tools/da_summary_n.htm b/org.tizen.devtools/html/native_tools/da_summary_n.htm index d7f7fdb..59dab2f 100644 --- a/org.tizen.devtools/html/native_tools/da_summary_n.htm +++ b/org.tizen.devtools/html/native_tools/da_summary_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -36,8 +36,7 @@

      Summary

      The Summary tab of the dynamic analyzer provides various information about the application performance.

      -

      Figure: Summary information

      -

      Summary information

      +

      The tab consists of the following views:

        @@ -46,7 +45,8 @@
      1. Function Usage Profiling view shows profiling information of the used methods.
      - +

      Figure: Summary information

      +

      Summary information

      Leaks

      The Leaks view shows data that is recognized as a leak on application runtime, mainly related to memory allocation and file operations.

      diff --git a/org.tizen.devtools/html/native_tools/da_thread_n.htm b/org.tizen.devtools/html/native_tools/da_thread_n.htm index 36af9ea..8b30bab 100644 --- a/org.tizen.devtools/html/native_tools/da_thread_n.htm +++ b/org.tizen.devtools/html/native_tools/da_thread_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -37,8 +37,7 @@

      Thread Analysis

      The Thread tab of the dynamic analyzer displays information about threads and synchronization.

      -

      Figure: Thread analysis

      -

      Thread analysis

      +

      The tab consists of the following views:

      1. Thread chart displays thread and synchronization operations and the thread load as a time flow graph.
      2. @@ -47,6 +46,9 @@
      3. Snapshot view provides additional information in the form of snapshots.
      +

      Figure: Thread analysis

      +

      Thread analysis

      +

      Thread Chart

      The thread chart displays the thread and the related synchronization object in a tree format using a graph.

      You can select either thread or synchronization as a parent of the tree.

      diff --git a/org.tizen.devtools/html/native_tools/da_timeline_n.htm b/org.tizen.devtools/html/native_tools/da_timeline_n.htm index 34ad6ed..60f593b 100644 --- a/org.tizen.devtools/html/native_tools/da_timeline_n.htm +++ b/org.tizen.devtools/html/native_tools/da_timeline_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -35,8 +35,7 @@

      Timeline

      The Timeline tab of the dynamic analyzer shows the data values over time as a graph.

      -

      Figure: Timeline information

      -

      Timeline information

      +

      The tab consists of the following views:

      1. Timeline chart shows the data values in a graph. The chart content can be edited in the Edit chart dialog.
      2. @@ -44,6 +43,9 @@
      3. Call Trace shows the user API calls.
      +

      Figure: Timeline information

      +

      Timeline information

      +

      Timeline Chart

      The timeline chart shows the data values over time as a chart. You can create 12 different charts, which can be selected from the left side of the window.

      diff --git a/org.tizen.devtools/html/native_tools/da_views_n.htm b/org.tizen.devtools/html/native_tools/da_views_n.htm index a29f9b8..8c4f301 100644 --- a/org.tizen.devtools/html/native_tools/da_views_n.htm +++ b/org.tizen.devtools/html/native_tools/da_views_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      diff --git a/org.tizen.devtools/html/native_tools/enventor_n.htm b/org.tizen.devtools/html/native_tools/enventor_n.htm index ea6e775..bad493f 100644 --- a/org.tizen.devtools/html/native_tools/enventor_n.htm +++ b/org.tizen.devtools/html/native_tools/enventor_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native

      @@ -45,13 +45,8 @@

      Enventor

      Tizen SDK provides a useful theme editor tool, Enventor. Enventor supports the text edit function and the preview function for EDC source code. You can edit EDC source code to create your layout using Enventor.

      - -

      For more information about the EDC format, see Edje module and EDC format.

      - -

      Figure: Enventor basic view

      -

      Enventor basic view

      - -

      Before using Enventor, familiarize yourself with the following:

      + +

      Before using Enventor, familiarize yourself with the following:

      + + + + + + + + + +
      Note
      Enventor is supported only in mobile Ubuntu.
      + +

      For more information about the EDC format, see Edje module and EDC format.

      + +

      Figure: Enventor basic view

      +

      Enventor basic view

      + + +

      Enventor Layout

      Basically, the Enventor view is divided into 2 sections, the live view and the text view. The live view is the left pane of the Enventor window and it previews images corresponding to the part objects of EDC source code. The text view is the right pane of the Enventor window and it contains EDC source code.

      diff --git a/org.tizen.devtools/html/native_tools/manifest_elements_n.htm b/org.tizen.devtools/html/native_tools/manifest_elements_n.htm index 0688710..f931f72 100644 --- a/org.tizen.devtools/html/native_tools/manifest_elements_n.htm +++ b/org.tizen.devtools/html/native_tools/manifest_elements_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -340,21 +340,23 @@

      <background-category> Element

      -

      The <background-category> element represents category of the application running on the background.

      +

      The <background-category> element represents the category of the application running on the background.

      - + +
      Note
      <background-category> is not supported for lower than 2.4 version of the API, so an application with <background-category> may failed to be installed on the devices with Tizen lower than version 2.4. In this case, the element can be replaced with <metadata key="http://tizen.org/metadata/bacgkround-category/value"/>
      The <background-category> element is not supported for API versions lower than 2.4. An application with a <background-category> element can fail to be installed on devices with a Tizen version lower than 2.4. In this case, the element can be replaced with <metadata key="http://tizen.org/metadata/bacgkround-category/<value>"/>.
      + - -
      <background-category> element
      -

      Category of the application that is allowed to run on the background

      +
      +

      Category of the application that is allowed to run on the background.

      For more information on the relationship between the elements, see the Element hierarchy.

      Occurrences:

        @@ -372,7 +374,7 @@ value attribute

      Value of background category

      +

      Value of the background category.

      Expected value:

      • String
      • @@ -380,8 +382,10 @@
      -

      For example:

      <background-category value="download"/><!-- for the API version 2.4 or later -->
      -<metadata key="http://tizen.org/metadata/background-category/download"/><!-- for the API version lower than 2.4 -->
      +

      For example:

      +
      +<background-category value="download"/><!--For the API version 2.4 or later-->
      +<metadata key="http://tizen.org/metadata/background-category/download"/><!--For the API version lower than 2.4-->
       
      diff --git a/org.tizen.devtools/html/native_tools/manifest_text_editor_n.htm b/org.tizen.devtools/html/native_tools/manifest_text_editor_n.htm index 5180db2..53f633f 100644 --- a/org.tizen.devtools/html/native_tools/manifest_text_editor_n.htm +++ b/org.tizen.devtools/html/native_tools/manifest_text_editor_n.htm @@ -17,7 +17,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -45,14 +45,7 @@

      A Tizen native application package consists of exactly 1 manifest file, called tizen-manifest.xml, which is used to describe the application information. The manifest file is composed of XML elements, which include the root <manifest> element and its child elements representing application information, such as <version>, and <privileges>. The child elements are organized into a specific hierarchy. The elements can have attributes associated with them, providing more information about the element.

      The manifest file information can be edited using the manifest editor, or you can modify the XML structure directly using the text editor. To open the manifest editor, double-click the tizen-manifest.xml file in the Project Explorer view of the IDE. To use the text editor, right-click the tizen-manifest.xml file in the Project Explorer view and select Open with > Text Editor.

      - - - - - - - -
      Note
      The tizen-manifest.xml file must conform to both the standard XML file format and the Tizen native application specification requirements. Editing the manifest file XML structure with the text editor is intended for advanced users only.
      +

      The following example illustrates the content and structure of a tizen-manifest.xml file:

       <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      @@ -60,8 +53,8 @@
          <author email="email@email.com" href="http://test.com">author</author>
          <description>testdescriptions</description>
          <description xml:lang="en-gb">testdesc</description>
      -   <ui-application appid="org.tizen.uiapp" auto-restart="false" exec="uiapp" launch_mode="single" multiple="false" nodisplay="false"
      -                on-boot="true" taskmanage="true" hw-acceleration="default" type="capp">
      +   <ui-application appid="org.tizen.uiapp" auto-restart="false" exec="uiapp" launch_mode="single" multiple="false" 
      +                   nodisplay="false" on-boot="true" taskmanage="true" hw-acceleration="default" type="capp">
             <label>uiapplication</label>
             <label xml:lang="en-gb">testlang</label>
             <icon>uiapp.png</icon>
      @@ -97,6 +90,14 @@
       </manifest>
       
      + + + + + + + +
      Note
      The tizen-manifest.xml file must conform to both the standard XML file format and the Tizen native application specification requirements. Editing the manifest file XML structure with the text editor is intended for advanced users only.

      Manifest Element Hierarchy

      The Tizen native application manifest file consists of XML elements organized in a hierarchy. The following tree structure shows the relationship between the elements of the tizen-manifest.xml file.

      @@ -114,159 +115,190 @@ <manifest> - +  <author> - +  <description> - +  <service-application> - +  +  <label> - +  +  <icon> - +  +  <app-control> - +  +  +  <operation> - +  +  +  <uri> - +  +  +  <mime> - +  +  <metadata> - +  +  <datacontrol> - +  +  <background-category> - +  <ui-application> - +  +  <label> - +  +  <icon> - +  +  <app-control> - +  +  +  <operation> - +  +  +  <uri> - +  +  +  <mime> - +  +  <metadata> - +  +  <datacontrol> - +  +  <background-category> - +  <account> - +  +  <account-provider> - +  +  +  <icon> - +  +  +  <label> - +  +  +  <capability> @@ -274,67 +306,73 @@ - +  <privileges> - +  +  <privilege> - +  <feature> - +  <profile> - +  <widget-application> - +  +  <icon> - +  +  <label> - +  +  <support-size> - +  <watch-application> - +  +  <icon> - +  +  <label> @@ -460,7 +498,7 @@

      Version number of the application.

      Expected value:

        -
      • Number in the "x.y.z" format, where 0 < x < 255, 0 < y < 255, and 0 < z < 65535
      • +
      • Number in the "x.y.z" format, where 0 <= x <= 255, 0 <= y <= 255, and 0 <= z <= 65535
      @@ -474,10 +512,8 @@

      API version number for the application.

      Expected value:

        -
      • Number in the "x.y.z" format
      • -
      • z is optional
      • -
      • ex) 2.3.1, 2.4
      • -
      +
    • Number in the "x.y.z" format, where z is optional (for example: 2.3.1 or 2.4)
    • +
    @@ -845,24 +881,21 @@ 1 or more (optional) - - - -

    Attributes:

    - - - - - + +

    Attributes:

    + + + +
    @@ -908,30 +941,6 @@
    - - - - - - - - - - - -
    - hw-acceleration attribute

    Application hardware acceleration.

    -

    By default, this value is set to default.

    -

    Expected value:

    -
      -
    • default (Depend on system setting)
    • -
    • on (Use hardware acceleration)
    • -
    • off (Do not use hardware acceleration)
    • -
    -
    - - -
    @@ -978,6 +987,27 @@
    + + + + + + + + + +
    + hw-acceleration attribute

    Indicates the application hardware acceleration status.

    +

    By default, this value is set to default.

    +

    Expected value:

    +
      +
    • default (depends on the system setting)
    • +
    • on (use hardware acceleration)
    • +
    • off (do not use hardware acceleration)
    • +
    +
    + + @@ -213,38 +213,37 @@ tizen build-web [-opt | --optimize] [-euf | --exclude-uifw] [-e | --exclude] [-o $ tizen build-web -- /home/workspace/basic $ cd /home/workspace/basic/.buildResult -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat build-web -- C:\Users\workspace\basic
    -> dir C:\Users\workspace\basic\.buildResult
    -
    - +> tizen.bat build-web -- C:\Users\workspace\basic +> dir C:\Users\workspace\basic\.buildResult + - - + + - + - + @@ -336,9 +335,9 @@ tizen install <-t | -target <target name>> <-n | --name <packa
     $ tizen install --target emulator-26101 --name basic.wgt -- /home/workspace/basic/.buildResult
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat install -–target emulator-26101 –-name basic.wgt -- C:\Users\workspace\basic\.buildResult
    +> tizen.bat install -–target emulator-26101 –-name basic.wgt -- C:\Users\workspace\basic\.buildResult
     
    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 e22c169..cb321e1 100644 --- a/org.tizen.devtools/html/web_tools/config_editor_w.htm +++ b/org.tizen.devtools/html/web_tools/config_editor_w.htm @@ -17,7 +17,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Content

    @@ -58,203 +58,203 @@
    - + - - + + - + - - + + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - - + + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + @@ -491,27 +491,29 @@

    Expected children:

      -
    • src

      -

      Attributes:

      -
        -
      • name

        Mandatory; page handling the requests

      • -
      • reload

        Optional; sets whether the page is reloaded or not when the page already loaded (available values: enable (default), disable)

        Since: 2.4

      • -
    @@ -999,7 +1029,8 @@

    For example:

    <ui-application appid="org.tizen.uiapp" auto-restart="false" exec="uiapp" launch_mode="single" 
    -                multiple="false" hw-acceleration="default" nodisplay="false" on-boot="true" taskmanage="true" type="capp">
    +                multiple="false" nodisplay="false" on-boot="true" taskmanage="true" 
    +                hw-acceleration="default" type="capp">
        <label>uiapplication</label>
        <label xml:lang="en-gb">testlang</label>
        <icon>uiapp.png</icon>
    @@ -1352,7 +1383,7 @@
     

    For more information on the relationship between the elements, see the element hierarchy.

    Occurrences:

      -
    • 1 or more (optional)
    • +
    • 1 (optional)

    Expected children:

    @@ -1362,15 +1393,15 @@ - + - + - +
    <icon>1 or more (optional)1
    <label>1 or more (optional)1
    <support-size>1 or more1

    Attributes:

    @@ -1393,7 +1424,7 @@

    Widget application icon image.

    Occurrences:

      -
    • 1 or more (optional)
    • +
    • 1

    Expected value:

    @@ -1412,7 +1443,7 @@

    Widget application text.

    Occurrences:

      -
    • 1 or more (optional)
    • +
    • 1

    Expected value:

    @@ -1431,7 +1462,7 @@

    Size supported by the widget application.

    Occurrences:

      -
    • 1 or more
    • +
    • 1

    Attributes:

      @@ -1697,4 +1728,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.devtools/html/native_tools/po_file_editor_n.htm b/org.tizen.devtools/html/native_tools/po_file_editor_n.htm index 28cf0b0..34c03b3 100644 --- a/org.tizen.devtools/html/native_tools/po_file_editor_n.htm +++ b/org.tizen.devtools/html/native_tools/po_file_editor_n.htm @@ -21,24 +21,14 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      PO File Editor

      PO file editor is used to edit .po files to generate compiled gettext .mo files, which are used by Tizen native applications to localize the user interface. gettext is GNU Translation Project, an internationalization and localization (i18n) system commonly used for writing multilingual programs on Unix-like computer OS.

      - - - - - - - -
      Note
      There is no specific wizard to create .po files. To create a .po file, go to New > Other > General > File and save the file with the extension .po in the res/po directory. -

      A .po file name usually has the form <ll>_<CC>.po. Here <ll> stands for an ISO 639 2-letter language code, and <CC> stands for an ISO 3166 2-letter country code. For example, for German in Germany, the file name is de_DE.po.

      -

      To open the PO file editor, double-click the .po file in the Project Explorer.

      @@ -62,6 +52,17 @@

      Figure: Removing languages

      Removing languages

      + + + + + + + + +
      Note
      There is no specific wizard to create .po files. To create a .po file, go to New > Other > General > File and save the file with the extension .po in the res/po directory. +

      A .po file name usually has the form <ll>_<CC>.po. Here <ll> stands for an ISO 639 2-letter language code, and <CC> stands for an ISO 3166 2-letter country code. For example, for German in Germany, the file name is de_DE.po.

      +
      diff --git a/org.tizen.devtools/html/native_tools/project_conversion_n.htm b/org.tizen.devtools/html/native_tools/project_conversion_n.htm index eafc395..ba65b4e 100644 --- a/org.tizen.devtools/html/native_tools/project_conversion_n.htm +++ b/org.tizen.devtools/html/native_tools/project_conversion_n.htm @@ -11,39 +11,36 @@ - Project Conversion for CLI + Project Conversion - +
      -
      -

      Mobile native Wearable native

      -
      +
      +

      Mobile native Wearable native

      +
      -

      Project Conversion for CLI

      +

      Project Conversion

      -

      The Tizen SDK provides a method for building an IDE-created project by CLI:

      +

      The Tizen SDK provides a method for building an IDE-created project using the CLI:

        -
      1. Select a Tizen native project in the Project Explorer View of the IDE.
      2. -
      3. Right-click the project, open the context menu, and then click Export to CLI Project.
      4. +
      5. Select a Tizen native project in the Project Explorer view of the IDE.
      6. +
      7. Right-click the project and, in the context menu, click Export to CLI Project.
      -

      When the export is completed, 'make' files in 'Build' folder and 'project_def.prop' file which has many build options, will be added to the converted CLI project.

      +

      During the export, the make files in the Build folder and the project_def.prop file (with many build options) are added to the converted CLI project.

      -

      And then you can build a converted project by the following CLI command.

      -
      -  $ tizen build-native -–arch x86 –-compiler llvm –-configuration Debug -- /home/workspace/basic
      -
      +

      The following table describes the properties in the project_def.prop file.

      @@ -51,131 +48,177 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
      - Table: Properties in 'project_def.prop' file + Table: project_def.prop file properties
      Value
      APPNAMEIt is the app name. It must be written in lowercase letters.

      ex) APPNAME = test
      APPNAMEApplication name, which must be written in lowercase letters. +

      For example: APPNAME = test

      typeSelect the application type in app, sharedLib, staticLib

      ex) type = app
      typeApplication type, which can be app, sharedLib, or staticLib. +

      For example: type = app

      profileSelect the profile with version.

      ex) profile = mobile-2.3
      profileProfile with version. +

      For example: profile = mobile-2.3

      USER_SRCSIt is a list of '.c', '.cpp' source files in the current project.
      It can be used with wildcard characters like '*'.
      If more than two files, a separator is a white-space character.

      ex) USER_SRCS = src/*.c
      USER_SRCSList of .c and .cpp source files in the current project. +

      The list can be used with wildcard characters, such as *.

      +

      If there are more than 2 files, a white-space character separator is used.

      +

      For example: USER_SRCS = src/*.c

      USER_DEFSIt is a list of user-defined C files added to the compilation process.
      It must be used without -D characters for C compiler.

      ex) USER_DEFS = ABC DEF
      USER_DEFSList of user-defined C files added to the compilation process. +

      The list must be used without the -D characters for the C compiler.

      +

      For example: USER_DEFS = ABC DEF

      USER_UNDEFSIt is a list of user-defined C files excluded from the compilation process.
      It must be used without -U characters for C compiler.
      USER_UNDEFSList of user-defined C files excluded from the compilation process. +

      The list must be used without the -U characters for the C compiler.

      USER_CPP_DEFSIt is a list of user-defined C++ files added to the compilation process.
      It must be used without -D characters for C++ compiler.
      USER_CPP_DEFSList of user-defined C++ files added to the compilation process. +

      The list must be used without the -D characters for the C++ compiler.

      USER_CPP_UNDEFSIt is a list of user-defined C++ files excluded from the compilation process.
      It must be used without -U characters for C++ compiler.
      USER_CPP_UNDEFSList of user-defined C++ files excluded from the compilation process. +

      The list must be used without the -U characters for the C++ compiler.

      USER_LIBSIt is a list of the library paths added to the linking process.
      It must be used without -l characters.
      USER_LIBSList of library paths added to the linking process. +

      The list must be used without the -l characters.

      USER_OBJSIt is a path list of the '.o' files added to the linking process.USER_OBJSPath list of the .o files added to the linking process.
      USER_OBJS_ABSIt is a absolute path list of the '.o' files added to the linking process.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_OBJS_ABSAbsolute path list of the .o files added to the linking process. +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_INC_DIRSIt is a path list of references for C compiling.
      It must be used without -I characters.

      ex) USER_INC_DIRS = inc
      USER_INC_DIRSPath list of references for C compiling. +

      The list must be used without the -I characters.

      +

      For example: USER_INC_DIRS = inc

      USER_INC_DIRS_ABSIt is an absolute path list of references for C compiling.
      It must be used without -I characters.
      It is recommended to use $(workspace_loc) for IDE compatibility.

      ex) USER_INC_DIRS_ABS = $(workspace_loc)/extlib/lib
      USER_INC_DIRS_ABSAbsolute path list of references for C compiling. +

      The list must be used without the -I characters.

      +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      +

      For example: USER_INC_DIRS_ABS = $(workspace_loc)/extlib/lib

      USER_INC_FILESIt is a path list of '.h' files for C.
      It must be used without -include characters.
      USER_INC_FILESPath list of .h files for C. +

      The list must be used without the -include characters.

      USER_INC_FILES_ABSIt is an absolute path list of '.h' files for C.
      It must be used without -include characters.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_INC_FILES_ABSAbsolute path list of .h files for C. +

      The list must be used without the -include characters.

      +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_CPP_INC_DIRSIt is a path list of references for C++ compiling.
      It must be used without -I characters.
      USER_CPP_INC_DIRSPath list of references for C++ compiling. +

      The list must be used without the -I characters.

      USER_CPP_INC_DIRS_ABSIt is an absolute path list of references for C++ compiling.
      It must be used without -I characters.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_CPP_INC_DIRS_ABSAbsolute path list of references for C++ compiling. +

      The list must be used without the -I characters.

      +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_CPP_INC_FILESIt is a path list of '.h' files for C++.
      It must be used without -include characters.
      USER_CPP_INC_FILESPath list of .h files for C++. +

      The list must be used without the -include characters.

      USER_CPP_INC_FILES_ABSIt is an absolute path list of '.h' files for C++.
      It must be used without -include characters.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_CPP_INC_FILES_ABSAbsolute path list of .h files for C++. +

      The list must be used without the -include characters.

      +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_LIB_DIRSIt is a path list of references for the library linking.
      It must be used without -L characters.
      USER_LIB_DIRSPath list of references for the library linking. +

      The list must be used without the -L characters.

      USER_LIB_DIRS_ABSIt is an absolute path list of references for the library linking.
      It must be used without -L characters.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_LIB_DIRS_ABSAbsolute path list of references for the library linking. +

      The list must be used without the -L characters.

      +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_EDCSIt is a path list of '.edc' files.
      It can be used with wildcard characters like '*'.
      If more than two files, a separator is a white-space character.

      ex) USER_EDCS = res/edje/*.edc
      USER_EDCSPath list of .edc files. +

      The list can be used with wildcard characters, such as *.

      +

      If there are more than 2 files, a white-space character separator is used.

      +

      For example: USER_EDCS = res/edje/*.edc

      USER_EDCS_IMAGE_DIRSIt is a path list of EDC references for compiling like '-id' option of the IDE.USER_EDCS_IMAGE_DIRSPath list of EDC references for compiling, such as the -id option of the IDE.
      USER_EDCS_IMAGE_DIRS_ABSIt is an absolute path list of EDC references for compiling like '-id' option of the IDE.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_EDCS_IMAGE_DIRS_ABSAbsolute path list of EDC references for compiling, such as the -id option of the IDE. +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_EDCS_SOUND_DIRSIt is a path list of EDC references for compiling like '-sd' option of the IDE.USER_EDCS_SOUND_DIRSPath list of EDC references for compiling, such as the -sd option of the IDE.
      USER_EDCS_SOUND_DIRS_ABSIt is an absolute path list of EDC references for compiling like '-sd' option of the IDE.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_EDCS_SOUND_DIRS_ABSAbsolute path list of EDC references for compiling, such as the -sd option of the IDE. +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_EDCS_FONT_DIRSIt is a path list of EDC references for compiling like '-fd' option of the IDE.USER_EDCS_FONT_DIRSPath list of EDC references for compiling, such as the -fd option of the IDE.
      USER_EDCS_FONT_DIRS_ABSIt is an absolute path list of EDC references for compiling like '-fd' option of the IDE.
      It is recommended to use $(workspace_loc) for IDE compatibility.
      USER_EDCS_FONT_DIRS_ABSAbsolute path list of EDC references for compiling, such as the -fd option of the IDE. +

      It is recommended to use $(workspace_loc) for IDE compatibility.

      USER_POSIt is a path list of '.po' files.
      It can be used with wildcard characters like '*'.
      If more than two files, a separator is a white-space character.

      ex) USER_POS = res/po/*.po
      USER_POSPath list of .po files. +

      The list can be used with wildcard characters, such as *.

      +

      If there are more than 2 files, a white-space character separator is used.

      +

      For example: USER_POS = res/po/*.po

      + +

      To build a converted project, use the following CLI command:

      + +
      +$ tizen build-native -–arch x86 –-compiler llvm –-configuration Debug -- /home/workspace/basic
      +
      + - +
      Note
      The converted CLI project cannot be reconverted to the IDE-based project.A converted CLI project cannot be reconverted back to an IDE-based project.
      diff --git a/org.tizen.devtools/html/native_tools/project_wizard_n.htm b/org.tizen.devtools/html/native_tools/project_wizard_n.htm index 6ffe6b1..21dd2a2 100644 --- a/org.tizen.devtools/html/native_tools/project_wizard_n.htm +++ b/org.tizen.devtools/html/native_tools/project_wizard_n.htm @@ -20,7 +20,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      diff --git a/org.tizen.devtools/html/native_tools/resource_explorer_n.htm b/org.tizen.devtools/html/native_tools/resource_explorer_n.htm new file mode 100644 index 0000000..fced898 --- /dev/null +++ b/org.tizen.devtools/html/native_tools/resource_explorer_n.htm @@ -0,0 +1,237 @@ + + + + + + + + + + + + + Resource Explorer + + + + + +
      + +

      Resource Explorer

      + +

      Tizen native applications can run on different types of devices, such as wearable, phone, tablets, and TVs. Tizen also supports various resolutions (WVGA ~ XQXGA) and resources. Regardless of these advantages, remember that you must always polish your work to create an optimal application for each device.

      + +

      Providing Configuration-specific Alternative Resources

      + +

      An application must provide a different UI depending on a specific device configuration, such as the screen size and screen orientation. When developing the application, provide alternative resources for each device display state by grouping them in resource directories.

      + +

      Predefined Resource Directory Hierarchy

      + +

      The res/contents directory contains predefined directories for specific alternative resources, and the res.xml file that is referenced at application runtime.

      + +

      The following example of a BasicUI project shows how to group the resources in your project. Place resources, such as images and sounds, in a specific subdirectory of the project's res/contents directory or the root directory of the contents directory.

      +
      +BasicUI/
      +   res/
      +      contents/
      +         LDPI /
      +               basicui.png
      +         MDPI/
      +            basicui.png
      +         basicui.png
      +         res.xml
      +
      + + + + + + + + + + +
      Note
      Always include default resources in the root directory (not in a subdirectory of the contents directory) to ensure that your application has no dependencies on a specific device configuration.
      + +

      A specific subdirectory is named as configuration-qualifier. The configuration-qualifier is an indicator that represents each device configuration and more content can be appended to it with a dash (-). The following table shows the 2 configuration-qualifier types currently supported by the SDK.

      + + + + + + + + + + + + + + + + + + + + +
      Table: Configuration-qualifiers
      Configuration-qualifier nameType valueDescription
      Language and region codeFor example, en_US or en_UKThe type values have the form ll_CC, where ll stands for an ISO 639 2-letter language code, and the optionally followed CC stands for an ISO 3166 2-upper letter region code.
      DPI (Dot Per Inch) densityLDPI +

      MDPI

      +

      HDPI

      +

      XHDPI

      +

      XXHDPI

      LDPI: low-dpi from 0 to 240 +

      MDPI: medium-dpi from 241 to 300

      +

      HDPI: high-dpi from 301 to 380

      +

      XHDPI: extra-high-dpi from 381 to 480

      +

      XXHDPI: extra-extra-high-dpi from 481 to 600

      + +

      Each application base scale can be applied to each DPI through a relation modification between the DPI and profile factor.

      + + + + + + + + + + + + + + + +
      Table: DPI and profile factor
      DPI type valueSmall screen mobile +

      (profile factor: 0.7)

      Large screen mobile +

      (profile factor: 0.8)

      LDPI +

      MDPI

      +

      HDPI

      +

      XHDPI

      +

      XXHDPI

      0 ~ 1.9 +

      1.9 ~ 2.3

      +

      2.3 ~ 3.0

      +

      3.0 ~ 3.7

      +

      3.7 ~

      0 ~ 2.1 +

      2.1 ~ 2.7

      +

      2.7 ~ 3.4

      +

      3.4 ~ 4.3

      +

      4.3 ~

      + +

      The res.xml file is composed of XML elements and describes where each alternative resource is grouped into a device configuration. The following example shows a res.xml file based on the BasicUI project.

      + +
      +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      +<res xmlns="http://tizen.org/ns/rm">
      +   <group-image folder="contents">
      +      <node folder="contents/LDPI" screen-dpi-range="from 0 to 240"/>
      +      <node folder="contents/MDPI" screen-dpi-range="from 241 to 300"/>
      +   </group-image>
      +</res>
      +
      + +

      The res.xml file is automatically generated as part of the build packaging process by the IDE. Since editing the res.xml file manually is not easy, the IDE helps to minimize this difficulty by supporting the Resource Explorer view.

      + + + + + + + + + + +
      Note
      You cannot modify the res.xml file manually in IDE. The res.xml file is always overridden by the IDE during the packaging process.
      + +

      Resource Explorer

      +

      The Resource Explorer view helps you to place resources to support specific device configurations, such as different screen densities.

      + +

      In the Resource Explorer view, you can:

      + +
      • Show all resource configurations that the project provides (see the Tab and folding lists figure).
      • +
      • Create multiple configuration-qualifier directories and remove them.
      • +
      • Copy resources to an alternative directory by dragging and dropping into the view area. You can also remove resources.
      • +
      • Generate code snippets by dragging and dropping into the source editor area.
      + + + + + + + + + + +
      Note
      If the Resource Explorer view is not visible, open it by selecting Window > Show View > Other > Resource Explorer from the IDE menu.
      + +

      To place a basicui.png image for LDPI and MDPI ()as shown in the Resource directory hierarchy figure below), use the following steps:

      + +
      1. Open the Resource Configuration dialog by clicking Resource Configuration from the toolbar menu in the Resource Explorer view.
      2. +
      3. Add a configuration by selecting LDPI and MDPI in the DPI combo box.
      4. +
      5. Drag the basicui.png file and drop it into the proper tab list view area in the Resource Explorer view.
      + +

      Figure: Resource directory hierarchy

      +

      Resource directory hierarchy

      + +

      The following figure shows the Tab list view (on the left) and the Folding list view (on the right) of the Resource Explorer view. You can switch between the views using the buttons in the Resource Explorer view toolbar menu (Switch to folding to switch to folding lists and Switch to tabs to switch to tab lists).

      + +

      Figure: Tab and folding lists

      +

      Tab and folding lists

      + +

      Example of Managing Resources in the SDK

      + +

      The following steps provide a quick how-to for managing resources in the SDK:

      + +
      1. Create a BasicUI project.
      2. +
      3. Create a resource directory hierarchy and copy images into it. +

        Resource directory hierarchy and the Resource Explorer

        +
      4. +
      5. Create a res.xml file with the Build Package command.
      6. +
      7. Check the res.xml file. +

        res.xml

        +
      8. +
      9. Add code for loading alternative resources by using the Resource Manager API (in mobile and wearable applications). +

        Resource Manager

        + +
      10. +
      11. Build and run the BasicUI project. +

        Output

      + +

      In case of predefined application layouts (edc), you can use the res.xml file manually.

      + + + + + +
      + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.devtools/html/native_tools/static_analyzer_n.htm b/org.tizen.devtools/html/native_tools/static_analyzer_n.htm index 416027c..df3211d 100644 --- a/org.tizen.devtools/html/native_tools/static_analyzer_n.htm +++ b/org.tizen.devtools/html/native_tools/static_analyzer_n.htm @@ -1,10 +1,10 @@ - - - - - - + + + + + + @@ -12,33 +12,30 @@ Static Analyzer - +
      -

      Mobile nativeWearable native

      +

      Mobile native Wearable native

      - -
      -
      +

      Static Analyzer

      Tizen Static Analyzer is a source code analysis tool that finds bugs in Tizen applications:

        @@ -47,7 +44,7 @@
      • - Checkers selection

        Describes how to select the checkers you want for Static Analysis of your project

        + Selecting Checkers

        Describes how to select the checkers you want for the static analysis of your project.

      • Viewing Static Analyzer Results

        Describes how to view the results analyzed by Tizen Static Analyzer.

        @@ -57,38 +54,39 @@

        Running the Static Analyzer

        To run a static analysis for your application:

          -
        1. -

          Choose the target project in the Project Explorer view, open the context menu, and select Check Potential Bugs with Build.

          -

          Running the Static Analyzer

          +
        2. In the Project Explorer view, right-click the project and select Check Potential Bugs with Build.

          +

          Running the Static Analyzer

        3. View the analysis results in the Potential Bugs view on the right side. -

          Potential Bugs view

          +

          Potential Bugs view

        -

        You can also enable the LLVM Static Analyzer to be run during the build process by changing the setting in the Project Properties: Tizen SDK > Static Analysis.

        +

        You can also enable the LLVM Static Analyzer to be run during the build process by changing the setting in the project properties: Tizen SDK > Static Analysis.

        Figure: Static analysis properties

        -

        Static analysis properties

        +

        Static analysis properties

        + -

        Checkers Selection

        -

        A list of checkers can be selected for Static Analysis. For a new project all the checkers are selected by default.

        +

        Selecting Checkers

        + +

        A list of checkers can be selected for static analysis. For a new project, all the checkers are selected by default.

        To select checkers for your application:

          -
        1. -In the Project Properties view, select Static Analysis. -

          Running the Static Analyzer

          +
        2. In the Project Properties view, select Static Analysis. +

          Running the Static Analyzer

        3. -
        4. -You can selectively set checkers for your project from the list. Selecting/de-selecting a checker will select/de-selct all the sub-checkers. -

          Running the Static Analyzer

          +
        5. You can selectively set checkers for your project from the list. Selecting or clearing a checker selects or clears all the sub-checkers. +

          Selecting the checkers

        6. -
        7. -More info about a checker can be obtained by hovering on it -

          Running the Static Analyzer

          +
        8. To obtain more information on a checker, hover over it. +

          Obtaining checker info

        + + +

        Viewing Static Analyzer Results

        The Tizen Static Analyzer results are displayed in the Potential Bug view after the analysis is completed.

        The Potential Bug view opens automatically, when you make a build or check potential bugs. To open the Potential Bugs explicitly:

        @@ -103,24 +101,40 @@ Type Potential Bugs. Select Potential Bugs and click OK.
      • -

        Figure: Opening the Potential Bug view

        -
        -

        Opening the Potential Bug view

        -

        Opening the Potential Bug view

        -
        +

        Figure: Opening the Potential Bug view

        +

        Opening the Potential Bug view

        +

        Opening the Potential Bug view

        +

        In the Potential Bug view, you can group the warnings based on type or file. You can also select any particular bug and expand it to see the complete flow, which resulted in the issue.

        -

        Figure: Static Analyzer Results

        -

        Static Analyzer Results

        +

        Figure: Static Analyzer results

        +

        Static Analyzer results

        + + + +
      -Go to top +Go to top - + + + + + diff --git a/org.tizen.devtools/html/native_tools/storyboard_n.htm b/org.tizen.devtools/html/native_tools/storyboard_n.htm new file mode 100644 index 0000000..3a2bdc8 --- /dev/null +++ b/org.tizen.devtools/html/native_tools/storyboard_n.htm @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + Storyboard + + + + + +
      +
      + +
      +
      +

      Mobile native Wearable native

      +
      + + +

      Storyboard

      + +

      The purpose of the Tizen Storyboard is to provide an interactive view to help in the design of page transition. Using the Storyboard, you can visualize page transition in the application.

      + +

      The StoryBoard is an additional tab in the WYSIWYG Editor. The StoryBoard view consists of multiple pages of the native UI Builder and a connection which depicts the transition between the pages.

      + +

      Figure: Component diagram

      +

      Component diagram

      + +

      To use the Storyboard:

      +
        +
      1. Create a Storyboard application. +

        To use the Storyboard, you must create a Tizen native project using the template available under the UI Builder Application.

        + +

        Creating a Storyboard application

        +
      2. + +
      3. Add views. +

        When you select the Storyboard tab in the WYSIWYG Editor, the Storyboard graphical viewer opens. If the Naviframe application template is used, the viewer contains 4 views of the application with some default connections between them. Otherwise, the viewer contains no views.

        + +

        A new view can be added by right-clicking the editor or adding a new view in the Navigation view and dragging and dropping the view from the Navigation view to the Storyboard view.

        + +

        Adding a new view in the Storyboard viewer

        + +

        You can move the views in the viewer by selecting the black label containing the view name and dragging it to a new position.

        +
      4. + +
      5. Create connections. +

        You can create connections between 2 views by pressing Ctrl and clicking on the component from which the page transition is to happen and dragging it to the intended page. When the dragging is finished, a context menu opens listing the corresponding events of the object. Select an appropriate event from the menu.

        + +

        Create a connection by dragging

        +

        Select the event in the context menu

        + +

        After you select the event, the new connection is displayed and code is generated in the layout.tuml file. The event handler code is also generated.

        + +

        The following figure shows the code generated for the connection from view4 to view5 for the onclicked event.

        + +

        Code generation

        + +

        When you select a connection, the origin component of that connection is highlighted. If you select a component, the connections originating from it are highlighted with a darker line.

        +
      6. + +
      7. Change the connection properties. +

        When you select a component (left in the figure) or connection (right in the figure) in the Storyboard, the editable properties related to it are displayed in the Properties view. You can view the transition properties and change the connection target view and title.

        + +

        Component properties Connection properties

        + +
      8. +
      + + + + + +
      + +Go to top + + + + + + + + \ No newline at end of file diff --git a/org.tizen.devtools/html/native_tools/t_trace_n.htm b/org.tizen.devtools/html/native_tools/t_trace_n.htm index 16e489b..0056268 100644 --- a/org.tizen.devtools/html/native_tools/t_trace_n.htm +++ b/org.tizen.devtools/html/native_tools/t_trace_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      @@ -36,17 +36,7 @@

      The T-trace is a profiling tool that allows you to optimize application performance by measuring and visualizing instrumented function calls in the Tizen platform. It helps you to understand what the system is doing while your application is running.

      - - - - - - - - - -
      Note
      To operate the T-trace, you must first install Python (2.7.x) and Google Chrome™ on your computer.
      - +

      T-trace Dialog

      The following figure illustrates the T-trace dialog elements.

      @@ -82,6 +72,17 @@

      When you run the T-trace, the tracing process gathers traces during a specified time period. After tracing is finished, the T-trace processes the traces and creates a trace report in the HTML format.

      + + + + + + + + + +
      Note
      To operate the T-trace, you must first install Python (2.7.x) and Google Chrome™ on your computer.
      +

      To run the T-trace in the Tizen IDE:

      1. Set up the target device for the debugging mode and connect it to your computer with a USB cable.
      2. diff --git a/org.tizen.devtools/html/native_tools/tools_n.htm b/org.tizen.devtools/html/native_tools/tools_n.htm index eab5d41..4fd57bc 100644 --- a/org.tizen.devtools/html/native_tools/tools_n.htm +++ b/org.tizen.devtools/html/native_tools/tools_n.htm @@ -22,24 +22,13 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        Native Tools

        The Tizen SDK provides the following set of tools for native application development:

        - - - - - - - - - -
        Note
        Some of the IDE tools and views are visible only in specific IDE perspectives. To switch to the applicable perspective, go to Window > Open Perspective > Other and select the perspective you want.
        -
        • Application generation management tools
            @@ -70,7 +59,8 @@
        • Application running and testing tools
        • Analysis and debugging tools @@ -83,12 +73,24 @@
        • Valgrind

          This memory profiling tool can be used to detect memory errors or memory leaks in an application.

        • -
        • T-trace

          This tools allows you to detect and analyze performance issues.

        • +
        • T-trace

          This tools allows you to detect and analyze performance issues.

        • +
        +
      3. Resource Fallback +
          +
        • Resource Explorer

          This tool helps you to place resource easier to support specific device configurations such as different screen densities and languages.

    -
  • Resource Fallback -
      -
    • Resource Explorer

      Resource explorer helps you to place resource easier to support specific device configurations such as different screen densities and languages.

    • -
  • + + + + + + + + + + + +
    Note
    Some of the IDE tools and views are visible only in specific IDE perspectives. To switch to the applicable perspective, go to Window > Open Perspective > Other and select the perspective you want.
    diff --git a/org.tizen.devtools/html/native_tools/uibuilder_n.htm b/org.tizen.devtools/html/native_tools/uibuilder_n.htm index a117727..0ff1e96 100644 --- a/org.tizen.devtools/html/native_tools/uibuilder_n.htm +++ b/org.tizen.devtools/html/native_tools/uibuilder_n.htm @@ -22,22 +22,32 @@
    -

    Mobile native Wearable native

    +

    Mobile native

    UI Builder

    -

    The Tizen native UI Builder is a graphical user interface builder tool that simplifies the creation of Tizen native UIs by allowing you to arrange UI Components using a drag-and-drop WYSIWYG (What You See Is What You Get) editor.

    +

    The Tizen native UI Builder is a graphical user interface builder tool that simplifies the creation of Tizen native UIs by allowing you to arrange UI components using a drag-and-drop WYSIWYG (What You See Is What You Get) editor.

    -

    The UI Builder supports a variety of UI Components and views and editors.

    +

    The UI Builder supports a variety of UI components and views and editors.

    The UI Builder is not only a UI layout code generating tool, it also supports an easy-to-use programming model though the UI Builder project.

    Figure: UI Builder

    UI Builder

    - + + + + + + + + + +
    Note
    The UI Builder is supported only in mobile Ubuntu.
    +

    Supported Views and Editors

    The UI Builder supports the following views and editors:

    @@ -96,37 +106,37 @@

    Outline view

    The Outline view provides the following features:

      -
    • UI Component navigation +
    • UI component navigation
        -
      • You can see the UI Component hierarchy.
      • +
      • You can see the UI component hierarchy.
    • -
    • UI Component management +
    • UI component management
        -
      • You can copy, cut, paste, delete, and rename UI Components.
      • +
      • You can copy, cut, paste, delete, and rename UI components.

    Properties View

    -

    The Properties view displays the properties of the UI Component selected in the WYSIWYG Editor view. If the Properties view is not visible, open it from Window > Show View > Other > General > Properties.

    +

    The Properties view displays the properties of the UI component selected in the WYSIWYG Editor view. If the Properties view is not visible, open it from Window > Show View > Other > General > Properties.

    -

    The Properties helps you to edit UI Component and events.

    +

    The Properties helps you to edit UI components and events.

    Figure: Properties view

    -

    Properties view

    +

    Properties view

    The Properties view consists of Attributes, and Event tabs:

    • Attributes -

      In the Attributes tab, you can edit UI Component attributes. Attributes are categorized into common (common UI Component properties) and UI Component specification (UI Component-specific properties) attributes. The UI Component specification attributes are divided into categories according to the UI Component attributes.

      +

      In the Attributes tab, you can edit UI component attributes. Attributes are categorized into common (common UI component properties) and UI component specification (UI component-specific properties) attributes. The UI component specification attributes are divided into categories according to the UI component attributes.

      • Common -

        The Common category only includes the ID attribute, which is the default UI Component identifier in the code.

        +

        The Common category only includes the ID attribute, which is the default UI component identifier in the code.

      • -
      • UI Component specification -

        The UI Component specification category includes all UI Component-specific attributes.

        +
      • UI component specification +

        The UI component specification category includes all UI component-specific attributes.

      Properties specification

      @@ -157,7 +167,7 @@

      You can import files or folders.

    • Easy editing -

      You can edit the resource property of the UI Components using drag and drop.

      +

      You can edit the resource property of the UI components using drag and drop.

    @@ -171,12 +181,10 @@
    • Palette

      -

      The palette contains EFL UI Components, which you can select and add to the design area.

      +

      The palette contains EFL UI components, which you can select and add to the design area.

        -
      • Supported UI Components for mobile applications: +
      • Supported UI components:

        Scroller, Grid, Table, Box, Panes, Panel, Button, Check, Radio, Colorselector, Entry, Spinner, Slider, Naviframe, List, Genlist, Toolbar, Multibuttonentry, Gengrid, Index, Background, Datetime, Icon, Image, Label, Progressbar, and Layout

      • -
      • Supported UI Components for wearable applications: -

        Scroller, Grid, Table, Box, Panel, Button, Check, Radio, Entry, Spinner, Slider, Naviframe, List, Genlist, Index, Background, Datetime, Icon, Image, Label, Progressbar, and Layout

    • @@ -232,7 +240,7 @@
    • Design area

      -

      You can work with UI Components visually so that you can see what your application looks like as you build it.

      +

      You can work with UI components visually so that you can see what your application looks like as you build it.

    @@ -263,4 +271,4 @@ - + \ No newline at end of file diff --git a/org.tizen.devtools/html/native_tools/valgrind_n.htm b/org.tizen.devtools/html/native_tools/valgrind_n.htm index 9accbc6..d13e4be 100644 --- a/org.tizen.devtools/html/native_tools/valgrind_n.htm +++ b/org.tizen.devtools/html/native_tools/valgrind_n.htm @@ -19,7 +19,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Valgrind

    diff --git a/org.tizen.devtools/html/web_tools/code_beautifier_w.htm b/org.tizen.devtools/html/web_tools/code_beautifier_w.htm index 9df8349..ff2c953 100644 --- a/org.tizen.devtools/html/web_tools/code_beautifier_w.htm +++ b/org.tizen.devtools/html/web_tools/code_beautifier_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Code Beautifier

    diff --git a/org.tizen.devtools/html/web_tools/code_minifier_w.htm b/org.tizen.devtools/html/web_tools/code_minifier_w.htm index 9742316..1e37050 100644 --- a/org.tizen.devtools/html/web_tools/code_minifier_w.htm +++ b/org.tizen.devtools/html/web_tools/code_minifier_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Code Minifier

    diff --git a/org.tizen.devtools/html/web_tools/command_line_interface_w.htm b/org.tizen.devtools/html/web_tools/command_line_interface_w.htm index 24abfa6..255c3a0 100644 --- a/org.tizen.devtools/html/web_tools/command_line_interface_w.htm +++ b/org.tizen.devtools/html/web_tools/command_line_interface_w.htm @@ -23,7 +23,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Command Line Interface

    @@ -102,9 +102,9 @@ Sets the default connection timeout value. The default is 60000 milliseconds.

    $ tizen cli-config -g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
    +> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
     
  • List all options for which values are set:

    @@ -176,9 +176,9 @@ tizen create web-project [-p|--profile <profile name>] [-t|--template <
     
     $ tizen create web-project -p mobile-2.3 -t BasicBasicApplication -n basic -- /home/workspace
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat create web-project -p mobile-2.3 -t BasicBasicApplication -n basic -- C:\Users\workspace
    +> tizen.bat create web-project -p mobile-2.3 -t BasicBasicApplication -n basic -- C:\Users\workspace
     
  • tizen clean
     tizen clean [--]
     
    Clean the Tizen web project. - Clean the Tizen Web project. +
    • Clean the project:

       $ tizen clean -- /home/workspace/basic
       
      -

      or for Windows,

      +

      Or for Windows:

      -> tizen.bat clean -- C:\Users\workspace\basic
      +> tizen.bat clean -- C:\Users\workspace\basic
       
    tizen package @@ -271,17 +270,17 @@ tizen package [-t | --type <package type>] [-s | --sign <security profi
     $ tizen cli-config –g default.profiles.path=/home/tizen-sdk/tools/ide/conf/profiles.xml
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat cli-config –g "default.profiles.path=C:\tizen-sdk\tools\ide\conf\profiles.xml"
    +> tizen.bat cli-config –g "default.profiles.path=C:\tizen-sdk\tools\ide\conf\profiles.xml"
     
  • Set up the path of the profile.xml file that is created from the IDE:

     $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
    +> tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
     
  • Package the profile:

    @@ -291,25 +290,25 @@ $ ls /home/workspace/basic/.buildResult
     
     basic.wgt
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat package --type wgt --sign myprofile -- C:\Users\workspace\basic\.buildResult
    +> tizen.bat package --type wgt --sign myprofile -- C:\Users\workspace\basic\.buildResult
     
  • Re-sign the package:

     $ tizen package --type wgt --sign myprofile2 -- /home/workspace/basic/.buildResult/basic.wgt
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat package --type wgt --sign myprofile2 -- C:\Users\workspace\basic\.buildResult\basic.wgt
    +> tizen.bat package --type wgt --sign myprofile2 -- C:\Users\workspace\basic\.buildResult\basic.wgt
     
  • Re-sign a hybrid application package:

     $ tizen package --type wgt --sign myprofile2 --reference /home/workspace/a.tpk --reference /home/workspace/b.tpk -- /home/workspace/basic/.buildResult/basic.wgt
     
    -

    or for Windows,

    +

    Or for Windows:

    -> tizen.bat package --type wgt --sign myprofile2 --reference C:\Users\workspace\a.tpk --reference C:\Users\workspace\b.tpk -- C:\Users\workspace\basic\.buildResult\basic.wgt
    +> tizen.bat package --type wgt --sign myprofile2 --reference C:\Users\workspace\a.tpk --reference C:\Users\workspace\b.tpk -- C:\Users\workspace\basic\.buildResult\basic.wgt
     
  • <widget>
      <name>
       <span>
      <description>
       <span>
      <author>
       <span>
      <content>
      <feature> (in mobile or wearable)
       <param>
      <icon>
      <license>
       <span>
      <preference>
      <access>
      <tizen:account> (in mobile only)
       <tizen:icon>
       <tizen:display-name>
       <tizen:capability>
      <tizen:app-control> (in mobile or wearable)
       <tizen:src>
       <tizen:operation>
       <tizen:uri>
       <tizen:mime>
      <tizen:application> (in mobile or wearable)
      <tizen:content> (in mobile or wearable)
      <tizen:privilege> (in mobile or wearable)
      <tizen:setting> (in mobile or wearable)
      <tizen:content-security-policy> (in mobile or wearable)
      <tizen:content-security-policy-report-only> (in mobile or wearable)
      <tizen:allow-navigation> (in mobile or wearable)
      <tizen:metadata> (in mobile or wearable)
      <tizen:profile> (in mobile or wearable)
      <tizen:ime> (in wearable only)
       <tizen:uuid>
       <tizen:languages>
        <tizen:language>
      <tizen:category> (in wearable only)
      <tizen:service> (in wearable only)
       <tizen:name>
       <tizen:icon>
       <tizen:content>
       <tizen:description>
       <tizen:metadata>
       <tizen:category>
    - - - - - - - - -
    Note
    The reload attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the reload attribute is used, the application will fail to install.
    - - +
  • src +

    Attributes:

    +
      +
    • name

      Mandatory; page handling the requests

    • +
    • reload

      Optional; sets whether the page is reloaded when it is already loaded (available values: enable (default), disable)

      Since: 2.4

      + + + + + + + + + +
      Note
      The reload attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the reload attribute is used, the application installation fails.
      +
    • +
    +
  • +
  • operation

    Mandatory; string that defines the action to be performed

  • uri and mime

    Optional; additional parameters used for resolving application control requests

  • Example:

    <tizen:app-control>
    -   <tizen:src name="view.html" reload="disable"/>
    +   <tizen:src name="view.html" reload="disable"/>
        <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
        <tizen:uri name="http"/>
        <tizen:mime name="image/jpeg"/>
    @@ -537,21 +539,27 @@
            
  • id

    Mandatory; Tizen application ID, which is a combination of the Tizen package ID and project name. The application ID is unique in the device.

    The project name is a set of characters (0~9, a~z, A~Z) randomly generated by the SDK. The minimum value is 1 byte and maximum value is 52 bytes.

  • package

    Mandatory; Tizen package ID generated by the SDK, comprises of 10 characters (0~9, a~z, A~Z). The package ID is unique in the Tizen Store.

  • required_version

    Mandatory; Tizen API version required for running the Web application

  • -
  • launch_mode

    Optional; Sets what launch mode can be supported (available values: single(default), group, caller)

    o single: launched as a main application

    o group: launched as a sub application

    o caller: caller application defines the launch mode with the app_control_set_launch_mode() function

    Since: 2.4

  • - - - - - - - - - -
    Note
    The launch_mode attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the launch_mode attribute is used, the application will fail to install.
    -

    Example:

    <tizen:application id="1234abcDEF.projectname"
    +		
  • launch_mode

    Optional; sets which launch mode is supported (available values: single (default), group, caller)

    +
    • single: launched as a main application
    • +
    • group: launched as a sub application
    • +
    • caller: caller application defines the launch mode with the app_control_set_launch_mode() function
    +

    Since: 2.4

    + + + + + + + + + +
    Note
    The launch_mode attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the launch_mode attribute is used, the application installation fails.
    +
  • +

    Example:

    <tizen:application id="1234abcDEF.projectname"
                        package="1234abcDEF"
                        required_version="2.4"
    -                   launch_mode="caller" />

    +                   launch_mode="caller" />
    + @@ -812,37 +820,41 @@
  • id

    Mandatory; Tizen application ID, which is a combination of the Tizen wearable package ID and project name. The application ID is unique in the device.

    The project name is a set of characters (0~9, a~z, A~Z) randomly generated by the SDK. The minimum value is 1 byte and maximum value is 52 bytes.

  • package

    Mandatory; Tizen wearable package ID generated by the SDK, comprises of 10 characters (0~9, a~z, A~Z). The package ID is unique in the Samsung Apps.

  • required_version

    Mandatory; Tizen API version required for running the Web application

  • -
  • launch_mode

    Optional; Sets what launch mode can be supported (available values: single(default), group, caller)

    o single: launched as a main application

    o group: launched as a sub application

    o caller: caller application defines the launch mode with the app_control_set_launch_mode() function

    Since: 2.4
  • - - - - - - - - - -
    Note
    The launch_mode attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the launch_mode attribute is used, the application will fail to install.
    -
  • ambient_support

    Optional; Sets whether the Web application supports the ambient mode (available values: enable, disable (default))

    If this option is enabled, the application can be shown in the ambient mode.

    Since: 2.3.1
  • +
  • launch_mode

    Optional; sets which launch mode is supported (available values: single (default), group, caller)

    +
    • single: launched as a main application
    • +
    • group: launched as a sub application
    • +
    • caller: caller application defines the launch mode with the app_control_set_launch_mode() function
    +

    Since: 2.4

    + + + + + + + + + +
    Note
    The launch_mode attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the launch_mode attribute is used, the application installation fails.
    +
  • +
  • ambient_support

    Optional; sets whether the Web application supports the ambient mode (available values: enable, disable (default))

    If this option is enabled, the application can be shown in the ambient mode.

    Since: 2.3.1 + - - - - - - + + +
    Note
    The ambient_support option is only used for watch applications, and ignored in all non-watch applications.
    The ambient_support attribute is supported from Tizen 2.3.1 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.3.1, and the ambient_support attribute is used, the application will fail to install.
    The ambient_support option is only used for watch applications, and ignored in all non-watch applications. +

    The ambient_support attribute is supported from Tizen 2.3.1 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.3.1, and the ambient_support attribute is used, the application installation fails.

    - +
  • Example:

    <tizen:application id="1234abcDEF.projectname"  
                        package="1234abcDEF"
                        required_version="2.4"
    -                   launch_mode="caller"
                        ambient_support="enable" />

    + @@ -881,27 +893,29 @@

    Expected children:

      -
    • src

      -

      Attributes:

      -
        -
      • name

        Mandatory; page handling the requests

      • -
      • reload

        Optional; sets whether the page is reloaded or not when the page already loaded (available values: enable (default), disable)

        Since: 2.4

      • - - - - - - - - - -
        Note
        The reload attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the reload attribute is used, the application will fail to install.
        -
      -
    • +
    • src +

      Attributes:

      +
        +
      • name

        Mandatory; page handling the requests

      • +
      • reload

        Optional; sets whether the page is reloaded when it is already loaded (available values: enable (default), disable)

        Since: 2.4

        + + + + + + + + + +
        Note
        The reload attribute is supported from Tizen 2.4 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.4, and the reload attribute is used, the application installation fails.
        +
      • +
      +
    • +
    • operation

      Mandatory; string that defines the action to be performed

    • uri and mime

      Optional; additional parameters used for resolving application control requests

    Example:

    <tizen:app-control>
    -   <tizen:src name="view.html" reload="disable"/>
    +   <tizen:src name="view.html" reload="disable"/>
        <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
        <tizen:uri name="http"/>
        <tizen:mime name="image/jpeg"/>
    @@ -925,12 +939,12 @@
     	 

    Attributes:

      -
    • background-support

      Optional; Sets whether Web Application is suspended when it goes to the background (available values: enable , disable (default))

      If this option is enabled, Web Application is not suspended when it goes to the background.

    • -
    • context-menu

      Optional; Sets whether the context menu is shown (available values: enable (default), disable)

      If this option is enabled, the context menu is visible to the user.

    • +
    • background-support

      Optional; Sets whether Web Application is suspended when it goes to the background (available values: enable, disable (default))

      If this option is enabled, Web Application is not suspended when it goes to the background.

    • +
    • context-menu

      Optional; Sets whether the context menu is shown (available values: enable (default), disable)

      If this option is enabled, the context menu is visible to the user.

    • encryption

      Optional; Sets whether Web Application resources are encrypted (available values: enable , disable (default))

      If this option is enabled, the application resources(HTML, JS and CSS files) are encrypted.

    • -
    • screen-orientation

      Optional; Sets whether it locks orientation of Web Application (available values: portrait (default), landscape, auto-rotation)

      If this option is portrait or landscape, the orientation is locked to portrait or landscape respectively.

      If the option is auto-rotation, it follows device orientation setting.

    • -
    • install-location

      Optional; Sets where Web Application is installed (available values: auto (default), internal-only, prefer-external)

      o auto: the system defined install location.

      o internal-only: the device internal storage.

      o prefer-external: the external storage (if exists).

    • -
    • hwkey-event

      Optional; a hardware key event is sent to the Web application when the user presses the hardware key (available values: enable (default), disable)

      If this option is enabled, the tizenhwkey custom event is sent to the Web application. The tizenhwkey event object has a keyName attribute (available value: back).

    • +
    • screen-orientation

      Optional; Sets whether it locks orientation of Web Application (available values: portrait (default), landscape, auto-rotation)

      If this option is portrait or landscape, the orientation is locked to portrait or landscape respectively.

      If the option is auto-rotation, it follows device orientation setting.

    • +
    • install-location

      Optional; Sets where Web Application is installed (available values: auto (default), internal-only, prefer-external)

      o auto: the system defined install location.

      o internal-only: the device internal storage.

      o prefer-external: the external storage (if exists).

    • +
    • hwkey-event

      Optional; a hardware key event is sent to the Web application when the user presses the hardware key (available values: enable (default), disable)

      If this option is enabled, the tizenhwkey custom event is sent to the Web application. The tizenhwkey event object has a keyName attribute (available value: back).

    Example:

     <tizen:setting background-support="enable" />
    @@ -1380,4 +1394,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
     
     
     
    -
    +
    \ No newline at end of file
    diff --git a/org.tizen.devtools/html/web_tools/content_assist_w.htm b/org.tizen.devtools/html/web_tools/content_assist_w.htm
    index 9068b5e..bf8edf1 100644
    --- a/org.tizen.devtools/html/web_tools/content_assist_w.htm
    +++ b/org.tizen.devtools/html/web_tools/content_assist_w.htm
    @@ -20,7 +20,7 @@
     
     
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Content Assist

    diff --git a/org.tizen.devtools/html/web_tools/css_editor_w.htm b/org.tizen.devtools/html/web_tools/css_editor_w.htm index 9048e6d..9a4ec5f 100644 --- a/org.tizen.devtools/html/web_tools/css_editor_w.htm +++ b/org.tizen.devtools/html/web_tools/css_editor_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    CSS Editor

    diff --git a/org.tizen.devtools/html/web_tools/css_preview_w.htm b/org.tizen.devtools/html/web_tools/css_preview_w.htm index a604250..e712ffa 100644 --- a/org.tizen.devtools/html/web_tools/css_preview_w.htm +++ b/org.tizen.devtools/html/web_tools/css_preview_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    CSS Preview

    diff --git a/org.tizen.devtools/html/web_tools/html_editor_w.htm b/org.tizen.devtools/html/web_tools/html_editor_w.htm index fde9161..2ed5a9a 100644 --- a/org.tizen.devtools/html/web_tools/html_editor_w.htm +++ b/org.tizen.devtools/html/web_tools/html_editor_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Content

    diff --git a/org.tizen.devtools/html/web_tools/html_preview_w.htm b/org.tizen.devtools/html/web_tools/html_preview_w.htm index 0617c1d..6d1ba54 100644 --- a/org.tizen.devtools/html/web_tools/html_preview_w.htm +++ b/org.tizen.devtools/html/web_tools/html_preview_w.htm @@ -21,7 +21,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    HTML Preview

    diff --git a/org.tizen.devtools/html/web_tools/js_analyzer_w.htm b/org.tizen.devtools/html/web_tools/js_analyzer_w.htm index fcc5f56..695a917 100644 --- a/org.tizen.devtools/html/web_tools/js_analyzer_w.htm +++ b/org.tizen.devtools/html/web_tools/js_analyzer_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Content

    diff --git a/org.tizen.devtools/html/web_tools/js_editor_w.htm b/org.tizen.devtools/html/web_tools/js_editor_w.htm index faf2b15..e426143 100644 --- a/org.tizen.devtools/html/web_tools/js_editor_w.htm +++ b/org.tizen.devtools/html/web_tools/js_editor_w.htm @@ -16,7 +16,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.devtools/html/web_tools/js_log_console_w.htm b/org.tizen.devtools/html/web_tools/js_log_console_w.htm index e3c903b..f708d12 100644 --- a/org.tizen.devtools/html/web_tools/js_log_console_w.htm +++ b/org.tizen.devtools/html/web_tools/js_log_console_w.htm @@ -19,22 +19,13 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    JavaScript Log Console View

    -

    The JavaScript Log Console view provides a functionality to view Web application JavaScript logs. The JavaScript Log Console view is automatically opened when a Web application is launched.

    - - - - - - - - - -
    Note
    If no target is connected, a notification dialog appears at the right-bottom section of the IDE and the JavaScript Log Console view is not launched.
    -

    The following table shows the methods supported for logging to the JavaScript log.

    +

    The JavaScript Log Console view provides a functionality to view Web application JavaScript logs.

    + +

    The following table shows the methods supported for logging to the JavaScript log.

    Table: Supported JavaScript log methods @@ -69,10 +60,24 @@

    The JavaScript log methods are shown in the IDE with colors.

    Figure: JavaScript log method colors

    - +

    JavaScript log method colors

    +

    The JavaScript Log Console view is automatically opened when a Web application is launched.

    + + + + + + + + + +
    Note
    If no target is connected, a notification dialog appears at the right-bottom section of the IDE and the JavaScript Log Console view is not launched.
    + + + diff --git a/org.tizen.devtools/html/web_tools/live_editing_w.htm b/org.tizen.devtools/html/web_tools/live_editing_w.htm index c5d7fd2..f9f471f 100644 --- a/org.tizen.devtools/html/web_tools/live_editing_w.htm +++ b/org.tizen.devtools/html/web_tools/live_editing_w.htm @@ -19,13 +19,19 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Live Editing

    Live editing is a special feature, which applies source changes to the running application immediately without building, packaging, and relaunching the application. All changes made in the HTML, CSS, and JavaScript files are automatically and immediately reflected in the running application.

    This feature can be used in the HTML Preview view and when running the application in the Emulator or the Web Simulator.

    + + +

    To enable live editing in the Tizen IDE, go to Run > Run Configuration > Tizen Web Application > <PROJECT NAME> (or in the project's context menu, select Run As > Run Configuration > Tizen Web Application > <PROJECT NAME>) and check Enable live editing at the run configuration. If you are running your application for the first time, you must first create a new configuration.

    + +

    You can set live editing preferences in the IDE.

    + @@ -33,7 +39,7 @@
    - This feature has the following limitations: + The live editing feature has the following limitations:
    • The Tizen Device API does not work on the Emulator.
    • Only specific device APIs are supported by the Web Simulator.
    • @@ -44,10 +50,6 @@
    -

    To enable live editing in the Tizen IDE, go to Run > Run Configuration > Tizen Web Application > <PROJECT NAME> (or in the project's context menu, select Run As > Run Configuration > Tizen Web Application > <PROJECT NAME>) and check Enable live editing at the run configuration. If you are running your application for the first time, you must first create a new configuration.

    - -

    You can set live editing preferences in the IDE.

    -
    diff --git a/org.tizen.devtools/html/web_tools/privilege_checker_w.htm b/org.tizen.devtools/html/web_tools/privilege_checker_w.htm index af341b5..e0419bd 100644 --- a/org.tizen.devtools/html/web_tools/privilege_checker_w.htm +++ b/org.tizen.devtools/html/web_tools/privilege_checker_w.htm @@ -19,7 +19,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Privilege Checker

    diff --git a/org.tizen.devtools/html/web_tools/project_wizard_w.htm b/org.tizen.devtools/html/web_tools/project_wizard_w.htm index 2aabc51..c11022e 100644 --- a/org.tizen.devtools/html/web_tools/project_wizard_w.htm +++ b/org.tizen.devtools/html/web_tools/project_wizard_w.htm @@ -20,7 +20,7 @@
    -

    Mobile web Wearable web

    +

    Mobile web Wearable web

    diff --git a/org.tizen.devtools/html/web_tools/rest_viewer_w.htm b/org.tizen.devtools/html/web_tools/rest_viewer_w.htm index 2658585..9a88ce1 100644 --- a/org.tizen.devtools/html/web_tools/rest_viewer_w.htm +++ b/org.tizen.devtools/html/web_tools/rest_viewer_w.htm @@ -16,7 +16,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.devtools/html/web_tools/set_ide_preference_w.htm b/org.tizen.devtools/html/web_tools/set_ide_preference_w.htm index 2778e1d..52092fa 100644 --- a/org.tizen.devtools/html/web_tools/set_ide_preference_w.htm +++ b/org.tizen.devtools/html/web_tools/set_ide_preference_w.htm @@ -18,7 +18,7 @@

    - Mobile Web Wearable Web

    + Mobile Web Wearable Web

    Content

    diff --git a/org.tizen.devtools/html/web_tools/tools_w.htm b/org.tizen.devtools/html/web_tools/tools_w.htm index caa7261..5c1ab6b 100644 --- a/org.tizen.devtools/html/web_tools/tools_w.htm +++ b/org.tizen.devtools/html/web_tools/tools_w.htm @@ -21,23 +21,13 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Web Tools

    The Tizen SDK provides the following set of features and tools for Web application development:

    - - - - - - - - - -
    Note
    Some of the IDE tools and views are visible only in specific IDE perspectives. To switch to the applicable perspective, go to Window > Open Perspective > Other and select the perspective you want.
    • Application generation management tools @@ -95,6 +85,17 @@
    + + + + + + + + + +
    Note
    Some of the IDE tools and views are visible only in specific IDE perspectives. To switch to the applicable perspective, go to Window > Open Perspective > Other and select the perspective you want.
    +
    diff --git a/org.tizen.devtools/html/web_tools/web_inspector_w.htm b/org.tizen.devtools/html/web_tools/web_inspector_w.htm index d8ef9e4..1edfa8b 100644 --- a/org.tizen.devtools/html/web_tools/web_inspector_w.htm +++ b/org.tizen.devtools/html/web_tools/web_inspector_w.htm @@ -16,7 +16,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.devtools/html/web_tools/web_simulator_features_w.htm b/org.tizen.devtools/html/web_tools/web_simulator_features_w.htm index d690f20..ecf868d 100644 --- a/org.tizen.devtools/html/web_tools/web_simulator_features_w.htm +++ b/org.tizen.devtools/html/web_tools/web_simulator_features_w.htm @@ -17,7 +17,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Content

    diff --git a/org.tizen.devtools/html/web_tools/web_simulator_w.htm b/org.tizen.devtools/html/web_tools/web_simulator_w.htm index 797b723..0943b86 100644 --- a/org.tizen.devtools/html/web_tools/web_simulator_w.htm +++ b/org.tizen.devtools/html/web_tools/web_simulator_w.htm @@ -16,7 +16,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    @@ -32,8 +32,7 @@

    Web Simulator

    The Tizen Web Simulator is a light-weight tool that provides many settings and features to develop Web applications. You can use the simulator features to debug your applications.

    -

    Figure: Tizen Web Simulator

    -

    Tizen Web Simulator

    +

    The Tizen Web Simulator:

    • Supports running and debugging modern HTML5 Web applications.
    • @@ -54,7 +53,8 @@
    - +

    Figure: Tizen Web Simulator

    +

    Tizen Web Simulator

    Web Simulator Settings

    The Web Simulator has several settings for developing Web applications.

    diff --git a/org.tizen.devtools/html/web_tools/web_unit_test_tool_w.htm b/org.tizen.devtools/html/web_tools/web_unit_test_tool_w.htm index fe4556d..42d76b2 100644 --- a/org.tizen.devtools/html/web_tools/web_unit_test_tool_w.htm +++ b/org.tizen.devtools/html/web_tools/web_unit_test_tool_w.htm @@ -16,7 +16,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.devtools/index.xml b/org.tizen.devtools/index.xml index 8faf1ed..c247998 100644 --- a/org.tizen.devtools/index.xml +++ b/org.tizen.devtools/index.xml @@ -50,9 +50,13 @@ - + + + - + + + @@ -67,7 +71,8 @@ - + + diff --git a/org.tizen.gettingstarted/META-INF/MANIFEST.MF b/org.tizen.gettingstarted/META-INF/MANIFEST.MF index 765732d..f8d8b1a 100644 --- a/org.tizen.gettingstarted/META-INF/MANIFEST.MF +++ b/org.tizen.gettingstarted/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 1 -Bundle-Name: Getting Started with Tizen +Bundle-Name: Getting Started Bundle-SymbolicName: org.tizen.gettingstarted;singleton=true Bundle-Version: 2.4.0 Bundle-Vendor: The Linux Foundation diff --git a/org.tizen.gettingstarted/html/cover_page.htm b/org.tizen.gettingstarted/html/cover_page.htm index b3a9939..6539271 100644 --- a/org.tizen.gettingstarted/html/cover_page.htm +++ b/org.tizen.gettingstarted/html/cover_page.htm @@ -11,7 +11,7 @@ - Getting Started with Tizen + Getting Started @@ -21,14 +21,14 @@
    -

    Mobile Web Wearable Web Mobile native Wearable native

    +

    Mobile Wearable

    Tizen
    Getting Started

    -

    The getting started with Tizen documentation provides overall information you need to become familiar with Tizen programming and application model:

    +

    The getting started documentation provides overall information you need to become familiar with Tizen programming and application model:

    • Preface @@ -47,7 +47,7 @@

      For more information about developing Tizen applications, see:

        -
      • Tizen UI Guides
      • +
      • Tizen UI Practices
      • Tizen Tutorials
      • Tizen Guides
      • Tizen API References
      • diff --git a/org.tizen.gettingstarted/html/images/mn_division.png b/org.tizen.gettingstarted/html/images/mn_division.png index 1f7e337..faecb28 100644 Binary files a/org.tizen.gettingstarted/html/images/mn_division.png and b/org.tizen.gettingstarted/html/images/mn_division.png differ diff --git a/org.tizen.gettingstarted/html/images/mobile_s_n.png b/org.tizen.gettingstarted/html/images/mobile_s_n.png new file mode 100644 index 0000000..ad8c779 Binary files /dev/null and b/org.tizen.gettingstarted/html/images/mobile_s_n.png differ diff --git a/org.tizen.gettingstarted/html/images/mobile_s_w.png b/org.tizen.gettingstarted/html/images/mobile_s_w.png new file mode 100644 index 0000000..f86df29 Binary files /dev/null and b/org.tizen.gettingstarted/html/images/mobile_s_w.png differ diff --git a/org.tizen.gettingstarted/html/images/mobile_s_w_optional.png b/org.tizen.gettingstarted/html/images/mobile_s_w_optional.png new file mode 100644 index 0000000..0434b73 Binary files /dev/null and b/org.tizen.gettingstarted/html/images/mobile_s_w_optional.png differ diff --git a/org.tizen.gettingstarted/html/images/mobile_s_wn.png b/org.tizen.gettingstarted/html/images/mobile_s_wn.png new file mode 100644 index 0000000..ec30fd2 Binary files /dev/null and b/org.tizen.gettingstarted/html/images/mobile_s_wn.png differ diff --git a/org.tizen.gettingstarted/html/images/mw_division.png b/org.tizen.gettingstarted/html/images/mw_division.png index 8fc3efa..c4a8655 100644 Binary files a/org.tizen.gettingstarted/html/images/mw_division.png and b/org.tizen.gettingstarted/html/images/mw_division.png differ diff --git a/org.tizen.gettingstarted/html/images/n_division.png b/org.tizen.gettingstarted/html/images/n_division.png index d687bc5..5a0b8f6 100644 Binary files a/org.tizen.gettingstarted/html/images/n_division.png and b/org.tizen.gettingstarted/html/images/n_division.png differ diff --git a/org.tizen.gettingstarted/html/images/nuib_cadvl_wysiwyg_editor.png b/org.tizen.gettingstarted/html/images/nuib_cadvl_wysiwyg_editor.png index 54fedaa..d5f02cb 100644 Binary files a/org.tizen.gettingstarted/html/images/nuib_cadvl_wysiwyg_editor.png and b/org.tizen.gettingstarted/html/images/nuib_cadvl_wysiwyg_editor.png differ diff --git a/org.tizen.gettingstarted/html/images/w_division.png b/org.tizen.gettingstarted/html/images/w_division.png index 88d9959..443a1ea 100644 Binary files a/org.tizen.gettingstarted/html/images/w_division.png and b/org.tizen.gettingstarted/html/images/w_division.png differ diff --git a/org.tizen.gettingstarted/html/images/wearable_s_n.png b/org.tizen.gettingstarted/html/images/wearable_s_n.png new file mode 100644 index 0000000..02e3791 Binary files /dev/null and b/org.tizen.gettingstarted/html/images/wearable_s_n.png differ diff --git a/org.tizen.gettingstarted/html/images/wearable_s_w.png b/org.tizen.gettingstarted/html/images/wearable_s_w.png new file mode 100644 index 0000000..379a9c5 Binary files /dev/null and b/org.tizen.gettingstarted/html/images/wearable_s_w.png differ diff --git a/org.tizen.gettingstarted/html/images/wearable_s_w_optional.png b/org.tizen.gettingstarted/html/images/wearable_s_w_optional.png new file mode 100644 index 0000000..cef460c Binary files /dev/null and b/org.tizen.gettingstarted/html/images/wearable_s_w_optional.png differ diff --git a/org.tizen.gettingstarted/html/images/wearable_s_wn.png b/org.tizen.gettingstarted/html/images/wearable_s_wn.png new file mode 100644 index 0000000..280245d Binary files /dev/null and b/org.tizen.gettingstarted/html/images/wearable_s_wn.png differ diff --git a/org.tizen.gettingstarted/html/images/wn_division.png b/org.tizen.gettingstarted/html/images/wn_division.png index 11a7876..dca667f 100644 Binary files a/org.tizen.gettingstarted/html/images/wn_division.png and b/org.tizen.gettingstarted/html/images/wn_division.png differ diff --git a/org.tizen.gettingstarted/html/images/ww_division.png b/org.tizen.gettingstarted/html/images/ww_division.png index 65e7ab7..5f5160c 100644 Binary files a/org.tizen.gettingstarted/html/images/ww_division.png and b/org.tizen.gettingstarted/html/images/ww_division.png differ diff --git a/org.tizen.gettingstarted/html/index.htm b/org.tizen.gettingstarted/html/index.htm index 4f754bf..27918ce 100644 --- a/org.tizen.gettingstarted/html/index.htm +++ b/org.tizen.gettingstarted/html/index.htm @@ -11,7 +11,7 @@ - Getting Started with Tizen + Getting Started @@ -21,7 +21,7 @@
        -

        Getting Started with Tizen

        +

        Getting Started

        Preface

        Web Application

        diff --git a/org.tizen.gettingstarted/html/native/app_model/application_model_n.htm b/org.tizen.gettingstarted/html/native/app_model/application_model_n.htm index d9e1b65..f0ba706 100644 --- a/org.tizen.gettingstarted/html/native/app_model/application_model_n.htm +++ b/org.tizen.gettingstarted/html/native/app_model/application_model_n.htm @@ -18,7 +18,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

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

        Starting the Tizen Native Application

        -

        An application can be launched by the user from the Launcher or by another application. Either way, the Application Framework starts the application by creating a new process and calling the application entry point. Like in a conventional Linux application, the application main function is the entry point. For more information about launching native applications, see Launching Applications.

        +

        An application can be launched by the user from the Launcher or by another application. Either way, the Application Framework starts the application by creating a new process and calling the application entry point. Like in a conventional Linux application, the application main function is the entry point. For more information about launching native applications, see App Control.

        Package ID and Application ID

        diff --git a/org.tizen.gettingstarted/html/native/cover_page_n.htm b/org.tizen.gettingstarted/html/native/cover_page_n.htm index d7e0a1c..7cde62a 100644 --- a/org.tizen.gettingstarted/html/native/cover_page_n.htm +++ b/org.tizen.gettingstarted/html/native/cover_page_n.htm @@ -21,7 +21,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        Introduction to Native Applications

        diff --git a/org.tizen.gettingstarted/html/native/details/app_filtering_n.htm b/org.tizen.gettingstarted/html/native/details/app_filtering_n.htm index 9e77836..fb60348 100644 --- a/org.tizen.gettingstarted/html/native/details/app_filtering_n.htm +++ b/org.tizen.gettingstarted/html/native/details/app_filtering_n.htm @@ -18,7 +18,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        Content

        @@ -61,64 +61,76 @@ Feature key Description + Platform version http://tizen.org/feature/screen.size.normal Specify this key, if the application supports all possible current and future resolutions on the normal screen size.

        You cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously. If you do, only the most specific resolution key is considered and the less specific resolution keys are ignored. For example, if you specify both http://tizen.org/feature/screen.size.normal and http://tizen.org/feature/screen.size.normal.320.480 keys, only the http://tizen.org/feature/screen.size.normal.320.480 key is applied.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.240.400 Specify this key, if the application supports the 240 x 400 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.320.320 Specify this key, if the application supports the 320 x 320 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.3 http://tizen.org/feature/screen.size.normal.320.480 Specify this key, if the application supports the 320 x 480 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.360.480 Specify this key, if the application supports the 360 x 480 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.3 http://tizen.org/feature/screen.size.normal.480.800 Specify this key, if the application supports the 480 x 800 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.540.960 Specify this key, if the application supports the 540 x 960 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.600.1024 Specify this key, if the application supports the 600 x 1024 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.720.1280 Specify this key, if the application supports the 720 x 1280 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.normal.1080.1920 Specify this key, if the application supports the 1080 x 1920 resolution on the normal screen size.

        You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 http://tizen.org/feature/screen.size.all Specify this key, if the application supports all possible current and future screen sizes and all possible current and future resolutions per screen size.

        You cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously. If you do, only the most specific resolution key is considered and the less specific resolution keys are ignored. For example, if you specify both http://tizen.org/feature/screen.size.all and http://tizen.org/feature/screen.size.normal.320.480 keys, only the http://tizen.org/feature/screen.size.normal.320.480 key is applied.

        If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

        + 2.2.1 @@ -151,418 +163,595 @@ Feature key Description + Platform version http://tizen.org/feature/camera Specify this key, if the application requires any kind of a camera. + 2.2.1 http://tizen.org/feature/camera.back Specify this key, if the application requires a back-facing camera. + 2.2.1 http://tizen.org/feature/camera.back.flash Specify this key, if the application requires a back-facing camera with a flash. + 2.2.1 http://tizen.org/feature/camera.front Specify this key, if the application requires a front-facing camera. + 2.2.1 http://tizen.org/feature/camera.front.flash Specify this key, if the application requires a front-facing camera with a flash. + 2.2.1 http://tizen.org/feature/fmradio Specify this key, if the application requires an FM radio. + 2.2.1 http://tizen.org/feature/graphics.acceleration Specify this key, if the application requires hardware acceleration for both 2D and 3D graphics. + 2.2.1 http://tizen.org/feature/input.keyboard Specify this key, if the application requires a built-in physical keyboard. + 2.2.1 http://tizen.org/feature/input.keyboard.layout Specify this key with a specific keyboard layout (string type), if the application requires a built-in physical keyboard supporting the specified keyboard layout. + 2.2.1 http://tizen.org/feature/led Specify this key, if the application requires a LED. + 2.3 http://tizen.org/feature/location Specify this key, if the application requires any location positioning features. + 2.2.1 +http://tizen.org/feature/location.geofence + Specify this key, if the application requires the geofence feature. + 2.4 + + http://tizen.org/feature/location.gps Specify this key, if the application requires the Global Positioning System (GPS) feature. + 2.2.1 http://tizen.org/feature/location.wps Specify this key, if the application requires the Wi-Fi-based Positioning System (WPS) feature. + 2.2.1 http://tizen.org/feature/microphone Specify this key, if the application requires a microphone. + 2.2.1 http://tizen.org/feature/multimedia.transcoder Specify this key, if the application requires the multimedia transcoder feature. + 2.3 http://tizen.org/feature/multi_point_touch.pinch_zoom Specify this key, if the application requires a pinch-zoom gesture feature. + 2.2.1 http://tizen.org/feature/multi_point_touch.point_count Specify this key with a specific number (int type), if the application requires the minimum of specified number of simultaneous touches in a multi-point touch. + 2.2.1 http://tizen.org/feature/network.bluetooth Specify this key, if the application requires the Bluetooth feature. + 2.2.1 http://tizen.org/feature/network.bluetooth.audio.call Specify this key, if the application requires the Bluetooth Handsfree feature (HFP). + 2.3 http://tizen.org/feature/network.bluetooth.audio.media Specify this key, if the application requires the Bluetooth Advanced Audio feature (A2DP). + 2.3 http://tizen.org/feature/network.bluetooth.health Specify this key, if the application requires the Bluetooth Health feature (HDP). + 2.3 http://tizen.org/feature/network.bluetooth.hid Specify this key, if the application requires the Bluetooth Human Input Device feature (HID). + 2.3 http://tizen.org/feature/network.bluetooth.le Specify this key, if the application requires the Bluetooth LE feature. + 2.3 http://tizen.org/feature/network.bluetooth.opp Specify this key, if the application requires the Bluetooth Object Push feature (OPP). + 2.3 http://tizen.org/feature/network.nfc Specify this key, if the application requires the use of any API that, in turn, requires the Near Field Communication (NFC) feature. + 2.2.1 http://tizen.org/feature/network.nfc.card_emulation Specify this key, if the application requires the NFC card emulation feature. + 2.3 http://tizen.org/feature/network.nfc.card_emulation.hce Specify this key, if the application requires the NFC host-based card emulation feature. + 2.3.1 +http://tizen.org/feature/network.nfc.p2p + Specify this key, if the application requires the NFC p2p feature. + 2.3.1 + + http://tizen.org/feature/network.nfc.reserved_push - Specify this key, if the application requires the NFC reserved push feature. + Specify this key, if the application requires the NFC reserved push feature.2.2.1 + + +http://tizen.org/feature/network.nfc.tag + Specify this key, if the application requires the NFC tag feature. + 2.3.1 http://tizen.org/feature/network.push - Specify this key, if the application requires the network-based push service. + Specify this key, if the application requires the network-based push service. + 2.2.1 http://tizen.org/feature/network.secure_element Specify this key, if the application requires the secure element feature. + 2.2.1 http://tizen.org/feature/network.secure_element.ese Specify this key, if the application requires the ESE secure element feature. + 2.3 http://tizen.org/feature/network.secure_element.uicc Specify this key, if the application requires the UICC secure element feature. + 2.3 http://tizen.org/feature/network.telephony Specify this key, if the application requires the use of any API that, in turn, requires the telephony feature. + 2.2.1 http://tizen.org/feature/network.telephony.mms Specify this key, if the application requires the MMS feature. + 2.2.1 +http://tizen.org/feature/network.telephony.sms + Specify this key, if the application requires the SMS feature. + 2.4 + + http://tizen.org/feature/network.tethering Specify this key, if the application requires any kind of tethering feature. + 2.3 http://tizen.org/feature/network.tethering.bluetooth Specify this key, if the application requires the tethering over Bluetooth feature. + 2.3 http://tizen.org/feature/network.tethering.usb Specify this key, if the application requires the tethering over USB connection feature. + 2.3 http://tizen.org/feature/network.tethering.wifi Specify this key, if the application requires the tethering over Wi-Fi feature. + 2.3 http://tizen.org/feature/network.wifi Specify this key, if the application requires the use of any API that, in turn, requires the Wi-Fi feature. + 2.2.1 http://tizen.org/feature/network.wifi.direct Specify this key, if the application requires the Wi-Fi Direct™ feature. + 2.2.1 http://tizen.org/feature/network.wifi.direct.display Specify this key, if the application requires the Wi-Fi Direct™ display feature. + 2.3 http://tizen.org/feature/network.wifi.direct.service_discovery Specify this key, if the application requires the Wi-Fi Direct™ service discovery feature. + 2.3 http://tizen.org/feature/opengles.texture_format.3dc Specify this key, if the application requires the 3DC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.atc Specify this key, if the application requires the ATC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.etc Specify this key, if the application requires the ETC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.ptc Specify this key, if the application requires the PTC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.pvrtc - Specify this key, if the application requires the PVRTC texture format for OpenGL® ES. + Specify this key, if the application requires the PVRTC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.utc Specify this key, if the application requires the UTC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.version.1_1 Specify this key, if the application requires OpenGL® ES version 1.1 at minimum.

        You can specify at most 1 openGL® ES version. If you specify multiple versions, only the highest one is considered.

        - + + 2.2.1 http://tizen.org/feature/opengles.version.2_0 Specify this key, if the application requires OpenGL® ES version 2.0.

        You can specify at most 1 openGL® ES version. If you specify multiple versions, only the highest one is considered.

        - + + 2.2.1 http://tizen.org/feature/platform.core.cpu.arch.armv7 Specify this key, if the application requires the ARMv7 CPU architecture. + 2.2.1 + + +http://tizen.org/feature/platform.core.cpu.arch.x86 + Specify this key, if the application requires the x86 CPU architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.sse2 Specify this key, if the application requires the SSE2 Floating Point Unit (FPU) architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.sse3 Specify this key, if the application requires the SSE3 FPU architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.ssse3 Specify this key, if the application requires the SSSE3 FPU architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.vfpv3 Specify this key, if the application requires the VFPv3 FPU architecture. - - -http://tizen.org/feature/platform.core.cpu.arch.x86 - Specify this key, if the application requires the x86 CPU architecture. + 2.2.1 http://tizen.org/feature/screen.auto_rotation Specify this key, if the application requires the automatic screen rotation feature. + 2.2.1 http://tizen.org/feature/screen.size.all Specify this key, if the application supports all possible current and future screen sizes and all possible current and future resolutions per screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal Specify this key, if the application supports all possible current and future resolutions on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.240.400 Specify this key, if the application supports the 240 x 400 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.320.320 Specify this key, if the application supports the 320 x 320 resolution on the normal screen size. + 2.3 http://tizen.org/feature/screen.size.normal.320.480 Specify this key, if the application supports the 320 x 480 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.360.480 Specify this key, if the application supports the 360 x 480 resolution on the normal screen size. + 2.3 http://tizen.org/feature/screen.size.normal.480.800 Specify this key, if the application supports the 480 x 800 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.540.960 Specify this key, if the application supports the 540 x 960 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.600.1024 Specify this key, if the application supports the 600 x 1024 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.720.1280 Specify this key, if the application supports the 720 x 1280 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.1080.1920 Specify this key, if the application supports the 1080 x 1920 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/sensor.accelerometer Specify this key, if the application requires an acceleration sensor. + 2.2.1 http://tizen.org/feature/sensor.accelerometer.wakeup Specify this key, if the application requires the acceleration sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.activity_recognition - Specify this key, if the application requires an activity recognition sensor. + Specify this key, if the application requires an activity recognition sensor. + 2.3 http://tizen.org/feature/sensor.barometer - Specify this key, if the application requires a barometer sensor. + Specify this key, if the application requires a barometer sensor. + 2.2.1 http://tizen.org/feature/sensor.barometer.wakeup Specify this key, if the application requires the barometer sensor wake-up feature. + 2.2.1 +http://tizen.org/feature/sensor.geomagnetic_rotation_vector + Specify this key, if the application requires a geomagnetic-based rotation vector sensor. + 2.4 + + http://tizen.org/feature/sensor.gesture_recognition - Specify this key, if the application requires a gesture recognition sensor. + Specify this key, if the application requires a gesture recognition sensor. + 2.3 http://tizen.org/feature/sensor.gravity Specify this key, if the application requires a gravity sensor. + 2.3 http://tizen.org/feature/sensor.gyroscope Specify this key, if the application requires a gyro sensor. + 2.2.1 + + +http://tizen.org/feature/sensor.gyroscope_rotation_vector + Specify this key, if the application requires a gyroscope-based rotation vector sensor. + 2.4 +http://tizen.org/feature/sensor.gyroscope.uncalibrated + Specify this key, if the application requires an uncalibrated gyroscope sensor. + 2.4 + + http://tizen.org/feature/sensor.gyroscope.wakeup Specify this key, if the application requires the gyro sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.heart_rate_monitor Specify this key, if the application requires a heart rate monitor sensor. + 2.3 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_green + Specify this key, if the application requires the LED green heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_ir + Specify this key, if the application requires the LED infrared heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_red + Specify this key, if the application requires the LED red heart rate monitor sensor. + 2.3.1 http://tizen.org/feature/sensor.humidity Specify this key, if the application requires a humidity sensor. + 2.3 http://tizen.org/feature/sensor.linear_acceleration - Specify this key, if the application requires a linear acceleration sensor. + Specify this key, if the application requires a linear acceleration sensor. + 2.3 http://tizen.org/feature/sensor.magnetometer Specify this key, if the application requires a magnetic sensor. + 2.2.1 +http://tizen.org/feature/sensor.magnetometer.uncalibrated + Specify this key, if the application requires an uncalibrated geomagnetic sensor. + 2.4 + + http://tizen.org/feature/sensor.magnetometer.wakeup Specify this key, if the application requires the magnetic sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.pedometer Specify this key, if the application requires a pedometer sensor. + 2.3 http://tizen.org/feature/sensor.photometer - Specify this key, if the application requires a photometer sensor. + Specify this key, if the application requires a photometer sensor. + 2.2.1 http://tizen.org/feature/sensor.photometer.wakeup Specify this key, if the application requires the photometer sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.proximity Specify this key, if the application requires a proximity sensor. + 2.2.1 http://tizen.org/feature/sensor.proximity.wakeup Specify this key, if the application requires the proximity sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.rotation_vector Specify this key, if the application requires a rotation vector sensor. + 2.3 http://tizen.org/feature/sensor.temperature - Specify this key, if the application requires a temperature sensor. + Specify this key, if the application requires a temperature sensor. + 2.3 http://tizen.org/feature/sensor.tiltmeter - Specify this key, if the application requires a tilt sensor. + Specify this key, if the application requires a tilt sensor. + 2.2.1 http://tizen.org/feature/sensor.tiltmeter.wakeup Specify this key, if the application requires the tilt sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.ultraviolet Specify this key, if the application requires a ultraviolet sensor. + 2.3 http://tizen.org/feature/sensor.wrist_up - Specify this key, if the application requires a wrist up sensor. + Specify this key, if the application requires a wrist up sensor. + 2.3 + + +http://tizen.org/feature/shell.appwidget + Specify this key, if the application requires the AppWidget (Dynamic Box) feature. + 2.2.1 http://tizen.org/feature/sip.voip Specify this key, if the application requires the Voice Over Internet Protocol (VOIP) feature. + 2.2.1 + + +http://tizen.org/feature/speech.control + Specify this key, if the application requires the voice control feature. + 2.4 http://tizen.org/feature/speech.recognition Specify this key, if the application requires the speech recognition (STT) feature. + 2.2.1 http://tizen.org/feature/speech.synthesis Specify this key, if the application requires the speech synthesis (text to speech, TTS) feature. + 2.2.1 http://tizen.org/feature/usb.accessory Specify this key, if the application requires the USB client (or accessory) feature. + 2.2.1 http://tizen.org/feature/usb.host Specify this key, if the application requires the USB host feature. + 2.2.1 + + +http://tizen.org/feature/vision.barcode_detection + Specify this key, if the application requires the barcode detection feature. + 2.4 +http://tizen.org/feature/vision.barcode_generation + Specify this key, if the application requires the barcode generation feature. + 2.4 + + http://tizen.org/feature/vision.face_recognition - Specify this key, if the application requires the face recognition feature. + Specify this key, if the application requires the face recognition feature. + 2.2.1 http://tizen.org/feature/vision.image_recognition - Specify this key, if the application requires the image recognition feature. + Specify this key, if the application requires the image recognition feature. + 2.2.1 http://tizen.org/feature/vision.qrcode_generation Specify this key, if the application requires the QR code generation feature. + 2.2.1 http://tizen.org/feature/vision.qrcode_recognition Specify this key, if the application requires the QR code recognition feature. + 2.2.1 @@ -575,434 +764,610 @@ Feature key Description + Platform version http://tizen.org/feature/camera Specify this key, if the application requires any kind of a camera. + 2.2.1 http://tizen.org/feature/camera.back Specify this key, if the application requires a back-facing camera. + 2.2.1 http://tizen.org/feature/camera.back.flash - Specify this key, if the application requires a back-facing camera with a flash. + Specify this key, if the application requires a back-facing camera with a flash. + 2.2.1 http://tizen.org/feature/camera.front Specify this key, if the application requires a front-facing camera. + 2.2.1 http://tizen.org/feature/camera.front.flash Specify this key, if the application requires a front-facing camera with a flash. + 2.2.1 http://tizen.org/feature/fmradio Specify this key, if the application requires an FM radio. + 2.2.1 http://tizen.org/feature/graphics.acceleration Specify this key, if the application requires hardware acceleration for both 2D and 3D graphics. + 2.2.1 http://tizen.org/feature/input.keyboard Specify this key, if the application requires a built-in physical keyboard. + 2.2.1 http://tizen.org/feature/input.keyboard.layout Specify this key with a specific keyboard layout (string type), if the application requires a built-in physical keyboard supporting the specified keyboard layout. + 2.2.1 http://tizen.org/feature/input.rotating_bezel Specify this key, if the application requires rotating bezel input. + 2.3.1 http://tizen.org/feature/led Specify this key, if the application requires a LED. + 2.3 http://tizen.org/feature/location Specify this key, if the application requires any location positioning features. + 2.2.1 http://tizen.org/feature/location.gps - Specify this key, if the application requires the Global Positioning System (GPS) feature. + Specify this key, if the application requires the Global Positioning System (GPS) feature. + 2.2.1 http://tizen.org/feature/location.wps Specify this key, if the application requires the Wi-Fi-based Positioning System (WPS) feature. + 2.2.1 http://tizen.org/feature/microphone Specify this key, if the application requires a microphone. + 2.2.1 http://tizen.org/feature/multimedia.transcoder Specify this key, if the application requires the multimedia transcoder feature. + 2.3 http://tizen.org/feature/multi_point_touch.pinch_zoom Specify this key, if the application requires a pinch-zoom gesture feature. + 2.2.1 http://tizen.org/feature/multi_point_touch.point_count Specify this key with a specific number (int type), if the application requires the minimum of specified number of simultaneous touches in a multi-point touch. + 2.2.1 http://tizen.org/feature/network.bluetooth Specify this key, if the application requires the Bluetooth feature. + 2.2.1 http://tizen.org/feature/network.bluetooth.audio.call Specify this key, if the application requires the Bluetooth Handsfree feature (HFP). + 2.3 http://tizen.org/feature/network.bluetooth.audio.media Specify this key, if the application requires the Bluetooth Advanced Audio feature (A2DP). + 2.3 http://tizen.org/feature/network.bluetooth.health Specify this key, if the application requires the Bluetooth Health feature (HDP). + 2.3 http://tizen.org/feature/network.bluetooth.hid Specify this key, if the application requires the Bluetooth Human Input Device feature (HID). + 2.3 http://tizen.org/feature/network.bluetooth.le Specify this key, if the application requires the Bluetooth LE feature. + 2.3 http://tizen.org/feature/network.bluetooth.opp Specify this key, if the application requires the Bluetooth Object Push feature (OPP). + 2.3 http://tizen.org/feature/network.internet Specify this key, if the application requires Internet access. + 2.3.1 http://tizen.org/feature/network.nfc Specify this key, if the application requires the use of any API that, in turn, requires the Near Field Communication (NFC) feature. + 2.2.1 http://tizen.org/feature/network.nfc.card_emulation Specify this key, if the application requires the NFC card emulation feature. + 2.3 http://tizen.org/feature/network.nfc.card_emulation.hce Specify this key, if the application requires the NFC host-based card emulation feature. + 2.3.1 +http://tizen.org/feature/network.nfc.p2p + Specify this key, if the application requires the NFC p2p feature. + 2.3.1 + + http://tizen.org/feature/network.nfc.reserved_push - Specify this key, if the application requires the NFC reserved push feature. + Specify this key, if the application requires the NFC reserved push feature.2.2.1 + + +http://tizen.org/feature/network.nfc.tag + Specify this key, if the application requires the NFC tag feature. + 2.3.1 http://tizen.org/feature/network.push Specify this key, if the application requires the network-based push service. + 2.2.1 http://tizen.org/feature/network.secure_element Specify this key, if the application requires the secure element feature. + 2.2.1 http://tizen.org/feature/network.secure_element.ese Specify this key, if the application requires the ESE secure element feature. + 2.3 http://tizen.org/feature/network.secure_element.uicc Specify this key, if the application requires the UICC secure element feature. + 2.3 http://tizen.org/feature/network.telephony Specify this key, if the application requires the use of any API that, in turn, requires the telephony feature. + 2.2.1 http://tizen.org/feature/network.telephony.mms Specify this key, if the application requires the MMS feature. + 2.2.1 +http://tizen.org/feature/network.telephony.sms + Specify this key, if the application requires the SMS feature. + 2.4 + + http://tizen.org/feature/network.tethering Specify this key, if the application requires any kind of tethering feature. + 2.3 http://tizen.org/feature/network.tethering.bluetooth Specify this key, if the application requires the tethering over Bluetooth feature. + 2.3 http://tizen.org/feature/network.tethering.usb Specify this key, if the application requires the tethering over USB connection feature. + 2.3 http://tizen.org/feature/network.tethering.wifi Specify this key, if the application requires the tethering over Wi-Fi feature. + 2.3 http://tizen.org/feature/network.wifi Specify this key, if the application requires the use of any API that, in turn, requires the Wi-Fi feature. + 2.2.1 http://tizen.org/feature/network.wifi.direct Specify this key, if the application requires the Wi-Fi Direct™ feature. + 2.2.1 http://tizen.org/feature/network.wifi.direct.display Specify this key, if the application requires the Wi-Fi Direct™ display feature. + 2.3 http://tizen.org/feature/network.wifi.direct.service_discovery Specify this key, if the application requires the Wi-Fi Direct™ service discovery feature. + 2.3 http://tizen.org/feature/opengles.texture_format.3dc Specify this key, if the application requires the 3DC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.atc Specify this key, if the application requires the ATC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.etc Specify this key, if the application requires the ETC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.ptc Specify this key, if the application requires the PTC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.pvrtc Specify this key, if the application requires the PVRTC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.texture_format.utc Specify this key, if the application requires the UTC texture format for OpenGL® ES. + 2.2.1 http://tizen.org/feature/opengles.version.1_1 Specify this key, if the application requires OpenGL® ES version 1.1 at minimum.

        You can specify at most 1 openGL® ES version. If you specify multiple versions, only the highest one is considered.

        + 2.2.1 http://tizen.org/feature/opengles.version.2_0 Specify this key, if the application requires OpenGL® ES version 2.0.

        You can specify at most 1 openGL® ES version. If you specify multiple versions, only the highest one is considered.

        + 2.2.1 http://tizen.org/feature/platform.core.cpu.arch.armv7 Specify this key, if the application requires the ARMv7 CPU architecture. + 2.2.1 + + +http://tizen.org/feature/platform.core.cpu.arch.x86 + Specify this key, if the application requires the x86 CPU architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.sse2 Specify this key, if the application requires the SSE2 Floating Point Unit (FPU) architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.sse3 Specify this key, if the application requires the SSE3 FPU architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.ssse3 Specify this key, if the application requires the SSSE3 FPU architecture. + 2.2.1 http://tizen.org/feature/platform.core.fpu.arch.vfpv3 Specify this key, if the application requires the VFPv3 FPU architecture. - - -http://tizen.org/feature/platform.core.cpu.arch.x86 - Specify this key, if the application requires the x86 CPU architecture. + 2.2.1 http://tizen.org/feature/screen.auto_rotation Specify this key, if the application requires the automatic screen rotation feature. + 2.2.1 http://tizen.org/feature/screen.shape.circle Specify this key, if the application requires a circle-shaped screen. + 2.3.1 http://tizen.org/feature/screen.shape.rectangle Specify this key, if the application requires a rectangle-shaped screen. + 2.3.1 http://tizen.org/feature/screen.size.all Specify this key, if the application supports all possible current and future screen sizes and all possible current and future resolutions per screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal Specify this key, if the application supports all possible current and future resolutions on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.240.400 Specify this key, if the application supports the 240 x 400 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.320.320 Specify this key, if the application supports the 320 x 320 resolution on the normal screen size. + 2.3 http://tizen.org/feature/screen.size.normal.320.480 Specify this key, if the application supports the 320 x 480 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.360.480 Specify this key, if the application supports the 360 x 480 resolution on the normal screen size. + 2.3 http://tizen.org/feature/screen.size.normal.480.800 Specify this key, if the application supports the 480 x 800 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.540.960 Specify this key, if the application supports the 540 x 960 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.600.1024 Specify this key, if the application supports the 600 x 1024 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.720.1280 Specify this key, if the application supports the 720 x 1280 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/screen.size.normal.1080.1920 Specify this key, if the application supports the 1080 x 1920 resolution on the normal screen size. + 2.2.1 http://tizen.org/feature/sensor.accelerometer Specify this key, if the application requires an acceleration sensor. + 2.2.1 http://tizen.org/feature/sensor.accelerometer.wakeup Specify this key, if the application requires the acceleration sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.activity_recognition Specify this key, if the application requires an activity recognition sensor. + 2.3 http://tizen.org/feature/sensor.barometer Specify this key, if the application requires a barometer sensor. + 2.2.1 http://tizen.org/feature/sensor.barometer.wakeup Specify this key, if the application requires the barometer sensor wake-up feature. + 2.2.1 +http://tizen.org/feature/sensor.geomagnetic_rotation_vector + Specify this key, if the application requires a geomagnetic-based rotation vector sensor. + 2.4 + + http://tizen.org/feature/sensor.gesture_recognition Specify this key, if the application requires a gesture recognition sensor. + 2.3 http://tizen.org/feature/sensor.gravity Specify this key, if the application requires a gravity sensor. + 2.3 http://tizen.org/feature/sensor.gyroscope Specify this key, if the application requires a gyro sensor. + 2.2.1 + + +http://tizen.org/feature/sensor.gyroscope_rotation_vector + Specify this key, if the application requires a gyroscope-based rotation vector sensor. + 2.4 +http://tizen.org/feature/sensor.gyroscope.uncalibrated + Specify this key, if the application requires an uncalibrated gyroscope sensor. + 2.4 + + http://tizen.org/feature/sensor.gyroscope.wakeup Specify this key, if the application requires the gyro sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.heart_rate_monitor Specify this key, if the application requires a heart rate monitor sensor. + 2.3 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_green + Specify this key, if the application requires the LED green heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_ir + Specify this key, if the application requires the LED infrared heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_red + Specify this key, if the application requires the LED red heart rate monitor sensor. + 2.3.1 http://tizen.org/feature/sensor.humidity Specify this key, if the application requires a humidity sensor. + 2.3 http://tizen.org/feature/sensor.linear_acceleration Specify this key, if the application requires a linear acceleration sensor. + 2.3 http://tizen.org/feature/sensor.magnetometer Specify this key, if the application requires a magnetic sensor. + 2.2.1 +http://tizen.org/feature/sensor.magnetometer.uncalibrated + Specify this key, if the application requires an uncalibrated geomagnetic sensor. + 2.4 + + http://tizen.org/feature/sensor.magnetometer.wakeup Specify this key, if the application requires the magnetic sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.pedometer Specify this key, if the application requires a pedometer sensor. + 2.3 http://tizen.org/feature/sensor.photometer Specify this key, if the application requires a photometer sensor. + 2.2.1 http://tizen.org/feature/sensor.photometer.wakeup Specify this key, if the application requires the photometer sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.proximity Specify this key, if the application requires a proximity sensor. + 2.2.1 http://tizen.org/feature/sensor.proximity.wakeup Specify this key, if the application requires the proximity sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.rotation_vector Specify this key, if the application requires a rotation vector sensor. + 2.3 http://tizen.org/feature/sensor.temperature Specify this key, if the application requires a temperature sensor. + 2.3 http://tizen.org/feature/sensor.tiltmeter Specify this key, if the application requires a tilt sensor. + 2.2.1 http://tizen.org/feature/sensor.tiltmeter.wakeup Specify this key, if the application requires the tilt sensor wake-up feature. + 2.2.1 http://tizen.org/feature/sensor.ultraviolet Specify this key, if the application requires a ultraviolet sensor. + 2.3 http://tizen.org/feature/sensor.wrist_up Specify this key, if the application requires a wrist up sensor. + 2.3 + + +http://tizen.org/feature/shell.appwidget + Specify this key, if the application requires the AppWidget (Dynamic Box) feature. + 2.2.1 http://tizen.org/feature/sip.voip Specify this key, if the application requires the Voice Over Internet Protocol (VOIP) feature. + 2.2.1 +http://tizen.org/feature/speech.control + Specify this key, if the application requires the voice control feature. + 2.4 + + http://tizen.org/feature/speech.recognition Specify this key, if the application requires the speech recognition (STT) feature. + 2.2.1 http://tizen.org/feature/speech.synthesis Specify this key, if the application requires the speech synthesis (text to speech, TTS) feature. + 2.2.1 http://tizen.org/feature/usb.accessory Specify this key, if the application requires the USB client (or accessory) feature. + 2.2.1 http://tizen.org/feature/usb.host Specify this key, if the application requires the USB host feature. + 2.2.1 + + +http://tizen.org/feature/vision.barcode_detection + Specify this key, if the application requires the barcode detection feature. + 2.4 +http://tizen.org/feature/vision.barcode_generation + Specify this key, if the application requires the barcode generation feature. + 2.4 + + http://tizen.org/feature/vision.face_recognition Specify this key, if the application requires the face recognition feature. + 2.2.1 http://tizen.org/feature/vision.image_recognition Specify this key, if the application requires the image recognition feature. + 2.2.1 http://tizen.org/feature/vision.qrcode_generation Specify this key, if the application requires the QR code generation feature. + 2.2.1 http://tizen.org/feature/vision.qrcode_recognition Specify this key, if the application requires the QR code recognition feature. + 2.2.1 diff --git a/org.tizen.gettingstarted/html/native/details/details_n.htm b/org.tizen.gettingstarted/html/native/details/details_n.htm index b41321b..a6d8746 100644 --- a/org.tizen.gettingstarted/html/native/details/details_n.htm +++ b/org.tizen.gettingstarted/html/native/details/details_n.htm @@ -18,7 +18,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        diff --git a/org.tizen.gettingstarted/html/native/details/error_handling_n.htm b/org.tizen.gettingstarted/html/native/details/error_handling_n.htm index fa3cc9b..8de7fe3 100644 --- a/org.tizen.gettingstarted/html/native/details/error_handling_n.htm +++ b/org.tizen.gettingstarted/html/native/details/error_handling_n.htm @@ -19,7 +19,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        Error Handling

        diff --git a/org.tizen.gettingstarted/html/native/details/event_handling_n.htm b/org.tizen.gettingstarted/html/native/details/event_handling_n.htm index 251dcf8..df2b60b 100644 --- a/org.tizen.gettingstarted/html/native/details/event_handling_n.htm +++ b/org.tizen.gettingstarted/html/native/details/event_handling_n.htm @@ -18,7 +18,7 @@
    @@ -44,7 +45,7 @@ Note - For more information on using Efl Extension for Menu key, Back key, and rotary events, see the Hardware Input Handling UI guide. + For more information on using Efl Extension for Menu key, Back key, and rotary events, see Hardware Input Handling. @@ -83,6 +84,10 @@

    Tizen supports handling Media key events, such as play, stop, and pause events, from media devices (such as Bluetooth remote controller and earjack).

    To handle the Media key events, use the Media key API (in mobile and wearable applications).

    +

    Ambient Events

    + +

    An ambient mode is available in a low-powered wearable device. For more information about ambient events in the mobile native profile, see the Watch Application guide.

    +
    diff --git a/org.tizen.gettingstarted/html/native/details/io_overview_n.htm b/org.tizen.gettingstarted/html/native/details/io_overview_n.htm index 709cb92..e3a851c 100644 --- a/org.tizen.gettingstarted/html/native/details/io_overview_n.htm +++ b/org.tizen.gettingstarted/html/native/details/io_overview_n.htm @@ -21,7 +21,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    File System Directory Hierarchy

    diff --git a/org.tizen.gettingstarted/html/native/details/sec_privileges_n.htm b/org.tizen.gettingstarted/html/native/details/sec_privileges_n.htm index b353a86..07dbe96 100644 --- a/org.tizen.gettingstarted/html/native/details/sec_privileges_n.htm +++ b/org.tizen.gettingstarted/html/native/details/sec_privileges_n.htm @@ -25,7 +25,7 @@ tr.partner-level, tr.platform-level { background-color: #cff }
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Security and API Privileges

    @@ -213,8 +213,8 @@ tr.partner-level, tr.platform-level { background-color: #cff }

    http://tizen.org/privilege/ime

    public

    -

    Providing input methods -

    The application can provide users with a way to enter characters and symbols into an associated text field. +

    Providing input methods

    +

    The application can provide users with a way to enter characters and symbols into an associated text field.

    http://tizen.org/privilege/imemanager

    @@ -232,7 +232,7 @@ tr.partner-level, tr.platform-level { background-color: #cff }

    http://tizen.org/privilege/keygrab

    platform

    Capturing special key events

    -

    The application can read actions involving special keys, such as the volume keys on this or other devices (e.g. TV remote controls), even when it is running in the background.

    +

    The application can read actions involving special keys, such as the volume keys on this or other devices (such as TV remote controls), even when it is running in the background.

    http://tizen.org/privilege/keymanager

    @@ -270,7 +270,7 @@ tr.partner-level, tr.platform-level { background-color: #cff }

    http://tizen.org/privilege/mapservice

    public

    Using map services

    -

    The application can use map services such as Geocoder, Places, and Route (Direction).

    +

    The application can use map services, such as Geocoder, Places, and Route (Direction).

    http://tizen.org/privilege/mediacontroller.client

    @@ -607,8 +607,8 @@ tr.partner-level, tr.platform-level { background-color: #cff }

    http://tizen.org/privilege/ime

    public

    -

    Providing input methods -

    The application can provide users with a way to enter characters and symbols into an associated text field. +

    Providing input methods

    +

    The application can provide users with a way to enter characters and symbols into an associated text field.

    http://tizen.org/privilege/imemanager

    @@ -626,7 +626,7 @@ tr.partner-level, tr.platform-level { background-color: #cff }

    http://tizen.org/privilege/keygrab

    platform

    Capturing special key events

    -

    The application can read actions involving special keys, such as the volume keys on this or other devices (e.g. TV remote controls), even when it is running in the background.

    +

    The application can read actions involving special keys, such as the volume keys on this or other devices (such as TV remote controls), even when it is running in the background.

    http://tizen.org/privilege/keymanager

    @@ -663,7 +663,7 @@ tr.partner-level, tr.platform-level { background-color: #cff }

    http://tizen.org/privilege/mapservice

    public

    Using map services

    -

    The application can use map services such as Geocoder, Places, and Route (Direction).

    +

    The application can use map services, such as Geocoder, Places, and Route (Direction).

    http://tizen.org/privilege/mediacontroller.client

    diff --git a/org.tizen.gettingstarted/html/native/details/tizen_apis_n.htm b/org.tizen.gettingstarted/html/native/details/tizen_apis_n.htm index 5a35519..b611537 100755 --- a/org.tizen.gettingstarted/html/native/details/tizen_apis_n.htm +++ b/org.tizen.gettingstarted/html/native/details/tizen_apis_n.htm @@ -21,7 +21,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Tizen APIs

    @@ -34,7 +34,7 @@

    There are 2 types of submodules - Tizen native modules and open source modules. The integration of open source modules in the native API structure allows you to add additional features by using well-known open source libraries. This is particularly advantageous for developers who are familiar with certain libraries because they can quickly add features and use previously written code in certain cases.

    -

    The following table define the Tizen native API mobile layout. The table describes the API modules and the functionality of all their submodule APIs within that module. The table also acts as reference sources for when you are planning a new feature for your application and need a way to efficiently compare different API modules to decide which APIs to use.

    +

    The following table defines the Tizen mobile native API layout. The table describes the API modules and the functionality of all their submodule APIs within that module. The table also acts as reference sources for when you are planning a new feature for your application and need a way to efficiently compare different API modules to decide which APIs to use.

    @@ -58,27 +58,30 @@ - - + - + - + - + + + + + - - + @@ -125,7 +128,7 @@ - @@ -141,16 +144,16 @@
  • Tutorials: Base
  • - + - + - + @@ -162,7 +165,7 @@ - + @@ -177,8 +180,8 @@ - - + - - - - - + @@ -232,11 +231,11 @@ - + - + @@ -279,7 +278,7 @@ - + @@ -287,7 +286,7 @@ - + @@ -299,15 +298,15 @@ - + - + - + @@ -323,7 +322,7 @@ - + @@ -331,7 +330,7 @@ - + @@ -363,7 +362,7 @@ - + @@ -394,7 +393,7 @@ - + @@ -407,10 +406,6 @@ - - - - @@ -418,6 +413,10 @@ + + + + - + @@ -460,7 +459,7 @@ - + @@ -479,24 +478,28 @@ - - + + - - + - + + + + + - + @@ -508,19 +511,19 @@ - + - + - + - + @@ -530,33 +533,29 @@
  • Guides: UIX
  • Tutorials: UIX
  • - + - + - + - + - - + - - - - - + @@ -565,7 +564,7 @@
    Functionality
    AccountThe Account API module features include managing various account information, such as receiving sync operation notifications, and obtaining an access token by using the oauth2 authorization. + AccountThe Account API module features include managing various account information, such as receiving sync operation notifications and obtaining an access token by using the OAuth 2.0 authorization.

    Documentation:

    Account ManagerThe Account APIs provide CRUD (Create, Read, Update, Delete) account management functionality.Provides CRUD (Create, Read, Update, Delete) account management functionality.
    OAuth 2.0

    (since 2.4)

    The OAuth 2.0 APIs provide an easy way to gain an access token between server and client.Provides an easy way to gain an access token between a server and client.
    Sync Manager

    (since 2.4)

    The Sync Manager API helps applications in scheduling their data sync operations.Helps applications in scheduling their data sync operations.
    libOAuthProvides a library for using an open standard for secure authorization. This library enables users to securely log into an account on an application by using their logon credentials from another secondary account that they may have with another account provider or application.
    Application Framework The Application Framework API contains submodule APIs for application development. The submodule APIs enable application life-cycle management, usage of functionality that is exported by other applications, and access to a user's application preferences. @@ -105,7 +108,7 @@
    BundleA bundle is a string-based dictionary abstract data type (ADT). A dictionary is an ordered or unordered list of key-element pairs. Keys are used to locate elements in the list. This submodule can be used to create and manage a dictionary.Provides a string-based dictionary abstract data type (ADT). A dictionary is an ordered or unordered list of key-element pairs. Keys are used to locate elements in the list. This submodule can be used to create and manage a dictionary.
    Data Control
    ShortcutAdds application shortcuts to the device home screen, which is the main landing screen of the device. + Adds application shortcuts to the device home screen, the main landing screen of the device.
    C++ Standard LibraryStandard C++ library.Provides a standard C++ library.
    zlib

    (since 2.4)

    zlib is used for in-memory compression and decompression.Used for in-memory compression and decompression.
    GlibcStandard C library.Provides a standard C library.
    Glib
    LibXMLThis library can be used to parse XML documents such as the Application Manifest.Used to parse XML documents such as the Application Manifest.
    MinizipImplements a lightweight SQL relational database. This is widely used for embedded client or local storage.
    ContentThe Content API module contains submodule APIs for managing the most common device media data types, such as image, audio, and video files. It provides operations to search for content, search for content information stored on the device, create playlists, download content from servers through an HTTP connection, and access the EXIF information of an image file. + ContentThe Content API module contains submodule APIs for managing the most common device media data types, such as image, audio, and video files. It provides operations to search for content, search for content information stored on the device, create playlists, download content from servers through an HTTP connection, and access the EXIF information of an image file.

    Documentation:

    • Guides: Content
    • @@ -195,10 +198,6 @@
    Connects and disconnects from the media content service. This connection is required to insert, update and remove media file information in the media content database. Common media data types, such as image, audio, and video can be managed through the database. Other queries, such as searching for content and content information and accessing EXIF information from image files, are also possible.
    Service Adaptor

    (since 2.4)

    The Service Adaptor API provides developer with common interfaces like using local service for various service infra.
    Context The Context API module contains submodule APIs to detect user information such as when a user is running with a device and device information such as gestures when a device is tilted.

    Documentation:

    @@ -218,7 +217,7 @@
    Contextual Trigger

    (since 2.4)

    The Contextual Trigger API provides a way to define rules, each of which can trigger a specified action when the rule is satisfied.Provides a way to define rules, each of which can trigger a specified action when the rule is satisfied.
    Location
    Geofence Manager

    (since 2.4)

    This Geofence Manager API provides service related to geofence(geo-fence).Provides a service related to geofence (geo-fence).
    Maps Service

    (since 2.4)

    Maps API provides a developer with a set of functions, helping to create Maps aware applications.Provides a set of functions, helping to create map-aware applications.
    libEXIFEXIF is an image file format that extends existing formats, such as JPEG and TIFF. Many Tizen devices have a camera and use this format, and libEXIF can be used to read and write EXIF metainformation to and from image files.Supports an image file format that extends existing formats, such as JPEG and TIFF. Many Tizen devices have a camera and use the EXIF format, and libEXIF can be used to read and write EXIF metainformation to and from image files.
    Media Codec
    Media Controller

    (since 2.4)

    The Media Controller API provides functions for communication between the media controller server and the media controller client.Provides functions for communication between the media controller server and the media controller client.
    Media Tool
    Metadata Editor

    (since 2.4)

    The Metadata Editor API provides functions for editing the metadata of several popular audio format.Provides functions for editing the metadata of several popular audio formats.
    Media Vision

    (since 2.4)

    Media Vision library provides functionality for barcodes detection and generation.Provides functionality for barcode detection and generation.
    OpenALEfficiently renders multichannel 3D audio.Renders multichannel 3D audio.
    Player
    Screen Mirroring

    (since 2.4)

    The Screen Mirroring API provides functions for screen mirroring as sink.Provides functions for screen mirroring as a sink.
    Sound Manager
    Thumbnail Util

    (since 2.4)

    The Thumbnail Util API provides functions for creating the thumbnail from an input media file.Provides functions for creating the thumbnail from an input media file.
    Tone Player
    CurlA client-side URL data transfer library supporting http, https, ftp, file URIs, and many other protocols. Allows applications to perform URL-related activities without a Web browser.Provides a client-side URL data transfer library supporting http, https, ftp, file URIs, and many other protocols. Allows applications to perform URL-related activities without a Web browser.
    NFC
    OpenSSLAn open source library that provides basic cryptographic functions and various utility functions.Provides an open source library that provides basic cryptographic functions and various utility functions.
    Privilege InfoAccount ManagerAn account is a collection of information representing the user of a specific account provider. This API submodule creates and manages accounts, retrieves account information, and receives account change notifications.
    Calendar Manages calendars, including events and tasks. It also stores and queries calendar information.
    Contacts Manages phone contact information, such as address books, persons, and phone logs.
    Service Adaptor

    (since 2.4)

    Provides common interfaces, such as using a local service for various service infra.
    System The System API module contains submodule APIs for system management. @@ -431,7 +430,7 @@
    Feedback

    (since 2.4)

    The Feedback API provides functions to play sound or vibration associated with properties.Provides functions to play sound or vibration associated with properties.
    T-trace

    (since 2.4)

    The T-trace API provides functions for writing trace message to the system trace buffer.Provides functions for writing trace messages to the system trace buffer.
    Obtains call, network, and SIM information.
    Phonenumber Utils

    (since 2.4)

    The phonenumber utils API provides methods for parsing and formatting phone numbers.Phonenumber utils

    (since 2.4)

    Provides functions for parsing and formatting phone numbers.
    UI FrameworkThe UI Framework API module contains submodule APIs and open source libraries for 2D and 3D graphics and text. + UI FrameworkThe UI Framework API module contains submodule APIs and open source libraries for 2D and 3D graphics and text.

    Documentation:

    CairoA library for 2D vector graphics drawing. Vector graphics are advantageous because they have small file sizes and can be scaled to any size without any loss of image quality. Cairo EvasGL APIs have been newly added since 2.3.1.Provides a library for 2D vector graphics drawing. Vector graphics are advantageous because they have small file sizes and can be scaled to any size without any loss of image quality. Cairo EvasGL APIs have been newly added since 2.3.1.
    DALiProvides a cross-platform 3D UI Toolkit for embedded systems.
    EFLEFL is a collection of libraries that are independent and can be built on top of each other to provide useful features that complement the existing environment.Provides a collection of libraries that are independent and can be built on top of each other to provide useful features that complement the existing environment.
    EFL UTIL
    External Output Manager

    (since 2.4)

    The External Output Manager provides APIs for external outputs.Provides functions for external outputs.
    Fontconfig and FreetypeA text rendering library and font-handling library to let applications find a font or closely matching font.Provides a text rendering library and font-handling library to let applications find a font or closely matching font.
    Minicontrol

    (since 2.4)

    Provides functions for creating EFL socket window and displaying EFL socket window.Provides functions for creating and displaying an EFL socket window.
    TBM SurfaceThe Tizen Buffer Manager (TBM) surface provides functions for the graphics buffer.Provides functions for the graphics buffer.
    UIX STTThis API submodule provides functions to recognize speech.Provides functions to recognize speech.
    TTSThis API submodule provides functions for synthesizing voice from text and playing synthesized sound data.Provides functions for synthesizing voice from text and playing synthesized sound data.
    Input Method

    (since 2.4)

    The Input Method API provides the functions for starting IME application lifecycle, methods to interact with current UI state of IME, and getting attributes/events.Provides functions for starting the IME application life-cycle, for interacting with the current UI state of the IME, and getting attributes and events.
    Voice control

    (since 2.4)

    The Voice control API provides functions for registering command and getting notification when registered command is recognized.Provides functions for registering commands and getting notifications when a registered command is recognized.
    WebThe Web API module contains submodule APIs for browsing the Internet, tracking browsing history, downloading Web content, and manipulating JavaScript Object Notation (JSON) documents. + WebThe Web API module contains submodule APIs for browsing the Internet, tracking browsing history, downloading Web content, and manipulating JavaScript Object Notation (JSON) documents.

    Documentation:

    Json-GlibThis library allows reading and parsing of JavaScript Object Notation (JSON) documents.
    libOAuthLibrary for using an open standard for secure authorization. This library enables users to securely log into an account on an application by using their logon credentials from another secondary account that they may have with another account provider or application. Allows reading and parsing of JavaScript Object Notation (JSON) documents.
    WebView
    -

    The following table describes the API modules in the wearable profile and the functionality of all their submodule APIs.

    +

    The following table describes the API modules in the wearable profile and the functionality of all their submodule APIs within that module. The table also acts as reference sources for when you are planning a new feature for your application and need a way to efficiently compare different API modules to decide which APIs to use.

    @@ -573,11 +572,11 @@ - +
    Note
    Except as noted, the wearable native APIs are available since Tizen 2.3.1Except as noted, the wearable native APIs are available since Tizen 2.3.1.
    - + @@ -588,23 +587,28 @@ - - + - + - - + + + + + + - + @@ -646,12 +650,11 @@ - - - - - + + + + + @@ -669,15 +672,15 @@
  • Tutorials: Base
  • - + - + - + @@ -689,7 +692,7 @@ - + @@ -716,6 +719,7 @@ + - + @@ -780,15 +784,15 @@ - + - - + + @@ -800,15 +804,15 @@ - + - + - + @@ -828,7 +832,7 @@ - + @@ -856,7 +860,7 @@ - + @@ -882,7 +886,7 @@ - + @@ -893,8 +897,8 @@ +
  • Guides: Social
  • +
  • Tutorials: Social
  • @@ -911,7 +915,7 @@ - + @@ -939,7 +943,7 @@ - + @@ -957,24 +961,28 @@ - - + + - - + - + + + + + - + @@ -986,19 +994,19 @@ - + - + - + - + @@ -1009,34 +1017,30 @@
  • Guides: UIX
  • Tutorials: UIX
  • - + - + - + - + - - + - - - - - + diff --git a/org.tizen.gettingstarted/html/native/first_app/first_app_n.htm b/org.tizen.gettingstarted/html/native/first_app/first_app_n.htm index e57ad86..378d521 100644 --- a/org.tizen.gettingstarted/html/native/first_app/first_app_n.htm +++ b/org.tizen.gettingstarted/html/native/first_app/first_app_n.htm @@ -21,7 +21,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Creating Your First Tizen Application

    @@ -103,7 +103,7 @@ messages_add_address (sms_msg,"01020157919", MESSAGE_RECIPIENT_TO);
  • Creating the Application UI with EFL -

    The EFL is the native graphical toolkit for Tizen.

    +

    The EFL is the native graphical toolkit for Tizen.

    To create the application UI:

      @@ -321,7 +321,7 @@ create_gui(appdata_s *ad)
    1. Exit the GUI

      The clicked_cb() function exits the Elementary; the prototype of the function is common to all callbacks given to evas_object_smart_callback_add(). Put the clicked_cb() function above the create_gui() function.

      -

      For more details on the callbacks, see the Evas Smart Object Events guide.

      +

      For more details on the callbacks, see the Evas Smart Object Events guide.

      static void
       clicked_cb(void *user_data, Evas_Object *obj, void *event_info)
       {
      diff --git a/org.tizen.gettingstarted/html/native/process/app_dev_process_n.htm b/org.tizen.gettingstarted/html/native/process/app_dev_process_n.htm
      index f3d90d7..7e26c30 100644
      --- a/org.tizen.gettingstarted/html/native/process/app_dev_process_n.htm
      +++ b/org.tizen.gettingstarted/html/native/process/app_dev_process_n.htm
      @@ -18,7 +18,7 @@
       
       
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      @@ -38,9 +38,8 @@

      Native Application Development Process

      -

      The following figure illustrates the process of developing a Tizen native application. Tizen provides the tools required to manage your application's life-cycle from product conception, through development and release, to end-of-life application retirement.

      -

      Figure: Native application development process

      -

      Native application development process

      +

      Tizen provides the tools required to manage your application's life-cycle from product conception, through development and release, to end-of-life application retirement.

      +

      To develop an application with Tizen:

      Planning and Designing the Application

      @@ -157,102 +156,98 @@
    2. Build and run the UI application.

      The service application or shared library is built and run automatically while the UI application is built and run.

    -
  • Table: Wearable native API modules
    Functionality
    AccountThe Account API module features include managing various account information, such as receiving sync operation notifications, and obtaining an access token by using the oauth2 authorization. + AccountThe Account API module features include managing various account information, such as receiving sync operation notifications and obtaining an access token by using the OAuth 2.0 authorization.

    Documentation:

    Account ManagerThe Account APIs provide CRUD (Create, Read, Update, Delete) account management functionality.Provides CRUD (Create, Read, Update, Delete) account management functionality.
    OAuth 2.0

    (since 2.4)

    The OAuth 2.0 APIs provide easy way to gain access token between server and client.
    Provides easy way to gain access token between server and client.
    libOAuthProvides a library for using an open standard for secure authorization. This library enables users to securely log into an account on an application by using their logon credentials from another secondary account that they can have with another account provider or application.
    Application Framework The Application Framework API contains submodule APIs for application development. The submodule APIs enable application life-cycle management, usage of functionality that is exported by other applications, and access to a user's application preferences. +

    Documentation:

    BundleA bundle is a string-based dictionary abstract data type (ADT). A dictionary is an ordered or unordered list of key-element pairs. Keys are used to locate elements in the list. This submodule can be used to create and manage a dictionary.Provides a string-based dictionary abstract data type (ADT). A dictionary is an ordered or unordered list of key-element pairs. Keys are used to locate elements in the list. This submodule can be used to create and manage a dictionary.
    Data ControlPackage Manager Stores and receives information related to packages installed on the device. This is information can be, for example, the package name, path to the icon image, or the application version. It can also be used to check whether 2 package certificates match. If they match, they have been created by the same developer and can share resources securely.
    ShortcutAdds application shortcuts to the device home screen, which is the main landing screen of the device. -
    ShortcutAdds application shortcuts to the device home screen, the main landing screen of the device.
    Watch Application Handles Tizen watch application state changes and system events. It is also used to start and exit the main event loop of watch applications. C++ Standard LibraryStandard C++ library.Provides a standard C++ library.
    zlib

    (since 2.4)

    zlib is used for in-memory compression and decompression.Used for in-memory compression and decompression.
    GlibcStandard C library.Provides a standard C library.
    Glib
    LibXMLThis library can be used to parse XML documents such as the Application Manifest.Used to parse XML documents such as the Application Manifest.
    Minizip
    Media Content Connects and disconnects from the media content service. This connection is required to insert, update and remove media file information in the media content database. Common media data types, such as image, audio, and video can be managed through the database. Other queries, such as searching for content and content information and accessing EXIF information from image files, are also possible.
    Context The Context API module contains submodule APIs to detect user information such as when a user is running with a device and device information such as gestures when a device is tilted. @@ -742,7 +746,7 @@
    Maps Service

    (since 2.4)

    Maps API provides a developer with a set of functions, helping to create Maps aware applications.Provides a set of functions, helping to create map-aware applications.
    Messaging
    libEXIFEXIF is an image file format that extends existing formats, such as JPEG and TIFF. Many Tizen devices have a camera and use this format, and libEXIF can be used to read and write EXIF metainformation to and from image files.Supports an image file format that extends existing formats, such as JPEG and TIFF. Many Tizen devices have a camera and use the EXIF format, and libEXIF can be used to read and write EXIF metainformation to and from image files.
    Media Codec Provides interfaces for encoding and decoding audio and video data, such as AAC audio or MPEG-4 AVC video.
    Media Controller

    (since 2.4)

    The Media Controller API provides functions for communication between the media controller server and the media controller client.Media Controller

    (since 2.4)

    Provides functions for communication between the media controller server and the media controller client.
    Media Tool
    Metadata Editor

    (since 2.4)

    The Metadata Editor API provides functions for editing the metadata of several popular audio format.Provides functions for editing the metadata of several popular audio formats.
    Media Vision

    (since 2.4)

    Media Vision library provides functionality for barcodes detection and generation.Provides functionality for barcode detection and generation.
    OpenALEfficiently renders multichannel 3D audio.Renders efficiently multichannel 3D audio.
    Player
    Thumbnail Util

    (since 2.4)

    The Thumbnail Util API provides functions for creating the thumbnail from an input media file.Provides functions for creating the thumbnail from an input media file.
    Tone Player
    CurlA client-side URL data transfer library supporting http, https, ftp, file URIs, and many other protocols. Allows applications to perform URL-related activities without a Web browser.Provides a client-side URL data transfer library supporting http, https, ftp, file URIs, and many other protocols. Allows applications to perform URL-related activities without a Web browser.
    NFC
    OpenSSLAn open source library that provides basic cryptographic functions and various utility functions.Provides an open source library that provides basic cryptographic functions and various utility functions.
    Privilege InfoThe Social API module contains submodule APIs to manage personal data, such as contacts on a device.

    Documentation:

    Contacts

    (since 2.4)

    Manages phone contact information, such as address books, persons, and phone logs.
    Feedback

    (since 2.4)

    The Feedback API provides functions to play sound or vibration associated with properties.Provides functions to play sound or vibration associated with properties.
    Media key
    T-trace

    (since 2.4)

    The T-trace API provides functions for writing trace message to the system trace buffer.Provides functions for writing trace messages to the system trace buffer.
    dlogObtains call, network, and SIM information.
    Phonenumber Utils

    (since 2.4)

    The phonenumber utils API provides methods for parsing and formatting phone numbers.Phonenumber utils

    (since 2.4)

    Provides functions for parsing and formatting phone numbers.
    UI FrameworkThe UI Framework API module contains submodule APIs and open source libraries for 2D and 3D graphics and text. + UI FrameworkThe UI Framework API module contains submodule APIs and open source libraries for 2D and 3D graphics and text.

    Documentation:

    CairoA library for 2D vector graphics drawing. Vector graphics are advantageous because they have small file sizes and can be scaled to any size without any loss of image quality. This module also includes Cairo EvasGL APIs which have been designed to support hardware-accelerated rendering.Provides a library for 2D vector graphics drawing. Vector graphics are advantageous because they have small file sizes and can be scaled to any size without any loss of image quality. This module also includes Cairo EvasGL APIs which have been designed to support hardware-accelerated rendering.
    DALiProvides a cross-platform 3D UI Toolkit for embedded systems.
    EFLEFL is a collection of libraries that are independent and can be built on top of each other to provide useful features that complement the existing environment.Provides a collection of libraries that are independent and can be built on top of each other to provide useful features that complement the existing environment.
    EFL UTIL
    External Output Manager

    (since 2.4)

    The External Output Manager provides APIs for external outputs.Provides functions for external outputs.
    Fontconfig and FreetypeA text rendering library and font-handling library to let applications find a font or closely matching font.Provides a text rendering library and font-handling library to let applications find a font or closely matching font.
    Minicontrol

    (since 2.4)

    Provides functions for creating EFL socket window and displaying EFL socket window.Provides functions for creating and displaying an EFL socket window.
    TBM SurfaceThe Tizen Buffer Manager (TBM) surface provides functions for the graphics buffer.Provides functions for the graphics buffer.
    STTThis API submodule provides functions to recognize speech.Provides functions to recognize speech.
    TTSThis API submodule provides functions for synthesizing voice from text and playing synthesized sound data.Provides functions for synthesizing voice from text and playing synthesized sound data.
    Input Method

    (since 2.4)

    The Input Method API provides the functions for starting IME application lifecycle, methods to interact with current UI state of IME, and getting attributes/events.Provides functions for starting the IME application life-cycle, for interacting with the current UI state of the IME, and getting attributes and events.
    Voice control

    (since 2.4)

    The Voice control API provides functions for registering command and getting notification when registered command is recognized.Provides functions for registering commands and getting notifications when a registered command is recognized.
    WebThe Web API module contains submodule APIs for browsing the Internet, tracking browsing history, downloading Web content, and manipulating JavaScript Object Notation (JSON) documents. + WebThe Web API module contains submodule APIs for browsing the Internet, tracking browsing history, downloading Web content, and manipulating JavaScript Object Notation (JSON) documents.

    Documentation:

    Json-GlibThis library allows reading and parsing of JavaScript Object Notation (JSON) documents.
    libOAuthLibrary for using an open standard for secure authorization. This library enables users to securely log into an account on an application by using their logon credentials from another secondary account that they may have with another account provider or application. Allows reading and parsing of JavaScript Object Notation (JSON) documents.
    WebView
    - - - - - - - - - -
    Note
    Tizen has limited combination policy of multi-project application for device usability. If you do not follow the policy, the submission of your applications to the Tizen Store might be rejected. -
    For developer's convenience, some policies can be allowed in the SDK, for example, the STANDALONE service-application or STANDALOE widget-application can be made in the IDE, but these applications might be rejected in the Tizen Store. -
    -

    The following table shows the possible combination for native mulit-project:

    -
      -
    • STANDALONE : If it is marked O, it means that it can be packaged alone or as the main application. If it is marked X, it means that it should not be packaged alone or as the main application.
    • -
    • 1 : Only one application can be packaged as the sub application.
    • -
    • N : Multiple applications can be packaged as the sub applications.
    • -
    + + + + + + + + + +
    Note
    Tizen has limited a multi-project application combination policy for device usability. If you do not follow the policy, the submission of your application to the Tizen Store can be rejected. +

    For your convenience, some policies can be allowed in the SDK only. For example, you can make a STANDALONE service application or STANDALONE widget application in the IDE, but these applications can be rejected in the Tizen Store.

    +
    + +

    The following table shows the possible combinations for a native multi-project. 1 means that only one application can be packaged as a sub application, while M means that multiple applications can be packaged as sub applications. The STANDALONE column defines whether the application can be packaged alone as the main application.

    - + - - - + + + - + - + - - - - + + + + - + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + +
    Table: The possible combinationTable: Combinations
    Main ProjectSub Project
    Main projectSub project
    STANDALONESTANDALONE UI SERVICE WATCH WIDGETIMEIME
    UIOXNXYesNoMNo 1XNo
    SERVICEXXXXXXNoNoNoNoNoNo
    WATCHOXNXXXYesNoMNoNoNo
    WIDGETXXXXXXNoNoNoNoNoNo
    IMEONNXXX
    YesMMNoNoNo
    + +

    The following examples illustrate how to read the above table:

    +
      +
    • Main UI project alone: Allowed
    • +
    • Main UI project + 3 service projects packaged together: Allowed
    • +
    • Main UI project + 1 widget project packaged together: Allowed
    • +
    • Main UI project + 2 widget projects packaged together: Not allowed
    • +
    • Main service project alone: Not allowed
    • +
    - - -
  • Example combination -
      -
    • Main UI Project : Allowed
    • -
    • Main UI Project + 3 Service Project : Allowed
    • -
    • Main UI Project + 1 Widget Project : Allowed
    • -
    • Main UI Project + 2 Widget Project : Not Allowed
    • -
    • Main SERVICE Project : Not Allowed
    • -
    -
  • - - + +

    The following figure illustrates the process of developing a Tizen native application.

    +

    Figure: Native application development process

    +

    Native application development process

    + diff --git a/org.tizen.gettingstarted/html/native/process/building_app_n.htm b/org.tizen.gettingstarted/html/native/process/building_app_n.htm index e8f7ea7..2030a00 100644 --- a/org.tizen.gettingstarted/html/native/process/building_app_n.htm +++ b/org.tizen.gettingstarted/html/native/process/building_app_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.gettingstarted/html/native/process/debugging_app_n.htm b/org.tizen.gettingstarted/html/native/process/debugging_app_n.htm index 1a7971e..62a7686 100644 --- a/org.tizen.gettingstarted/html/native/process/debugging_app_n.htm +++ b/org.tizen.gettingstarted/html/native/process/debugging_app_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.gettingstarted/html/native/process/designing_app_ui_n.htm b/org.tizen.gettingstarted/html/native/process/designing_app_ui_n.htm index 5e44037..69e8255 100644 --- a/org.tizen.gettingstarted/html/native/process/designing_app_ui_n.htm +++ b/org.tizen.gettingstarted/html/native/process/designing_app_ui_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -75,7 +75,7 @@

    The following figure illustrates the default project folder structure for Tizen UI Builder applications.

    Figure: Default project folder structure

    -

    Default project folder structure

    +

    Default project folder structure

    The following table describes the content of the default project folders.

    - - + +
    @@ -152,40 +152,40 @@

    Using the WYSIWYG Editor View

    You can configure the design area of the WYSIWYG Editor view by managing the display resolution, changing the orientation, zooming in and out, and scaling the design area to the available screen space.

    -

    You can add a UI Component in the WYSIWYG Editor view and set its properties:

    +

    You can add a UI component in the WYSIWYG Editor view and set its properties:

      -
    1. In the Project Explorer view, double-click the layout.tuml file to which you want to add UI Components. +
    2. In the Project Explorer view, double-click the layout.tuml file to which you want to add UI components.

      A design area is displayed in the WYSIWYG Editor view.

    3. -
    4. Drag the UI Component from the Palette area to the WYSIWYG Editor view. -

      Designing page layout

      +
    5. Drag the UI component from the Palette area to the WYSIWYG Editor view. +

      Designing page layout

    6. -
    7. Select the UI Component in the WYSIWYG Editor or Outline view.
    8. -
    9. In the Properties view, set the UI Component properties.
    10. +
    11. Select the UI component in the WYSIWYG Editor or Outline view.
    12. +
    13. In the Properties view, set the UI component properties.
    -

    You can move the UI Components around in the WYSIWYG Editor.

    +

    You can move the UI components around in the WYSIWYG Editor.

    -

    Placing UI Components

    -

    You can place a variety of UI Components in the WYSIWYG Editor view.

    -

    To place a UI Component, drag the UI Component from the Palette area to the WYSIWYG Editor view. The next empty position in the WYSIWYG Editor view is marked with a dotted rectangle.

    -

    You can add child UI Components in a container, such as a Table. For example, you can add a set of Image UI Components in a Table container UI Component. When adding the Image UI Component, some areas in the Table container change to the blue color, which implies that the UI Component can be placed.

    +

    Placing UI Components

    +

    You can place a variety of UI components in the WYSIWYG Editor view.

    +

    To place a UI component, drag the UI component from the Palette area to the WYSIWYG Editor view. The next empty position in the WYSIWYG Editor view is marked with a dotted rectangle.

    +

    You can add child UI components in a container, such as a Table. For example, you can add a set of Image components in a Table container component. When adding the Image component, some areas in the Table container change to the blue color, which implies that the UI component can be placed.

    Handling Events and Testing

    -

    You can select a UI Component from the design area of the WYSIWYG Editor view and add event handlers to it.

    -

    To add an event handler to a selected UI Component:

    +

    You can select a UI component from the design area of the WYSIWYG Editor view and add event handlers to it.

    +

    To add an event handler to a selected UI component:

    1. In the Properties view, select the Event sub-tab.
    2. In the list, select the event to which you want to add an event handler.
    3. If you want to add a click event, click the + button on the right side of the clicked label.
    4. -
    5. Click the right arrow on the right side of Combo.
      - The UI Builder generates a skeleton code for the event handler, and the event handler for the selected event is displayed.
    6. +
    7. Click the right arrow on the right side of Combo. +

      The UI Builder generates a skeleton code for the event handler, and the event handler for the selected event is displayed.

    8. Enter the application-specific event handler-related code.
    9. -
    10. Press Ctrl+s.
      - The Tizen native application is rendered as it is on the Emulator (target).
    11. +
    12. Press Ctrl+s. +

      The Tizen native application is rendered as it is on the Emulator (target).

    -

    All UI Components have their own unique ID in a specific view, and you can access the UI Components in the event handler code using the ID. You can view and edit the UI Component ID in the Outline view.

    +

    All UI components have their own unique ID in a specific view, and you can access the UI components in the event handler code using the ID. You can view and edit the UI component ID in the Outline view.

    For example, if your view (with the view1 ID) has a button (with the button1 ID), you can create an event handler for the button tap that changes the heading text:

     void view1_button1_onclicked(uib_view1_view_context *vc, Evas_object *obj, void *event_info) 
    @@ -224,4 +224,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
      
         
      
    -
    +
    \ No newline at end of file
    diff --git a/org.tizen.gettingstarted/html/native/process/performance_n.htm b/org.tizen.gettingstarted/html/native/process/performance_n.htm
    index d2fd954..a269cef 100644
    --- a/org.tizen.gettingstarted/html/native/process/performance_n.htm
    +++ b/org.tizen.gettingstarted/html/native/process/performance_n.htm
    @@ -16,7 +16,7 @@
      
      
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.gettingstarted/html/native/process/running_app_n.htm b/org.tizen.gettingstarted/html/native/process/running_app_n.htm index 609424f..ff16549 100644 --- a/org.tizen.gettingstarted/html/native/process/running_app_n.htm +++ b/org.tizen.gettingstarted/html/native/process/running_app_n.htm @@ -22,7 +22,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Running Applications

    You can run Tizen native applications on the Emulator using the Project Explorer view or the Tizen IDE menu.

    diff --git a/org.tizen.gettingstarted/html/native/process/setting_properties_n.htm b/org.tizen.gettingstarted/html/native/process/setting_properties_n.htm index d97b517..2d25616 100644 --- a/org.tizen.gettingstarted/html/native/process/setting_properties_n.htm +++ b/org.tizen.gettingstarted/html/native/process/setting_properties_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -200,13 +200,13 @@
    Note
    The auto-restart and on-boot attributes are not supported in Tizen wearable devices. Since Tizen 2.4, both attributes are not supported in all Tizen devices. Hence, the auto-restart or on-boot attributes used on the lower than 2.4 API version package shall ignored on the devices with Tizen platform version 2.4 or higher.
    The auto-restart and on-boot attributes are not supported in Tizen wearable devices. Since Tizen 2.4, both attributes are not supported in all Tizen devices. Because of this, if they are used in a lower API version package than 2.4, they are ignored in the devices with the Tizen platform version 2.4 or higher.
  • Define application control. -

    You can export the application control functionality of your application. To define an application control used to access the functionality of your application, click Add in the Application Control section of the Advanced tab of the manifest editor.

    +

    You can export the application control functionality of your application. To define an application control used to access the functionality of your application, click Add in the Application Control section of the Advanced tab of the manifest editor.

    Each application control can have multiple operation, mime type, and uri attributes.

  • Add an account (in mobile applications only).

    Account providers, such as Google and Facebook, represent specific service provider-related information or protocol that provides the user accounts. To add, update, or remove accounts, you must register a specific account provider in your application.

    diff --git a/org.tizen.gettingstarted/html/preface.htm b/org.tizen.gettingstarted/html/preface.htm index 3335898..43ecd5c 100644 --- a/org.tizen.gettingstarted/html/preface.htm +++ b/org.tizen.gettingstarted/html/preface.htm @@ -21,7 +21,7 @@
    -

    Mobile Web Wearable Web Mobile native Wearable native

    +

    Mobile Wearable

    Preface

    @@ -34,7 +34,7 @@

    The Tizen platform provides various profiles for application development: the mobile and wearable Web profiles can be used to develop Web applications for mobile and wearable devices, while the mobile and wearable native profile can be used to develop native applications for mobile and wearable devices.

    -

    When using the Tizen documentation, look for the profile icons on the upper right corner of each page. The icons (listed in the following table) indicate which profiles the topic applies to. "N" in the icon stands for the native application profiles and "W" stands for the Web application profiles.

    +

    When using the Tizen documentation, look for the profile icons on the upper right corner of each page. The icons (listed in the following table) indicate which profiles the topic applies to. "W" stands for the Web application profiles and "N" in the icon stands for the native application profiles.

    + + + + + + + + - + - + - - + + - - + +
    @@ -51,20 +51,28 @@
    Icon
    Mobile Web and nativeMobile
    Wearable Web and nativeWearable
    Mobile WebMobile Web or Optional Mobile WebMobile Web or Optional Mobile Web
    Wearable WebWearable Web or Optional Wearable WebWearable Web or Optional Wearable Web
    Mobile NativeMobile NativeMobile nativeMobile Native
    Wearable NativeWearable NativeWearable nativeWearable Native
    @@ -75,7 +83,7 @@ Note - In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional. The gray profile icon (as shown in the table above) refers to an optional API. + In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional. The fully gray profile icon (as shown in the table above) refers to an optional API.

    The mandatory APIs are always available on all Tizen devices. The optional APIs provide functionality that depends on the available device hardware or software capabilities, and they may not be available in all Tizen devices.

    @@ -90,10 +98,10 @@
    • Getting Started -

      The getting started with Tizen documentation provides overall information you need to become familiar with Tizen programming and application model. The documentation also walks you through creating your first Tizen application.

      +

      The getting started documentation provides overall information you need to become familiar with Tizen programming and application model. The documentation also walks you through creating your first Tizen application.

    • -
    • UI Guides -

      The Tizen UI guides instruct you in planning and developing a user interface for your application. The guides introduce all the available UI toolkit frameworks.

      +
    • UI Practices +

      The Tizen UI practices instruct you in planning and developing a user interface for your application. The guides introduce all the available UI toolkit frameworks.

    • Tutorials

      The Tizen tutorials teach you how to incorporate Tizen features into your application. The tutorials contain detailed code examples to help you write the required code in practice.

      diff --git a/org.tizen.gettingstarted/html/tizen_websites.htm b/org.tizen.gettingstarted/html/tizen_websites.htm index bc5f83a..f6b517b 100644 --- a/org.tizen.gettingstarted/html/tizen_websites.htm +++ b/org.tizen.gettingstarted/html/tizen_websites.htm @@ -21,7 +21,7 @@
      -

      Mobile Web Wearable Web Mobile native Wearable native

      +

      Mobile Wearable

      Tizen Web Sites

      diff --git a/org.tizen.gettingstarted/html/web/app_model/application_model_w.htm b/org.tizen.gettingstarted/html/web/app_model/application_model_w.htm index af2c0d9..d94864e 100644 --- a/org.tizen.gettingstarted/html/web/app_model/application_model_w.htm +++ b/org.tizen.gettingstarted/html/web/app_model/application_model_w.htm @@ -18,7 +18,7 @@
      -

      Mobile Web Wearable Web

      +

      Mobile Web Wearable Web

      diff --git a/org.tizen.gettingstarted/html/web/cover_page_w.htm b/org.tizen.gettingstarted/html/web/cover_page_w.htm index 5d20f15..4153506 100644 --- a/org.tizen.gettingstarted/html/web/cover_page_w.htm +++ b/org.tizen.gettingstarted/html/web/cover_page_w.htm @@ -21,7 +21,7 @@
      -

      Mobile Web Wearable Web

      +

      Mobile Web Wearable Web

      Introduction to Web Applications

      diff --git a/org.tizen.gettingstarted/html/web/details/app_filtering_w.htm b/org.tizen.gettingstarted/html/web/details/app_filtering_w.htm index 716f0fd..f977bf8 100644 --- a/org.tizen.gettingstarted/html/web/details/app_filtering_w.htm +++ b/org.tizen.gettingstarted/html/web/details/app_filtering_w.htm @@ -18,7 +18,7 @@
      -

      Mobile Web Wearable Web

      +

      Mobile Web Wearable Web

      Content

      @@ -62,64 +62,76 @@ Feature key Description + Platform version http://tizen.org/feature/screen.size.normal Specify this key, if the application supports all possible current and future resolutions on the normal screen size.

      You cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously. If you do, only the most specific resolution key is considered and the less specific resolution keys are ignored. For example, if you specify both http://tizen.org/feature/screen.size.normal and http://tizen.org/feature/screen.size.normal.320.480 keys, only the http://tizen.org/feature/screen.size.normal.320.480 key is applied.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.240.400 Specify this key, if the application supports the 240 x 400 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.320.320 Specify this key, if the application supports the 320 x 320 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.3 http://tizen.org/feature/screen.size.normal.320.480 Specify this key, if the application supports the 320 x 480 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.360.480 Specify this key, if the application supports the 360 x 480 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.3 http://tizen.org/feature/screen.size.normal.480.800 Specify this key, if the application supports the 480 x 800 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.540.960 Specify this key, if the application supports the 540 x 960 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.600.1024 Specify this key, if the application supports the 600 x 1024 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.720.1280 Specify this key, if the application supports the 720 x 1280 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.1080.1920 Specify this key, if the application supports the 1080 x 1920 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.all Specify this key, if the application supports all possible current and future screen sizes and all possible current and future resolutions per screen size.

      You cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously. If you do, only the most specific resolution key is considered and the less specific resolution keys are ignored. For example, if you specify both http://tizen.org/feature/screen.size.all and http://tizen.org/feature/screen.size.normal.320.480 keys, only the http://tizen.org/feature/screen.size.normal.320.480 key is applied.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 @@ -130,18 +142,21 @@ Feature key Description + Platform version http://tizen.org/feature/screen.size.normal Specify this key, if the application supports all possible current and future resolutions on the normal screen size.

      You cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously. If you do, only the most specific resolution key is considered and the less specific resolution keys are ignored. For example, if you specify both http://tizen.org/feature/screen.size.normal and http://tizen.org/feature/screen.size.normal.320.480 keys, only the http://tizen.org/feature/screen.size.normal.320.480 key is applied.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 http://tizen.org/feature/screen.size.normal.320.320 Specify this key, if the application supports the 320 x 320 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.3 @@ -149,12 +164,14 @@ http://tizen.org/feature/screen.size.normal.360.480 Specify this key, if the application supports the 360 x 480 resolution on the normal screen size.

      You can specify multiple http://tizen.org/feature/screen.size.normal.* keys, if your application supports multiple screen resolutions on the normal screen size. However, you cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.3 http://tizen.org/feature/screen.size.all Specify this key, if the application supports all possible current and future screen sizes and all possible current and future resolutions per screen size.

      You cannot specify keys on both screen.size.* and screen.size.normal.* levels simultaneously. If you do, only the most specific resolution key is considered and the less specific resolution keys are ignored. For example, if you specify both http://tizen.org/feature/screen.size.all and http://tizen.org/feature/screen.size.normal.320.480 keys, only the http://tizen.org/feature/screen.size.normal.320.480 key is applied.

      If no screen size key is declared, it is assumed that the application supports only screen.size.normal.720.1280. To avoid this, specify at least 1 screen size key.

      + 2.2.1 @@ -192,111 +209,158 @@ Feature key Description + Platform version http://tizen.org/feature/datasync Specify this key, if the application requires the DataSync feature. + 2.3 http://tizen.org/feature/fmradio Specify this key, if the application requires an FM radio. + 2.2.1 http://tizen.org/feature/humanactivitymonitor Specify this key, if the application requires any of the Human Activity Monitor features. + 2.3 http://tizen.org/feature/location.batch Specify this key, if the application requires the location tracking with a position batch information feature for using the Human Activity Monitor (GPS Type) API. + 2.3 http://tizen.org/feature/network.bluetooth Specify this key, if the application requires the Bluetooth feature. + 2.2.1 http://tizen.org/feature/network.bluetooth.audio.media Specify this key, if the application requires the Bluetooth Advanced Audio feature (A2DP). + 2.3 http://tizen.org/feature/network.bluetooth.health Specify this key, if the application requires the Bluetooth Health feature (HDP). + 2.3 http://tizen.org/feature/network.bluetooth.le Specify this key, if the application requires the Bluetooth Low Energy feature (BLE). + 2.3 http://tizen.org/feature/network.nfc Specify this key, if the application requires the use of any API that, in turn, requires the Near Field Communication (NFC) feature. + 2.2.1 http://tizen.org/feature/network.nfc.card_emulation Specify this key, if the application requires the NFC card emulation feature. + 2.3 http://tizen.org/feature/network.nfc.card_emulation.hce Specify this key, if the application requires the NFC host-based card emulation feature. + 2.3.1 http://tizen.org/feature/network.nfc.p2p Specify this key, if the application requires the NFC P2P feature. + 2.3.1 http://tizen.org/feature/network.nfc.tag Specify this key, if the application requires the NFC tag feature. + 2.3.1 http://tizen.org/feature/network.push Specify this key, if the application requires the network-based push service. + 2.2.1 http://tizen.org/feature/network.secure_element Specify this key, if the application requires the secure element feature. + 2.2.1 http://tizen.org/feature/network.telephony Specify this key, if the application requires the use of any API that, in turn, requires the telephony feature. + 2.2.1 http://tizen.org/feature/network.telephony.mms Specify this key, if the application requires the MMS feature. + 2.2.1 +http://tizen.org/feature/network.telephony.sms + Specify this key, if the application requires the SMS feature. + 2.4 + + http://tizen.org/feature/network.wifi Specify this key, if the application requires the use of any API that, in turn, requires the Wi-Fi feature. + 2.2.1 http://tizen.org/feature/sensor.barometer Specify this key, if the application requires a barometer sensor for using the Sensor (Pressure Type) API. + 2.2.1 http://tizen.org/feature/sensor.heart_rate_monitor Specify this key, if the application requires a heart rate monitor sensor for using the Human Activity Monitor (HRM Type) API. + 2.3 +http://tizen.org/feature/sensor.heart_rate_monitor.led_green + Specify this key, if the application requires the LED green heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_ir + Specify this key, if the application requires the LED infrared heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_red + Specify this key, if the application requires the LED red heart rate monitor sensor. + 2.3.1 + + http://tizen.org/feature/sensor.magnetometer Specify this key, if the application requires a magnetic sensor for using the Sensor (MAGNETIC Type) API. + 2.2.1 http://tizen.org/feature/sensor.pedometer Specify this key, if the application requires a pedometer sensor for using the Human Activity Monitor (PEDOMETER Type) API. + 2.3 http://tizen.org/feature/sensor.photometer Specify this key, if the application requires a photometer sensor for using the Sensor (LIGHT Type) API. + 2.2.1 http://tizen.org/feature/sensor.proximity Specify this key, if the application requires a proximity sensor for using the Sensor (PROXIMITY Type) API. + 2.2.1 http://tizen.org/feature/sensor.ultraviolet Specify this key, if the application requires a ultraviolet sensor for using the Sensor (ULTRAVIOLET Type) API. + 2.3 http://tizen.org/feature/sensor.wrist_up Specify this key, if the application requires a wrist up sensor for using the Human Activity Monitor (WRIST_UP Type) API. + 2.3 @@ -307,35 +371,59 @@ Feature key Description + Platform version http://tizen.org/feature/camera Specify this key, if the application requires any kind of a camera for using the getUserMedia or HTML Media Capture API. + 2.2.1 http://tizen.org/feature/location.gps Specify this key, if the application requires the Global Positioning System (GPS) feature for using the GeoLocation API. + 2.2.1 http://tizen.org/feature/microphone Specify this key, if the application requires a microphone for using the getUserMedia or HTML Media Capture API. + 2.2.1 http://tizen.org/feature/sensor.accelerometer Specify this key, if the application requires an acceleration sensor for using the DeviceOrientation Event Specification API. + 2.2.1 http://tizen.org/feature/sensor.gyroscope Specify this key, if the application requires a gyro sensor for using the DeviceOrientation Event API. + 2.2.1 http://tizen.org/feature/sensor.magnetometer Specify this key, if the application requires a magnetic sensor for using the DeviceOrientation Event Specification or Screen Orientation API. + 2.2.1 http://tizen.org/feature/speech.synthesis Specify this key, if the application requires the speech synthesis (text-to-speech, TTS) feature for using the Web Speech API. + 2.2.1 + + + + + + + + + + + + + + + +
      Table: Available requirements for mobile Web Runtime
      Feature keyDescriptionPlatform version
      http://tizen.org/feature/shell.appwidgetSpecify this key, if the application requires the AppWidget (Dynamic Box) feature.2.2.1
      @@ -347,10 +435,12 @@ Feature key Description + Platform version http://tizen.org/feature/download Specify this key, if the application requires the network connection to access the Internet for using the Download API. + 2.3 http://tizen.org/feature/humanactivitymonitor @@ -363,94 +453,137 @@
    • GPS: http://tizen.org/feature/location.batch
    + 2.3 http://tizen.org/feature/location.batch Specify this key, if the application requires the location tracking with a position batch information feature. + 2.3 http://tizen.org/feature/network.bluetooth Specify this key, if the application requires the Bluetooth feature. + 2.2.1 http://tizen.org/feature/network.bluetooth.audio.media Specify this key, if the application requires the Bluetooth Advanced Audio feature (A2DP) feature for using the Media Key API. + 2.3 http://tizen.org/feature/network.bluetooth.health Specify this key, if the application requires the Bluetooth Health feature (HDP). + 2.3 http://tizen.org/feature/network.bluetooth.le Specify this key, if the application requires the Bluetooth Low Energy feature (BLE). + 2.3 http://tizen.org/feature/network.nfc Specify this key, if the application requires the use of any API that, in turn, requires the Near Field Communication (NFC) feature. + 2.2.1 http://tizen.org/feature/network.nfc.card_emulation Specify this key, if the application requires the NFC card emulation feature. + 2.3 http://tizen.org/feature/network.nfc.card_emulation.hce Specify this key, if the application requires the NFC host-based card emulation feature. + 2.3.1 http://tizen.org/feature/network.nfc.p2p Specify this key, if the application requires the NFC P2P feature. + 2.3.1 http://tizen.org/feature/network.nfc.tag Specify this key, if the application requires the NFC tag feature. + 2.3.1 http://tizen.org/feature/network.push Specify this key, if the application requires the network-based push service. + 2.2.1 http://tizen.org/feature/network.secure_element Specify this key, if the application requires the secure element feature. + 2.2.1 http://tizen.org/feature/network.telephony Specify this key, if the application requires the use of any API that, in turn, requires the telephony feature. + 2.2.1 +http://tizen.org/feature/network.telephony.sms + Specify this key, if the application requires the SMS feature. + 2.4 + + http://tizen.org/feature/network.wifi Specify this key, if the application requires the use of any API that, in turn, requires the Wi-Fi feature (for example, the Download API). + 2.2.1 http://tizen.org/feature/sensor.barometer Specify this key, if the application requires a barometer sensor. + 2.2.1 http://tizen.org/feature/sensor.heart_rate_monitor Specify this key, if the application requires a heart rate monitor sensor. + 2.3 +http://tizen.org/feature/sensor.heart_rate_monitor.led_green + Specify this key, if the application requires the LED green heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_ir + Specify this key, if the application requires the LED infrared heart rate monitor sensor. + 2.3.1 + + +http://tizen.org/feature/sensor.heart_rate_monitor.led_red + Specify this key, if the application requires the LED red heart rate monitor sensor. + 2.3.1 + + http://tizen.org/feature/sensor.magnetometer Specify this key, if the application requires a magnetic sensor. + 2.2.1 http://tizen.org/feature/sensor.pedometer Specify this key, if the application requires a pedometer sensor. + 2.3 http://tizen.org/feature/sensor.photometer Specify this key, if the application requires a photometer sensor. + 2.2.1 http://tizen.org/feature/sensor.proximity Specify this key, if the application requires a proximity sensor. + 2.2.1 http://tizen.org/feature/sensor.ultraviolet Specify this key, if the application requires an ultraviolet sensor. + 2.3 http://tizen.org/feature/sensor.wrist_up Specify this key, if the application requires a wrist up sensor. + 2.3 @@ -461,47 +594,58 @@ Feature key Description + Platform version http://tizen.org/feature/camera Specify this key, if the application requires any kind of a camera for using the getUserMedia API. + 2.2.1 http://tizen.org/feature/input.rotating_bezel Specify this key, if the application requires rotating bezel input. + 2.3.1 http://tizen.org/feature/location.gps Specify this key, if the application requires the Global Positioning System (GPS) feature for using the GeoLocation API. + 2.2.1 http://tizen.org/feature/microphone Specify this key, if the application requires a microphone for using the getUserMedia API. + 2.2.1 http://tizen.org/feature/network.internet Specify this key, if the application requires Internet access for using the WebSocket API, XMLHttpRequest Level 1, or Cross-Origin Resource Sharing API. + 2.3.1 http://tizen.org/feature/screen.shape.circle Specify this key, if the application requires a circle-shaped screen. + 2.3.1 http://tizen.org/feature/screen.shape.rectangle Specify this key, if the application requires a rectangle-shaped screen. + 2.3.1 http://tizen.org/feature/sensor.accelerometer Specify this key, if the application requires an acceleration sensor for using the DeviceOrientation Event Specification API. + 2.2.1 http://tizen.org/feature/sensor.gyroscope Specify this key, if the application requires a gyro sensor for using the DeviceOrientation Event API. + 2.2.1 http://tizen.org/feature/speech.synthesis Specify this key, if the application requires the speech synthesis (text-to-speech, TTS) feature for using the Web Speech API. + 2.2.1 @@ -512,18 +656,22 @@ Feature key Description + Platform version http://tizen.org/feature/media.audio_recording Specify this key, if the application requires the audio recording functionality of the device for using the Camera API (Tizen Extension) (Audio Recording) API. + 2.3 http://tizen.org/feature/media.image_capture Specify this key, if the application requires the image capture functionality of the device for using the Camera API (Tizen Extension) (Image Recording) API. + 2.3 http://tizen.org/feature/media.video_recording Specify this key, if the application requires the video recording functionality of the device for using the Camera API (Tizen Extension) (Video Recording) API. + 2.3 @@ -534,10 +682,17 @@ Feature key Description + Platform version + + +http://tizen.org/feature/shell.appwidget + Specify this key, if the application requires the AppWidget (Dynamic Box) feature. + 2.2.1 http://tizen.org/feature/web.service Specify this key, if the application requires the Web service application feature. + 2.3 diff --git a/org.tizen.gettingstarted/html/web/details/details_w.htm b/org.tizen.gettingstarted/html/web/details/details_w.htm index de7b12f..9e3b280 100644 --- a/org.tizen.gettingstarted/html/web/details/details_w.htm +++ b/org.tizen.gettingstarted/html/web/details/details_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.gettingstarted/html/web/details/event_handling_w.htm b/org.tizen.gettingstarted/html/web/details/event_handling_w.htm index 6d3e54b..aef5a8e 100644 --- a/org.tizen.gettingstarted/html/web/details/event_handling_w.htm +++ b/org.tizen.gettingstarted/html/web/details/event_handling_w.htm @@ -18,7 +18,7 @@
    -

    Wearable Web

    +

    Wearable Web

    Content

    @@ -35,16 +35,7 @@

    The Tizen platform supports event handling for user interactions. To provide a full user experience for your application users, you must handle various events in your application.

    - - - - - - - - - -
    Note
    This feature is supported in wearable applications only.
    +

    This feature is supported in wearable applications only.

    Rotary Events

    @@ -75,18 +66,18 @@
     document.addEventListener("rotarydetent", function(ev) 
     {
    -   /* Get direction value from event */
    +   /* Get the direction value from the event */
        var direction = ev.detail.direction;
        
    -   if (direction == "CW")
    +   if (direction == "CW")
        {
           /* Add behavior for clockwise rotation */
    -      console.log("clockwise");
    +      console.log("clockwise");
        }
    -   else if (direction == "CCW")
    +   else if (direction == "CCW")
        {
           /* Add behavior for counter-clockwise rotation */
    -      console.log("counter-clockwise");
    +      console.log("counter-clockwise");
        }
     });
     
    diff --git a/org.tizen.gettingstarted/html/web/details/sec_privileges_w.htm b/org.tizen.gettingstarted/html/web/details/sec_privileges_w.htm index 4eaf884..7366d1c 100644 --- a/org.tizen.gettingstarted/html/web/details/sec_privileges_w.htm +++ b/org.tizen.gettingstarted/html/web/details/sec_privileges_w.htm @@ -25,7 +25,7 @@ tr.partner-level, tr.platform-level { background-color: #cff }
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Security and API Privileges

    @@ -91,34 +91,38 @@ tr.partner-level, tr.platform-level { background-color: #cff } The application can close other applications. - http://tizen.org/privilege/bluetooth - public - Using unrestricted Bluetooth services - The application can perform unrestricted actions using Bluetooth, such as scanning for and connecting to other devices. + http://tizen.org/privilege/bluetooth + public + Using unrestricted Bluetooth services + The application can perform unrestricted actions using Bluetooth, such as scanning for and connecting to other devices. http://tizen.org/privilege/bluetooth.admin public Managing Bluetooth general settings - The application can change Bluetooth settings, such as turning Bluetooth on or off and setting the device name. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can change Bluetooth settings, such as turning Bluetooth on or off and setting the device name. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetooth.gap public Using Bluetooth GAP - The application can use the Bluetooth Generic Access Profile (GAP) to, for example, scan for and pair with devices. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can use the Bluetooth Generic Access Profile (GAP) to, for example, scan for and pair with devices. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetooth.health public Using Bluetooth HDP - The application can use the Bluetooth Health Device Profile (HDP) to, for example, send health information. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can use the Bluetooth Health Device Profile (HDP) to, for example, send health information. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetooth.spp public Using Bluetooth SPP - The application can use the Bluetooth Serial Port Profile (SPP) to, for example, send serial data. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can use the Bluetooth Serial Port Profile (SPP) to, for example, send serial data. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetoothmanager @@ -413,7 +417,7 @@ tr.partner-level, tr.platform-level { background-color: #cff } http://tizen.org/privilege/notification public - The application can display simple notifications using the Web Notifications API. + The application can display simple notifications using the Web Notifications API.

    Privilege behavior:

    • In the local domain, if this privilege is defined, permission is granted. Otherwise, pop-up user prompt is used.
    • In the remote domain, pop-up user prompt is used.
    @@ -496,25 +500,29 @@ tr.partner-level, tr.platform-level { background-color: #cff } http://tizen.org/privilege/bluetooth.admin public Managing Bluetooth general settings - The application can change Bluetooth settings, such as turning Bluetooth on or off and setting the device name. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can change Bluetooth settings, such as turning Bluetooth on or off and setting the device name. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetooth.gap public Using Bluetooth GAP - The application can use the Bluetooth Generic Access Profile (GAP) to, for example, scan for and pair with devices. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can use the Bluetooth Generic Access Profile (GAP) to, for example, scan for and pair with devices. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetooth.health public Using Bluetooth HDP - The application can use the Bluetooth Health Device Profile (HDP) to, for example, send health information. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can use the Bluetooth Health Device Profile (HDP) to, for example, send health information. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetooth.spp public Using Bluetooth SPP - The application can use the Bluetooth Serial Port Profile (SPP) to, for example, send serial data. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + The application can use the Bluetooth Serial Port Profile (SPP) to, for example, send serial data. Deprecated since 2.4. Use http://tizen.org/privilege/bluetooth instead. + http://tizen.org/privilege/bluetoothmanager diff --git a/org.tizen.gettingstarted/html/web/details/tizen_apis_w.htm b/org.tizen.gettingstarted/html/web/details/tizen_apis_w.htm index 1baf132..38aaa19 100644 --- a/org.tizen.gettingstarted/html/web/details/tizen_apis_w.htm +++ b/org.tizen.gettingstarted/html/web/details/tizen_apis_w.htm @@ -21,7 +21,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Tizen APIs

    @@ -153,7 +153,7 @@

    You can create and manage various kinds of UI components.

    @@ -270,7 +270,7 @@

    You can create and manage various kinds of UI components.

    @@ -298,7 +298,7 @@ These APIs enable you to create animations, specify the border and background styles of HTML elements, apply styles to HTML documents, specify the color and opacity of HTML elements, create flexible and multi-column layouts for Web applications, move, rotate, stretch, and scale elements, and add effects using the CSS3 properties. They also enable you to use CSS and JavaScript code effectively with HTML elements, implement Web forms for user input, define media features for specific output devices, select element nodes in the DOM tree, and store the information of the page that the user has viewed. @@ -367,7 +367,7 @@ These APIs enable you to copy content and paste it in an editable area, create and manage draggable elements, and implement drag events.
      -
    • UI Guides: W3C
    • +
    • UI Practices: W3C
    • API Reference: UI
    @@ -426,7 +426,7 @@ These APIs enable you to create animations, specify the border and background styles of HTML elements, apply styles to HTML documents, specify the color and opacity of HTML elements, create flexible layouts for Web applications, move, rotate, stretch, and scale elements, and add effects using the CSS3 properties. They also enable you to use CSS and JavaScript code effectively with HTML elements, implement Web forms for user input, define media features for specific output devices, select element nodes in the DOM tree, and store the information of the page that the user has viewed. diff --git a/org.tizen.gettingstarted/html/web/details/web_runtime_w.htm b/org.tizen.gettingstarted/html/web/details/web_runtime_w.htm index 7d814f0..b723dd7 100644 --- a/org.tizen.gettingstarted/html/web/details/web_runtime_w.htm +++ b/org.tizen.gettingstarted/html/web/details/web_runtime_w.htm @@ -19,7 +19,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.gettingstarted/html/web/first_app/first_app_w.htm b/org.tizen.gettingstarted/html/web/first_app/first_app_w.htm index 439bab2..ea37f77 100644 --- a/org.tizen.gettingstarted/html/web/first_app/first_app_w.htm +++ b/org.tizen.gettingstarted/html/web/first_app/first_app_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.gettingstarted/html/web/process/app_dev_process_w.htm b/org.tizen.gettingstarted/html/web/process/app_dev_process_w.htm index 89e18da..ec3f644 100644 --- a/org.tizen.gettingstarted/html/web/process/app_dev_process_w.htm +++ b/org.tizen.gettingstarted/html/web/process/app_dev_process_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    @@ -43,9 +43,8 @@

    Web Application Development Process

    -

    The following figure illustrates the process of developing a Tizen Web application. Tizen provides the tools required to manage your application's life-cycle from product conception, through development and release, to end-of-life application retirement.

    -

    Figure: Web application development process

    -

    Web application development process

    +

    Tizen provides the tools required to manage your application's life-cycle from product conception, through development and release, to end-of-life application retirement.

    +

    To develop an application with Tizen:

    Planning and Designing the Application

    @@ -196,31 +195,26 @@

    To modify the build configuration of the service application, see Building the Application.

  • - - - - - - - - - -
    Note
    Tizen has limited combination policy of multi-project application for device usability. If you do not follow the policy, the submission of your applications to the Tizen Store might be rejected. -
    - - -

    The following table shows the possible combination for hybrid mulit-project:

    -
      -
    • 1 : Only one application can be packaged as the sub application.
    • -
    • N : Multiple applications can be packaged as the sub applications.
    • -
    + + + + + + + + + +
    Note
    Tizen has limited a multi-project application combination policy for device usability. If you do not follow the policy, the submission of your application to the Tizen Store can be rejected. +
    + +

    The following table shows the possible combinations for a hybrid multi-project. M means that multiple applications can be packaged as sub applications.

    - + - - + + @@ -230,21 +224,19 @@ - - - - + + + + - - - - + + + + - -
    Table: The possible combinationTable: Combinations
    Main ProjectSub ProjectMain projectSub project
    UI
    WEB UIXNXXNoMNoNo
    WEB SERVICEXXXXNoNoNoNo

    With a hybrid application package, you can register the included applications in the Tizen Store and install, upgrade, and uninstall them using the single hybrid package. When a hybrid application package is installed, the Web application is installed by the Web installer, followed by the native installer installing native service applications.

    @@ -253,32 +245,25 @@

    The Web application and native service applications within a hybrid application package share the same package ID and data folder. Sharing application data between them is easy. Many useful inter-application APIs, such as Message Port and AppControl, can be used in a hybrid application package.

    For more information on hybrid applications and their package structure, see HybridWebApp and HybridServiceApp, and Hybrid Application Package.

    +

    Packaging Web Applications

    -

    Packaging Web Applications

    - -

    A web application package combines a Web application and 1 or more web service applications.

    - - - - - - - - - - -
    Note
    Tizen has limited combination policy of multi-project application for device usability. If you do not follow the policy, the submission of your applications to the Tizen Store might be rejected. -
    - +

    A Web application package combines a Web application and 1 or more Web service applications.

    -

    The following table shows the possible combination for web mulit-project:

    -
      -
    • STANDALONE : If it is marked O, it means that it can be packaged alone or as the main application. If it is marked X, it means that it should not be packaged alone or as the main application.
    • -
    • 1 : Only one application can be packaged as the sub application.
    • -
    • N : Multiple applications can be packaged as the sub applications.
    • -
    + + + + + + + + + +
    Note
    Tizen has limited a multi-project application combination policy for device usability. If you do not follow the policy, the submission of your application to the Tizen Store can be rejected. +
    + +

    The following table shows the possible combinations for a Web multi-project. M means that multiple applications can be packaged as sub applications. The STANDALONE column defines whether the application can be packaged alone as the main application.

    - + @@ -291,21 +276,20 @@ - - - + + + - - - + + + - -
    Table: The possible combinationTable: Combinations
    Main Project
    WEB UIOXNYesNoM
    WEB SERVICEXXXNoNoNo
    - + +

    Certifying and Publishing the Application

    After you have packaged your application, you are ready to certify and publish your application.

    @@ -336,6 +320,9 @@

    Once your application has reached the end of its life-cycle, you can remove it from the Tizen Store or Samsung Galaxy Apps Store.

    +

    The following figure illustrates the process of developing a Tizen Web application.

    +

    Figure: Web application development process

    +

    Web application development process

    @@ -360,4 +347,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.gettingstarted/html/web/process/coding_app_w.htm b/org.tizen.gettingstarted/html/web/process/coding_app_w.htm index 882a048..4e11c12 100644 --- a/org.tizen.gettingstarted/html/web/process/coding_app_w.htm +++ b/org.tizen.gettingstarted/html/web/process/coding_app_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.gettingstarted/html/web/process/creating_app_project_w.htm b/org.tizen.gettingstarted/html/web/process/creating_app_project_w.htm index 619a90a..25bcd25 100644 --- a/org.tizen.gettingstarted/html/web/process/creating_app_project_w.htm +++ b/org.tizen.gettingstarted/html/web/process/creating_app_project_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.gettingstarted/html/web/process/run_debug_app_w.htm b/org.tizen.gettingstarted/html/web/process/run_debug_app_w.htm index fc77dd6..8d9b8a4 100644 --- a/org.tizen.gettingstarted/html/web/process/run_debug_app_w.htm +++ b/org.tizen.gettingstarted/html/web/process/run_debug_app_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    @@ -43,16 +43,7 @@

    Running Web Applications on the Emulator

    You can debug Tizen Web applications on the Emulator using the Project Explorer view or the Tizen IDE menu.

    - - - - - - - - - -
    Note
    Running an Emulator image requires a minimum free disk space of 20 MB. The image can occupy up to 10 GB of disk space.
    +

    To launch the Emulator, do one of the following:

    To stop the Emulator, right-click the Emulator and click Close.

    + + + + + + + + + +
    Note
    Running an Emulator image requires a minimum free disk space of 20 MB. The image can occupy up to 10 GB of disk space.
    +

    Running Web Applications on a Target Device

    You can run Tizen Web applications on a target device using the Project Explorer view or the Tizen IDE menu.

    To run your application on the target device:

    diff --git a/org.tizen.gettingstarted/html/web/process/setting_properties_w.htm b/org.tizen.gettingstarted/html/web/process/setting_properties_w.htm index ebfd9cc..e311469 100644 --- a/org.tizen.gettingstarted/html/web/process/setting_properties_w.htm +++ b/org.tizen.gettingstarted/html/web/process/setting_properties_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    diff --git a/org.tizen.gettingstarted/index.xml b/org.tizen.gettingstarted/index.xml index a86d27c..5548346 100644 --- a/org.tizen.gettingstarted/index.xml +++ b/org.tizen.gettingstarted/index.xml @@ -2,7 +2,7 @@ - + diff --git a/org.tizen.guides/html/images/common_appcontrol_browser.png b/org.tizen.guides/html/images/common_appcontrol_browser.png new file mode 100644 index 0000000..dbe9f6a Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_browser.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_browser2.png b/org.tizen.guides/html/images/common_appcontrol_browser2.png new file mode 100644 index 0000000..d789943 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_browser2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_calendar.png b/org.tizen.guides/html/images/common_appcontrol_calendar.png new file mode 100644 index 0000000..26dc7dc Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_calendar.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_calendar2.png b/org.tizen.guides/html/images/common_appcontrol_calendar2.png new file mode 100644 index 0000000..bbab557 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_calendar2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_calendar3.png b/org.tizen.guides/html/images/common_appcontrol_calendar3.png new file mode 100644 index 0000000..8a63743 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_calendar3.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_calendar4.png b/org.tizen.guides/html/images/common_appcontrol_calendar4.png new file mode 100644 index 0000000..fa989b0 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_calendar4.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_call1.png b/org.tizen.guides/html/images/common_appcontrol_call1.png new file mode 100644 index 0000000..08d869d Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_call1.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_call2.png b/org.tizen.guides/html/images/common_appcontrol_call2.png new file mode 100644 index 0000000..757f259 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_call2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_contact_add.png b/org.tizen.guides/html/images/common_appcontrol_contact_add.png new file mode 100644 index 0000000..f9218bf Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_contact_add.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_contact_edit.png b/org.tizen.guides/html/images/common_appcontrol_contact_edit.png new file mode 100644 index 0000000..0ac5425 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_contact_edit.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_contact_select.png b/org.tizen.guides/html/images/common_appcontrol_contact_select.png new file mode 100644 index 0000000..1a39211 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_contact_select.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_contact_view1.png b/org.tizen.guides/html/images/common_appcontrol_contact_view1.png new file mode 100644 index 0000000..091c11e Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_contact_view1.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_contact_view2.png b/org.tizen.guides/html/images/common_appcontrol_contact_view2.png new file mode 100644 index 0000000..3d1ead5 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_contact_view2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_email.png b/org.tizen.guides/html/images/common_appcontrol_email.png new file mode 100644 index 0000000..797383b Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_email.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_email2.png b/org.tizen.guides/html/images/common_appcontrol_email2.png new file mode 100644 index 0000000..7dd7e88 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_email2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_email3.png b/org.tizen.guides/html/images/common_appcontrol_email3.png new file mode 100644 index 0000000..013b0ad Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_email3.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_email4.png b/org.tizen.guides/html/images/common_appcontrol_email4.png new file mode 100644 index 0000000..bb07756 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_email4.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_message.png b/org.tizen.guides/html/images/common_appcontrol_message.png new file mode 100644 index 0000000..237526e Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_message.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_message2.png b/org.tizen.guides/html/images/common_appcontrol_message2.png new file mode 100644 index 0000000..86c7982 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_message2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_message3.png b/org.tizen.guides/html/images/common_appcontrol_message3.png new file mode 100644 index 0000000..064b2f1 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_message3.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_message4.png b/org.tizen.guides/html/images/common_appcontrol_message4.png new file mode 100644 index 0000000..56cf873 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_message4.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_system_bluetooth.png b/org.tizen.guides/html/images/common_appcontrol_system_bluetooth.png new file mode 100644 index 0000000..b364b20 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_system_bluetooth.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_system_bluetooth2.png b/org.tizen.guides/html/images/common_appcontrol_system_bluetooth2.png new file mode 100644 index 0000000..2b09367 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_system_bluetooth2.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_system_location.png b/org.tizen.guides/html/images/common_appcontrol_system_location.png new file mode 100644 index 0000000..bdd4f8c Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_system_location.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_system_nfc.png b/org.tizen.guides/html/images/common_appcontrol_system_nfc.png new file mode 100644 index 0000000..1214be3 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_system_nfc.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_system_setting.png b/org.tizen.guides/html/images/common_appcontrol_system_setting.png new file mode 100644 index 0000000..d24ad84 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_system_setting.png differ diff --git a/org.tizen.guides/html/images/common_appcontrol_system_wifi.png b/org.tizen.guides/html/images/common_appcontrol_system_wifi.png new file mode 100644 index 0000000..2b3adc1 Binary files /dev/null and b/org.tizen.guides/html/images/common_appcontrol_system_wifi.png differ diff --git a/org.tizen.guides/html/images/hw_acceleration.png b/org.tizen.guides/html/images/hw_acceleration.png new file mode 100644 index 0000000..8da8c28 Binary files /dev/null and b/org.tizen.guides/html/images/hw_acceleration.png differ diff --git a/org.tizen.guides/html/images/key_manager.png b/org.tizen.guides/html/images/key_manager.png index 0a37663..40c1f92 100644 Binary files a/org.tizen.guides/html/images/key_manager.png and b/org.tizen.guides/html/images/key_manager.png differ diff --git a/org.tizen.guides/html/images/mn_division.png b/org.tizen.guides/html/images/mn_division.png index 1f7e337..faecb28 100644 Binary files a/org.tizen.guides/html/images/mn_division.png and b/org.tizen.guides/html/images/mn_division.png differ diff --git a/org.tizen.guides/html/images/mobile_s_n.png b/org.tizen.guides/html/images/mobile_s_n.png new file mode 100644 index 0000000..ad8c779 Binary files /dev/null and b/org.tizen.guides/html/images/mobile_s_n.png differ diff --git a/org.tizen.guides/html/images/mobile_s_w.png b/org.tizen.guides/html/images/mobile_s_w.png new file mode 100644 index 0000000..f86df29 Binary files /dev/null and b/org.tizen.guides/html/images/mobile_s_w.png differ diff --git a/org.tizen.guides/html/images/mobile_s_w_optional.png b/org.tizen.guides/html/images/mobile_s_w_optional.png new file mode 100644 index 0000000..0434b73 Binary files /dev/null and b/org.tizen.guides/html/images/mobile_s_w_optional.png differ diff --git a/org.tizen.guides/html/images/mw_division.png b/org.tizen.guides/html/images/mw_division.png index 8fc3efa..c4a8655 100644 Binary files a/org.tizen.guides/html/images/mw_division.png and b/org.tizen.guides/html/images/mw_division.png differ diff --git a/org.tizen.guides/html/images/n_division.png b/org.tizen.guides/html/images/n_division.png index d687bc5..5a0b8f6 100644 Binary files a/org.tizen.guides/html/images/n_division.png and b/org.tizen.guides/html/images/n_division.png differ diff --git a/org.tizen.guides/html/images/shortcut.png b/org.tizen.guides/html/images/shortcut.png new file mode 100644 index 0000000..576fd83 Binary files /dev/null and b/org.tizen.guides/html/images/shortcut.png differ diff --git a/org.tizen.guides/html/images/w_division.png b/org.tizen.guides/html/images/w_division.png index 88d9959..443a1ea 100644 Binary files a/org.tizen.guides/html/images/w_division.png and b/org.tizen.guides/html/images/w_division.png differ diff --git a/org.tizen.guides/html/images/wearable_s_n.png b/org.tizen.guides/html/images/wearable_s_n.png new file mode 100644 index 0000000..02e3791 Binary files /dev/null and b/org.tizen.guides/html/images/wearable_s_n.png differ diff --git a/org.tizen.guides/html/images/wearable_s_w.png b/org.tizen.guides/html/images/wearable_s_w.png new file mode 100644 index 0000000..379a9c5 Binary files /dev/null and b/org.tizen.guides/html/images/wearable_s_w.png differ diff --git a/org.tizen.guides/html/images/wearable_s_w_optional.png b/org.tizen.guides/html/images/wearable_s_w_optional.png new file mode 100644 index 0000000..cef460c Binary files /dev/null and b/org.tizen.guides/html/images/wearable_s_w_optional.png differ diff --git a/org.tizen.guides/html/images/wn_division.png b/org.tizen.guides/html/images/wn_division.png index 11a7876..dca667f 100644 Binary files a/org.tizen.guides/html/images/wn_division.png and b/org.tizen.guides/html/images/wn_division.png differ diff --git a/org.tizen.guides/html/images/ww_division.png b/org.tizen.guides/html/images/ww_division.png index 65e7ab7..5f5160c 100644 Binary files a/org.tizen.guides/html/images/ww_division.png and b/org.tizen.guides/html/images/ww_division.png differ diff --git a/org.tizen.guides/html/index.htm b/org.tizen.guides/html/index.htm index 42ea7d8..37f0966 100644 --- a/org.tizen.guides/html/index.htm +++ b/org.tizen.guides/html/index.htm @@ -32,6 +32,7 @@ @@ -129,7 +130,7 @@ @@ -144,8 +145,8 @@
  • Security
  • Performance and Optimization @@ -186,16 +187,28 @@

    Native Application

  • Location
  • Messaging
  • @@ -276,7 +290,7 @@
  • Connection
  • Bluetooth
  • NFC
  • -
  • SmartCard
  • +
  • Smartcard
  • Wi-Fi
  • Wi-Fi Direct
  • @@ -289,10 +303,9 @@
  • Social
  • System @@ -317,6 +330,7 @@
  • UI Framework
  • UIX @@ -333,11 +347,6 @@
  • Web
  • -
  • Porting - -
  • diff --git a/org.tizen.guides/html/native/account/account_guide_n.htm b/org.tizen.guides/html/native/account/account_guide_n.htm index ac60e65..676d4d7 100644 --- a/org.tizen.guides/html/native/account/account_guide_n.htm +++ b/org.tizen.guides/html/native/account/account_guide_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -33,18 +33,17 @@

    Account

    -

    Account features include managing various account information, such as receiving sync operation notifications, and obtaining an access token by using the oauth2 authorization.

    +

    Account features include managing various account information, such as receiving sync operation notifications, and obtaining an access token by using the OAuth 2.0 authorization.

    The main account features are:

      -
    • oauth2

      -

      Enables you to obtain an access token by using the oauth2 authorization.

    • +
    • Account Manager +

      Allows you to work with accounts in your application by creating, managing and removing individual accounts.

    • +
    • OAuth 2.0

      +

      Enables you to obtain an access token by using the OAuth 2.0 authorization.

    - - - +

    The following guides apply in mobile applications only:

    -
    • Sync Manager

      Enables you to receive notifications in your application about syncing operations between a server and the device.

    • diff --git a/org.tizen.guides/html/native/account/account_manager_n.htm b/org.tizen.guides/html/native/account/account_manager_n.htm new file mode 100644 index 0000000..6c611de --- /dev/null +++ b/org.tizen.guides/html/native/account/account_manager_n.htm @@ -0,0 +1,356 @@ + + + + + + + + + + + + + Account Manager + + + + + +
      + + +

      Account Manager

      + +

      An account is a collection of information representing the user of a specific provider.

      + +

      The main features of the Account Manager API include: +

      +
        +
      • Creating and managing accounts
      • +
      • Retrieving account information
      • +
      • Receiving account change notifications
      • +
      + + + + + + + + + +
      Note
      To add, update, or remove an account, you must register your account provider for all your applications belonging to the same package.
      + +

      The account.h header file handles account-related information. The following table lists the account properties that can be modified.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + Table: Account properties +
      Account propertyData typeMandatoryDescription
      User nameStringYesIdentity of an account. +

      If the display name and email address are not set for an account, the user name is shown for the account on the Accounts screen in the Setting application.

      +
      Display nameStringNoDisplay name of an account. +

      Display name is shown for the account on the Accounts screen in the Setting application.

      +
      Email addressStringNoEmail address of an account. +

      If the display name is not set for an account, the email address is shown for the account on the Accounts screen in the Setting application.

      +
      Package nameStringNoOne of an account package IDs, like the app ID. +

      If the package name is not set for an account, the app ID is used as a package name.

      +
      Icon pathStringNoIcon path of an account. +

      The icon is shown through the registered icon path as an account icon on the Accounts screen in the Setting application.

      +
      Domain nameStringNoDomain name of an account. +
      Access tokenStringNoAccess token of an account. +
      Auth typeIntegerNoAuthentication type, such as oauth or xauth. +
      CapabilityKey-value string-integer pairsNoCapability of an account. +
      SecretIntegerNoThe secret value is used to decide whether the account is shown on the Accounts screen in the Setting application. +
      Sync supportIntegerNoCurrent synchronization status.
      SourceStringNoSource of an account. +
      User textStringNoString array which you can use freely. +
      User intIntegerNoInteger array which you can use freely. +
      CustomKey-value string pairsNoKey-value pairs which you can use freely. +
      + +

      Account Providers

      +

      Account providers, such as Google and Facebook, represent specific service provider-related information or protocol that provides the user accounts. To add, update, or remove accounts, you must register a specific account provider in your application.

      +

      To register an account provider, define the account provider information in the Account tab of the manifest editor, as described in the following table, and implement the account application control.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + Table: Account provider properties +
      Account propertyData typeMandatoryDescription
      Multiple accounts supportbool YesIndicates whether multiple accounts are supported.
      IconStringYesFile path of the account provider icon. +

      The icon size is:

      +
        +
      • 72 x 72 for Xhigh (HD)
      • +
      • 48 x 48 for High (WVGA)
      • +
      +

      Since the icon is used in Settings > Accounts, place the icon in a shared directory.

      Small iconStringYesFile path of the account provider icon. +

      The icon size is:

      +
        +
      • 45 x 45 for Xhigh (HD)
      • +
      • 30 x 30 for High (WVGA)
      • +
      +

      Since the small icon is used in other applications, place the icon in a shared directory.

      Display nameStringYesDisplay name of the account provider.
      CapabilitiesStringNoCapability of the account provider. +

      Capability can be a liaison between an account application and another application. If an account application registers a capability in the manifest file, other applications know that the account application has the capability. And if an account application gives an account a capability, other applications know that the account has the capability.

      +

      Several service-specific capabilities are defined for the Account Manager in Tizen:

      + +
        +
      • Contact capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"

        +

        If you register this capability in the manifest file, the user using the contact application can see a list of accounts with the account of your service in the contact application.

        +
      • +
      • Calendar capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR or "http://tizen.org/account/capability/calendar"

        +

        If you register this capability in the manifest file, the user using the calendar application can see a list of accounts with the account of your service in the calendar application.

        +
      • +
      • Email capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_EMAIL or "http://tizen.org/account/capability/email"

        +
      • +
      • Photo capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_PHOTO or "http://tizen.org/account/capability/photo"

        +
      • +
      • Video capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_VIDEO or "http://tizen.org/account/capability/video"

        +
      • +
      • Music capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_MUSIC or "http://tizen.org/account/capability/music"

        +
      • +
      • Document capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_DOCUMENT or "http://tizen.org/account/capability/document"

        +
      • +
      • Message capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE or "http://tizen.org/account/capability/message"

        +
      • +
      • Game capability: +

        ACCOUNT_SUPPORTS_CAPABILITY_GAME or "http://tizen.org/account/capability/game"

        +
      • +
      +
      + +

      If the application has defined the account provider information and implements the appcontrol for the account provider, the account provider is automatically registered when the application is installed.

      + +

      Account Application Control

      +

      The account application control, which allows the user to add and configure accounts, must be implemented in all applications that define an account provider. You are not required to define the application control information in the Application Control tab of the manifest editor.

      + +

      This application control supports the http://tizen.org/appcontrol/operation/account/add and http://tizen.org/appcontrol/operation/account/configure operations.

      + +

      ACCOUNT_OPERATION_SIGNIN Operation

      +

      The http://tizen.org/appcontrol/operation/account/add operation enables the user to add a new account for a specific account provider. With the operation, the login page for the specific account provider can be displayed. In Settings > Accounts, if the account provider is clicked for adding a new account, this operation is launched.

      + +

      You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

      + +

      The results of the operation are returned in the app_control_get_operation() event handler.

      +

      The following table shows the ACCOUNT_OPERATION_SIGNIN (http://tizen.org/appcontrol/operation/account/add) operation.

      + + + + + + + + + + + + + + +
      + Table: ACCOUNT_OPERATION_SIGNIN operation +
      OperationDescription
      ACCOUNT_OPERATION_SIGNINAccount ID of the added account.
      +

      ACCOUNT_OPERATION_VIEW Operation

      +

      The http://tizen.org/appcontrol/operation/account/configure operation enables the user to set account information, such as synchronization settings. The delete button must be included for removing accounts.

      +

      In Settings > Accounts, if the specific account is clicked for setting the account information, this operation is launched.

      +

      You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

      +

      The results of the operation are returned in the app_control_get_operation() event handler.

      +

      The following table shows the ACCOUNT_OPERATION_VIEW (http://tizen.org/appcontrol/operation/account/configure) operation.

      + + + + + + + + + + + + + + +
      + Table: ACCOUNT_OPERATION_VIEW operation +
      OperationDescription
      ACCOUNT_OPERATION_VIEWAccount ID for setting account information.
      + + + +
      + +Go to top + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/account/oauth2_n.htm b/org.tizen.guides/html/native/account/oauth2_n.htm index 244ba74..013acab 100644 --- a/org.tizen.guides/html/native/account/oauth2_n.htm +++ b/org.tizen.guides/html/native/account/oauth2_n.htm @@ -10,28 +10,28 @@ - oauth2 + OAuth 2.0
      -

      oauth2

      +

      OAuth 2.0

      The OAuth 2.0 authorization framework enables a 3rd party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the 3rd party application to obtain access on its own behalf.

      Figure: Protocol flow

      diff --git a/org.tizen.guides/html/native/account/sync_manager_n.htm b/org.tizen.guides/html/native/account/sync_manager_n.htm index 7a07b9e..0355893 100644 --- a/org.tizen.guides/html/native/account/sync_manager_n.htm +++ b/org.tizen.guides/html/native/account/sync_manager_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native

      +

      Mobile native

      @@ -35,28 +35,20 @@

      Sync Manager

      Tizen provides notifications for a service application to maintain data consistency between a server and the device. You can manage the synchronization schedule for applications.

      - - - - - - - - - -
      Note
      The Sync Manager API domain is supported in mobile applications only.
      Service and UI applications should have package name as same.
      +

      This feature is supported in mobile applications only.

      +

      The service and UI applications must have the same package name.

      The main Sync Manager API features are:

        -
      • Add on-demand sync job schedules.
      • -
      • Add periodic sync job schedules.
      • -
      • Add data change sync job schedules.
      • -
      • Remove registered sync job schedules.
      • -
      • Iterate registered sync job schedules.
      • +
      • Adding on-demand sync job schedules
      • +
      • Adding periodic sync job schedules
      • +
      • Adding data change sync job schedules
      • +
      • Removing registered sync job schedules
      • +
      • Iterating registered sync job schedules
      -


      The sync manager operates sync jobs based on the rules defined in the following table.

      +

      The sync manager operates the sync jobs based on the rules defined in the following table.

      - @@ -64,12 +56,14 @@ - - + + - - + + @@ -77,78 +71,99 @@ - + - +
      Table: Sync job scheduling rules

      +

      Table: Sync job scheduling rules
      Description
      Data changes on serverA server sends a push message to the account provider service and service applications. When the data is changed on a server, a push message is sent from the server. Then, the device which is received the push message can trigger on-demand sync job.Data changes on the serverA server sends a push message to the account provider service and service applications. When the data is changed on the server, a push message is sent from the server. Then, the device which receives the push message can trigger an on-demand sync job.
      Data changes on deviceA subscribed callback function is invoked whenever DB change occurs for the registered capability. The data change listener notices the changes by using the Calendar, Contacts, and Media Content API. If there are any changes in corresponding data, the sync manager notices the changes and schedules a sync job.

      Changing data in the Calendar database includes adding, updating, and deleting books, events, and todos. Changing data in the Contacts database includes adding, removing, and modifying contacts.
      Media content provides notification for the types of changed data such as image, music, sound, and video.
      Data changes on the deviceA subscribed callback function is invoked whenever a database change occurs for a registered capability. The data change listener notices the changes by using the Calendar, Contacts, and Media Content APIs. If there are any changes in the corresponding data, the sync manager notices the changes and schedules a sync job. +

      Changing data in the Calendar database includes adding, updating, and deleting books, events, and todos. Changing data in the Contacts database includes adding, removing, and modifying contacts.

      +

      The media content provides notifications for changes in media types, such as image, music, sound, and video.

      Network availability
      On demand syncThe on-demand sync means that you can schedule a sync job for once. You can use this feature with the sync_manager_on_demand_sync_job() API.The on-demand sync means that you can schedule a sync job once. You can use this feature with the sync_manager_on_demand_sync_job() function.
      Periodic syncThe periodic sync means that you can schedule a sync job to be performed regularly. You can use this feature with the sync_manager_add_periodic_sync_job() API. You can also use the sync intervals as various enumerators which is provided through the Sync Manager API. To use this API, "http://tizen.org/privilege/alarm.set" is required. Because user who use this API can use setting an alarm indirectly.The periodic sync means that you can schedule a sync job to be performed regularly. You can use this feature with the sync_manager_add_periodic_sync_job() function. You can also use the sync intervals through various enumerators provided through the Sync Manager API. +

      When using the Sync Manager API, you can set an alarm indirectly. Consequently, the http://tizen.org/privilege/alarm.set privilege is required.

      - -


      The following table lists the variables and theirs description for using Sync Manager.

      +

      The following table lists the variables used with the sync manager.

      - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Table: Sync Manager variables

      Table: Sync manager variables
      Sync Manager variableData typeMandatoryDescription
      Account Handleaccount_s*NoHandle of account module.

      An account handle for managing account related data.

      Sync Job Nameconst char*YesName for managing sync jobs.

      On-demand and periodic sync jobs can be managed by using Sync Job Name. It is user defined value. If sync_manager_add_periodic_sync_job() API is called again with same Sync Job Name, not adding a new sync job but renewing all the data except Sync Job Name and Sync Job ID. That is for mainly resetting of periodic interval.

      Sync Capabilityconst char*YesCapability for a data change sync jobs.

      Data change sync job can provide notification whenever corresponding data change occurs. If sync_manager_add_data_change_sync_job() API is used with a capability, it is operated only for the related capability. In the case of using calendar and contact capability, "http://tizen.org/privilege/calendar.read" and "http://tizen.org/privilege/contact.read" are required for each.

      Available capabilities are below:
      #define    SYNC_SUPPORTS_CAPABILITY_CALENDAR    "http://tizen.org/sync/capability/calendar"
      #define    SYNC_SUPPORTS_CAPABILITY_CONTACT    "http://tizen.org/sync/capability/contact"
      #define    SYNC_SUPPORTS_CAPABILITY_IMAGE    "http://tizen.org/sync/capability/image"
      #define    SYNC_SUPPORTS_CAPABILITY_MUSIC    "http://tizen.org/sync/capability/music"
      #define    SYNC_SUPPORTS_CAPABILITY_SOUND    "http://tizen.org/sync/capability/sound"
      #define    SYNC_SUPPORTS_CAPABILITY_VIDEO    "http://tizen.org/sync/capability/video"

      Sync Periodsync_period_eYesInterval for a periodic sync jobs.

      With it, sync job is provided periodically. In the case of setting periodic interval as 30 minutes, a time interval is set as power of 2 less than 30. Then, the time interval which is 16 minutes will operate the sync job every 16 minutes with skipping the first notification. So, the first will be 32 minutes. That is same for the other cases.
      In other words, it provides periodical sync job with an inexact time. By doing so, coupling various periodic sync jobs with interval as power of 2 is for preventing waking up service application too many times from a device.

      Available period intervals are below:
      SYNC_PERIOD_INTERVAL_30MIN    Sync within 30 minutes
      SYNC_PERIOD_INTERVAL_1H    Sync within 1 hour
      SYNC_PERIOD_INTERVAL_2H    Sync within 2 hours
      SYNC_PERIOD_INTERVAL_3H    Sync within 3 hours
      SYNC_PERIOD_INTERVAL_6H    Sync within 6 hours
      SYNC_PERIOD_INTERVAL_12H    Sync within 12 hours
      SYNC_PERIOD_INTERVAL_1DAY    Sync within 1 day

      Sync Optionsync_option_eYesOption for deciding the behavior of sync jobs.

      The behavior of sync job is decided with corresponding sync option. These options can be used as OR value. For example, the expression of "(SYNC_OPTION_EXPEDITED | SYNC_OPTION_NO_RETRY)" is available. That means "Sync job will be operated just once with priority".

      Available options are below:
      SYNC_OPTION_NONE    Sync job will be operated normally
      SYNC_OPTION_EXPEDITED    Sync job will be operated as soon as possible
      SYNC_OPTION_NO_RETRY    Sync job will not be performed again when it fails

      Sync Job IDint*YesUnique ID for managing sync jobs.

      It is generated when a sync job is added. It is required to remove the sync job. The number of Sync Job ID which can be generated is restricted as a hundred per a package.

      Sync Job User Databundle*NoUser data for sync jobs.

      User data which contains additional information related registered sync jobs.

      User Datavoid*NoUser data for sync_manager_for_each_sync_job().

      User data which contains additional information related foreach jobs.

      VariableData typeMandatoryDescription
      Account handleaccount_s*NoHandle of the account module for managing account-related data.
      Sync job nameconst char*YesSync job name for managing the jobs. +

      The on-demand and periodic sync jobs can be managed by a user-defined name. If the sync_manager_add_periodic_sync_job() function is called again with same sync job name (where all details except the name and sync job ID are changed), the function does not add a new sync job but updates the existing job. This is mainly used to reset the periodic interval.

      Sync capabilityconst char*YesCapability for a data change sync job. +

      A data change sync job can provide a notification whenever a corresponding data change occurs. If the sync_manager_add_data_change_sync_job() function is used with a capability, it is operated for the related capability only. In the case of using the calendar or contact capability, the respective http://tizen.org/privilege/calendar.read or http://tizen.org/privilege/contact.read privilege is required.

      +

      The following capabilities are available:

      +
      +#define SYNC_SUPPORTS_CAPABILITY_CALENDAR "http://tizen.org/sync/capability/calendar" 
      +#define SYNC_SUPPORTS_CAPABILITY_CONTACT "http://tizen.org/sync/capability/contact"
      +#define SYNC_SUPPORTS_CAPABILITY_IMAGE "http://tizen.org/sync/capability/image"
      +#define SYNC_SUPPORTS_CAPABILITY_MUSIC "http://tizen.org/sync/capability/music"
      +#define SYNC_SUPPORTS_CAPABILITY_SOUND "http://tizen.org/sync/capability/sound"
      +#define SYNC_SUPPORTS_CAPABILITY_VIDEO "http://tizen.org/sync/capability/video"
      Sync periodsync_period_eYesInterval for a periodic sync job. +

      If the interval is provided, the sync job is performed periodically. If you set the periodic interval to 30 minutes, a time interval is set as a power of 2 less than 30. This means that a time interval set to 16 minutes operates the sync job every 16 minutes while skipping the first notification (so the first is in 32 minutes). The same logic applies to other cases.

      +

      This variable provides a periodic sync job with an inexact time. Coupling various periodic sync jobs with an interval as a power of 2 prevents the device from waking up the service application too many times.

      +

      The sync_period_e enumerator defines the available period intervals.

      Sync optionsync_option_eYesOption for deciding the sync job behavior. +

      The behavior options can be used as an OR value. For example, the (SYNC_OPTION_EXPEDITED | SYNC_OPTION_NO_RETRY) expression is available, and means that the "Sync job is operated just once with priority".

      +

      The following options are available:

      +
      • SYNC_OPTION_NONE: Sync job is operated normally
      • +
      • SYNC_OPTION_EXPEDITED: Sync job is operated as soon as possible
      • +
      • SYNC_OPTION_NO_RETRY: Sync job is not performed again when it fails
      Sync job IDint*YesUnique ID for managing sync jobs. +

      The ID is generated when a sync job is added. It is required to remove the sync job. The number of ID that can be generated is restricted to a hundred per a package.

      Sync job user databundle*NoUser data for a sync job. +

      The data can contain additional information related to the registered sync jobs.

      User datavoid*NoUser data for the sync_manager_for_each_sync_job() function. +

      The data can contain additional information related to the foreach jobs.

      - - + +

      Sync Adapter

      @@ -157,19 +172,22 @@ - +
      Note
      The Sync Adapter API should be carried out by a service application which will operate data synchronization before using the Sync Manager API.
      The number of service application which can set callbacks is restricted as only one per a package.
      The Sync Adapter API operations must be carried out by a service application (which operates data synchronization) before using the Sync Manager API. +

      The number of service applications that can set callbacks is restricted to only one per a package.

      -

      The Sync Adapter API allows you to:

      +

      The Sync Adapter API allows you to:

      • Register callbacks for notifications about the sync job start and cancellation.
      • -
      • App control is used to start the sync operation, so that the application's daemon does not need to stay awake. Sync Adapter API allows you to use this mechanism without using the App Control API separately.

        In other words, in the case of using Sync Adapter API, you can use the App Control API indirectly.

        -
      • -
      - +
    • Start a sync operation with an app control, so that the application's daemon needs not to stay awake. +

      The Sync Adapter API allows you to use this mechanism without using the App Control API separately. In other words, when using the Sync Adapter API, you can use the App Control API indirectly.

      +
    • +
    + +
    @@ -193,3 +211,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga + diff --git a/org.tizen.guides/html/native/app/alarm_n.htm b/org.tizen.guides/html/native/app/alarm_n.htm new file mode 100644 index 0000000..8079fc9 --- /dev/null +++ b/org.tizen.guides/html/native/app/alarm_n.htm @@ -0,0 +1,61 @@ + + + + + + + + + + + + + Alarm + + + + + +
    +

    Alarm

    + +

    You can launch an application at a specific time using alarms. The mechanism involved in launching the application is the App Control API (in mobile and wearable applications).

    +

    The AppControl API allows launching an application explicitly, giving its package name, or providing certain criteria that the application must meet. For example, the criteria can include the type of data on which the application must be able to operate. The structure containing the criteria is called an appcontrol.

    + + + + +
    + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/app/app_guide_n.htm b/org.tizen.guides/html/native/app/app_guide_n.htm index 7ee0561..1f1e5bd 100644 --- a/org.tizen.guides/html/native/app/app_guide_n.htm +++ b/org.tizen.guides/html/native/app/app_guide_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -34,22 +34,19 @@

    Application framework features include managing various types of applications and packages, and handling events.

    The main application framework features are:

      -
    • Application

      Enables you to manage application state change or system events and control mechanisms that launch other applications.

    • -
    • Application Group

      Enables you to manage application launch mode and grouping.

    • +
    • Application

      Enables you to manage application state change or system events and control mechanisms that launch other applications. You can also manage application launch mode and grouping, alarms, events, and localization.

    • Application Manager

      Allows you to retrieve information about an application.

    • Badge

      Allows you to create badges.

    • Bundle

      Enables you to manage bundles and their content.

    • -
    • Data Control

      Allows your applications to exchange data.

    • +
    • Data Control

      Allows your applications to exchange data.

    • Message Port

      Enables your applications to communicate with each other using message port communication.

    • Notification

      Allows you to create and manage notifications.

    • Package Manager

      Allows you to install, uninstall, and update packages, and store their information.

    • Service Application

      Allows you to create and manage native service applications.

    • +
    • Shortcut

      Allows you to add a shortcut for the Home application.

    • Widget Application

      Allows you to create and manage widget applications.

    -

    The following guides apply in mobile applications only:

    -
      -
    • Shortcut

      Allows you to add a shortcut for the Home application.

    • -
    +

    The following guides apply in wearable applications only:

    • Watch Application

      Allows you to manage a watch application and display the current date and time accurately.

    • diff --git a/org.tizen.guides/html/native/app/app_manager_n.htm b/org.tizen.guides/html/native/app/app_manager_n.htm index 694532e..8edfeee 100644 --- a/org.tizen.guides/html/native/app/app_manager_n.htm +++ b/org.tizen.guides/html/native/app/app_manager_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      diff --git a/org.tizen.guides/html/native/app/appcontrol_n.htm b/org.tizen.guides/html/native/app/appcontrol_n.htm new file mode 100644 index 0000000..5849b42 --- /dev/null +++ b/org.tizen.guides/html/native/app/appcontrol_n.htm @@ -0,0 +1,448 @@ + + + + + + + + + + + + + App Control + + + + + +
      +

      App Control

      + +

      An application control (app control) is a way of sharing an application's functionality. To use another application's features through application controls reduces your efforts and time to develop your application.

      + +

      An application can be launched by the user from the Launcher or by another application. The application control can be used to describe either an action to be performed by other applications, or the results of the operation performed by a launched application. The application can receive results from the launched application.

      +

      Regardless of how an application is launched, the application framework starts the application by creating a new process and calling the entry point of the application. Like a conventional Linux application, the main function of the application is its entry point. In the Tizen application, the main task is to hand over control to the application framework by calling the ui_app_main() function:

      + +
      +bool app_create(void *user_data)
      +{
      +   // Take necessary actions before the main event loop starts
      +   // Initialize UI resources and application data
      +   // If this function returns true, the application main loop starts
      +   // If this function returns false, the application terminates
      +   return true;
      +}
      +
      +void app_control(app_control_h app_control, void *user_data)
      +{
      +   // Handle the launch request
      +}
      +
      +void app_pause(void *user_data)
      +{
      +   // Take necessary actions when application becomes invisible
      +}
      +
      +void app_resume(void *user_data)
      +{
      +   // Take necessary actions when application becomes visible
      +}
      +
      +void app_terminate(void *user_data)
      +{
      +   // Release all resources
      +}
      +
      +int main(int argc, char *argv[])
      +{
      +   struct appdata ad;
      + 
      +   ui_app_lifecycle_callback_s event_callback;
      +     
      +   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;
      +
      +   memset(&ad, 0x0, sizeof(struct appdata));
      +
      +   return ui_app_main(argc, argv, &event_callback, &ad);
      +}
      +
      + +

      The ui_app_main() function initializes the application and starts the main loop. It takes 4 parameters and uses them to initialize the application. The argc and argv parameters contain the values from the application framework, and you must never change their values. The third parameter is a state transition handler that is responsible for managing the state transitions the application goes through while it is running. The fourth parameter is application data to be passed to each state handler.

      +

      When the ui_app_main() is first invoked, the application moves from the ready state to the created state. The application has to initialize itself. During this transition, the application framework calls the application's app_create_cb() state transition callback just before the application enters the main loop. Within the registered callback, you must initialize the application resources and create the main window.

      +

      If the app_create_cb() callback function returns false, the application moves to the terminated state. If it returns true, the application enters the main loop.

      + +

      Handling the Launch Options

      +

      The application framework calls the application's app_control_cb() callback just after the application enters the main loop. This callback is passed to the app_control containing the reason why the application was launched. For example, the application can be launched to open a file to handle the request that has been sent by other application. In all of these cases, the application is responsible for checking the content of the app_control and responding appropriately. The content of the app_control can be empty, if the application is launched by the user from the Launcher.

      + +
      static void app_control(app_control_h app_control, void *user_data)
      +{
      +   struct appdata *ad = (struct appdata *)user_data;
      +   char *operation;
      +   char *uri;
      +   char *mime_type;
      + 
      +   app_control_get_operation(app_control, operation);
      + 
      +   if (!strcmp(operation, APP_CONTROL_OPERATION_VIEW))
      +   {
      +      app_control_get_uri(app_control, &uri);
      +      app_control_get_mime(app_control, &mime_type);
      + 
      +      if (uri && !strcmp(mime_type, "image/jpg"))
      +      {
      +         display_image_file(ad, uri); // Display a specific image file
      +      }
      +   }
      + 
      +   if (ad->win)
      +      elm_win_activate(ad->win);
      +}
      +
      +

      Managing Application Controls

      +

      The App Control API provides functions for launching other applications with a specific operation, URI, and MIME type. The requesting application can get a result back from the launched application.

      +

      To launch an application with the App Control API, create an app_control handle and add information to that handle. You can set the following information:

      +
        +
      • Operation: Action to be performed by the app control.
      • +
      • URI: Data itself to be performed.
      • +
      • MIME type: Specific type of the URI.
      • +
      • Application ID: ID of the application to be launched.
      • +
      • Extra data: Key-value pairs to provide additional information for the launch request and the result of the request.
      • +
      +

      The operation is mandatory information for sending the launch request. The App Control API provides several functions to get and set the above information to the app_control handle.

      +

      To launch an application with the App Control API, use one of the following methods:

      + +

      The application launched by the app control can return the result to the caller application.

      + +

      You can take advantage of the Tizen base application functionalities through the app control feature. You can also export your application functionality to allow other applications to launch your application.

      + + + + + + + + + + +
      Note
      Since Tizen 2.4, application controls used to launch service applications outside the current package are not supported. Because of this, the service application is only allowed to be launched explicitly by the application in the same package.
      + + +

      Explicit Launch

      + +

      When you request an explicit launch:

      + +
        +
      • If the underlying application launcher framework finds an application matched with the given application ID in the installed application list, it launches the application in a new process. If the matched application is not found, the framework returns the APP_CONTROL_ERROR_APP_NOT_FOUND result. Additional information (such as operation, URI, or MIME type) is not used to select an application for an explicit launch.
      • +
      • If the operation setting in the app_control handle is set to APP_CONTROL_OPERATION_DEFAULT, the application ID must be set. Otherwise the APP_CONTROL_ERROR_INVALID_PARAMETER result is returned.
      • +
      +

      The following code example launches a calculator application explicitly with the application ID:

      +
      +#include <app.h>
      +#include <dlog.h>
      + 
      +#define TAG "MY_TAG"
      +
      +app_control_h app_control;
      + 
      +app_control_create(&app_control);
      +app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
      +app_control_set_app_id(app_control, "org.tizen.calculator");
      + 
      +if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
      +{
      +   dlog_print(DLOG_INFO, TAG, "Succeeded to launch a calculator app.");
      +} 
      +else 
      +{
      +   dlog_print(DLOG_ERROR, TAG, "Failed to launch a calculator app.");
      +}
      + 
      +app_control_destroy(app_control);
      +
      + +

      Implicit Launch

      + +

      When you request an implicit launch:

      + +
        +
      • Only 3 data categories are used to determine which application can be launched: Operation, URI scheme, and MIME type.
      • +
      • The application launcher framework iterates the desktop files of installed applications on the device to find applications where the 3 categories are exactly matched.
      • +
      • If only one application is matched for the given categories, that application is launched. If multiple matching applications are found, the application selector is shown and the user can select the proper application.
      • +
      • Each app control requires a different combination of the 3 categories. For some, only one category is necessary (for example, URI), for others, all 3 can be needed. Check the app control list and required data in the API Reference to determine the needed categories.
      • +
      • If no match is found, an error is returned.
      • +
      +

      To allow the application launcher framework to find and select matching applications, each application must describe its operation, URI, or MIME type correctly.

      + +

      The following code example launches a camera application with the operation and MIME type:

      + +
      +#include <app.h>
      +#include <dlog.h>
      +
      +#define TAG "MY_TAG"
      +
      +app_control_h app_control;
      + 
      +app_control_create(&app_control);
      +app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT);
      +app_control_set_mime(app_control, "image/jpg");
      +if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
      +{
      +   dlog_print(DLOG_INFO, TAG, "Succeeded to launch a viewer app.");
      +} 
      +else 
      +{
      +   dlog_print(DLOG_ERROR, TAG, "Failed to launch a viewer app.");
      +}
      + 
      +app_control_destroy(app_control);
      +
      + +

      The following code example launches a gallery application with the operation, URI, and MIME type:

      + +
      +#include <app.h>
      +#include <dlog.h>
      +
      +#define TAG "MY_TAG"
      + 
      +app_control_h app_control;
      + 
      +app_control_create(&app_control);
      +app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
      +app_control_set_uri(app_control, "file:///home/myhome/Photos/1_photo.jpg");
      +app_control_set_mime(app_control, "image/*");
      + 
      +if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
      +{
      +   dlog_print(DLOG_INFO, TAG, "Succeeded to launch a viewer app.");
      +} 
      +else 
      +{
      +   dlog_print(DLOG_ERROR, TAG, "Failed to launch a viewer app.");
      +}
      + 
      +app_control_destroy(app_control);
      +
      + + + + + + + + + + +
      Note
      Since Tizen 2.4, service applications are only allowed to be launched explicitly. All service applications are excluded from matches of implicit launch requests.
      + +

      Getting the App Control Results

      +

      The app control result from the requested application is delivered to the caller application in the app_control handle with extra data. For some cases, the App Control API provides pre-defined extra data keys.

      +

      If you cannot find a proper key, you can define your own key. However, the customized key must be shared between the caller and callee applications.

      + +

      The following code example gets the result of an app control request by implementing an app_control result callback:

      + +
      +#include <app.h>
      +#include <dlog.h>
      + 
      +#define TAG "MY_TAG"
      + 
      +// Callback function to get result
      +static void app_control_result(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) 
      +{
      +   char *value;
      + 
      +   if (result == APP_CONTROL_RESULT_SUCCEEDED) 
      +   {
      +      if (app_control_get_extra_data(reply, APP_CONTROL_DATA_SELECTED, &value) == APP_CONTROL_ERROR_NONE)
      +      {
      +         dlog_print(DLOG_INFO, TAG, "[app_control_result_cb] Succeeded: value(%s)", value);
      +      } 
      +      else 
      +      {
      +         dlog_print(DLOG_ERROR, TAG, "[app_control_result_cb] Failed");
      +      }
      + 
      +   } 
      +   else 
      +   {
      +      dlog_print(DLOG_ERROR, TAG, "[app_control_result_cb] APP_CONTROL_RESULT_FAILED.");
      +   }
      +}
      +
      + +

      The following code example requests the launch of another application:

      + +
      +#include <app.h>
      +#include <dlog.h>
      +
      +#define TAG "MY_TAG"
      +
      +app_control_h app_control;
      + 
      +app_control_create(&app_control);
      + 
      +app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT);
      +app_control_set_mime(app_control, "text/plain");
      + 
      +if (app_control_send_launch_request(app_control, app_control_result, NULL) == APP_CONTROL_ERROR_NONE) 
      +{
      +   dlog_print(DLOG_INFO, TAG, "Succeeded: the application is launched.");
      +} 
      +else 
      +{
      +   dlog_print(DLOG_ERROR, TAG, "Failed to launch an application.");
      +}
      + 
      +app_control_destroy(app_control);
      +
      + +

      The following code example implements an app_control callback in the callee application:

      + +
      +static void app_control(app_control_h app_control, void *user_data) 
      +{
      +   struct appdata *ad = (struct appdata *)user_data;
      +   char *operation;
      +   char *mime;
      +   app_control_h reply;
      +   char *app_id;
      + 
      +   app_control_get_operation(app_control, &operation);
      + 
      +   if (!strcmp(operation, APP_CONTROL_OPERATION_CREATE_CONTENT)) 
      +   {
      +      app_control_get_mime(app_control, &mime);
      + 
      +      if (!strcmp(mime, "text/plain")) 
      +      {
      +         app_control_create(&reply);
      + 
      +         app_get_app_id(&app_id);
      +         app_control_add_extra_data(reply, APP_CONTROL_DATA_SELECTED, app_id);
      +         app_control_reply_to_launch_request(reply, app_control, APP_CONTROL_RESULT_SUCCEEDED);
      + 
      +         app_control_destroy(reply);
      +      }
      +   }
      +}
      +
      + + +

      Common Application Controls

      + +

      Tizen provides common application controls that allow you to take advantage of the Tizen base application functionalities. You can use the common application controls to perform some basic tasks, such as selecting a file or taking a picture.

      + +

      The following common application controls are available:

      + + + +

      Exporting AppControl Functionality

      +

      You can advertise your application features to other applications by exporting your application control functionalities. To allow other applications to find and use your application features implicitly without the application ID, declare your application control information in the tizen-manifest.xml file:

      +
      +<app-control>
      +   <mime name="application/xhtml+xml"/>
      +   <operation name="http://tizen.org/appcontrol/operation/view"/>
      +   <uri name="http://test.com"/>
      +</app-control>
      +<app-control>
      +   <operation name="http://tizen.org/appcontrol/operation/call"/>
      +</app-control>
      +
      +

      + The resolution filter is used when resolving the application control. Each entry of the resolution filter has the <app-control> + element and forms an application resolution unit. The additional URI or MIME type information must contain the associated operation ID, and the retrieved application control must have the specified + application ID and operation ID when resolving the application control. +

      +

      + You can specify the application control information of your application in the application project settings in the IDE; an + operation ID must be specified for the application control. +

      + +

      Managing Application Groups

      +

      You can define the application launch mode and group your applications into entities that can be managed together.

      + +

      The main application group features include:

      +
        +
      • Defining the application launch mode +

        When an application is launched through an app control, its launch mode defines its behavior:

        +
        • The single launch mode means that the application is launched as a main application (in a new group).
        • +
        • The caller launch mode means that the application is launched as a sub application belonging to the same group as the caller application who is causing the application to be launched.
        +

        You can set the application launch mode in the manifest file using the launch_mode attribute of the <ui-application> element. If the launch mode is set to caller, the application that calls the app control can define the launch mode for the called application using the app_control_set_launch_mode() function. However, if the called application has set its launch mode in its manifest file to single, that setting overrides the caller application's launch mode request.

        +
      • +
      • Managing the application group +

        Applications in a same group act as if they are in 1 stack. For example, if an application A wants to send an email using an email application B, the application A can launch the email application B, making the email application B a sub application in the same group as the application A. When both applications are running, and the user presses the home button, both applications are hidden. When the user later resumes the caller application (application A), the email application B is shown on top of the caller application.

        +

        If an application is launched in a group, it can be terminated by the main (first) application in the group. If the main application is terminated or killed, the sub applications in the group are terminated automatically (they can be terminated by the framework even if they are hidden).

        + +

        Figure: Group behavior

        +

        Group behavior

        + +
      • +
      + + + +
      + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/app/application_n.htm b/org.tizen.guides/html/native/app/application_n.htm index e4bce8d..2222f6f 100644 --- a/org.tizen.guides/html/native/app/application_n.htm +++ b/org.tizen.guides/html/native/app/application_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -24,11 +24,8 @@

      Related Info

      + +

      In addition, you can use sub-category APIs to:

      +

      Managing the Event Loop

      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.

      The ui_app_main() function is used to start the event loop. Before calling this function, set up the app_event_callback_s structure variable, which is passed to the function.

      -

      For more information about launching applications, see Launching Applications.

      +

      For more information about launching applications, see App Control.

      Registering Callbacks for Events

      The following table lists the application state change events.

      @@ -125,466 +127,13 @@ APP_EVENT_REGION_FORMAT_CHANGED Event type for the callback function that is responsible for refreshing the display into the new time zone. - - APP_EVENT_SUSPENDED_STATE_CHANGED - Event type for the callback function that is responsible for taking necessary actions before enter to the suspended state or after exit from the state. (Since Tizen 2.4) - + + APP_EVENT_SUSPENDED_STATE_CHANGED + Event 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.) + - -

      Launching Applications

      -

      An application can be launched by the user from the Launcher or by another application.

      -

      The App Control can be used to describe either an action to be performed by other applications, or the results of the operation performed by a launched application. The application can receive results from the launched application.

      -

      Regardless of how an application is launched, the application framework starts the application by creating a new process and calling the entry point of the application. Like a conventional Linux application, the main function of the application is its entry point. In the Tizen application, the main task is to hand over control to the application framework by calling the ui_app_main() function:

      - -
      -bool app_create(void *user_data)
      -{
      -   // Take necessary actions before the main event loop starts
      -   // Initialize UI resources and application data
      -   // If this function returns true, the application main loop starts
      -   // If this function returns false, the application terminates
      -   return true;
      -}
      -
      -void app_control(app_control_h app_control, void *user_data)
      -{
      -   // Handle the launch request
      -}
      -
      -void app_pause(void *user_data)
      -{
      -   // Take necessary actions when application becomes invisible
      -}
      -
      -void app_resume(void *user_data)
      -{
      -   // Take necessary actions when application becomes visible
      -}
      -
      -void app_terminate(void *user_data)
      -{
      -   // Release all resources
      -}
      -
      -int main(int argc, char *argv[])
      -{
      -   struct appdata ad;
      - 
      -   ui_app_lifecycle_callback_s event_callback;
      -     
      -   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;
      -
      -   memset(&ad, 0x0, sizeof(struct appdata));
      -
      -   return ui_app_main(argc, argv, &event_callback, &ad);
      -}
      -
      - -

      The ui_app_main() function initializes the application and starts the main loop. It takes 4 parameters and uses them to initialize the application. The argc and argv parameters contain the values from the application framework, and you must never change their values. The third parameter is a state transition handler that is responsible for managing the state transitions the application goes through while it is running. The fourth parameter is application data to be passed to each state handler.

      -

      When the ui_app_main() is first invoked, the application moves from the ready state to the created state. The application has to initialize itself. During this transition, the application framework calls the application's app_create_cb() state transition callback just before the application enters the main loop. Within the registered callback, you must initialize the application resources and create the main window.

      -

      If the app_create_cb() callback function returns false, the application moves to the terminated state. If it returns true, the application enters the main loop.

      - -

      Handling the Launch Options

      -

      The application framework calls the application's app_control_cb() callback just after the application enters the main loop. This callback is passed to the app_control containing the reason why the application was launched. For example, the application can be launched to open a file to handle the request that has been sent by other application. In all of these cases, the application is responsible for checking the content of the app_control and responding appropriately. The content of the app_control can be empty, if the application is launched by the user from the Launcher.

      - -
      static void app_control(app_control_h app_control, void *user_data)
      -{
      -   struct appdata *ad = (struct appdata *)user_data;
      -   char *operation;
      -   char *uri;
      -   char *mime_type;
      - 
      -   app_control_get_operation(app_control, operation);
      - 
      -   if (!strcmp(operation, APP_CONTROL_OPERATION_VIEW))
      -   {
      -      app_control_get_uri(app_control, &uri);
      -      app_control_get_mime(app_control, &mime_type);
      - 
      -      if (uri && !strcmp(mime_type, "image/jpg"))
      -      {
      -         display_image_file(ad, uri); // Display a specific image file
      -      }
      -   }
      - 
      -   if (ad->win)
      -      elm_win_activate(ad->win);
      -}
      -
      -

      Application Controls

      -

      The App control API provides functions for launching other applications with a specific operation, URI, and MIME type. The requesting application can get a result back from the launched application.

      -

      To launch an application with the App control API, create an app_control handle and add information to that handle. You can set the following information:

      -
        -
      • Operation: Action to be performed by the app control.
      • -
      • URI: Data itself to be performed.
      • -
      • MIME type: Specific type of the URI.
      • -
      • Application ID: ID of the application to be launched.
      • -
      • Extra data: Key-value pairs to provide additional information for the launch request and the result of the request.
      • -
      -

      The operation is mandatory information for sending the launch request. The app control API provides several functions to get and set the above information to the app_control handle.

      -

      To launch an application with the app control API, use one of the following methods:

      - -

      The application launched by the app control can return the result to the caller application.

      - -

      You can take advantage of the Tizen base application functionalities through the app control feature. You can also export your application functionality to allow other applications to launch your application.

      - - - - - - - - - - -
      Note
      Since Tizen 2.4, application controls of service applications over out of packages are not supported; hence the service application is only allowed to be launched explicitly by the application in the same package.
      - - -

      Explicit Launch

      - -

      When you request an explicit launch:

      - -
        -
      • If the underlying application launcher framework finds an application matched with the given application ID in the installed application list, it launches the application in a new process. If the matched application is not found, the framework returns the APP_CONTROL_ERROR_APP_NOT_FOUND result. Additional information (such as operation, URI, or MIME type) is not be used to select an application for an explicit launch.
      • -
      • If the operation setting in the app_control handle is set to APP_CONTROL_OPERATION_DEFAULT, the application ID must be set. Otherwise the APP_CONTROL_ERROR_INVALID_PARAMETER result is returned.
      • -
      -

      The following code example launches a calculator application explicitly with the application ID:

      -
      -#include <app.h>
      -#include <dlog.h>
      - 
      -#define TAG "MY_TAG"
      -
      -app_control_h app_control;
      - 
      -app_control_create(&app_control);
      -app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
      -app_control_set_app_id(app_control, "org.tizen.calculator");
      - 
      -if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
      -{
      -   dlog_print(DLOG_INFO, TAG, "Succeeded to launch a calculator app.");
      -} 
      -else 
      -{
      -   dlog_print(DLOG_ERROR, TAG, "Failed to launch a calculator app.");
      -}
      - 
      -app_control_destroy(app_control);
      -
      - -

      Implicit Launch

      - -

      When you request an implicit launch:

      - -
        -
      • Only 3 data categories are used to determine which application can be launched: Operation, URI scheme, and MIME type.
      • -
      • The application launcher framework iterates the desktop files of installed applications on the device to find applications where the 3 categories are exactly matched.
      • -
      • If only one application is matched for the given categories, that application is launched. If multiple matching applications are found, the application selector is shown and the user can select the proper application.
      • -
      • Each app control requires a different combination of the 3 categories. For some, only one category is necessary (for example, URI), for others, all 3 can be needed. Check the app control list and required data in the API Reference to determine the needed categories.
      • -
      -

      To allow the application launcher framework to find and select matching applications, each application must describe its operation, URI, or MIME type correctly.

      - -

      The following code example launches a camera application with the operation and MIME type:

      - -
      -#include <app.h>
      -#include <dlog.h>
      -
      -#define TAG "MY_TAG"
      -
      -app_control_h app_control;
      - 
      -app_control_create(&app_control);
      -app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT);
      -app_control_set_mime(app_control, "image/jpg");
      -if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
      -{
      -   dlog_print(DLOG_INFO, TAG, "Succeeded to launch a viewer app.");
      -} 
      -else 
      -{
      -   dlog_print(DLOG_ERROR, TAG, "Failed to launch a viewer app.");
      -}
      - 
      -app_control_destroy(app_control);
      -
      - -

      The following code example launches a gallery application with the operation, URI, and MIME type:

      - -
      -#include <app.h>
      -#include <dlog.h>
      -
      -#define TAG "MY_TAG"
      - 
      -app_control_h app_control;
      - 
      -app_control_create(&app_control);
      -app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
      -app_control_set_uri(app_control, "file:///home/myhome/Photos/1_photo.jpg");
      -app_control_set_mime(app_control, "image/*");
      - 
      -if (app_control_send_launch_request(app_control, NULL, NULL) == APP_CONTROL_ERROR_NONE) 
      -{
      -   dlog_print(DLOG_INFO, TAG, "Succeeded to launch a viewer app.");
      -} 
      -else 
      -{
      -   dlog_print(DLOG_ERROR, TAG, "Failed to launch a viewer app.");
      -}
      - 
      -app_control_destroy(app_control);
      -
      - - - - - - - - - - -
      Note
      Since Tizen 2.4, service applications are only allowed to be launched explicitly. Any service applications are excluded from matches of implicit launch requests.
      - -

      Getting the App Control Results

      -

      The app control result from the requested application is delivered to the caller application in the app_control handle with extra data. For some cases, the App control API provides pre-defined extra data keys.

      -

      If you cannot find a proper key, you can define your own key. However, the customized key must be shared between the caller and callee applications.

      - -

      The following code example gets the result of an app control request by implementing an app_control result callback:

      - -
      -#include <app.h>
      -#include <dlog.h>
      - 
      -#define TAG "MY_TAG"
      - 
      -// Callback function to get result
      -static void app_control_result(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) 
      -{
      -   char *value;
      - 
      -   if (result == APP_CONTROL_RESULT_SUCCEEDED) 
      -   {
      -      if (app_control_get_extra_data(reply, APP_CONTROL_DATA_SELECTED, &value) == APP_CONTROL_ERROR_NONE)
      -      {
      -         dlog_print(DLOG_INFO, TAG, "[app_control_result_cb] Succeeded: value(%s)", value);
      -      } 
      -      else 
      -      {
      -         dlog_print(DLOG_ERROR, TAG, "[app_control_result_cb] Failed");
      -      }
      - 
      -   } 
      -   else 
      -   {
      -      dlog_print(DLOG_ERROR, TAG, "[app_control_result_cb] APP_CONTROL_RESULT_FAILED.");
      -   }
      -}
      -
      - -

      The following code example requests the launch of another application:

      - -
      -#include <app.h>
      -#include <dlog.h>
      -
      -#define TAG "MY_TAG"
      -
      -app_control_h app_control;
      - 
      -app_control_create(&app_control);
      - 
      -app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT);
      -app_control_set_mime(app_control, "text/plain");
      - 
      -if (app_control_send_launch_request(app_control, app_control_result, NULL) == APP_CONTROL_ERROR_NONE) 
      -{
      -   dlog_print(DLOG_INFO, TAG, "Succeeded: the application is launched.");
      -} 
      -else 
      -{
      -   dlog_print(DLOG_ERROR, TAG, "Failed to launch an application.");
      -}
      - 
      -app_control_destroy(app_control);
      -
      - -

      The following code example implements an app_control callback in the callee application:

      - -
      -static void app_control(app_control_h app_control, void *user_data) 
      -{
      -   struct appdata *ad = (struct appdata *)user_data;
      -   char *operation;
      -   char *mime;
      -   app_control_h reply;
      -   char *app_id;
      - 
      -   app_control_get_operation(app_control, &operation);
      - 
      -   if (!strcmp(operation, APP_CONTROL_OPERATION_CREATE_CONTENT)) 
      -   {
      -      app_control_get_mime(app_control, &mime);
      - 
      -      if (!strcmp(mime, "text/plain")) 
      -      {
      -         app_control_create(&reply);
      - 
      -         app_get_app_id(&app_id);
      -         app_control_add_extra_data(reply, APP_CONTROL_DATA_SELECTED, app_id);
      -         app_control_reply_to_launch_request(reply, app_control, APP_CONTROL_RESULT_SUCCEEDED);
      - 
      -         app_control_destroy(reply);
      -      }
      -   }
      -}
      -
      - -

      Exporting AppControl Functionality

      -

      You can export functionalities of your application to be used in another application. However, if the other application uses the application control functionality implicitly without the - application ID, it must declare the application control information in its manifest file:

      -
      -<app-control>
      -   <mime name="application/xhtml+xml"/>
      -   <operation name="http://tizen.org/appcontrol/operation/view"/>
      -   <uri name="http://test.com"/>
      -</app-control>
      -<app-control>
      -   <operation name="http://tizen.org/appcontrol/operation/call"/>
      -</app-control>
      -
      -

      - The resolution filter is used when resolving the application control. Each entry of the resolution filter has the <app-control> - element and forms an application resolution unit. The additional URI or MIME type information must contain the associated operation ID, and the retrieved application control must have the specified - application ID and operation ID when resolving the application control. -

      -

      - You can specify the application control information of your application in the application project settings in the IDE; an - operation ID must be specified for the application control. -

      - -

      Using Platform Application Controls

      - -

      Tizen provides base applications, such as Web browser, image viewer, music player, and video player. Using the App Control module (in mobile and wearable applications), you can take advantage of the Tizen base application functionalities.

      - -

      The Tizen platform provides the platform application controls for the following base applications:

      -
        -
      • FileManager
      • -
      • ImageViewer
      • -
      • Internet
      • -
      • MusicPlayer
      • -
      • VideoPlayer
      • -
      -

      The following table defines the details of each platform application control.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Table: Tizen base application services -
      ServiceOperationSchemeMIME
      Browsing a Web pagehttp://tizen.org/appcontrol/operation/view -
        -
      • http
      • -
      • https
      • -
      -
      -
      Displaying an image -
        -
      • file
      • -
      • http
      • -
      • https
      • -
      -
      -
        -
      • image/bmp
      • -
      • image/gif
      • -
      • image/jpeg
      • -
      • image/png
      • -
      -
      Playing a sound filefile -
        -
      • audio/aac
      • -
      • audio/amr
      • -
      • audio/mp3
      • -
      • audio/wav
      • -
      -
      Playing a video file -
        -
      • video/mp4
      • -
      • video/3gpp
      • -
      -
      Selecting a filehttp://tizen.org/appcontrol/operation/pick -
        -
      • */*
      • -
      • image/*
      • -
      • video/*
      • -
      • audio/*
      • -
      -
      - - - - - - - - - - - -
      Note
      Tizen provides support for the defined MIME types of the base application services depending on the platform implementation.
      - - - - -

      Handling Alarms

      - -

      The Alarm API (in mobile and wearable applications) provides functions to launch an application at a specific time. The mechanism involved in launching the application is the App Control API (in mobile and wearable applications).

      -

      The AppControl API allows launching an application explicitly, giving its package name, or providing certain criteria that the application must meet. For example, the criteria can include the type of data on which the application must be able to operate. The structure containing the criteria is called an appcontrol.

      -

      For more information, see the Launching Applications guide.

      - +

      Managing Application States and Transitions

      The Tizen native application can be in one of several different states. Typically, the application is launched by the user from the Launcher, or by another application. As the application is starting, the app_create_cb() callback is executed and the main event loop starts. The application now normally becomes the frontmost window, with focus. When the application loses the frontmost or focus status, the app_pause_cb() callback is invoked and your application goes into a pause state. The pause state means that the application is not terminated but is running in the background. The application can go into a pause state because:

      @@ -603,7 +152,7 @@ static void app_control(app_control_h app_control, void *user_data)

      When your application starts exiting, the app_terminate_cb() callback is invoked. Your application terminates because:

        -
      • Your application itself requests to exit by calling ui_app_exit() function to terminate the event loop.
      • +
      • Your application itself requests to exit by calling the ui_app_exit() function to terminate the event loop.
      • The Low Memory Killer is killing your application in a low memory situation.

      The application state changes are managed by the underlying framework. The following figure and table illustrate the application states.

      @@ -653,7 +202,7 @@ static void app_control(app_control_h app_control, void *user_data)

      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.

      - + @@ -670,7 +219,7 @@ static void app_control(app_control_h app_control, void *user_data) - + @@ -709,7 +258,7 @@ static void app_control(app_control_h app_control, void *user_data)    <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 or higher --> +      <!--For API version 2.4 or higher-->       <background-category value="media"/>       <background-category value="download"/>       <background-category value="background-network"/> @@ -726,264 +275,35 @@ static void app_control(app_control_h app_control, void *user_data) - - - - + + + - - - -
      Table: Allowed Background Application PolicyTable: Allowed background application policy
      Background category
      Download Downloading data with the Tizen Download-manager APIDownload API (in mobile and wearable applications)Download API (in mobile applications) download
      Note

      The <background-category> element is supported for the API version equal or higher than 2.4. An application with <background-category> declared may failed to be installed on the devices with Tizen lower than version 2.4. In this case, for those who work on the API version lower than 2.4 should declare the background category in <metadata key="http://tizen.org/metadata/background-category/value"/> if the application should run on the background in the devices of Tizen 2.4 or higher version.

      +	
      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"/>
      +      <!--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"/>
      +      <metadata key="http://tizen.org/metadata/background-category/background-network"/>
      +      <metadata key="http://tizen.org/metadata/background-category/location"/>
          </service-application>
       </manifest>
      -

      <metadata key="http://tizen.org/metadata/bacgkround-category/value"/> has no effect on Tizen 2.3 devices, but has same effects with <background-category> declared on Tizen 2.4 or higher devices.

      -
      -

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

      - -

      Localizing Application Strings

      -

      Tizen provides localized resources to make your application usable for different countries. The localization is based on the Internationalization API (in mobile and wearable applications), which makes strings translatable and places them in .po (portable object) files.

      - - - - - - - - - - -
      Note

      The .po files must be placed in the res/po directory of the application. The files can be edited using the PO File Editor provided by the Tizen SDK.

      - -

      Depending on the device's locale information, your application must load the proper resource set. If no matching resource set is found for the device's current locale, the default resource set is used.

      - -

      To get the localized value of a string, use the MsgID shown in the PO File Editor, prefaced with an underscore _ (for example, _(<MsgID>)). The underlying implementation calls the i18n_get_text() function to retrieve the localized value:

      - -
      -char *hello_text = i18n_get_text("Hello");
      -
      -

      The hello_text variable is set to the localized text for "Hello" for the current locale of the device.

      -

      When you change the language setting on the device, the text changes in the application according to the current language.

      - -

      Marking Text Parts as Translatable

      -

      The most common way to use a translation involves the following APIs:

      - -
      -elm_object_translatable_text_set(Evas_Object *obj, const char *text)
      -elm_object_item_translatable_text_set(Elm_Object_Item *it, const char *text)
      -
      - -

      They set the untranslated string for the "default" part of the given Evas_Object or Elm_Object_Item and mark the string as translatable.

      - -

      Similar functions are available if you wish to set the text for a part that is not "default":

      - -
      -elm_object_translatable_part_text_set(Evas_Object *obj, const char *part, const char *text)
      -elm_object_item_translatable_part_text_set(Elm_Object_Item *it, const char *part, const char *text)
      -
      - -

      It is important to provide the untranslated string to these functions, because the EFLs trigger the translation themselves and re-translate the strings automatically, if the system language changes.

      - - -

      Translating Texts Directly

      - -

      The approach described in the previous section is not applicable all of the time. For instance, it does not work if you are populating a genlist, if you need plurals in the translation or if you want to do something else than put the translation in elementary UI components.

      - -

      It is possible to retrieve the translation for a given text through the i18n_get_text() function from app_i18n.h.

      - -
      -char *i18n_get_text(const char *msgid);
      -
      - -

      This function takes as input a string (that is copied to an msgid field in the .po files) and returns the translation (the corresponding msgstr field).

      - - - - - - - - - - -
      Note
      Do not modify or free the return value of these functions. They are statically allocated.
      - -

      When giving the text for a genlist item, you can use it in a similar manner as in the example below.

      - -
      -#include "app_i18n.h"
      -static char *_genlist_text_get(void *data, Evas_Object *obj, const char *part)
      -{
      -   return strdup(i18n_get_text("Some Text"));
      -}
      -
      - -

      Plurals

      -

      Plurals are handled through the ngettext() function. Its prototype is shown below.

      - -
      -char *ngettext(const char *msgid, const char *msgid_plural, unsigned long int n);
      -
      - -
        -
      • msgid is the same as before, that is, the untranslated string
      • -
      • msgid_plural is the plural form of msgid
      • -
      • the quantity (in English, 1 is singular and anything else is plural)
      • -
      - -

      A matching fr.po file contains the following lines.

      - -
      -msgid "%d Comment"
      -msgid_plural "%d Comments"
      -msgstr[0] "%d commentaire"
      -msgstr[1] "%d commentaires"
      -
      - -

      Several Plurals

      -

      It is possible to have several plural forms. For instance, the .po file for Polish could contain the following lines.

      - -
      -msgid "%d Comment"
      -msgid_plural "%d Comments"
      -msgstr[0] "%d Komentarz"
      -msgstr[1] "%d Komentarze"
      -msgstr[2] "%d Komentarzy"
      -
      - -

      The index values after msgstr are defined in system-wide settings. The ones for Polish are given below:

      - -
      -"Plural-Forms: nplurals = 3; plural = n = = 1 ? 0 : n%10> = 2 && n%10< = 4 && (n%100<10 | | n%100> = 20) ? 1 : 2;\n"
      -
      - -

      There are three forms (including singular). The index is 0 (singular), if the given integer n is 1. Then, if (n % 10 >= 2 && % 10 <= 4 && (n % 100 < 10 | | n % 100 >= 20), the index is 1, otherwise it is 2.

      - -

      Handling Language Changes at Runtime

      - -

      The user can change the system language settings at any time. When that is done, the framework notifies the application, which changes the language used in the Elementary. The UI components receive a "language,changed" signal and reset their text.

      - -

      This is how to handle the framework event:

      - -
      -static void
      -_app_language_changed(void *data)
      -{
      -   char *language;
      -   // Retrieve the current system language
      -   system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language);
      -   // Set the language in elementary
      -   elm_language_set(language);
      -   free(language);
      -}
      -int
      -main(int argc, char *argv[])
      -{
      -   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, _app_language_changed, &ad);
      -}
      -
      - -

      The call to elm_language_set() above triggers the emission of the "language,changed" signal, which is handled the same way as the typical smart event signals.

      - -

      Extracting Messages for Translation

      - -

      The xgettext tool extracts strings to translate to a .pot file (po template), while msgmerge maintains the existing .po files. The typical workflow is as follows:

      -
        -
      • run xgettext once; it generates a .pot file
      • -
      • when adding a new translation, copy the .pot file to <locale>.po and translate that file
      • -
      • new runs of xgettext update the existing .pot file and msgmerge updates the .po files
      • -
      - -

      The following example is a typical call to xgettext.

      - -
      -xgettext --directory = src --output-dir = res/po --keyword = _ --keyword = N_ --keyword = elm_object_translatable_text_set:2 --keyword = elm_object_item_translatable_text_set:2 --add-comments = --from-code = utf-8 --foreign-use
      -
      - -

      This extracts all strings that are used inside the _() function (as an optional short-hand for i18n_get_text()), use UTF-8 as the encoding and add the comments right before the strings to the output files).

      - -

      The following example is a typical call to msgmerge.

      - -
      -msgmerge --width=120 --update res/po/fr.po res/po/ref.pot
       
      +

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

      + + + + -

      Internationalization Tips

      - -

      Do Not Make Assumptions about Languages

      - -

      Languages vary greatly and even if you knew several of them, do not assume there is any common logic to them.

      - -

      For example, with English typography, no character must appear before colons and semicolons (':' and ';'). However, with French typography, there must be "espace fine insécable", that is, a non-breakable space (HTML's &nbsp;) that is narrower that regular spaces.

      - -

      This prevents proper translation in the following construct:

      - -
      -snprintf(buf, some_size, "%s: %s", i18n_get_text(error), i18n_get_text(reason));
      -
      - -

      The correct way to translate it is to use a single string and let the translators manage the punctuation. This means translating the format string instead:

      - -
      -snprintf(buf, some_size, i18n_get_text("%s: %s"), i18n_get_text(error), i18n_get_text(reason));
      -
      - -

      It is not always possible, but aim for this unless a specific issue arises.

      - -

      Translations Are of Different Lengths

      -

      Depending on the language, the translation has a different length on screen. In some cases, a language has a shorter construct than another, while the situation is reversed in another case; a language may have a word for a specific concept, while another does not and requires a circumlocution (designating something by using several words).

      - -

      For Source Control, Do Not Commit .po If Only Line Indicators Have Changed

      - -

      From the example above, a translation block looks like:

      - -
      -#: some_file.c:43 another_file.c:41
      -msgid "Click Here"
      -msgstr "Cliquez ici"
      -
      - -

      In case you insert a new line at the top of "some_file.c", the line indicator changes to look like this:

      - -
      -#: some_file.c:44 another_file.c:41
      -
      - -

      Obviously, on non-trivial projects, such changes often happen. If you use source control and commit such changes even though no actual translation change has happened, each commit probably contains a change to .po files. This hampers readability of the change history, and in case several people are working in parallel and need to merge their changes, this creates huge merge conflicts each time.

      - -

      Only commit changes to .po files when there are actual translation changes, not because line comments have changed.

      - -

      Using _() as Shorthand to the i18n_get_text() Function

      - -

      Since calling i18n_get_text() may often happen, it is abbreviated to _(). The Tizen SDK provides this abbreviation by default.

      - -

      Proper Sorting: strcoll()

      -

      There is a string comparison tailored for sorting data for display: strcoll(). It works the same way as strcmp() but sorts the data according to the current locale settings.

      - -
      -int strcmp(const char *s1, const char *s2);
      -int strcoll(const char *s1, const char *s2);
      -
      - -

      The function prototype is a standard one and indicates how to order strings. A detailed explanation is out of scope for this guide, but use the strcoll() function as the comparison function for sorting the data set you are using.

      - -

      Working with Translators

      -

      The system described above is a common one and is likely to be known to translators, meaning that giving its name (gettext) may be enough to explain how it works. In addition to this documentation, there is extensive additional documentation as well as questions and answers on the topic in the Internet.

      - -

      Do not hesitate to put comments in your code above the strings to be translated, since they can be extracted along with the strings and saved in the .po files for the translator to see them.

      +

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

      @@ -1007,4 +327,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/badge_n.htm b/org.tizen.guides/html/native/app/badge_n.htm index 2fd179d..29438c0 100644 --- a/org.tizen.guides/html/native/app/badge_n.htm +++ b/org.tizen.guides/html/native/app/badge_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -34,13 +34,12 @@

      Badge

      A badge is an image displayed on the application icon, which informs the user about notifications and events.

      -

      Figure: Badge

      -

      Badge

      -

      To create a badge, use the badge_new() method. The application that creates the badge can also update and remove it. When applications are signed with the same certificate, they can control each other's badges.

      If an application not signed with the same certificate must be allowed manage a badge, use the badge_new() method with a writable application ID. The writable application ID enables another application to control your application to manage the badge. You can also configure your application to handle the badge itself.

      +

      Figure: Badge

      +

      Badge

      diff --git a/org.tizen.guides/html/native/app/bundle_n.htm b/org.tizen.guides/html/native/app/bundle_n.htm index 513de53..59db5c8 100644 --- a/org.tizen.guides/html/native/app/bundle_n.htm +++ b/org.tizen.guides/html/native/app/bundle_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      diff --git a/org.tizen.guides/html/native/app/common_appcontrol_n.htm b/org.tizen.guides/html/native/app/common_appcontrol_n.htm new file mode 100644 index 0000000..9542403 --- /dev/null +++ b/org.tizen.guides/html/native/app/common_appcontrol_n.htm @@ -0,0 +1,1701 @@ + + + + + + + + + + + + + Common Application Controls + + + + + +
      +

      Common Application Controls

      + +

      The following sections introduce the common application controls provided by the Tizen base applications.

      + +

      Browser

      + +

      Performing a Web Search

      + +

      To find what you are looking for on the Web, use the APP_CONTROL_OPERATION_SEARCH operation.

      +

      Figure: Performing a Web search

      +

      Performing a Web search

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SEARCH

      + +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TEXTThe text to search. This key must be passed as a string.This key is mandatory.
      + +

      Example Code

      +
      +app_control_h app_control;
      +app_control_create(&app_control);
      +app_control_set_operation(app_control, APP_CONTROL_OPERATION_SEARCH);
      +app_control_add_extra_data(app_control, APP_CONTROL_DATA_TEXT, "tizen");
      +
      +app_control_send_launch_request(app_control, NULL, NULL);
      +app_control_destroy(app_control);
      +
      + +

      Loading a Web Page

      + +

      To open a web page, use the APP_CONTROL_OPERATION_VIEW operation and specify the Web URL in the URI.

      +

      Figure: Loading a Web page

      +

      Loading a Web page

      + +

      Operation

      +

      APP_CONTROL_OPERATION_VIEW

      +

      URI (Mandatory)

      +
        +
      • http:<path>
      • +
      • https:<path>
      • +
      • file:<path>
      • +
      • javascript:<path>
      • +
      +

      MIME Type (Optional)

      +
        +
      • image/svg+xml
      • +
      • text/html
      • +
      • application/xml
      • +
      • application/xhtml+xml
      • +
      • text/plain
      • +
      + +

      Example Code

      +
      +app_control_h app_control;
      +app_control_create(&app_control);
      +app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
      +app_control_set_uri(app_control, "https://www.tizen.org");
      +
      +app_control_send_launch_request(app_control, NULL, NULL);
      +app_control_destroy(app_control);
      +
      + +

      Calendar

      + +

      Adding a Calendar Event

      + +

      To add a new event to the user's calendar, use the APP_CONTROL_OPERATION_ADD operation with the application/vnd.tizen.calendar MIME type. To specify various event details, refer to the extras defined below.

      + +

      Figure: Adding a calendar event

      +

      Adding a calendar event

      + +

      Operation

      +

      APP_CONTROL_OPERATION_ADD

      +

      MIME Type (Mandatory)

      +

      application/vnd.tizen.calendar

      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_CALENDAR_ALLDAYThe string to indicate if an event applies to all day. Available values are true or false. This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_CALENDAR_START_TIMEThe start time of the event (format: YYYY-MM-DD HH:MM:SS). This key must be passed as a string.
      APP_CONTROL_DATA_CALENDAR_END_TIMEThe end time of the event (format: YYYY-MM-DD HH:MM:SS). This key must be passed as a string.
      APP_CONTROL_DATA_TITLEThe title of the event. This key must be passed as a string.
      APP_CONTROL_DATA_TEXTThe description of the event. This key must be passed as a string.
      +

      Extra Output

      + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_IDThe database record ID of the event (ID in the _calendar_event view). This key must be passed as a string.
      + +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_ADD);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TITLE, "Meeting with Jason");
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Editing a Calendar Event

      + +

      To edit an existing event in the user's calendar, use the APP_CONTROL_OPERATION_EDIT operation with the application/vnd.tizen.calendar MIME type. To specify various event details, refer to the extras defined below.

      + +

      Figure: Editing a calendar event

      +

      Editing a calendar event

      + +

      Operation

      +

      APP_CONTROL_OPERATION_EDIT

      +

      MIME Type (Mandatory)

      +

      application/vnd.tizen.calendar

      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_IDThe database record ID of the event (ID in the _calendar_event view). This key must be passed as a string.This key is mandatory.
      APP_CONTROL_DATA_CALENDAR_ALLDAYThe string to indicate if an event applies to all day. Available values are true or false. This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_CALENDAR_START_TIMEThe start time of event (format: YYYY-MM-DD HH:MM:SS). This key must be passed as a string.
      APP_CONTROL_DATA_CALENDAR_END_TIMEThe end time of event (format: YYYY-MM-DD HH:MM:SS). This key must be passed as a string.
      APP_CONTROL_DATA_TITLEThe title of event. This key must be passed as a string.
      APP_CONTROL_DATA_TEXTThe description of event. This key must be passed as a string.
      +

      Extra Output

      + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_IDThe database record ID of the event (ID in the _calendar_event view). This key must be passed as a string.
      +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_EDIT);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_ID, "42");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TITLE, "Meeting with Jason");
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Viewing a Calendar Event

      + +

      To display a specified event in the user's calendar, use the APP_CONTROL_OPERATION_VIEW operation with the application/vnd.tizen.calendar MIME type. To specify various event details, refer to the extras defined below.

      +

      In case of viewing an event from a VCalendar file, the file path URI and text/x-vcalendar MIME type must be specified. In case of viewing an event by an event ID, the event ID (ID in the _calendar_event view) extra data and application/vnd.tizen.calendar MIME type must be specified.

      + +

      Figure: Viewing a calendar event

      +

      Viewing a calendar event

      + +

      Operation

      +

      APP_CONTROL_OPERATION_VIEW

      +

      URI

      +

      file:<path>

      +

      For example: file://<media storage path>/file.vcs

      +

      MIME Type

      +
        +
      • application/vnd.tizen.calendar
      • +
      • text/x-vcalendar
      • +
      +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_IDThe database record ID of the event (ID in the _calendar_event view). This key must be passed as a string.This key is mandatory when the MIME type is set to application/vnd.tizen.calendar.
      +

      Example Code

      +
      +// To view a calendar event from a vcs file
      +app_control_h service;
      +app_control_create(&service);
      +app_control_set_operation(service, APP_CONTROL_OPERATION_VIEW);
      +app_control_set_uri(service, "file://<app's shared path>/Calendar3.vcs");
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +app_control_destroy(service);
      +
      +// To view a calendar event from a calendar event ID
      +app_control_h service;
      +app_control_create(&service);
      +app_control_set_operation(service, APP_CONTROL_OPERATION_VIEW);
      +app_control_set_mime(service, "application/vnd.tizen.calendar");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_ID, "42");
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +app_control_destroy(service);
      +
      + +

      Selecting a Calendar Event

      + +

      To select a specified event in the user's calendar, use the APP_CONTROL_OPERATION_PICK operation with the application/vnd.tizen.calendar MIME type. To specify various event details, refer to the extras defined below.

      +

      Figure: Selecting a calendar event

      +

      Selecting a calendar event

      + +

      Operation

      +

      APP_CONTROL_OPERATION_PICK

      +

      MIME Type (Mandatory)

      +

      application/vnd.tizen.calendar

      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TYPEThe type of items to be delivered. The available values are id and vcs (id is the default, if not presented). This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_SELECTION_MODEThe selection mode of the PICK operation. The available values are single and multiple (single is the default, if not presented). This key must be passed as a string.
      APP_CONTROL_DATA_TOTAL_COUNTThe total number of events to be returned. This key must be passed as a string.
      +

      Extra Output

      + + + + + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_TYPEThe type of items to be delivered. The available values are id and vcs. This key must be passed as a string.
      APP_CONTROL_DATA_SELECTEDThe database record ID of the event (ID in the _calendar_event view) or the paths of the vcs files. This key must be passed as an array.
      +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_PICK);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TYPE, "id");
      +app_control_add_extra_data(service, APP_CONTROL_ SELECTION_MODE, "single");
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Call

      + +

      Making a Phone Call

      +

      To directly initiate a phone call, use the APP_CONTROL_OPERATION_CALL operation with a phone number URI scheme.

      +

      Figure: Making a phone call

      +

      Making a phone call

      + +

      Operation

      +

      APP_CONTROL_OPERATION_CALL

      +

      To request this operation, the http://tizen.org/privilege/call privilege is needed.

      +

      URI (Mandatory)

      +

      tel:<number>

      +

      For example: tel:+821234567890

      +

      Code Example

      +
      +void 
      +launchCall()
      +{
      +   app_control_h request = NULL;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_CALL);
      +   app_control_set_uri(request, "tel:+380665554433");
      +
      +   app_control_send_launch_request(request, NULL, NULL);
      +   app_control_destroy(request);
      +}
      +
      + + +

      Launching a Call Application with a Phone Number

      + +

      To open a call application and display a predefined a phone number, use the APP_CONTROL_OPERATION_DIAL action with a phone number URI scheme. When the call application opens, it displays the phone number, but the user must press the Call button to initiate the phone call.

      +

      Figure: Launching a Call application

      +

      Launching a Call application

      + +

      Operation

      +

      APP_CONTROL_OPERATION_DIAL

      +

      URI (Optional)

      +

      tel:<number>

      +

      For example: tel:+821234567890

      +

      Example Code

      +
      +void 
      +launchCall()
      +{
      +   app_control_h request = NULL;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_DIAL);
      +   app_control_set_uri(request "tel:+380665554433");
      +
      +   app_control_send_launch_request(request, NULL, NULL);
      +   app_control_destroy(request);
      +}
      +
      + + +

      Contact

      + +

      Adding a Contact

      + +

      To add a new contact, use the APP_CONTROL_OPERATION_ADD operation with the application/vnd.tizen.contact MIME type. To specify various contact details, refer to the extras defined below.

      +

      Figure: Adding a contact

      +

      Adding a contact

      + +

      Operation

      +

      APP_CONTROL_OPERATION_ADD

      +

      MIME Type (Mandatory)

      +

      application/vnd.tizen.contact

      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_PHONEThe phone number. This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_EMAILThe email address. This key must be passed as a string.
      APP_CONTROL_DATA_URLThe homepage URL. This key must be passed as a string.
      APP_CONTROL_DATA_NAMEThe contact's name. This key must be passed as a string.
      +

      Extra Output

      + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_IDThe database record ID of the added person (ID in the _contacts_person view). This key must be passed as a string.
      +

      Example Code

      +
      +int 
      +launchContactCreate(const char *number)
      +{
      +   app_control_h request;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_ADD);
      +   app_control_set_mime(request, "application/vnd.tizen.contact");
      +
      +   if (number) 
      +   {
      +      app_control_add_extra_data(request, APP_CONTROL_DATA_PHONE, number);
      +   }
      +
      +   app_control_set_launch_mode(request, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +   int result = app_control_send_launch_request(request, NULL, NULL);
      +   app_control_destroy(request);
      +
      +   return result;
      +}
      +
      + + +

      Editing a Contact

      + +

      To edit a known contact, use the APP_CONTROL_OPERATION_EDIT operation with the application/vnd.tizen.contact MIME type. To specify various contact details, refer to the extras defined below.

      + +

      Figure: Editing a contact

      +

      Editing a contact

      + +

      Operation

      +

      APP_CONTROL_OPERATION_EDIT

      +

      MIME Type (Mandatory)

      +

      application/vnd.tizen.contact

      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_IDThe database record ID of the person to be edited (ID in the _contacts_person view). This key must be passed as a string.This key is mandatory.
      APP_CONTROL_DATA_PHONEThe phone number that is added to the contact. This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_EMAILThe email address that is added to the contact. This key must be passed as a string.
      APP_CONTROL_DATA_URLThe homepage URL that is added to the contact. This key must be passed as a string.
      + +

      Extra Output

      + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_IDThe database record ID of the person to be edited (ID in the _contacts_person view). This key must be passed as a string.
      +

      Example Code

      +
      +int 
      +launchContactEdit(const char* personId, const char *number)
      +{
      +   app_control_h request;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_EDIT);
      +   app_control_set_mime(request, "application/vnd.tizen.contact");
      +
      +   app_control_add_extra_data(request, APP_CONTROL_DATA_ID, personId);
      +	
      +   if (number) 
      +   {
      +      app_control_add_extra_data(request, APP_CONTROL_DATA_PHONE, number);
      +   }
      +
      +   app_control_set_launch_mode(request, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +   int result = app_control_send_launch_request(request, NULL, NULL);
      +   app_control_destroy(request);
      +
      +   return result;
      +}
      +
      + +

      Viewing a Contact

      + +

      To display a specified contact in the contact database, use the APP_CONTROL_OPERATION_VIEW operation with the application/vnd.tizen.contact MIME type. To specify various contact details, refer to the extras defined below.

      +

      In case of viewing a contact from a vcard file, the file path URI and text/vcard or text/x-vcard MIME type must be specified. In case of viewing a contact by a person ID, the person ID (ID in the _contact_person view) extra data and application/vnd.tizen.contact MIME type must be specified.

      + +

      Figure: Viewing a contact

      +

      Viewing a contact Viewing a contact

      + +

      Operation

      +

      APP_CONTROL_OPERATION_VIEW

      +

      URI

      +

      file:<path>

      +

      MIME Type

      +
        +
      • application/vnd.tizen.contact
      • +
      • text/vcard
      • +
      • text/x-vcard
      • +
      +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_IDThe database record ID of the edited person (ID in the _contacts_person view). This key must be passed as a string.This key is mandatory when the MIME type is set to application/vnd.tizen.contact.
      + +

      Example Code

      +
      +int 
      +launchContactDetails(const char* personId)
      +{
      +   app_control_h request;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_VIEW);
      +   app_control_set_mime(request, "application/vnd.tizen.contact");
      +   app_control_add_extra_data(request, APP_CONTROL_DATA_ID, personId);
      +
      +   app_control_set_launch_mode(request, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +   int result = app_control_send_launch_request(request, NULL, NULL);
      +   app_control_destroy(request);
      +
      +   return result;
      +}
      +
      +int launchViewVcard(const char *uri)
      +{
      +   app_control_h request;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_VIEW);
      +   app_control_set_mime(request, "text/vcard");
      +   app_control_set_uri(request, uri);
      +
      +   app_control_set_launch_mode(request, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +   int result = app_control_send_launch_request(request, NULL, NULL);
      +   app_control_destroy(request);
      +
      +   return result;
      +}
      +
      + +

      Selecting a Contact

      + +

      To select a specified contact in the user's contacts, use the APP_CONTROL_OPERATION_PICK operation with the application/vnd.tizen.contact MIME type. To specify various contact details, refer to the extras defined below.

      + +

      Figure: Selecting a contact

      +

      Selecting a contact

      + +

      Operation

      +

      APP_CONTROL_OPERATION_PICK

      +

      MIME Type (Mandatory)

      +

      application/vnd.tizen.contact

      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_SELECTION_MODEThe selection mode of the PICK operation. The available values are single and multiple (single is the default, if not presented). This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_TYPEThe type of items to be delivered. The available values are id, phone, email, and vcf (id is the default, if not presented). This key must be passed as a string.
      APP_CONTROL_DATA_TOTAL_COUNTThe total number of events to be returned. This key must be passed as a string.
      +

      Extra Output

      + + + + + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_TYPEThe type of items to be delivered. The available values are id, phone, email, and vcf. This key must be passed as a string.
      APP_CONTROL_DATA_SELECTEDThe extra field to get the return information. The content of this key depends on its type: +
        +
      • id – The database record ID of the selected person (ID in the _contacts_person view).
      • +
      • phone – The database record ID of the number of the selected person (ID in the _contacts_number view).
      • +
      • email – The database record ID of the email of the selected person (ID in the _contacts_email view).
      • +
      • vcf – The path to the vCard file.
      • +
      +

      This key must be passed as an array.

      +
      + +

      Example Code

      +
      +int 
      +launchContactPick(const char *selectionMode, const char *resultType,
      +                  app_control_reply_cb replyCallback, void *userData)
      +{
      +   app_control_h request;
      +   app_control_create(&request);
      +   app_control_set_operation(request, APP_CONTROL_OPERATION_PICK);
      +   app_control_set_mime(request, "application/vnd.tizen.contact");
      +
      +   app_control_add_extra_data(request, APP_CONTROL_DATA_SELECTION_MODE, selectionMode);
      +   app_control_add_extra_data(request, APP_CONTROL_DATA_TYPE, resultType);
      +
      +   int result = app_control_send_launch_request(request, replyCallback, userData);
      +   app_control_destroy(request);
      +
      +   return result;
      +}
      +
      + +

      Email

      + +

      Composing an Email

      + +

      To launch an email composer with optional recipients, subject, and body text, use the APP_CONTROL_OPERATION_COMPOSE operation.

      + +

      Figure: Composing an email

      +

      Composing an email

      + +

      Operation

      +

      APP_CONTROL_OPERATION_COMPOSE

      +

      URI (Optional)

      +

      mailto:<email address>

      +

      If the mailto: field is empty, it filters out all but email applications in the system, and you can use the extra data only to pass optional parameters.

      + +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TOThe email address list of main recipients, separated by ";".This key is optional.
      APP_CONTROL_DATA_CCThe email address list of secondary (copy) recipients, separated by ";".
      APP_CONTROL_DATA_BCCThe email address list of hidden (blind copy) recipients, separated by ";".
      APP_CONTROL_DATA_SUBJECTThe subject of an email message. This key must be passed as a string.
      APP_CONTROL_DATA_TEXTThe body of the email to be sent. This key must be passed as a string.
      + +

      Example Code

      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_COMPOSE);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TO, "to@test.com");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_CC, "cc@test.com");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_BCC, "bcc@test.com");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_SUBJECT, "test subject");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TEXT, "line1\nline2");
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +app_control_destroy(service);
      +
      + +

      Sharing a Single File in an Email

      + +

      To share a single file of nay MIME type in an email message, use the APP_CONTROL_OPERATION_SHARE operation.

      + +

      Figure: Sharing a single file

      +

      Sharing a single file

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SHARE

      +

      URI (Mandatory)

      +
      • file:<full path to file> or <full path to file> (no scheme) +

        Using a URI with the file: scheme or without any scheme is the default input for this operation. If there is such a URI, all extra data is ignored.

      • +
      • mailto: +

        Only an empty mailto: field is allowed. It filters out all but email applications in the system.

      • +
      + +

      MIME Type (Optional)

      +

      Any MIME type that your application needs, such as image/jpg, video/*, or */*

      + +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_PATHWhen the URI is set to mailto, a path to a single file to be shared must be provided using this key. Otherwise, the key is ignored. This key must be passed as a string.This key is mandatory when the URI is set to mailto.
      + +

      Example Code

      +
      +#define PATH_MAX 128
      +
      +char *shared_res_path = app_get_shared_resource_path();
      +char img_path[PATH_MAX] = {0,};
      +snprintf(img_path, PATH_MAX, "%s/image.jpg", shared_res_path);
      +free(shared_res_path);
      +
      +app_control_h service;
      +app_control_create(&service);
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +app_control_set_operation(service, APP_CONTROL_OPERATION_SHARE);
      +app_control_set_uri(service, "mailto:");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_PATH, img_path);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +app_control_destroy(service);
      +
      + +

      Sharing Multiple Items in an Email

      + +

      To share multiple files of any MIME type in an email message, use the APP_CONTROL_OPERATION_MULTI_SHARE operation.

      + +

      Figure: Sharing multiple items

      +

      Sharing multiple items

      + +

      Operation

      +

      APP_CONTROL_OPERATION_MULTI_SHARE

      +

      URI (Optional)

      +

      mailto:

      +

      Only an empty mailto: field is allowed. It filters out all but email applications in the system.

      + +

      MIME Type (Optional)

      +

      Any MIME type that your application needs, such as image/jpg, video/*, or */*

      + +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_PATHThe list of multiple file paths to be shared in an email message. This key must be passed as an array.This key is mandatory.
      + +

      Example Code

      +
      +#define PATH_MAX 128
      +
      +char *shared_res_path = app_get_shared_resource_path();
      +char img1_path[PATH_MAX] = {0,};
      +char img2_path[PATH_MAX] = {0,};
      +const char *path_array[2] = {img1_path, img2_path};
      +snprintf(img1_path, PATH_MAX, "%s/image.jpg", shared_res_path);
      +snprintf(img2_path, PATH_MAX, "%s/image2.jpg", shared_res_path);
      +free(shared_res_path);
      +
      +app_control_h service;
      +app_control_create(&service);
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +app_control_set_operation(service, APP_CONTROL_OPERATION_MULTI_SHARE);
      +app_control_set_uri(service, "mailto:");
      +app_control_add_extra_data_array(service, APP_CONTROL_DATA_PATH, path_array, 2);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +app_control_destroy(service);
      +
      + +

      Sharing Text in an Email

      + +

      To share any text with an email message, use the APP_CONTROL_OPERATION_SHARE_TEXT operation. You can also define the message subject and a list of file attachments.

      + +

      Figure: Sharing text

      +

      Sharing text

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SHARE_TEXT

      +

      URI (Optional)

      +

      mailto:

      +

      Only an empty mailto: field is allowed. It filters out all but email applications in the system.

      + + +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TEXTThe body of the message to be sent. This key must be passed as a string.This key is mandatory.
      APP_CONTROL_DATA_SUBJECTThe subject of an email message. This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_PATHThe list of multiple file paths to be shared in an email message. This key must be passed as an array.
      + +

      Example Code

      +
      +#define PATH_MAX 128
      +
      +char *shared_res_path = app_get_shared_resource_path();
      +char img1_path[PATH_MAX] = {0,};
      +char img2_path[PATH_MAX] = {0,};
      +const char *path_array[2] = {img1_path, img2_path};
      +snprintf(img1_path, PATH_MAX, "%s/image.jpg", shared_res_path);
      +snprintf(img2_path, PATH_MAX, "%s/image2.jpg", shared_res_path);
      +free(shared_res_path);
      +
      +app_control_h service;
      +app_control_create(&service);
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +app_control_set_operation(service, APP_CONTROL_OPERATION_SHARE_TEXT);
      +app_control_set_uri(service, "mailto:");
      +app_control_add_extra_data_array(service, APP_CONTROL_DATA_PATH, path_array, 2);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_SUBJECT, "test subject");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TEXT, "line1\nline2");
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +app_control_destroy(service);
      +
      + +

      Map

      + +

      Showing a Location on a Map

      + +

      To open a map to show a location, use the APP_CONTROL_OPERATION_VIEW operation with an URI. To specify various map details, refer to the extras defined below.

      + + +

      Operation

      +

      APP_CONTROL_OPERATION_VIEW

      +

      URI (Mandatory)

      +
      • geo:latitude,longitude +

        Show the map with 2 values that represent the latitude and longitude. For example: geo:50.1,-50.1

      • +
      • geo:0,0?q=keyword +

        Show the map at the location of a given keyword (address or POI). For example: geo:0,0?q="Eiffel Tower"

      • +
      +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TYPEThe type of the keyword, in case the URI contains a keyword. The available values are address and poi (poi is the default, if not presented).This key is mandatory only when the location URI is given as a keyword.
      + +

      Example Code

      +
      +#include <app_control.h>
      +#include <dlog.h>
      +
      +int 
      +show_maps_operation(void)
      +{
      +   int ret = 0;
      +
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      +   
      +   if (service == NULL)
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      +   
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_VIEW);
      +   app_control_set_uri(service, "geo:50.1,-50.1"); 
      +  
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      +   
      +   if (ret == APP_CONTROL_ERROR_NONE)
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to request!\n");
      +	  
      +      return 0;
      +   }
      +   else
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to request!\n");
      +	  
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + +

      Picking a Location from the Map

      + +

      To pick a location from the map, use the APP_CONTROL_OPERATION_PICK operation. To specify various map details, refer to the extras defined below.

      + + +

      Operation

      +

      APP_CONTROL_OPERATION_PICK

      +

      URI (Optional)

      +

      geo:0,0?q=keyword

      +

      Show the map at the location of a given keyword (address or POI). For example: geo:0,0?q="Eiffel Tower"

      +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TYPEThe type of the keyword. The available values are address and poi (poi is the default, if not presented).This key is optional.
      + +

      Extra Output

      + + + + + + + + + + + + + + + +
      KeyDescription
      APP_CONTROL_DATA_SELECTEDThe address of the selected location. This key must be passed as a string.
      APP_CONTROL_DATA_PATHThe file path of the image showing the selected location. This key must be passed as a string.
      + +

      Example Code

      +
      +#include <app_control.h>
      +#include <dlog.h>
      +
      +int 
      +pick_location_operation(void)
      +{
      +   int ret = 0;
      +
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      +   
      +   if (service == NULL)
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      +   
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_PICK);
      +   app_control_set_uri(service, "geo:0,0?q=”Eiffel Tower");
      +   app_control_set_extra_data(service, APP_CONTROL_DATA_TYPE, "poi");
      +
      +   app_control_send_launch_request(service, pick_reply_cb, NULL);
      +   app_control_destroy(service);
      +
      +   return 0;
      +}
      +
      +void 
      +pick_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
      +{
      +   char *address = NULL;
      +   char *path = NULL;
      +
      +   if (result == APP_CONTROL_RESULT_SUCCEEDED)
      +   {
      +      app_control_get_extra_data(reply, APP_CONTROL_DATA_SELECTED, &address);
      +      app_control_get_extra_data(reply, APP_CONTROL_DATA_PATH, &path);
      +
      +      dlog_print(DLOG_INFO, LOG_TAG, "Selected address: %s", address);
      +      dlog_print(DLOG_INFO, LOG_TAG, "Map image path: %s", path);
      +
      +      free(address);
      +      free(path);
      +   }
      +}
      +
      + +

      Message

      + +

      Composing a Message

      + +

      To compose a new message, use the APP_CONTROL_OPERATION_COMPOSE operation. To specify various message details, refer to the extras defined below.

      + +

      Figure: Composing a message

      +

      Composing a message

      + +

      Operation

      +

      APP_CONTROL_OPERATION_COMPOSE

      +

      URI (Optional)

      +
      • sms:<phone-number> +

        For example: sms:+17913331234

      • +
      • mmsto:<phone-number> +

        For example: mmsto:+17913331234

      • +
      +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TOThe phone numbers of recipients. This key must be passed as an array.This key is optional.
      APP_CONTROL_DATA_TEXTThe body of the message to be sent. This key must be passed as a string.
      APP_CONTROL_DATA_SUBJECTThe subject of an MMS message. If this value is set for an SMS message, the message is automatically converted to MMS. This key must be passed as a string.
      + +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_COMPOSE);
      +app_control_set_uri(service, "sms:123456789");         
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Sharing a Single Item in a Message

      + +

      To share a single file in an MMS message, use the APP_CONTROL_OPERATION_SHARE operation.

      + +

      Figure: Sharing a single item

      +

      Sharing a single item

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SHARE

      +

      URI (Mandatory)

      +
      • mmsto:<phone-number> +

        For example: mmsto:+17913331234

      • +
      • file:<path> +

        For example: file://<media storage path>/item.jpg

      • +
      + +

      MIME Type (Optional)

      +

      Any MIME type that your application needs, such as image/jpg, video/*, or */*

      + +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_PATHWhen the URI is set to mmsto, a path to a single file to be shared must be provided using this key. Otherwise, the key is ignored. This key must be passed as a string.This key is mandatory when the URI is set to mmsto.
      + +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_SHARE);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_PATH, IMAGE_PATH);
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Sharing Multiple Items in a Message

      + +

      To share multiple files in an MMS message, use the APP_CONTROL_OPERATION_MULTI_SHARE operation.

      + +

      Figure: Sharing multiple items

      +

      Sharing multiple items

      + +

      Operation

      +

      APP_CONTROL_OPERATION_MULTI_SHARE

      +

      URI (Optional)

      +

      mmsto:<phone-number>

      +

      For example: mmsto:+17913331234

      + +

      MIME Type (Optional)

      +

      Any MIME type that your application needs, such as image/jpg, video/*, or */*

      + +

      Extra Input

      + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_PATHThe list of multiple file paths to be shared in a multimedia message. This key must be passed as an array.This key is mandatory.
      + +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +const char* paths[] = {IMAGE_PATH1,IMAGE_PATH2};
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_MULTI_SHARE);
      +app_control_add_extra_data_array(service, APP_CONTROL_DATA_PATH, paths, 2);
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Sharing Text in a Message

      + +

      To share any text with an SMS or MSM message, use the APP_CONTROL_OPERATION_SHARE_TEXT operation.

      + +

      Figure: Sharing text

      +

      Sharing text

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SHARE_TEXT

      +

      URI (Optional)

      +
      • sms:<phone-number> +

        For example: sms:+17913331234

      • +
      • mmsto:<phone-number> +

        For example: mmsto:+17913331234

      • +
      + + +

      Extra Input

      + + + + + + + + + + + + + + + + + + + + + + +
      KeyDescriptionNote
      APP_CONTROL_DATA_TEXTThe body of the message to be sent. This key must be passed as a string.This key is mandatory.
      APP_CONTROL_DATA_SUBJECTThe subject of an MMS message. If it is set for an SMS message, the message is automatically converted to MMS. This key must be passed as a string.This key is optional.
      APP_CONTROL_DATA_PATHThe list of multiple file paths to be shared in a multimedia message. This key must be passed as an array.
      + +

      Example Code

      +
      +#include <app_control.h>
      +
      +app_control_h service;
      +app_control_create(&service);
      +
      +app_control_set_operation(service, APP_CONTROL_OPERATION_SHARE_TEXT);
      +app_control_add_extra_data(service, APP_CONTROL_DATA_TEXT, "How are you?");
      +app_control_add_extra_data(service, APP_CONTROL_DATA_SUBJECT, "Hi");
      +app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
      +
      +app_control_send_launch_request(service, NULL, NULL);
      +
      + +

      Settings for Bluetooth

      + +

      Showing Bluetooth Settings to Activate Bluetooth

      + +

      To launch the Bluetooth setting application to allow the user to activate or deactivate Bluetooth, use the APP_CONTROL_OPERATION_SETTING_BT_ENABLE operation.

      + +

      Figure: Showing Bluetooth activation settings

      +

      Showing Bluetooth activation settings

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SETTING_BT_ENABLE

      + + +

      Example Code

      +
      +#include <app_control.h>
      + 
      +int 
      +bt_enable_operation(void)
      +{
      +   int ret = 0;
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      + 
      +   if (service == NULL) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      + 
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_BT_ENABLE);
      +
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      + 
      +   if (ret == APP_CONTROL_ERROR_NONE) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to launch!\n");
      +
      +      return 0;
      +   } 
      +   else 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to launch!\n");
      +
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + +

      Showing Bluetooth Settings to Configure Visibility

      + +

      To launch the Bluetooth setting application to allow the user to configure the visibility of the device, use the APP_CONTROL_OPERATION_SETTING_BT_VISIBILITY operation.

      + +

      Showing location settings

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SETTING_BT_VISIBILITY

      + + +

      Example Code

      +
      +#include <app_control.h>
      + 
      +int 
      +bt_visibility_operation(void)
      +{
      +   int ret = 0;
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      + 
      +   if (service == NULL) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      + 
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_BT_VISIBILITY);
      +
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      + 
      +   if (ret == APP_CONTROL_ERROR_NONE) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to launch!\n");
      +
      +      return 0;
      +   } 
      +   else 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to launch!\n");
      +
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + +

      Settings for Location

      + +

      Showing Location Settings

      + +

      To launch the location setting application to allow the user to configure the source of the location information, use the APP_CONTROL_OPERATION_SETTING_LOCATION operation.

      +

      If the location service is not active when an application tries to use the Location Manager (in mobile or wearable applications) or Geolocation APIs, an error occurs. To solve the problem, the application can try to launch the location setting application to let the user enable the location service. The user can activate the GPS, network positioning using the Wi-Fi Positioning System (WPS) and cellular network, or both.

      +

      Figure: Showing location settings

      +

      Showing location settings

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SETTING_LOCATION

      + + +

      Example Code

      +
      +int 
      +location_setting(void)
      +{
      +   int ret = 0;
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      + 
      +   if (service == NULL) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      + 
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_LOCATION);
      +
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      + 
      +   if (ret == APP_CONTROL_ERROR_NONE) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to launch location settings!\n");
      +
      +      return 0;
      +   } 
      +   else 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to launch location settings!\\n");
      +
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + +

      Settings for NFC

      + +

      Showing NFC Settings

      + +

      To launch the NFC setting application to allow the user to activate or deactivate NFC, use the APP_CONTROL_OPERATION_SETTING_NFC operation.

      +

      Figure: Showing NFC settings

      +

      Showing NFC settings

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SETTING_NFC

      + + +

      Example Code

      +
      +#include <app_control.h>
      +#include <dlog.h>
      +
      +int 
      +nfc_setting(void)
      +{
      +   int ret = 0;
      +
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      +   
      +   if (service == NULL)
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +	  
      +      return -1;
      +   }
      +   
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_NFC);
      +
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      +   
      +   if (ret == APP_CONTROL_ERROR_NONE)
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to launch NFC settings app!\n");
      +	  
      +      return 0;
      +   }
      +   else
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to launch NFC settings app!\n");
      +	  
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + +

      Settings for Wi-Fi

      + +

      Showing Wi-Fi Settings

      + +

      To launch the Wi-Fi setting application to allow the user to activate and configure (or deactivate) Wi-Fi connections, use the APP_CONTROL_OPERATION_SETTING_WIFI operation.

      +

      Figure: Showing Wi-Fi settings

      +

      Showing Wi-Fi settings

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SETTING_WIFI

      + + +

      Example Code

      +
      +int 
      +wifi_launch_operation(void)
      +{
      +   int ret = 0;
      +   app_control_h service = NULL;
      +	
      +   ret = app_control_create(&service);
      +	 
      +   if (ret != APP_CONTROL_ERROR_NONE || service == NULL) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      +	
      +   app_control_set_operation(service,  APP_CONTROL_OPERATION_SETTING_WIFI);
      +
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      +	   
      +   if (ret != APP_CONTROL_ERROR_NONE) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to launch Wi-Fi setting application");
      +
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + +

      System Settings

      + +

      Showing System Settings

      + +

      To display various setting menus for, for example, Connections, Devices, and System Information, use the APP_CONTROL_OPERATION_SETTING operation.

      +

      Figure: Showing system settings

      +

      Showing system settings

      + +

      Operation

      +

      APP_CONTROL_OPERATION_SETTING

      + + +

      Example Code

      +
      +int 
      +launch_setting(void)
      +{
      +   int ret = 0;
      +   app_control_h service = NULL;
      +   app_control_create(&service);
      + 
      +   if (service == NULL) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to create app control handler");
      +
      +      return -1;
      +   }
      + 
      +   app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING);
      +
      +   ret = app_control_send_launch_request(service, NULL, NULL);
      +   app_control_destroy(service);
      + 
      +   if (ret == APP_CONTROL_ERROR_NONE) 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Succeeded to launch settings!\n");
      +
      +      return 0;
      +   } 
      +   else 
      +   {
      +      dlog_print(DLOG_INFO, LOG_TAG, "Failed to launch settings!\\n");
      +
      +      return -1;
      +   }
      +
      +   return 0;
      +}
      +
      + + + + + + + + +
      + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/app/data_control_n.htm b/org.tizen.guides/html/native/app/data_control_n.htm index 8adbb73..e61b8a1 100644 --- a/org.tizen.guides/html/native/app/data_control_n.htm +++ b/org.tizen.guides/html/native/app/data_control_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -40,9 +40,6 @@

      Data Control

      Data control is a standard mechanism for exchanging specific data between applications.

      -

      Figure: Data control mechanism

      -

      Data control mechanism

      -

      All applications can request data shared by other applications using a data control. However, only service applications can provide their own data.

      There are 2 types of data controls:

      • DATA_CONTROL_SQL @@ -62,6 +59,9 @@

        Format:

        • Data ID consists of one or more components, separated by a slash ("/") character.
      + +

      Figure: Data control mechanism

      +

      Data control mechanism

      Using Data Controls

      You can get a datacontrol_h instance from the datacontrol_map_create() or datacontrol_sql_create() function.

      diff --git a/org.tizen.guides/html/native/app/event_n.htm b/org.tizen.guides/html/native/app/event_n.htm new file mode 100644 index 0000000..e39ddd7 --- /dev/null +++ b/org.tizen.guides/html/native/app/event_n.htm @@ -0,0 +1,384 @@ + + + + + + + + + + + + + Event + + + + + +
      + +

      Event

      + +

      The application can broadcast its own events to all listeners, and subscribe to events. The events can be either predefined system events from the platform (only platform modules can broadcast system events) or user-defined events (broadcast by UI and service applications).

      + +

      The main features of the Event API are:

      +
        +
      • Event publication +

        To publish an event, use the event_publish_app_event() and event_publish_trusted_app_event() functions. The event_publish_trusted_app_event() function publishes a trusted event which can only be received by the application that has the same signature as the publishing application.

        +
      • + +
      • Event subscription +

        To subscribe to an event, use the event_add_event_handler() function. When no longer needed, unsubscribe the event with the event_remove_event_handler() function.

        +
      • + +
      • Launch-On-Events +

        Service applications can be launched when a desired target event occurs.

        +

        To register an interest in a Launch-On-Event, define the http://tizen.org/appcontrol/operation/launch_on_event operation in the tizen-manifest.xml file.

        + +

        The following table shows the system events that support Launch-On-Event.

        + + + + + + + + + + + + + + + + + + + + + + + + + +
        + Table: System events supporting Launch-On-Event +
        NameCondition
        tizen.system.event.battery_charger_statusWhen the charger state is "connected".
        tizen.system.event.usb_statusWhen the USB state is "connected".
        tizen.system.event.earjack_statusWhen the earjack status is "connected".
        tizen.system.event.incoming_msgWhen the msg_type and msg_id exist.
        +
      • +
      + +

      The following table lists the platform event types.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + Table: Platform event types +
      ModuleCategoryEvent nameEvent dataNotes
      KeyValue
      capi-system-devicebatterytizen.system.event.battery_charger_statusbattery_charger_status"disconnected" +

      "connected"

      +

      "charging"

      +
      tizen.system.event.battery_level_statusbattery_level_status"empty" +

      "critical"

      +

      "low"

      +

      "high"

      +

      "full"

      +
      empty (0~1%) +

      critical (2~5%)

      +

      low (6~15%)

      +

      high (16~95%)

      +

      full (96~100%)

      +
      devicedusbtizen.system.event.usb_statususb_status"disconnected" +

      "connected"

      +

      "available"

      +
      "connected" means that the cable is connected but USB communication is not available.
      earjacktizen.system.event.earjack_statusearjack_status"disconnected" +

      "connected"

      +
      displaytizen.system.event.display_statedisplay_state"normal" +

      "dim"

      +

      "off"

      +
      systemdsystemtizen.system.event.boot_completedboot_completed"true" +

      => send "true" only

      +
      tizen.system.event.system_shutdownsystem_shutdown"true" +

      => send "true" only

      +
      "true": go to shutdown
      resourcedram memorytizen.system.event.low_memorylow_memory"normal" +

      "soft_warning"

      +

      "hard_warning"

      +
      networkconnectivitytizen.system.event.wifi_statewifi_state"deactivated" +

      "disconnected"

      +

      "connected"

      +
      tizen.system.event.bt_statebt_state"on" +

      "off"

      +
      bt_le_state"on" +

      "off"

      +
      bt_transfering_state"non_transfering" +

      "transfering"

      +
      libslp-locationlocationtizen.system.event.location_enable_statelocation_enable_state"disabled" +

      "enabled"

      +
      gps_enable_state"disabled" +

      "enabled"

      +
      nps_enable_state"disabled" +

      "enabled"

      +
      msg-servicemessagetizen.system.event.incoming_msgmsg_type"sms" +

      "push"

      +

      "cb"

      +
      msg_idString of the unsigned int type value. +
      alarm-managertimetizen.system.event.time_changedtime_changed"true" +

      => send "true" only

      +
      settingtimetizen.system.event.time_zonetime_zoneThe value of this key is the time zone value of the time zone database, for example, "Asia/Seoul", "America/New_York". For more information, see the IANA Time Zone Database. +
      localetizen.system.event.hour_formathour_format"12" +

      "24"

      +
      tizen.system.event.language_setlanguage_setThe value of this key is full name of locale, for example, ko_KR.UTF8 in case of Korean and en_US.UTF8 in case of American English. For more information, see the Linux locale information. +
      tizen.system.event.region_formatregion_formatThe value of this key is the full name of the locale, for example, ko_KR.UTF8 in case of the Korean region format and en_US.UTF8 in case of the USA region format. For more information, see the Linux locale information. +
      soundtizen.system.event.silent_modesilent_mode"on" +

      "off"

      +
      vibrationtizen.system.event.vibration_statevibration_state"on" +

      "off"

      +
      screentizen.system.event.screen_autorotate_statescreen_autorotate_state"on" +

      "off"

      +
      mobiletizen.system.event.mobile_data_statemobile_data_state"on" +

      "off"

      +
      tizen.system.event.data_roaming_statedata_roaming_state"on" +

      "off"

      +
      fonttizen.system.event.font_setfont_setThe value of this key is the font name of the string type by font-config. +
      + + + + + + +
      + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/app/internationalization_n.htm b/org.tizen.guides/html/native/app/internationalization_n.htm new file mode 100644 index 0000000..4b0e451 --- /dev/null +++ b/org.tizen.guides/html/native/app/internationalization_n.htm @@ -0,0 +1,293 @@ + + + + + + + + + + + + + Internationalization + + + + + +
      +

      Internationalization

      + +

      Tizen provides localized resources to make your application usable for different countries. The localization is based on the Internationalization API (in mobile and wearable applications), which makes strings translatable and places them in .po (portable object) files.

      + + + + + + + + + + +
      Note

      The .po files must be placed in the res/po directory of the application. The files can be edited using the PO File Editor provided by the Tizen SDK.

      + +

      Depending on the device's locale information, your application must load the proper resource set. If no matching resource set is found for the device's current locale, the default resource set is used.

      + +

      To get the localized value of a string, use the MsgID shown in the PO File Editor, prefaced with an underscore _ (for example, _(<MsgID>)). The underlying implementation calls the i18n_get_text() function to retrieve the localized value:

      + +
      +char *hello_text = i18n_get_text("Hello");
      +
      +

      The hello_text variable is set to the localized text for "Hello" for the current locale of the device.

      +

      When you change the language setting on the device, the text changes in the application according to the current language.

      + +

      Marking Text Parts as Translatable

      +

      The most common way to use a translation involves the following APIs:

      + +
      +elm_object_translatable_text_set(Evas_Object *obj, const char *text)
      +elm_object_item_translatable_text_set(Elm_Object_Item *it, const char *text)
      +
      + +

      They set the untranslated string for the "default" part of the given Evas_Object or Elm_Object_Item and mark the string as translatable.

      + +

      Similar functions are available if you wish to set the text for a part that is not "default":

      + +
      +elm_object_translatable_part_text_set(Evas_Object *obj, const char *part, const char *text)
      +elm_object_item_translatable_part_text_set(Elm_Object_Item *it, const char *part, const char *text)
      +
      + +

      It is important to provide the untranslated string to these functions, because the EFLs trigger the translation themselves and re-translate the strings automatically, if the system language changes.

      + + +

      Translating Texts Directly

      + +

      The approach described in the previous section is not applicable all of the time. For instance, it does not work if you are populating a genlist, if you need plurals in the translation or if you want to do something else than put the translation in elementary UI components.

      + +

      It is possible to retrieve the translation for a given text through the i18n_get_text() function from app_i18n.h.

      + +
      +char *i18n_get_text(const char *msgid);
      +
      + +

      This function takes as input a string (that is copied to an msgid field in the .po files) and returns the translation (the corresponding msgstr field).

      + + + + + + + + + + +
      Note
      Do not modify or free the return value of these functions. They are statically allocated.
      + +

      When giving the text for a genlist item, you can use it in a similar manner as in the example below.

      + +
      +#include "app_i18n.h"
      +static char *_genlist_text_get(void *data, Evas_Object *obj, const char *part)
      +{
      +   return strdup(i18n_get_text("Some Text"));
      +}
      +
      + +

      Plurals

      +

      Plurals are handled through the ngettext() function. Its prototype is shown below.

      + +
      +char *ngettext(const char *msgid, const char *msgid_plural, unsigned long int n);
      +
      + +
        +
      • msgid is the same as before, that is, the untranslated string
      • +
      • msgid_plural is the plural form of msgid
      • +
      • the quantity (in English, 1 is singular and anything else is plural)
      • +
      + +

      A matching fr.po file contains the following lines.

      + +
      +msgid "%d Comment"
      +msgid_plural "%d Comments"
      +msgstr[0] "%d commentaire"
      +msgstr[1] "%d commentaires"
      +
      + +

      Several Plurals

      +

      It is possible to have several plural forms. For instance, the .po file for Polish could contain the following lines.

      + +
      +msgid "%d Comment"
      +msgid_plural "%d Comments"
      +msgstr[0] "%d Komentarz"
      +msgstr[1] "%d Komentarze"
      +msgstr[2] "%d Komentarzy"
      +
      + +

      The index values after msgstr are defined in system-wide settings. The ones for Polish are given below:

      + +
      +"Plural-Forms: nplurals = 3; plural = n = = 1 ? 0 : n%10> = 2 && n%10< = 4 && (n%100<10 | | n%100> = 20) ? 1 : 2;\n"
      +
      + +

      There are three forms (including singular). The index is 0 (singular), if the given integer n is 1. Then, if (n % 10 >= 2 && % 10 <= 4 && (n % 100 < 10 | | n % 100 >= 20), the index is 1, otherwise it is 2.

      + +

      Handling Language Changes at Runtime

      + +

      The user can change the system language settings at any time. When that is done, the framework notifies the application, which changes the language used in the Elementary. The UI components receive a "language,changed" signal and reset their text.

      + +

      This is how to handle the framework event:

      + +
      +static void
      +_app_language_changed(void *data)
      +{
      +   char *language;
      +   // Retrieve the current system language
      +   system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language);
      +   // Set the language in elementary
      +   elm_language_set(language);
      +   free(language);
      +}
      +int
      +main(int argc, char *argv[])
      +{
      +   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, _app_language_changed, &ad);
      +}
      +
      + +

      The call to elm_language_set() above triggers the emission of the "language,changed" signal, which is handled the same way as the typical smart event signals.

      + +

      Extracting Messages for Translation

      + +

      The xgettext tool extracts strings to translate to a .pot file (po template), while msgmerge maintains the existing .po files. The typical workflow is as follows:

      +
        +
      • run xgettext once; it generates a .pot file
      • +
      • when adding a new translation, copy the .pot file to <locale>.po and translate that file
      • +
      • new runs of xgettext update the existing .pot file and msgmerge updates the .po files
      • +
      + +

      The following example is a typical call to xgettext.

      + +
      +xgettext --directory = src --output-dir = res/po --keyword = _ --keyword = N_ --keyword = elm_object_translatable_text_set:2 --keyword = elm_object_item_translatable_text_set:2 --add-comments = --from-code = utf-8 --foreign-use
      +
      + +

      This extracts all strings that are used inside the _() function (as an optional short-hand for i18n_get_text()), use UTF-8 as the encoding and add the comments right before the strings to the output files).

      + +

      The following example is a typical call to msgmerge.

      + +
      +msgmerge --width=120 --update res/po/fr.po res/po/ref.pot
      +
      + +

      Internationalization Tips

      + +

      Do Not Make Assumptions about Languages

      + +

      Languages vary greatly and even if you knew several of them, do not assume there is any common logic to them.

      + +

      For example, with English typography, no character must appear before colons and semicolons (':' and ';'). However, with French typography, there must be "espace fine insécable", that is, a non-breakable space (HTML's &nbsp;) that is narrower that regular spaces.

      + +

      This prevents proper translation in the following construct:

      + +
      +snprintf(buf, some_size, "%s: %s", i18n_get_text(error), i18n_get_text(reason));
      +
      + +

      The correct way to translate it is to use a single string and let the translators manage the punctuation. This means translating the format string instead:

      + +
      +snprintf(buf, some_size, i18n_get_text("%s: %s"), i18n_get_text(error), i18n_get_text(reason));
      +
      + +

      It is not always possible, but aim for this unless a specific issue arises.

      + +

      Translations Are of Different Lengths

      +

      Depending on the language, the translation has a different length on screen. In some cases, a language has a shorter construct than another, while the situation is reversed in another case; a language may have a word for a specific concept, while another does not and requires a circumlocution (designating something by using several words).

      + +

      For Source Control, Do Not Commit .po If Only Line Indicators Have Changed

      + +

      From the example above, a translation block looks like:

      + +
      +#: some_file.c:43 another_file.c:41
      +msgid "Click Here"
      +msgstr "Cliquez ici"
      +
      + +

      In case you insert a new line at the top of "some_file.c", the line indicator changes to look like this:

      + +
      +#: some_file.c:44 another_file.c:41
      +
      + +

      Obviously, on non-trivial projects, such changes often happen. If you use source control and commit such changes even though no actual translation change has happened, each commit probably contains a change to .po files. This hampers readability of the change history, and in case several people are working in parallel and need to merge their changes, this creates huge merge conflicts each time.

      + +

      Only commit changes to .po files when there are actual translation changes, not because line comments have changed.

      + +

      Using _() as Shorthand to the i18n_get_text() Function

      + +

      Since calling i18n_get_text() may often happen, it is abbreviated to _(). The Tizen SDK provides this abbreviation by default.

      + +

      Proper Sorting: strcoll()

      +

      There is a string comparison tailored for sorting data for display: strcoll(). It works the same way as strcmp() but sorts the data according to the current locale settings.

      + +
      +int strcmp(const char *s1, const char *s2);
      +int strcoll(const char *s1, const char *s2);
      +
      + +

      The function prototype is a standard one and indicates how to order strings. A detailed explanation is out of scope for this guide, but use the strcoll() function as the comparison function for sorting the data set you are using.

      + +

      Working with Translators

      +

      The system described above is a common one and is likely to be known to translators, meaning that giving its name (gettext) may be enough to explain how it works. In addition to this documentation, there is extensive additional documentation as well as questions and answers on the topic in the Internet.

      + +

      Do not hesitate to put comments in your code above the strings to be translated, since they can be extracted along with the strings and saved in the .po files for the translator to see them.

      + + + +
      + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/app/message_port_n.htm b/org.tizen.guides/html/native/app/message_port_n.htm index 4197041..5ae8669 100644 --- a/org.tizen.guides/html/native/app/message_port_n.htm +++ b/org.tizen.guides/html/native/app/message_port_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      diff --git a/org.tizen.guides/html/native/app/notification_n.htm b/org.tizen.guides/html/native/app/notification_n.htm index 223c61d..2e1f9c0 100644 --- a/org.tizen.guides/html/native/app/notification_n.htm +++ b/org.tizen.guides/html/native/app/notification_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -48,14 +48,15 @@

      Notification Types

      Tizen provides notifications by using a combination of any of the following notification types:

      -
        -
      • Quick panel
      • -
      • Active notification
      • +
        • Quick panel
        • +
        • Active notification
        • Indicator
        -

        You can specify the message for the indicator or quick panel, active notification.

        -

        Notifications on quick panel

        +

        You can specify the message for the quick panel, active notification, or indicator.

        + +

        Notifications on the Quick Panel

        +

        The display area for quick panel notifications can be one of the following:

        • Notification area

          The notification area is the reserved space for displaying all notifications, except the on-going notifications.

        • @@ -65,13 +66,13 @@

          Figure: Notification and on-going areas

          Notification and on-going areas

          -

          Active Notification

          -

          Active notification can be used to show a notification on upper side of screen.

          -

          You can add several buttons for getting user interaction.

          +

          Active Notifications

          +

          Active notifications can be used to show a notification on the upper side of the screen.

          +

          You can add several buttons for user interaction.

          Figure: Active notification

          Active notification

          - +

          Notification Layouts

          The following notification layouts are provided:

          • NOTIFICATION_LY_NOTI_EVENT_SINGLE @@ -87,7 +88,7 @@

            Figure: Notification layouts

            Notification layouts

            - + diff --git a/org.tizen.guides/html/native/app/package_n.htm b/org.tizen.guides/html/native/app/package_n.htm index a4192be..2671335 100644 --- a/org.tizen.guides/html/native/app/package_n.htm +++ b/org.tizen.guides/html/native/app/package_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/app/service_app_n.htm b/org.tizen.guides/html/native/app/service_app_n.htm index d7aad3e..e3a1323 100644 --- a/org.tizen.guides/html/native/app/service_app_n.htm +++ b/org.tizen.guides/html/native/app/service_app_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            @@ -159,8 +159,8 @@ Note - This attribute is not supported in Tizen wearable devices. Since Tizen 2.4, this attribute is not supported in all Tizen devices. Hence, the auto-restart attribute used on the lower than 2.4 API version package shall ignored on the devices with Tizen platform version 2.4 or higher. - + This attribute is not supported in Tizen wearable devices. Since Tizen 2.4, this attribute is not supported in all Tizen devices. Because of this, the auto-restart attribute used in a lower API version package than 2.4 is ignored in the devices with the Tizen platform version 2.4 or higher. +
          • on-boot @@ -171,8 +171,8 @@ Note - This attribute is not supported in Tizen wearable devices. Since Tizen 2.4, this attribute is not supported in all Tizen devices. Hence, the on-boot attribute used on the lower than 2.4 API version package shall ignored on the devices with Tizen platform version 2.4 or higher. - + This attribute is not supported in Tizen wearable devices. Since Tizen 2.4, this attribute is not supported in all Tizen devices. Because of this, the on-boot attribute used in a lower API version package than 2.4 is ignored in the devices with the Tizen platform version 2.4 or higher. +
          @@ -254,4 +254,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/shortcut_n.htm b/org.tizen.guides/html/native/app/shortcut_n.htm index c0fdfb2..e9d8d43 100644 --- a/org.tizen.guides/html/native/app/shortcut_n.htm +++ b/org.tizen.guides/html/native/app/shortcut_n.htm @@ -16,7 +16,7 @@ @@ -33,19 +34,13 @@

          You can add your shortcut for the Home application. The Tizen Shortcut API requires the http://tizen.org/privilege/shortcut privilege.

          - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          To use the shortcut feature:

          -
          • To add a shortcut, use the shortcut_add_to_home() function, which requests the Home application to add a new shortcut.
          • +

            To add a shortcut, use the shortcut_add_to_home() function, which requests the Home application to add a new shortcut.

            +

            Figure: Shortcuts

            +

            Shortcuts

            +

            There are 2 types of shortcuts:

            +
              +
            • LAUNCH_BY_APP: Creates a shortcut to launch an application by a given application ID.
            • +
            • LAUNCH_BY_URI: Creates a shortcut to launch an application by a given URI. The URI is passed to the app_control_set_uri() function. For example, if you want to create a shortcut to open an image file, set the uri with file:///home/myhome/Photos/1_photo.jpg.
            diff --git a/org.tizen.guides/html/native/app/watch_n.htm b/org.tizen.guides/html/native/app/watch_n.htm index 2f0e86c..b443d73 100644 --- a/org.tizen.guides/html/native/app/watch_n.htm +++ b/org.tizen.guides/html/native/app/watch_n.htm @@ -16,7 +16,7 @@
            -

            Wearable native

            +

            Wearable native

            @@ -38,16 +38,7 @@

            Watch Application

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

            - - - - - - - - - -
            Note
            This feature is supported in wearable applications only.
            +

            This feature is supported in wearable applications only.

            The main features of the Watch Application API include:

              diff --git a/org.tizen.guides/html/native/app/widget_n.htm b/org.tizen.guides/html/native/app/widget_n.htm index 4417f4e..58cb66b 100644 --- a/org.tizen.guides/html/native/app/widget_n.htm +++ b/org.tizen.guides/html/native/app/widget_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/base/base_guide_n.htm b/org.tizen.guides/html/native/base/base_guide_n.htm index fd4f83a..dbf8cda 100644 --- a/org.tizen.guides/html/native/base/base_guide_n.htm +++ b/org.tizen.guides/html/native/base/base_guide_n.htm @@ -18,7 +18,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/base/i18n_n.htm b/org.tizen.guides/html/native/base/i18n_n.htm index 2446296..046360b 100644 --- a/org.tizen.guides/html/native/base/i18n_n.htm +++ b/org.tizen.guides/html/native/base/i18n_n.htm @@ -18,7 +18,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              @@ -74,7 +74,7 @@

              When computing a Udate from the time fields, 2 special circumstances can arise. The information can be insufficient to compute the Udate (you have only the year and the month, but not the day of the month), or the information can be inconsistent (such as "Tuesday, July 15, 1996" even though July 15, 1996 is actually a Monday).

                -
              • Insufficient information

                The calendar uses the default information to specify the missing fields. This can vary by calendar: for the Gregorian calendar, the default for a field is the same as that of the start of the epoch, such as I18N_UCALENDAR_YEAR = 1970, I18N_UCALENDAR_ MONTH = JANUARY, I18N_UCALENDAR_ DATE = 1.

              • +
              • Insufficient information

                The calendar uses the default information to specify the missing fields. This can vary by calendar: for the Gregorian calendar, the default for a field is the same as that of the start of the epoch, such as I18N_UCALENDAR_YEAR = 1970, I18N_UCALENDAR_MONTH = JANUARY, I18N_UCALENDAR_DATE = 1.

              • Inconsistent information

                If the fields conflict, the calendar prefers the most recently set fields. For example, when determining the day, the calendar looks for one of the following field combinations listed in the following table. The most recent combination, as determined by the most recently set single field, is used.

              @@ -129,6 +129,100 @@

              For more information, see About the Unicode Character Database and ICU User Guide chapter on Properties.

              +

              The following table describes the details of script codes that you can get using the i18n_uchar_get_int_property_value() function. +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + Table: Script codes +
              ValueCodeEnglish nameValueCodeEnglish name
              0 Zyyy Code for undetermined script 80 Latf Latin (Fraktur variant)
              1 Zinh Code for inherited script 81 Latg Latin (Gaelic variant)
              2 Arab Arabic 82 Lepc Lepcha (Rong)
              3 Armn Armenian 83 Lina LinearA
              4 Beng Bengali 84 Mand Mandaic, Mandaean
              5 Bopo Bopomofo 85 Maya Mayan hieroglyphs
              6 Cher Cherokee 86 Mero Meroitic hieroglyphs
              7 Copt Coptic 87 Nkoo N’Ko
              8 Cyrl Cyrillic 88 Orkh Old Turkic, Orkhon Runic
              9 Dsrt Deseret (Mormon) 89 Perm Old Permic
              10 Deva Devanagari (Nagari) 90 Phag Phags-pa
              11 Ethi Ethiopic (Geʻez) 91 Phnx Phoenician
              12 Geor Georgian (Mkhedruli) 92 Plrd Miao (Pollard)
              13 Goth Gothic 93 Roro Rongorongo
              14 Grek Greek 94 Sara Sarati
              15 Gujr Gujarati 95 Syre Syriac (Estrangelo variant)
              16 Guru Gurmukhi 96 Syrj Syriac (Western variant)
              17 Hani Han (Hanzi, Kanji, Hanja) 97 Syrn Syriac (Eastern variant)
              18 Hang Hangul (HangÅ­l, Hangeul) 98 Teng Tengwar
              19 Hebr Hebrew 99 Vaii Vai
              20 Hira Hiragana 100 Visp Visible Speech
              21 Knda Kannada 101 Xsux Cuneiform, Sumero-Akkadian
              22 Kana Katakana 102 Zxxx Code for unwritten documents
              23 Khmr Khmer 103 Zzzz Code for uncoded script
              24 Laoo Lao 104 Cari Carian
              25 Latn Latin 105 Jpan Japanese (alias for Han+Hiragana+Katakana)
              26 Mlym Malayalam 106 Lana TaiTham (Lanna)
              27 Mong Mongolian 107 Lyci Lycian
              28 Mymr Myanmar (Burmese) 108 Lydi Lydian
              29 Ogam Ogham 109 Olck Ol Chiki (Ol Cemet’, Ol Santali)
              30 Ital Old Italic (Etruscan, Oscan) 110 Rjng Rejang (Redjang, Kaganga)
              31 Orya Oriya 111 Saur Saurashtra
              32 Runr Runic 112 Sgnw SignWriting
              33 Sinh Sinhala 113 Sund Sundanese
              34 Syrc Syriac 114 Moon Moon (Mooncode, Moonscript, Moontype)
              35 Taml Tamil 115 Mtei Meitei Mayek (Meithei, Meetei)
              36 Telu Telugu 116 Armi Imperial Aramaic
              37 Thaa Thaana 117 Avst Avestan
              38 Thai Thai 118 Cakm Chakma
              39 Tibt Tibetan 119 Kore Korean (alias for Hangul+Han)
              40 Cans Unified Canadian Aboriginal Syllabics 120 Kthi Kaithi
              41 Yiii Yi 121 Mani Manichaean
              42 Tglg Tagalog (Baybayin, Alibata) 122 Phli Inscriptional Pahlavi
              43 Hano Hanunoo (Hanunoo) 123 Phlp Psalter Pahlavi
              44 Buhd Buhid 124 Phlv Book Pahlavi
              45 Tagb Tagbanwa 125 Prti Inscriptional Parthian
              46 Brai Braille 126 Samr Samaritan
              47 Cprt Cypriot 127 Tavt TaiViet
              48 Limb Limbu 128 Zmth Mathematical notation
              49 Linb LinearB 129 Zsym Symbols
              50 Osma Osmanya 130 Bamu Bamum
              51 Shaw Shavian (Shaw) 131 Lisu Lisu (Fraser)
              52 Tale TaiLe 132 Nkgb Nakhi Geba ('Na-'Khi ²Ggŏ-¹baw, Naxi Geba)
              53 Ugar Ugaritic 133 Sarb Old South Arabian
              54 Hrkt Japanese syllabaries (alias for Hiragana+Katakana) 134 Bass BassaVah
              55 Bugi Buginese 135 Dupl Duployan shorthand, Duployan stenography
              56 Glag Glagolitic 136 Elba Elbasan
              57 Khar Kharoshthi 137 Gran Grantha
              58 Sylo Syloti Nagri 138 Kpel Kpelle
              59 Talu New Tai Lue 139 Loma Loma
              60 Tfng Tifinagh (Berber) 140 Mend Mende Kikakui
              61 Xpeo Old Persian 141 Merc Meroitic Cursive
              62 Bali Balinese 142 Narb Old North Arabian (Ancient North Arabian)
              63 Batk Batak 143 Nbat Nabataean
              64 Blis Blissymbols 144 Palm Palmyrene
              65 Brah Brahmi 145 Sind Khudawadi, Sindhi
              66 Cham Cham 146 Wara Warang Citi (Varang Kshiti)
              67 Cirt Cirth 147 Afak Afaka
              68 Cyrs Cyrillic (Old Church Slavonic variant) 148 Jurc Jurchen
              69 Egyd Egyptian demotic 149 Mroo Mro, Mru
              70 Egyh Egyptian hieratic 150 Nshu Nushu
              71 Egyp Egyptian hieroglyphs 151 Shrd Sharada, Śāradā
              72 Geok Khutsuri (Asomtavruli and Nuskhuri) 152 Sora Sora Sompeng
              73 Hans Han (Simplified variant) 153 Takr Takri, Ṭākrī, Ṭāṅkrī
              74 Hant Han (Traditional variant) 154 Tang Tangut
              75 Hmng Pahawh Hmong 155 Wole Woleai
              76 Hung Old Hungarian (Hungarian Runic) 156 Hluw Anatolian hieroglyphs (Luwian hieroglyphs, Hittite hieroglyphs)
              77 Inds Indus (Harappan) 157 Khoj Khojki
              78 Java Javanese 158 Tirh Tirhuta
              79 Kali KayahLi -1 Invalid code
              + +

              Ucollator

              The Ucollator API (in mobile and wearable applications) performs locale-sensitive string comparison. It builds searching and sorting routines for natural language text and provides correct sorting orders for most supported locales. If specific data for a locale is not available, the order eventually falls back to the CLDR root sort order. The sorting order can be customized by providing your own set of rules. For more information, see the ICU Collation Customization section of the User Guide.

              @@ -210,7 +304,7 @@

              The Unumber API (in mobile and wearable applications) helps you to format and parse numbers for any locale. Your code can be completely independent of the locale conventions for decimal points, thousands-separators, or even the particular decimal digits used, or whether the number format is even decimal. There are different number format styles like decimal, currency, percent and spellout.

              Usearch

              -

              The Usearch API (in mobile and wearable applications) provides language-sensitive text searching based on the comparison rules defined in a Ucollator data struct.

              +

              The Usearch API (in mobile and wearable applications) provides language-sensitive text searching based on the comparison rules defined in a Ucollator data struct. This ensures that language eccentricity can be handled. For example, for the German collator, characters ß and SS are matched if case is chosen to be ignored. That is why it can be important to pass a locale when creating the usearch with the i18n_usearch_create_new() function.

              Uset

              Uset is a mutable set of Unicode characters and multicharacter strings. The sets represent character classes used in regular expressions. A character specifies a subset of the Unicode code points. The legal code points are U+0000 to U+10FFFF, inclusive.

              diff --git a/org.tizen.guides/html/native/content/content_guide_n.htm b/org.tizen.guides/html/native/content/content_guide_n.htm index 68b8e75..559c4b2 100644 --- a/org.tizen.guides/html/native/content/content_guide_n.htm +++ b/org.tizen.guides/html/native/content/content_guide_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/content/download_n.htm b/org.tizen.guides/html/native/content/download_n.htm index e85e247..0e853e8 100644 --- a/org.tizen.guides/html/native/content/download_n.htm +++ b/org.tizen.guides/html/native/content/download_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native

              +

              Mobile native

              @@ -38,16 +38,7 @@

              Download

              You can create and manage one or more download requests. Tizen allows you to create a new download process, configure the download URL or destination, and launch the process.

              - - - - - - - - - -
              Note
              This feature is supported in mobile applications only.
              +

              This feature is supported in mobile applications only.

              Download States

              diff --git a/org.tizen.guides/html/native/content/media_content_n.htm b/org.tizen.guides/html/native/content/media_content_n.htm index f739372..4e016bb 100644 --- a/org.tizen.guides/html/native/content/media_content_n.htm +++ b/org.tizen.guides/html/native/content/media_content_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/content/mime_type_n.htm b/org.tizen.guides/html/native/content/mime_type_n.htm index 5c37a57..0f62f66 100644 --- a/org.tizen.guides/html/native/content/mime_type_n.htm +++ b/org.tizen.guides/html/native/content/mime_type_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/context/activity_recognition_n.htm b/org.tizen.guides/html/native/context/activity_recognition_n.htm index 0c24403..2bd3d82 100644 --- a/org.tizen.guides/html/native/context/activity_recognition_n.htm +++ b/org.tizen.guides/html/native/context/activity_recognition_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/context/context_guide_n.htm b/org.tizen.guides/html/native/context/context_guide_n.htm index e51fe3f..be7ba1d 100644 --- a/org.tizen.guides/html/native/context/context_guide_n.htm +++ b/org.tizen.guides/html/native/context/context_guide_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              diff --git a/org.tizen.guides/html/native/context/gesture_recognition_n.htm b/org.tizen.guides/html/native/context/gesture_recognition_n.htm index 1b38559..1c4fd54 100644 --- a/org.tizen.guides/html/native/context/gesture_recognition_n.htm +++ b/org.tizen.guides/html/native/context/gesture_recognition_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              @@ -36,17 +36,6 @@

              With gesture recognition, you can receive notifications about different device movement patterns, identify device states, and trigger events when the sensor data meets predefined conditions. In some cases, you can also listen to different states (started, in-progress, and ended).

              - - - - - - - - - -
              Note
              You can test the gesture recognition functionality only on a target device. The Emulator does not support this feature.
              -

              The following gesture events are supported in Tizen devices:

                @@ -99,6 +88,17 @@

                Wrist-up event

              + + + + + + + + + +
              Note
              You can test the gesture recognition functionality only on a target device. The Emulator does not support this feature.
              +
              diff --git a/org.tizen.guides/html/native/context/history_n.htm b/org.tizen.guides/html/native/context/history_n.htm index 4c17180..5932043 100644 --- a/org.tizen.guides/html/native/context/history_n.htm +++ b/org.tizen.guides/html/native/context/history_n.htm @@ -16,7 +16,7 @@
              -

              Mobile native

              +

              Mobile native

              @@ -39,16 +39,7 @@

              The Tizen platform collects data on the device usage. Based on this data, the applications can take advantage of the user's application usage patterns through statistical analysis.

              - - - - - - - - - -
              Note
              This feature is supported in mobile applications only.
              +

              This feature is supported in mobile applications only.

              The Contextual History API provides history data about application usage, media playback, communications, and device settings. When an application reads each type of history data, the application can set filters to specify the necessary statistics. The following example shows how to get information about the 5 most frequently used applications from the last 30 days.

              diff --git a/org.tizen.guides/html/native/context/trigger_n.htm b/org.tizen.guides/html/native/context/trigger_n.htm
              index 00c6560..8b4916d 100644
              --- a/org.tizen.guides/html/native/context/trigger_n.htm
              +++ b/org.tizen.guides/html/native/context/trigger_n.htm
              @@ -16,7 +16,7 @@
               
               
              -

              Mobile native

              +

              Mobile native

              @@ -39,18 +39,9 @@

              Tizen enables you to define rules as a combination of a contextual event, conditions, and an action. When the rule is enabled, the system starts to monitor the device status or user activities corresponding to the event defined in the rule. When the event is detected, the conditions are evaluated, and if the conditions are met, the action is triggered.

              - - - - - - - - - -
              Note
              This feature is supported in mobile applications only.
              +

              This feature is supported in mobile applications only.

              -

              The action can be an application launching request using an App Control, or a notification posting. For example, every day at 10:00 PM, if the battery level is low, the application can post a notification to remind the user to charge the battery.

              +

              The action can be an application launching request using an App Control, or a notification posting. For example, every day at 10:00 PM, if the battery level is low, the application can post a notification to remind the user to charge the battery.

              The main features of the Contextual Trigger API include:

              @@ -85,7 +76,7 @@
            • Condition

              A condition denotes a contextual state or fact that can be recognized by the device. For example, the current device status or the historical pattern of the device usage can be used as conditions. In a rule, the application can define 1 condition, multiple conditions, or even no condition. If you define multiple conditions in a rule, the application can choose the way of combining the conditions using logical conjunctions or disjunctions. In case of the logical conjunction, the rule is true only if all the conditions are met. Otherwise, the rule can be true if at least 1 condition is met. If no condition is given, the rule is satisfied instantly when the corresponding event occurs.

            • Action -

              An action is triggered when the rule is satisfied. Each rule must basically contain 1 action only. However, because the action itself can be defined as an App Control, if necessary, you can implement an application that executes a series of tasks to create a complex context-aware service.

            +

            An action is triggered when the rule is satisfied. Each rule must basically contain 1 action only. However, because the action itself can be defined as an App Control, if necessary, you can implement an application that executes a series of tasks to create a complex context-aware service.

          The following figure illustrates the rule components and their relations.

          @@ -565,7 +556,7 @@ context_trigger_rule_entry_add_comparison_int(time_condition, CONTEXT_TRIGGER_TI
          • Application launch request: -

            The contextual trigger allows you to set an App Control as an action. You can utilize the app control functionalities by developing an application with the corresponding app controls to execute a series of tasks when a rule is satisfied.

          • +

            The contextual trigger allows you to set an App Control as an action. You can utilize the app control functionalities by developing an application with the corresponding app controls to execute a series of tasks when a rule is satisfied.

          • Notification posting:

            A basic form of notification can be set as an action. A notification can contain a title, content body text, an icon, and an app control to be executed. For more information, see the Notification guide.

          diff --git a/org.tizen.guides/html/native/graphics/cairo_n.htm b/org.tizen.guides/html/native/graphics/cairo_n.htm index a49f437..9cd2a42 100644 --- a/org.tizen.guides/html/native/graphics/cairo_n.htm +++ b/org.tizen.guides/html/native/graphics/cairo_n.htm @@ -16,7 +16,7 @@
          -

          Mobile native Wearable native

          +

          Mobile native Wearable native

          diff --git a/org.tizen.guides/html/native/graphics/graphics_guide_n.htm b/org.tizen.guides/html/native/graphics/graphics_guide_n.htm index d84feb9..50e1a42 100644 --- a/org.tizen.guides/html/native/graphics/graphics_guide_n.htm +++ b/org.tizen.guides/html/native/graphics/graphics_guide_n.htm @@ -16,7 +16,7 @@
          -

          Mobile native Wearable native

          +

          Mobile native Wearable native

          @@ -38,6 +38,7 @@
        • OpenGL ES

          Enables you to create OpenGL ES applications in Tizen with the EGL layer.

        • TBM Surface

          Provides Tizen Buffer Manager (TBM) surface functions for the graphic buffer in Tizen.

        • Cairo

          Allows you to use Cairo to draw on the image surface and Evas objects to get the image data.

        • +
        • Hardware Acceleration

          Allows you to enable hardware acceleration to increase rendering performance and use OpenGL ES.

        diff --git a/org.tizen.guides/html/native/graphics/hw_acceleration_n.htm b/org.tizen.guides/html/native/graphics/hw_acceleration_n.htm new file mode 100644 index 0000000..960390e --- /dev/null +++ b/org.tizen.guides/html/native/graphics/hw_acceleration_n.htm @@ -0,0 +1,92 @@ + + + + + + + + + + + + + Hardware Acceleration + + + +
        +
        + +
        +
        +

        Mobile native Wearable native

        +
        + +

        Hardware Acceleration

        + +

        Tizen supports hardware acceleration since Tizen 2.3.1. If hardware acceleration is enabled, it increases rendering performance and allows you to use OpenGL ES.

        + +

        You can enable hardware acceleration in the tizen-manifest file, using the manifest editor's Advanced tab.

        + +

        Figure: Hardware acceleration option

        +

        Hardware acceleration option

        + +

        In the tizen-manifest file, the option is shows as follows:

        +
        +<ui-application appid="example" hw-acceleration="on">
        +
        + +

        The possible values are on (enabled) and off (disabled). If the value is not defined, the default system policy determines whether the hardware acceleration is enabled.

        + +

        Normally, it is enough to modify the manifest file to enable hardware acceleration. In the following special cases, however, additional actions are required:

        + +
        • OpenGL ES application +

          In addition to enabling hardware acceleration in the manifest file, you must also call the elm_config_accel_preference_set() function before creating an elm window.

          + +

          In an indirect rendering mode:

          +
          +elm_config_accel_preference_set("opengl");
          +win = elm_win_util_standard_add(name, "OpenGL example");
          +
          +

          This function and option are supported since Tizen 2.3.

          + +

          In a direct rendering mode, if you want to use depth and stencil buffers or multisample, you have to specify them in the elm_config_accel_preference_set() function:

          +
          +elm_config_accel_preference_set("opengl:depth24:stencil8:msaa_high");
          +win = elm_win_util_standard_add(name, "OpenGL example");
          +
          +

          In the above example, the depth buffer size is 24 bit, stencil buffer size is 8 bit and MSAA is on with a high bit.

          +

          These special options are supported since Tizen 2.3.1. For more information, see OpenGL ES Tutorial.

          +
        • +
        • EFL WebKit (EWK) application +

          In addition to enabling hardware acceleration in the manifest file, you must also call the elm_config_accel_preference_set() function before creating an elm window. Because EWK uses a 24-bit depth buffer and a 8-bit stencil buffer, you must also specify them in the elm_config_accel_preference_set() function:

          +
          +elm_config_accel_preference_set("opengl:depth24:stencil8");
          +win = elm_win_util_standard_add(name, "EWK example");
          +
          +

          These special options are supported since Tizen 2.3.1. For more information, see Web Tutorial.

          +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/graphics/opengles_n.htm b/org.tizen.guides/html/native/graphics/opengles_n.htm index 2c62eea..84c2860 100644 --- a/org.tizen.guides/html/native/graphics/opengles_n.htm +++ b/org.tizen.guides/html/native/graphics/opengles_n.htm @@ -16,7 +16,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        @@ -48,7 +48,7 @@

        OpenGL ES in Tizen

        -

        Building an OpenGL ES application in Tizen requires knowledge about designing UI applications with EFL.

        +

        Building an OpenGL ES application in Tizen requires knowledge about designing UI applications with EFL.

        Tizen native applications do not depend on the Window system, because the Window system is an internal Tizen module, which can be enhanced or replaced. EFL provides a method that draws the OpenGL ES content and encapsulates the EGL and the native Window system.

        @@ -73,28 +73,26 @@

        GLView is a simple Elementary UI component that sets up an OpenGL ES target surface and a context, and allows you to embed it in any Tizen application. GLView is basically a wrapper around EvasGL, the OpenGL ES/EGL abstraction layer of EFL.

        -

        To create a basic application:

        +

        Creating a Basic Application

        -

        First, you can declare the global variable using ELEMENTARY_GLVIEW_GLOBAL_DEFINE(), then create a GLView object and use ELEMENTARY_GLVIEW_GLOBAL_USE(glview). These macro help that you can call GL functions directly. Now, you can call GL functions. If you want to know that detail, refer Elementary_GL_Helpers.h, please.

        +

        Declare the global variable using the ELEMENTARY_GLVIEW_GLOBAL_DEFINE() function. Create a GLView object and use the ELEMENTARY_GLVIEW_GLOBAL_USE(glview) function. These macros help you to call the GL functions directly.

        +

        Now, you can call the GL functions. For more detailed information, see the Elementary_GL_Helpers.h file.

         #include <app.h>
         #include <Elementary_GL_Helpers.h>
         
        -/*
        - * This code to place at the beginning of any function using GLES 2.0 APIs.
        - * When using this macro, developers can then call all glFunctions without changing their code.
        - * If you want to know that detail, refer Elementary_GL_Helpers.h.
        - */
        +// This code is to be placed at the beginning of any function using GLES 2.0 APIs
        +// When using this macro, you can call all glFunctions without changing their code
        +// For details, see Elementary_GL_Helpers.h
         
         ELEMENTARY_GLVIEW_GLOBAL_DEFINE()
         
          -
        1. HW acceleration
        2. -

          To develop a GL application, you have to call elm_config_accel_preference_set before creating a window. It makes an application to use GPU. This function is supported since Tizen 2.3.

          -

          To use the Direct Rendering mode of EvasGL or EFL WebKit(EWK), you have to set the same option values (depth, stencil and MSAA) to a rendering engine and a GLView object. EWK's options are depth24 and stencil8. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function and to a GLView object using the elm_glview_mode_set() function. If the GLView object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled or abnormal rendering occurs. These special options will be supported since Tizen 2.3.1.

          - +
        3. Manage HW acceleration. +

          To develop a GL application, call the elm_config_accel_preference_set() function before creating a window. This makes an application to use GPU. The function is supported since Tizen 2.3.

          +

          To use the Direct Rendering mode of EvasGL or EFL WebKit (EWK), set the same option values (depth, stencil, and MSAA) to a rendering engine and a GLView object. The EWK options are depth24 and stencil8. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function and to a GLView object using the elm_glview_mode_set() function. If the GLView object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled or abnormal rendering occurs. These special options are supported since Tizen 2.3.1.

           static bool app_create(void *data) 
          @@ -104,19 +102,17 @@ static bool app_create(void *data)
              ad->win = elm_win_util_standard_add("GLView example", "GLView example");
              evas_object_show(ad->win);
              ad->glview = ad->glview_create(ad->win);
          -/*
          - * This macro will set the global variable holding the GL API,
          - * so that it's available to the application.
          - * It should be used right after setting up the GL context object.
          - * If you want to know that detail, refer Elementary_GL_Helpers.h
          - */
          +
          +   // This macro sets the global variable holding the GL API,
          +   // so that it is available to the application
          +   // Use it right after setting up the GL context object
          +   // For details, see Elementary_GL_Helpers.h
              ELEMENTARY_GLVIEW_GLOBAL_USE(ad->glview);
              glview_start(ad->glview);
           
              return true;
          -}
          - -
        4. Add the OpenGL ES view to the application
        5. +}
    +
  • Add the OpenGL ES view to the application:
     // This is the GL initialization function
    @@ -147,7 +143,7 @@ static Evas_Object *glview_create(Evas_Object *win)
     
        return glview;
     }
    - +
  • Setting up the Callbacks

    @@ -170,8 +166,7 @@ static void init_gl(Evas_Object *glview) }
  • Callback for resizing -

    The resize callback is called whenever the GLView component is resized. A common action to take here is to reset the viewport. Because GLView size can be changed by a parent container, you should set a resize callback and should reset viewport size with new GLView size. -

    +

    The resize callback is called whenever the GLView component is resized. A common action to take here is to reset the viewport. Because the GLView size can be changed by a parent container, you must set a resize callback and reset the viewport size with the new GLView size.

     // GLView resize function
    @@ -215,7 +210,7 @@ static void del_gl(Evas_Object *glview)
     }
  • Add an animator. -

    The application above is technically working but the scene does not get updated unless the frame is marked as such. Games might want to use an animator to have a regular update of the scene. Here is an example for a default update refresh rate:

    +

    The application above is technically working but the scene does not get updated unless the frame is marked as such. Games sometimes want to use an animator to have a regular update of the scene. Here is an example for a default update refresh rate:

     static Eina_Bool anim_cb(void *data)
    @@ -260,7 +255,8 @@ static void glview_start(Evas_Object *glview)
     
     
     Evas_GL *evgl = elm_glview_evas_gl_get(glview);
    -// Then it is possible to call any evas_gl function with it, for example:
    +// Then it is possible to call any evas_gl function with it +
    @@ -278,17 +274,17 @@ Evas_GL *evgl = elm_glview_evas_gl_get(glview);

    This guide assumes that the application uses EvasGL directly instead of using the GLView. (If the application uses a GLView, EvasGL is created internally.)

    -

    First, you can declare the global variable using EVAS_GL_GLOBAL_GLES2_DEFINE(), then create a EvasGL and use EVAS_GL_GLOBAL_GLES2_USE(evasgl, evasgl’s context). It is similar to the GLView’s macro. These macro help that you can call GL functions directly. Now, you can call GL functions. If you want to know that detail, refer Evas_GL_GLES2_Helpers.h.

    +

    First, you can declare the global variable using the EVAS_GL_GLOBAL_GLES2_DEFINE() macro. Then, create an EvasGL and use EVAS_GL_GLOBAL_GLES2_USE(evasgl, evasgl context). This is similar to the GLView macro. Both macros help you to call GL functions directly.

    + +

    Now, you can call GL functions. For more detailed information, see the Evas_GL_GLES2_Helpers.h file.

     #include <app.h>
     #include <Evas_GL_GLES2_Helpers.h>
    -...
    -/*
    - * This code to place at the beginning of any function using GLES 2.0 APIs.
    - * When using this macro, developers can then call all glFunctions without changing their code
    - * If you want to know that detail, refer Evas_GL_GLES2_Helpers.h.
    - */
    +
    +// This code is to be placed at the beginning of any function using GLES 2.0 APIs
    +// When using this macro, you can call all glFunctions without changing their code
    +// For details, see Evas_GL_GLES2_Helpers.h
     EVAS_GL_GLOBAL_GLES2_DEFINE();
     
    @@ -307,6 +303,8 @@ typedef struct appdata    Evas_GL_Context *ctx;    Evas_GL_Surface *sfc;    Evas_GL_Config *cfg; +   Evas_Coord sfc_w; +   Evas_Coord sfc_h;    unsigned int program;    unsigned int vtx_shader; @@ -315,46 +313,43 @@ typedef struct appdata } appdata_s;
      -
    • Evas_Object *win: Application window.
    • -
    • Evas_Object *img: OpenGL ES canvas.
    • -
    • Evas_GL *evasgl: EvasGL Object for rendering gl in Evas.
    • -
    • Evas_GL_API *glapi: EvasGL API object that contains the GL APIs to be used in Evas GL.
    • -
    • Evas_GL_Context *ctx: EvasGL Context object, a GL rendering context in Evas GL.
    • -
    • Evas_GL_Surface *sfc: EvasGL Surface object, a GL rendering target in Evas GL.
    • -
    • Evas_GL_Config *cfg: EvasGL Surface configuration object for surface creation.
    • +
    • Evas_Object *win: Application window.
    • +
    • Evas_Object *img: OpenGL ES canvas.
    • +
    • Evas_GL *evasgl: EvasGL Object for rendering gl in Evas.
    • +
    • Evas_GL_API *glapi: EvasGL API object that contains the GL APIs to be used in Evas GL.
    • +
    • Evas_GL_Context *ctx: EvasGL Context object, a GL rendering context in Evas GL.
    • +
    • Evas_GL_Surface *sfc: EvasGL Surface object, a GL rendering target in Evas GL.
    • +
    • Evas_GL_Config *cfg: EvasGL Surface configuration object for surface creation.
    -

    Creating Elm window and EvasGL

    +

    Creating the Elm Window and EvasGL

    +

    To create the Elm window and EvasGL:

      -
    1. - HW acceleration -

      To develop a GL application, you have to call elm_config_accel_preference_set() before creating a window. It makes an application to use GPU. This function is supported since Tizen 2.3.

      -

      To use the Direct Rendering mode of EvasGL or EFL WebKit (EWK), you have to set the same option values (depth, stencil, and MSAA) to a rendering engine and a GLView object. EWK’s options are depth24 and stencil8. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function and to a GLView object using the elm_glview_mode_set() function. If the GLView object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled or abnormal rendering occurs. These Special options will be supported since Tizen 2.3.1.

      +
    2. Manage HW acceleration. +

      To develop a GL application, call the elm_config_accel_preference_set() function before creating a window. THis makes an application to use GPU. The function is supported since Tizen 2.3.

      +

      To use the Direct Rendering mode of EvasGL, set the same option values (depth, stencil, and MSAA) to a rendering engine and a Evas_GL_Surface object. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function and to a Evas_GL_Surface object using the Evas_GL_Config object. If the Evas_GL_Config object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled or abnormal rendering occurs. These special options are supported since Tizen 2.3.1.

       Evas_Object *win;
      -/*
      - * To use OpenGL ES, the application should turn on hardware acceleration
      - * To enable that, elm_config_accel_preference_set() with "opengl&quat;
      - * should be called before createing Elm window
      - * This function is supported since 2.3.
      - */
      +
      +// To use OpenGL ES, the application must switch on hardware acceleration
      +// To enable that, call elm_config_accel_preference_set() with "opengl&quat;
      +// before creating the Elm window
      +// This function is supported since 2.3.
       elm_config_accel_preference_set("opengl");
      -/* Creating Elm Window */
      +// Creating Elm window
       ad->win = elm_win_util_standard_add("Evas_GL Example", "Evas_GL Example");
       
      -

      We can create our EvasGL handler using evas_gl_new(Evas * e). This initializer takes the Evas canvas that OpenGL ES is to be used on as a parameter. When developing an application with Elementary, we can use the canvas of our window:

      - -
      ad->evasgl = evas_gl_new(evas_object_evas_get(ad->win));
      - -

      To free the memory allocated to this handler, use evas_gl_free(Evas_GL *evas_gl).

      -
    3. +

      You can create your EvasGL handler using the evas_gl_new(Evas * e) function. This initializer takes as a parameter the Evas canvas on which OpenGL ES is to be used. When developing an application with Elementary, use the canvas of your window:

      +
      ad->evasgl = evas_gl_new(evas_object_evas_get(ad->win));
      -
    4. Creating a Surface +

      To free the memory allocated to this handler, use the evas_gl_free(Evas_GL *evas_gl) function.

      +
    5. +
    6. Create a surface. -

      We must allocate a new config object to fill it out using evas_gl_config_new(). As long as Evas creates a config object for the user, it takes care of the backward compatibility issue. Once we have our config object, we can specify the surface settings:

      +

      You must allocate a new config object to fill the surface out using the evas_gl_config_new() function. As long as Evas creates a config object for the user, it takes care of the backward compatibility issue. Once you have your config object, you can specify the surface settings:

       appdata_s *ad;
      @@ -365,7 +360,7 @@ ad->cfg->stencil_bits = EVAS_GL_STENCIL_NONE; // Surface Stencil Format
       ad->cfg->options_bits = EVAS_GL_OPTIONS_NONE; // Configuration options (here, no extra options)
       
      -

      Once we have configured the surface behavior, we must initialize the surface using evas_gl_surface_create(Evas_GL* evas_gl, Evas_GL_Config * cfg, int w, int h). This function takes the given Evas_GL object as the first parameter and the pixel format, and configuration of the rendering surface as the second parameter. The last two parameters are the width and height of the surface, which we recover directly from the window.

      +

      Once we have configured the surface behavior, we must initialize the surface using evas_gl_surface_create(Evas_GL* evas_gl, Evas_GL_Config * cfg, int w, int h). This function takes the given Evas_GL object as the first parameter and the pixel format, and configuration of the rendering surface as the second parameter. The last two parameters are the width and height of the surface, which we recover directly from the window.

       Evas_Coord w, h;
      @@ -373,37 +368,36 @@ evas_object_geometry_get(ad->win, NULL, NULL, &w, &h);
       ad->sfc = evas_gl_surface_create(ad->evasgl, ad->cfg, w, h);
       
      -

      To manually delete a GL surface, use evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf).

      -
    7. +

      To manually delete a GL surface, use the evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf) function.

      -
    8. Creating a Context +
    9. Create a context. -

      Here, we create a context for Evas_GL using evas_gl_context_create(Evas_GL * evas_gl, Evas_GL_Context * share_ctx). You can merge the context with a higher context definition you must pass as a second parameter.

      +

      Create a context for Evas_GL using the evas_gl_context_create(Evas_GL * evas_gl, Evas_GL_Context * share_ctx) function. You can merge the context with a higher context definition you must pass as a second parameter.

       ad->ctx = evas_gl_context_create(ad->evasgl, NULL);
      -/*
      - * This macro will set the global variable holding the GL API,
      - * so that it's available to the application.
      - * It should be used right after setting up the GL context object.
      - * If you want to know that detail, refer Evas_GL_GLES2_Helpers.h.
      - */
      -EVAS_GL_GLOBAL_GLES2_USE(ad->evasgl, ad->ctx);
      +
      +// This macro sets the global variable holding the GL API,
      +// so that it is available to the application
      +// Use it right after setting up the GL context object
      +// For details, see Evas_GL_GLES2_Helpers.h
      +EVAS_GL_GLOBAL_GLES2_USE(ad->evasgl, ad->ctx);
       
      -

      To delete the context later, use evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx). To delete the entire configuration object, use evas_gl_config_free(Evas_GL_Config *cfg) instead.

      -
    10. +

      To delete the context later, use the evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx) function. To delete the entire configuration object, use the evas_gl_config_free(Evas_GL_Config *cfg) function instead.

      +

    Getting OpenGL ES APIs

    -

    If you want to get the API of OpenGL ES, You can get the API for rendering OpenGL ES with evas_gl_api_get(Evas_GL *evas_gl_). This function returns a structure that contains all the OpenGL ES functions you can use to render in Evas. These functions consist of all the standard OpenGL ES 2.0 functions and any extra ones Evas has decided to provide in addition. If you have your code ported to OpenGL ES 2.0, it is easy to render to Evas. (OpenGL ES 3.0 will be supported in the next Tizen version.)

    +

    If you want to get the API of OpenGL ES, you can get the API for rendering OpenGL ES with the evas_gl_api_get(Evas_GL *evas_gl_)function. This function returns a structure that contains all the OpenGL ES functions you can use to render in Evas. These functions consist of all the standard OpenGL ES 2.0 functions and any extra ones Evas has decided to provide in addition. If you have your code ported to OpenGL ES 2.0, it is easy to render to Evas. (OpenGL ES 3.0 is supported in the next Tizen version.)

    -

    If you already use global macro as a EVAS_GL_GLOBAL_GLES2_XXX, you need not get the APIs.

    +

    If you already use a global macro, such as EVAS_GL_GLOBAL_GLES2_XXX, you need not get the APIs.

     ad->glapi = evas_gl_api_get(ad->evasgl);
    +

    Callbacks

    Now that we have configured the EvasGL environment, we declare a UI component in which all the OpenGL ES transformation takes place. In the example below, we selected the image component because it provides callbacks that allow us to play with the mouse events and coordinates, and we set up an image object that inherits the size of the parent window.

    @@ -427,6 +421,8 @@ img_pixels_get_cb(void *data, Evas_Object *obj)    // Rendering process    evas_gl_make_current(ad->evasgl, ad->sfc, ad->ctx); +   // Because the surface size can be changed, set the viewport in this callback +   gl->glViewport(0, 0, ad->sfc_w, ad->sfc_h);    // Paint it blue    gl->glClearColor(0.2, 0.2, 0.6, 1.0);    gl->glClear(GL_COLOR_BUFFER_BIT); @@ -450,7 +446,7 @@ animate_cb(void *data) ecore_animator_add(animate_cb, ad->img); -

    You can define several other callbacks that have an impact on the drawing depending on the mouse, resize, and deletion events. Because window size can be changed, you should set a resize callback of a window. You should recreate a Evas_GL_Surface in the resize callback and should reset viewport size with new window size.

    +

    You can define several other callbacks that have an impact on the drawing depending on the mouse, resize, and deletion events.

     evas_object_event_callback_add(ad->img, EVAS_CALLBACK_DEL, img_del_cb, ad);
    @@ -459,6 +455,37 @@ evas_object_event_callback_add(ad->img, EVAS_CALLBACK_MOUSE_UP, mouse_up_cb,
     evas_object_event_callback_add(ad->img, EVAS_CALLBACK_MOUSE_MOVE, mouse_move_cb, ad);
     evas_object_event_callback_add(ad->win, EVAS_CALLBACK_RESIZE, win_resize_cb, ad);
    +

    Because the window size can be changed, you must set a resize callback for the window. In addition, you must recreate an Evas_GL_Surface in the resize callback and reset the viewport size with the new window size:

    + +
    +static void
    +win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
    +{
    +   appdata_s *ad = data;
    +
    +   if (ad->sfc)
    +   {
    +      evas_object_image_native_surface_set(ad->img, NULL);
    +      evas_gl_surface_destroy(ad->evasgl, ad->sfc);
    +      ad->sfc = NULL;
    +   }
    +
    +   evas_object_geometry_get(obj, NULL, NULL, &ad->sfc_w, &ad->sfc_h);
    +   evas_object_image_size_set(ad->img, ad->sfc_w, ad->sfc_h);
    +   evas_object_resize(ad->img, ad->sfc_w, ad->sfc_h);
    +   evas_object_show(ad->img);
    +
    +   if (!ad->sfc)
    +   {
    +      Evas_Native_Surface ns;
    +
    +      ad->sfc = evas_gl_surface_create(ad->evasgl, ad->cfg, ad->sfc_w, ad->sfc_h);
    +      evas_gl_native_surface_get(ad->evasgl, ad->sfc, &ns);
    +      evas_object_image_native_surface_set(ad->img, &ns);
    +      evas_object_image_pixels_dirty_set(ad->img, EINA_TRUE);
    +   }
    +}
    +

    Setting a Surface into the Image Object

    We can also fill in the native Surface information from the given EvasGL surface. For example, to adapt the surface to the target image when the size of the canvas changes, use the following code.

    @@ -467,6 +494,7 @@ evas_object_event_callback_add(ad->win, EVAS_CALLBACK_RESIZE, win_resize_cb, Evas_Native_Surface ns; evas_gl_native_surface_get(ad->evasgl, ad->sfc, &ns); evas_object_image_native_surface_set(ad->img, &ns); + diff --git a/org.tizen.guides/html/native/graphics/tbm_n.htm b/org.tizen.guides/html/native/graphics/tbm_n.htm index f3cb78d..4a0706e 100644 --- a/org.tizen.guides/html/native/graphics/tbm_n.htm +++ b/org.tizen.guides/html/native/graphics/tbm_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/guides_n.htm b/org.tizen.guides/html/native/guides_n.htm index 08e1cdf..2accf72 100644 --- a/org.tizen.guides/html/native/guides_n.htm +++ b/org.tizen.guides/html/native/guides_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Related Info

    @@ -38,8 +38,10 @@

    Select the API domain you are interested in and see what Tizen offers for your application:

      +
    • Migration Guide +

      Enables you to make your application conform to Tizen 2.4 regarding to the application Framework APIs.

    • Account -

      Enables you to manage account information, such as receive sync operation notifications, and obtain an access token by using the oauth2 authorization.

    • +

      Enables you to manage account information, such as receive sync operation notifications, and obtain an access token by using the OAuth 2.0 authorization.

    • Application Framework

      Enables you to configure application properties, and manage application data, and runtime environment and behavior.

    • Base @@ -73,12 +75,6 @@
    • Web

      Enables you to access Web content.

    - -

    For information about features not implemented by a specific API:

    -
      -
    • Porting in mobile applications only -

      Enables you to port your current 2.2.1 native API-based applications to the new 2.3 native API.

    • -
    diff --git a/org.tizen.guides/html/native/location/geofence_n.htm b/org.tizen.guides/html/native/location/geofence_n.htm index 53c48ae..3c72e31 100644 --- a/org.tizen.guides/html/native/location/geofence_n.htm +++ b/org.tizen.guides/html/native/location/geofence_n.htm @@ -15,7 +15,7 @@
    -

    Mobile native

    +

    Mobile native

    @@ -37,16 +37,7 @@

    Geofence

    A geofence is a virtual perimeter for a real-world geographic area. A geofence is defined by either a geopoint with a radius in case of geopoint geofences, or a MAC address in case of Wi-Fi and Bluetooth geofences. The geofence feature alerts the user when the geofence state changes (the user crosses the perimeter).

    -
    - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    +

    This feature is supported in mobile applications only.

    The main geofence features are:

      diff --git a/org.tizen.guides/html/native/location/location_guide_n.htm b/org.tizen.guides/html/native/location/location_guide_n.htm index 59cd731..d060813 100644 --- a/org.tizen.guides/html/native/location/location_guide_n.htm +++ b/org.tizen.guides/html/native/location/location_guide_n.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -39,6 +39,8 @@
      • Location

        Provides the geographical location of the device.

      • +
      • Maps Service +

        Allows you to create and use the maps services, such as geocoder, place searching, and routing.

      @@ -46,8 +48,6 @@
      • Geofence

        Allows you to create and use geofences.

      • -
      • Maps Service -

        Allows you to create and use the maps services, such as geocoder, place searching, and routing.

      diff --git a/org.tizen.guides/html/native/location/location_n.htm b/org.tizen.guides/html/native/location/location_n.htm index dd614cb..42b9f4a 100644 --- a/org.tizen.guides/html/native/location/location_n.htm +++ b/org.tizen.guides/html/native/location/location_n.htm @@ -16,15 +16,15 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      Related Info

        @@ -40,15 +40,15 @@

        Location

        -

        Location information has a geographical point on the Earth, and optionally location-related information can also contain information about altitude, accuracy about the geographical point and altitude, and speed and course of direction of the user. Location data features include managing location information on the device.

        +

        Location information has a geographical point on the Earth, and optionally location-related information can also contain information about altitude, accuracy about the geographical point and altitude, and the user speed and course of direction. Location data features include managing location information on the device.

        The main location features are:

        - + @@ -63,41 +63,43 @@

        Location Manager

        -

        The Location Manager API (in mobile and wearable applications) provides the current location using the location sources specified in the location method.

        -

        Using the Location Manager allows your application to:

        +

        The Location Manager API (in mobile and wearable applications) provides the current location using the location sources specified in the location method.

        +

        With the Location Manager, you can:

        • Get the current location
        • Get the last known location
        • Get location updates

        Asynchronous location-related updates and region monitoring notifications are implemented with callback interfaces (functions whose names end with "cb").

        -

        You can use the location state and updates as follows:

        +

        You can use the location state and updates as follows:

        • If the Location Manager is working correctly, the location state is set to LOCATIONS_SERVICE_ENABLED. The device can receive notifications about location updates and accuracy changes only in this update state.

        • -
        • If the Location Manager is unable to run on the requested device due to weak radio reception, the location update state is set to LOCATIONS_SERVICE_DISABLED (LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE). If this situation persists for a longer period, it is recommended to stop the service and try again to conserve the device battery.

        • +
        • If the Location Manager is unable to run on the requested device due to weak radio reception, the location update state is set to LOCATIONS_SERVICE_DISABLED (LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE). If this situation persists for a longer period, it is recommended to stop the service and try again to conserve the device battery.

        • If the user revokes a permission for the application to use location information, the location update state is set to LOCATIONS_ACCESS_STATE_DENIED, and the Location Manager stops all on-going services with the application. The application can request the device user for a permission to continue the stopped service.

        -

        Location Method

        -

        The location Method is used for specifying the desired quality of service of the Location Manager. For example, a location-based weather forecast application can require location-related information just to distinguish a city or a neighborhood while a GPS navigation application can require the highest quality level to pinpoint a map location. Selecting the appropriate quality level not only helps the Location Manager to run the system efficiently but also leads to a good user experience.

        -

        Using the location_method_e structure allows your application to specify the following methods of location positioning system:

        - -
          +

          Location Methods

          + +

          The location method is used to specify the desired quality of service of the Location Manager. For example, a location-based weather forecast application can require location-related information just to distinguish a city or a neighborhood, while a GPS navigation application can require the highest quality level to pinpoint a map location. Selecting the appropriate quality level not only helps the Location Manager to run the system efficiently, but also leads to a good user experience.

          +

          Using the location_method_e structure (in mobile and wearable applications) allows your application to specify the following methods of location positioning system:

          +
          • GPS, which uses the global positioning system
          • WPS, which uses the Wi-Fi positioning system
          • Hybrid, which selects the best method available at the moment
          -

          Based on the desired method, the Location Manager provides best-effort location-based services, such as an asynchronous location update or region monitoring notification.

          - -

          Location Settings

          -

          Tizen provides the user a robust way of controlling the usage of their location data through the device location settings. The following figure shows the various options for enabling or disabling specific positioning technologies.

          -

          Figure: Location setting and indicator

          -

          Location settings

          -

          The location-related functions work differently based on whether the location settings are used.

          -

          The GPS setting controls the Global Positioning System usage. It takes GPS satellite signals and provides accurate positioning services generally outdoors. The Wireless networks setting enables the usage of network-based positioning technology, which includes Wi-Fi and cell tower-based positioning, and improves the coverage of positioning services to indoors.

          -

          -

          All location settings are initially enabled, if the model is support GPS. To disable them, the user must manually toggle the buttons. The manual task required from the user is understood as an implicit user consent.

          +

          Based on the desired method, the Location Manager provides best-effort location-based services, such as an asynchronous location update or region monitoring notification.

          + +

          Location Settings

          + +

          Tizen provides a robust way of controlling the usage of the location data through the device location settings. The following figure shows the various options for enabling or disabling specific positioning technologies.

          +

          Figure: Location settings and indicator

          +

          Location settings and indicator

          + +

          The location-related functions work differently based on whether the location settings are used.

          + +

          The GPS setting controls the Global Positioning System usage. It uses GPS satellite signals and provides accurate positioning services, generally outdoors. The Wireless networks setting enables the usage of network-based positioning technology, which includes Wi-Fi and cell tower-based positioning, and improves the coverage of positioning services to indoors.

          +

          All location settings are initially enabled, if the device supports GPS. To disable them, the user must manually toggle the buttons. The manual task required from the user is understood as an implicit user consent.

          @@ -134,4 +136,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/location/maps_n.htm b/org.tizen.guides/html/native/location/maps_n.htm index 7427969..0d06578 100644 --- a/org.tizen.guides/html/native/location/maps_n.htm +++ b/org.tizen.guides/html/native/location/maps_n.htm @@ -16,7 +16,7 @@
          -

          Mobile native

          +

          Mobile native Wearable native

          @@ -34,17 +35,6 @@

          Maps Service

          Map service features include geocoding, reverse geocoding, place searching, and route calculation.

          -
          - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          -

          The main Maps Service API features are:

          • Discovering and selecting a map provider diff --git a/org.tizen.guides/html/native/messaging/email_n.htm b/org.tizen.guides/html/native/messaging/email_n.htm index 1ae9a57..1459cad 100644 --- a/org.tizen.guides/html/native/messaging/email_n.htm +++ b/org.tizen.guides/html/native/messaging/email_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native

            +

            Mobile native

            @@ -33,16 +33,7 @@

            Email

            Email is a method of exchanging digital messages. Email systems are based on a store-and-forward model, in which email server computer systems accept, forward, deliver, and store messages on behalf of users, who only need to connect to the email infrastructure, typically an email server, with a network-enabled device for the duration of a message submission or retrieval.

            - - - - - - - - - -
            Note
            This feature is supported in mobile applications only.
            +

            This feature is supported in mobile applications only.

            Email provides features for composing, saving, and sending email messages using an SMTP (SMTP used for sending emails through the Internet is described in the RFC5321/5322 standards). It provides services to applications that make use of the email service.

            diff --git a/org.tizen.guides/html/native/messaging/messages_n.htm b/org.tizen.guides/html/native/messaging/messages_n.htm index 321ab8d..ad9cc17 100644 --- a/org.tizen.guides/html/native/messaging/messages_n.htm +++ b/org.tizen.guides/html/native/messaging/messages_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/messaging/messaging_guide_n.htm b/org.tizen.guides/html/native/messaging/messaging_guide_n.htm index a4c4311..3662533 100644 --- a/org.tizen.guides/html/native/messaging/messaging_guide_n.htm +++ b/org.tizen.guides/html/native/messaging/messaging_guide_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/messaging/push_n.htm b/org.tizen.guides/html/native/messaging/push_n.htm index 0b9a195..4ca35d4 100644 --- a/org.tizen.guides/html/native/messaging/push_n.htm +++ b/org.tizen.guides/html/native/messaging/push_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            @@ -34,10 +34,9 @@

            Push

            Push enables you to push events from an application server to your application on a Tizen device.

            -

            Figure: Push messaging service

            -

            Push messaging service

            +

            Once your application is successfully registered in the push server through the push daemon on the device, your application server can send push messages to the application in that particular device.

            -

            When a push message arrives when the application is running, it is automatically delivered to the application. If not, the daemon makes a sound or vibrates and adds a ticker or a badge notification to notify the user. By touching this notification, the user can check the message. The application server may send a message with a LAUNCH option. In this case, the daemon forcibly launches the application and hands over the message to the application as an app control.

            +

            When a push message arrives when the application is running, it is automatically delivered to the application. If not, the daemon makes a sound or vibrates and adds a ticker or a badge notification to notify the user. By touching this notification, the user can check the message. The application server may send a message with a LAUNCH option. In this case, the daemon forcibly launches the application and hands over the message to the application as an app control.

            To use the push messaging service, the application needs the permission to access Tizen push server. Request the permission from the Tizen push service team by email (push.tizen@samsung.com), including the information listed in the following table. When the team approves your request, you receive a push app ID corresponding to your package ID.

            @@ -105,6 +104,9 @@ +

            Figure: Push messaging service

            +

            Push messaging service

            +

            Service Architecture

            The following figure illustrates the service architecture of the Tizen push messaging service.

            Figure: Service architecture

            diff --git a/org.tizen.guides/html/native/migration_guide_n.htm b/org.tizen.guides/html/native/migration_guide_n.htm new file mode 100644 index 0000000..6408176 --- /dev/null +++ b/org.tizen.guides/html/native/migration_guide_n.htm @@ -0,0 +1,145 @@ + + + + + + + + + + + + + Migration Guide + + + + + +
            +

            Migration Guide

            + +

            Tizen 2.4 introduces new APIs for applications and modifies the behavior of some APIs to improve the quality of the platform. The following sections define the issues you must consider to make your application conform to Tizen 2.4 Application Framework APIs.

            + +

            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.

            +

            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 APIDownload API (in mobile applications)download
            Background networkProcessing general network operations on the background (such as Sync Manager, IM, and VOIP)Sync Manager (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
            + +

            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.

            + + +

            Changes in the Alarm API for Reducing Power Consumption

            +

            Since Tizen 2.4, the Alarm API is changed to reduce the power consumption of the device:

            + +
              +
            • Alarm APIs that support exact alarms are changed to be able to launch UI applications only. While launching UI applications when the alarm expires, the framework turns the LCD display on. Because of this you must not use those Alarm APIs for background processing. You can use the alarm_schedule_after_delay() function that supports an inexact alarm for background processing.
            • +
            • The alarm_schedule_after_delay() function is changed to support an inexact alarm. You can pass a period for alarm expiration, but the platform decides when the alarm expires according to the status of the device. +

              The alarm_schedule_after_delay() function can launch service applications when it is expired. However, the target service application must specify a background category to be registered as the target application of the function.

            • +
            • Regarding the app_control parameter of the Alarm APIs, only explicit launch is allowed. You cannot pass app_control for an implicit launch because the implicit launch cannot specify the target application when it is registered.
            • +
            +

            When you migrate your application from Tizen 2.3 to Tizen 2.4, check the changes and modify your application to conform with the Tizen 2.4 Alarm APIs.

            + +

            Tizen Application Event System

            +

            Tizen 2.4 introduces new Tizen Application Event APIs for subscribing system events and publishing and subscribing application events to other applications.

            +

            Using the Tizen Application Event APIs, you can register your service application to be launched when a specified event is published. You can specify the event name through the <app-control> element in the application manifest file. This launch-on-event allows your service application to only run after receiving an event from the platform or other application. Note that UI applications cannot be launched using the launch-on-event mechanism. For more information, see the Event API (in mobile and wearable applications).

            + +

            Application Group Launching Management

            +

            When you launch an application using the app_control_send_launch_request() function, you can treat the launched application as a sub-view of your application. For example, when your application launches the message composer application to send a message, you can treat the message composer as a member of your application group. Tizen 2.4 introduces the application group feature to supports this requirement.

            +

            The application can specify a launch mode when it launches a new application with the app_control_set_launch_mode() function. The APP_CONTROL_LAUNCH_MODE_SINGLE mode means the launched application is launched in a separate group and the APP_CONTROL_LAUNCH_MODE_GROUP mode means that the launched application is included in the group of the caller application.

            +

            You can also specify whether your application supports the group mode launching. You can specify the supported launch mode of your application in the application manifest file. If you specify the launch_mode as single, your application is always launched in a separate group, even if the caller application requests the APP_CONTROL_LAUNCH_MODE_GROUP mode. If you specify the launch_mode as caller, your application is launched according to the caller application request. If you specify the mode as group, the application is included in the group of caller application.

            +

            For more information, see the Managing Application Groups guide.

            + + + + +
            + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/multimedia/audio_io_n.htm b/org.tizen.guides/html/native/multimedia/audio_io_n.htm index c01d19b..5b19ce7 100644 --- a/org.tizen.guides/html/native/multimedia/audio_io_n.htm +++ b/org.tizen.guides/html/native/multimedia/audio_io_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/multimedia/camera_n.htm b/org.tizen.guides/html/native/multimedia/camera_n.htm index d1eff57..23d8ca0 100644 --- a/org.tizen.guides/html/native/multimedia/camera_n.htm +++ b/org.tizen.guides/html/native/multimedia/camera_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/multimedia/image_util_n.htm b/org.tizen.guides/html/native/multimedia/image_util_n.htm index 519f941..57a7865 100644 --- a/org.tizen.guides/html/native/multimedia/image_util_n.htm +++ b/org.tizen.guides/html/native/multimedia/image_util_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/multimedia/media_codecs_n.htm b/org.tizen.guides/html/native/multimedia/media_codecs_n.htm index d600b8a..5150d4c 100644 --- a/org.tizen.guides/html/native/multimedia/media_codecs_n.htm +++ b/org.tizen.guides/html/native/multimedia/media_codecs_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/multimedia/media_controller_n.htm b/org.tizen.guides/html/native/multimedia/media_controller_n.htm index 8f7f645..a103043 100644 --- a/org.tizen.guides/html/native/multimedia/media_controller_n.htm +++ b/org.tizen.guides/html/native/multimedia/media_controller_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/multimedia/media_tools_n.htm b/org.tizen.guides/html/native/multimedia/media_tools_n.htm index 46fae74..12c7cb4 100644 --- a/org.tizen.guides/html/native/multimedia/media_tools_n.htm +++ b/org.tizen.guides/html/native/multimedia/media_tools_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/multimedia/media_vision_n.htm b/org.tizen.guides/html/native/multimedia/media_vision_n.htm index 0d8c846..7548996 100644 --- a/org.tizen.guides/html/native/multimedia/media_vision_n.htm +++ b/org.tizen.guides/html/native/multimedia/media_vision_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            @@ -33,7 +33,7 @@

            Media Vision

            -

            You can perceive and understand an image or to extract information from images in ypur application.

            +

            You can perceive and understand an image or to extract information from images in your application.

            The main features of Media Vision API include:

              @@ -42,30 +42,21 @@
            • Detecting barcodes

              You can detect barcodes in an image or from camera preview streams, and then decrypt them to display messages to the user.

              -

              Before detecting a barcode, you must define the following detection attribute:

              -
                -
              • Barcode detection target: +

                Before detecting a barcode, you must define the barcode detection target attribute value:

                • Detect both 1D and 2D barcodes
                • Detect 1D barcodes only
                • Detect 2D barcodes only
                -
              • -
            • Generating barcodes

              You can encrypt a given message, generate a barcode from it, and save it in a memory or as a file.

              -

              Define the barcode type:

              -

              Before generating a barcode, you must define the following generation attribute:

              -
                -
              • Barcode generation text: -
                  -
                • Generate barcode without input message
                • -
                • Generate barcode with input message (Support only 1D barcodes)
                • -
                -
              • -
              -

              and specifications:

              +

              Before generating a barcode, you must define the barcode text generation attribute value:

              +
                +
              • Generate barcode without an input message
              • +
              • Generate barcode with an input message (supports only 1D barcodes)
              • +
              +

              You must also define the following specifications:

              • Barcode type
              • QR code specification (if the QA code barcode type is used)
              • @@ -207,4 +198,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/multimedia/metadata_editor_n.htm b/org.tizen.guides/html/native/multimedia/metadata_editor_n.htm index 64d45a5..edb2b0e 100644 --- a/org.tizen.guides/html/native/multimedia/metadata_editor_n.htm +++ b/org.tizen.guides/html/native/multimedia/metadata_editor_n.htm @@ -16,7 +16,7 @@
                -

                Mobile native Wearable native

                +

                Mobile native Wearable native

                diff --git a/org.tizen.guides/html/native/multimedia/metadata_extractor_n.htm b/org.tizen.guides/html/native/multimedia/metadata_extractor_n.htm index ad6e406..3ce3d7e 100644 --- a/org.tizen.guides/html/native/multimedia/metadata_extractor_n.htm +++ b/org.tizen.guides/html/native/multimedia/metadata_extractor_n.htm @@ -16,7 +16,7 @@
                -

                Mobile native Wearable native

                +

                Mobile native Wearable native

                diff --git a/org.tizen.guides/html/native/multimedia/multimedia_guide_n.htm b/org.tizen.guides/html/native/multimedia/multimedia_guide_n.htm index c7d342a..b11f498 100644 --- a/org.tizen.guides/html/native/multimedia/multimedia_guide_n.htm +++ b/org.tizen.guides/html/native/multimedia/multimedia_guide_n.htm @@ -16,7 +16,7 @@
                -

                Mobile native Wearable native

                +

                Mobile native Wearable native

                @@ -67,7 +67,7 @@

                The following guides apply in mobile applications only:

                  -
                • Screen Mirroring Sink +
                • Screen Mirroring

                  Enables you to mirror the device screen and sound to another device wirelessly.

                • Video Util

                  Enables you to use video transcoding features, such as multi-format codec and output format.

                • diff --git a/org.tizen.guides/html/native/multimedia/player_n.htm b/org.tizen.guides/html/native/multimedia/player_n.htm index b1dbac0..033df71 100644 --- a/org.tizen.guides/html/native/multimedia/player_n.htm +++ b/org.tizen.guides/html/native/multimedia/player_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  diff --git a/org.tizen.guides/html/native/multimedia/radio_n.htm b/org.tizen.guides/html/native/multimedia/radio_n.htm index 7319310..b4224aa 100644 --- a/org.tizen.guides/html/native/multimedia/radio_n.htm +++ b/org.tizen.guides/html/native/multimedia/radio_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  diff --git a/org.tizen.guides/html/native/multimedia/recorder_n.htm b/org.tizen.guides/html/native/multimedia/recorder_n.htm index b3e54b7..509b036 100644 --- a/org.tizen.guides/html/native/multimedia/recorder_n.htm +++ b/org.tizen.guides/html/native/multimedia/recorder_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  diff --git a/org.tizen.guides/html/native/multimedia/screen_mirroring_n.htm b/org.tizen.guides/html/native/multimedia/screen_mirroring_n.htm index efe4cb9..3aeb448 100644 --- a/org.tizen.guides/html/native/multimedia/screen_mirroring_n.htm +++ b/org.tizen.guides/html/native/multimedia/screen_mirroring_n.htm @@ -10,41 +10,32 @@ - Screen Mirroring Sink + Screen Mirroring
                  -

                  Screen Mirroring Sink

                  +

                  Screen Mirroring

                  You can mirror the device screen and sound to another device wirelessly using the screen mirroring feature. It follows the Wi-Fi Display Technical Specification and supports the feature as a sink, which receives shared data from a source device that supports the Wi-Fi Display, and displays it.

                  - - - - - - - - - -
                  Note
                  This feature is supported in mobile applications only.
                  +

                  This feature is supported in mobile applications only.

                  -

                  The main features of the Screen Mirroring Sink API include:

                  +

                  The main features of the Screen Mirroring API include:

                  • Managing the connection to the screen mirroring source

                    You can connect to and disconnect from a screen mirroring source, and start, pause, and resume the screen mirroring sink.

                    diff --git a/org.tizen.guides/html/native/multimedia/sound_manager_n.htm b/org.tizen.guides/html/native/multimedia/sound_manager_n.htm index 3bee14b..a19fc91 100644 --- a/org.tizen.guides/html/native/multimedia/sound_manager_n.htm +++ b/org.tizen.guides/html/native/multimedia/sound_manager_n.htm @@ -16,7 +16,7 @@
                    -

                    Mobile native Wearable native

                    +

                    Mobile native Wearable native

                    diff --git a/org.tizen.guides/html/native/multimedia/thumbnail_util_n.htm b/org.tizen.guides/html/native/multimedia/thumbnail_util_n.htm index d3785bd..1d3c294 100644 --- a/org.tizen.guides/html/native/multimedia/thumbnail_util_n.htm +++ b/org.tizen.guides/html/native/multimedia/thumbnail_util_n.htm @@ -16,7 +16,7 @@
                    -

                    Mobile native Wearable native

                    +

                    Mobile native Wearable native

                    diff --git a/org.tizen.guides/html/native/multimedia/tone_player_n.htm b/org.tizen.guides/html/native/multimedia/tone_player_n.htm index 86089ab..dcd6e16 100644 --- a/org.tizen.guides/html/native/multimedia/tone_player_n.htm +++ b/org.tizen.guides/html/native/multimedia/tone_player_n.htm @@ -16,7 +16,7 @@
                    -

                    Mobile native Wearable native

                    +

                    Mobile native Wearable native

                    diff --git a/org.tizen.guides/html/native/multimedia/video_util_n.htm b/org.tizen.guides/html/native/multimedia/video_util_n.htm index 51f91dd..dcc35d2 100644 --- a/org.tizen.guides/html/native/multimedia/video_util_n.htm +++ b/org.tizen.guides/html/native/multimedia/video_util_n.htm @@ -16,7 +16,7 @@
                    -

                    Mobile native

                    +

                    Mobile native

                    @@ -40,16 +40,7 @@
                  • Trim

                    A trim chapter is available in the video editor.

                  - - - - - - - - - -
                  Note
                  This feature is supported in mobile applications only.
                  +

                  This feature is supported in mobile applications only.

                  The following figure shows the result of the video file size change (due to scaling and container and codec format change).

                  diff --git a/org.tizen.guides/html/native/multimedia/wav_player_n.htm b/org.tizen.guides/html/native/multimedia/wav_player_n.htm index bff16d6..7e2a128 100644 --- a/org.tizen.guides/html/native/multimedia/wav_player_n.htm +++ b/org.tizen.guides/html/native/multimedia/wav_player_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  diff --git a/org.tizen.guides/html/native/network/bluetooth_n.htm b/org.tizen.guides/html/native/network/bluetooth_n.htm index 104bc2e..335688a 100644 --- a/org.tizen.guides/html/native/network/bluetooth_n.htm +++ b/org.tizen.guides/html/native/network/bluetooth_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  @@ -55,9 +55,9 @@
                • Connecting to audio devices with Bluetooth

                  Connect to Bluetooth audio devices, such as headset, hand-free, and headphone.

                • Handling attributes with Bluetooth GATT -

                  The Bluetooth GATT API (in mobile and wearable applications) provides functions for creating/destroying GATT Client handle, discovering, reading, modifying attributes and setting/unsetting the callbackes to get notified when characeteristic value is changed at remote device.

                  -

                  As a client, you can connect to and use a specific service on the server device. Once the connection is established, the client can manage the service attributes.

                  -

                  When no longer GATT Client operations are required, unregister the callbacks and destroy GATT Client handle.

                • +

                  The Bluetooth GATT API (in mobile and wearable applications) provides functions for creating and destroying the GATT client handle, discovering, reading, and modifying attributes, and setting and releasing callbacks to be notified when characteristic values are changed at the remote device.

                  +

                  As a client, you can connect to and use a specific service on the server device. Once the connection is established, the client can manage the service attributes. When the GATT client operations are no longer required, unregister the callbacks and destroy GATT client handle.

                  +
                • Connecting to health devices with Bluetooth HDP

                  Manage connections to health devices and exchange data.

                • Connecting to devices with Bluetooth HID diff --git a/org.tizen.guides/html/native/network/connection_n.htm b/org.tizen.guides/html/native/network/connection_n.htm index 5a8141f..4b77061 100644 --- a/org.tizen.guides/html/native/network/connection_n.htm +++ b/org.tizen.guides/html/native/network/connection_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  @@ -40,17 +40,6 @@

                  The connection features enable you to create a network connection and perform various operations over the connection. The application can access connection details, such as the IP address, proxy information, gateway information, and connection statistics.

                  - - - - - - - - - -
                  Note
                  Within the Network Programming Guide, the term "network" refers to IP network connections. For information on telephony connections, see the Telephony guide.
                  -

                  Connection Manager

                  The Connection Manager API (in mobile and wearable applications) provides functions for managing data connections. It allows you to get a state of the connection interface such as Bluetooth, cellular, and Wi-Fi. It also contains functions for getting the IP address, proxy information, and gateway information.

                  diff --git a/org.tizen.guides/html/native/network/network_guide_n.htm b/org.tizen.guides/html/native/network/network_guide_n.htm index 3094b7d..28168c5 100644 --- a/org.tizen.guides/html/native/network/network_guide_n.htm +++ b/org.tizen.guides/html/native/network/network_guide_n.htm @@ -16,7 +16,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  @@ -38,7 +38,7 @@
                • Connection

                  Enables you to get information about the connected network, set up and configure network connections, and track information, such as sent and received size.

                • Bluetooth

                  Enables you to use Bluetooth functionalities, such as managing the local Bluetooth adapter, bonding, and exchanging data between Bluetooth-enabled devices.

                • NFC

                  Enables you to use Near Field Communication (NFC) functionalities, such as reading and writing tags, and emulating a smart card.

                • -
                • SmartCard

                  Enables you to access secure elements (SE) through smart card features.

                • +
                • Smartcard

                  Enables you to access secure elements (SE) through smart card features.

                • Wi-Fi

                  Enables you to connect to a Wireless Local Area Network (WLAN) and transfer data over the network.

                The following guides apply in mobile applications only:

                @@ -46,6 +46,17 @@
              • Wi-Fi Direct

                Enables you to connect to Wi-Fi Direct™ devices and manage Wi-Fi Direct™ connections.

              + + + + + + + + + +
              Note
              Within the Network guides, the term "network" refers to IP network connections. For information on telephony connections, see the Telephony guide.
              +
            diff --git a/org.tizen.guides/html/native/network/nfc_n.htm b/org.tizen.guides/html/native/network/nfc_n.htm index 041ea86..61c6d9d 100644 --- a/org.tizen.guides/html/native/network/nfc_n.htm +++ b/org.tizen.guides/html/native/network/nfc_n.htm @@ -16,7 +16,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            @@ -132,6 +132,8 @@
          + +
      diff --git a/org.tizen.guides/html/native/network/smartcard_n.htm b/org.tizen.guides/html/native/network/smartcard_n.htm index 6acc7fc..bd4ee82 100644 --- a/org.tizen.guides/html/native/network/smartcard_n.htm +++ b/org.tizen.guides/html/native/network/smartcard_n.htm @@ -10,31 +10,31 @@ - SmartCard + Smartcard
      -

      SmartCard

      +

      Smartcard

      -

      Tizen enables you to use smart card functionalities, such as accessing a secure element (SE). Before using the SmartCard API, make sure you have a secure element on the device. The smart card service allow you to open a session on an SE, open a channel to the applet in the SE, send a command to the channel, and finally receive a response to the command.

      +

      Tizen enables you to use smart card functionalities, such as accessing a secure element (SE). Before using the Smartcard API, make sure you have a secure element on the device. The smart card service allow you to open a session on an SE, open a channel to the applet in the SE, send a command to the channel, and finally receive a response to the command.

      -

      The main components of the SmartCard API include:

      +

      The main components of the Smartcard API include:

      • SE service @@ -55,12 +55,12 @@

        Figure: Smart card service architecture

        Smart card service architecture

        -

        The SmartCard API is a reference implementation of the SIMalliance Open Mobile 3.0 API specification that enables Tizen applications to communicate with secure elements. For more information, see the SimAlliance. The Tizen implementation differs from the original as follows:

        +

        The Smartcard API is a reference implementation of the SIMalliance Open Mobile 3.0 API specification that enables Tizen applications to communicate with secure elements. For more information, see the SimAlliance. The Tizen implementation differs from the original as follows:

        • Only the transport layer is provided. There is no service layer support in Tizen.
        • The "get version" function does not exist. In Tizen, version management is not performed through a function.
        • Allocation style differs dramatically. -The Open Mobile API can facilitate the memory management by calling the API twice (for an example, see section 6.3.1, Usage pattern, in the SIMalliance Open Mobile 3.0 API specification). However, Tizen SmartCard API does not follow this allocation style.
        • +The Open Mobile API can facilitate the memory management by calling the API twice (for an example, see section 6.3.1, Usage pattern, in the SIMalliance Open Mobile 3.0 API specification). However, Tizen Smartcard API does not follow this allocation style.
        • For the SE Service object management, Tizen provides functions for initialization and deinitialization.
        diff --git a/org.tizen.guides/html/native/network/wifi_direct_n.htm b/org.tizen.guides/html/native/network/wifi_direct_n.htm index d51697b..76a989d 100644 --- a/org.tizen.guides/html/native/network/wifi_direct_n.htm +++ b/org.tizen.guides/html/native/network/wifi_direct_n.htm @@ -16,7 +16,7 @@
        -

        Mobile native

        +

        Mobile native

        @@ -33,16 +33,7 @@

        Wi-Fi Direct™ (synonym for Wi-Fi P2P (Peer-to-Peer)) is a technology that allows you to find nearby Wi-Fi Direct™ devices and form a Wi-Fi Direct™ group to communicate over a peer-to-peer link without wireless access points (base stations) in the infrastructure mode.

        - - - - - - - - - -
        Note
        This feature is supported in mobile applications only.
        +

        This feature is supported in mobile applications only.

        In a Wi-Fi Direct™ group, the group owner works as an access point in the Wi-Fi infrastructure mode and the other devices join the group as clients. A group can be created either by negotiation between 2 devices or in an autonomous mode by a single group owner device. In a negotiation-based group creation, 2 devices compete based on the group owner intent value and the higher intent device becomes a group owner, while the other device becomes a group client. In an autonomous group creation, a device becomes a group owner by itself without any group client.

        diff --git a/org.tizen.guides/html/native/network/wifi_n.htm b/org.tizen.guides/html/native/network/wifi_n.htm index 8c4ab8b..43fa985 100644 --- a/org.tizen.guides/html/native/network/wifi_n.htm +++ b/org.tizen.guides/html/native/network/wifi_n.htm @@ -16,7 +16,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        diff --git a/org.tizen.guides/html/native/security/key_manager_n.htm b/org.tizen.guides/html/native/security/key_manager_n.htm index 020f0a2..b6b581a 100644 --- a/org.tizen.guides/html/native/security/key_manager_n.htm +++ b/org.tizen.guides/html/native/security/key_manager_n.htm @@ -16,7 +16,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        @@ -34,8 +34,6 @@

        The key manager provides functions to securely store keys, certificates, and sensitive data related to users and their password-protected APPs. Additionally, it provides secure cryptographic operations for non-exportable keys without revealing the key values to clients.

        -

        Figure: Key manager process

        -

        Key manager process

        A key manager stores keys, certificates, and sensitive user data in a central secure repository. The central secure repository is protected by a password.

        @@ -75,6 +73,8 @@
      +

      Figure: Key manager process

      +

      Key manager process

      The key manager provides 2 types of APIs (in mobile and wearable applications):

        diff --git a/org.tizen.guides/html/native/security/privilege_n.htm b/org.tizen.guides/html/native/security/privilege_n.htm index 17e2b55..910a7d3 100644 --- a/org.tizen.guides/html/native/security/privilege_n.htm +++ b/org.tizen.guides/html/native/security/privilege_n.htm @@ -16,7 +16,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        diff --git a/org.tizen.guides/html/native/security/security_guide_n.htm b/org.tizen.guides/html/native/security/security_guide_n.htm index ea26b3c..10acf39 100644 --- a/org.tizen.guides/html/native/security/security_guide_n.htm +++ b/org.tizen.guides/html/native/security/security_guide_n.htm @@ -16,7 +16,7 @@
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        diff --git a/org.tizen.guides/html/native/social/calendar_n.htm b/org.tizen.guides/html/native/social/calendar_n.htm index 256a2ff..c2f53ce 100644 --- a/org.tizen.guides/html/native/social/calendar_n.htm +++ b/org.tizen.guides/html/native/social/calendar_n.htm @@ -16,7 +16,7 @@

      Related Info

        @@ -44,23 +44,14 @@

        Calendar

        - +

        A calendar is a system of organizing days for social purposes. It is composed of records, such as events and todos. The records consist of subrecords, such as alarms, attendees, or extensions. For example, if an event has a recurrence rule (meaning that it happens multiple times), separate instances are generated for each time the event occurs.

        - - - - - - - - - -
        Note
        This feature is supported in mobile applications only.
        - -

        Figure: Calendar model

        +

        This feature is supported in mobile applications only.

        + +

        Figure: Calendar model

        Calendar model

        - +

        The Calendar Service supports vCalendars.

        The main features of the Calendar API include:

        @@ -87,10 +78,10 @@
      -

      The following figure illustrates the different Calendar entities and their relationships.

      +

      The following figure illustrates the different Calendar entities and their relationships.

      -

      Figure: Calendar entities

      -

      Calendar entities

      +

      Figure: Calendar entities

      +

      Calendar entities

      vCalendar supports ver1.0 (vcs) and 2.0 (ics). For more information about vCalendar, see rfc2445.

      @@ -107,30 +98,30 @@ calendar_disconnect();

      A calendar book is a placeholder for other records in the Calendar API. Every event and todo has to belong to a calendar book. There are 3 built-in calendar books, as shown in the following table.

      - +
      - - - - - - - - - - - - - - - - - - -
      Table: Calendar books -
      BookDescription
      DEFAULT_EVENT_CALENDAR_BOOK_IDEvent book
      DEFAULT_TODO_CALENDAR_BOOK_IDTodo book
      DEFAULT_BIRTHDAY_CALENDAR_BOOK_IDBirthday book
      - + + + + Book + Description + + + DEFAULT_EVENT_CALENDAR_BOOK_ID + Event book + + + DEFAULT_TODO_CALENDAR_BOOK_ID + Todo book + + + DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID + Birthday book + + + + The following code example sets a calendar book ID.
       calendar_record_h event = NULL;
      @@ -149,7 +140,7 @@ calendar_db_insert_record(event &event_id);
       calendar_record_destroy(event, true);
       
      - +

      To receive a list of existing calendar books, use the following code:

      calendar_list_h calendar_book_list = NULL;
       calendar_db_get_all_records(_calendar_calendar_book._uri, 0, 0, &calendar_book_list);
      @@ -168,115 +159,115 @@ calendar_db_add_changed_cb(_calendar_event._uri, __event_changed_cb, NULL);
  • Events and Instances

    An event record describes various properties, such as description, categories, and priority. It also contains information on when the event takes place. In a recurring event, there are more than one instance of the event. Each instance has its corresponding instance record.

    If an event is inserted with rrule (recurrence rule), alarm, and attendee, its data is saved to each database. Generated instances based on the rrule are also stored in the instance database.

    - -

    Figure: Views and databases

    -

    Views and databases

    + +

    Figure: Views and databases

    +

    Views and databases

    The following table illustrates and example of a recurring event and its instances.

    - +
    - - - - - - + Table: Event and instance example + + + + + + + +
  • Count set to 3
  • - - -
    - Table: Event and instance example -
    EventInstances
    EventInstances
    Recurrence rules:
    • Start date on 2012-10-09 (Tuesday)
    • Frequency set to WEEKLY
    • Interval set to 1
    • -
    • Count set to 3
    2012-10-09 Tuesday

    2012-10-16 Tuesday

    -

    2012-10-22 Tuesday

    +

    2012-10-22 Tuesday

    + + +

    The recurrence model in the Calendar API is compliant with the iCalendar specification. The following event properties have the same functionality as their corresponding values in iCalendar:

    - +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Table: Recurrence rules -
    Recurrence rule propertyDescription
    freqYearly, monthly, weekly, or daily
    countUntil count. If the count is 3, 3 instances are generated.
    intervalInterval is a positive integer representing how often the recurrence rule repeats
    bydayMO, TU, WE, TH, FR, SA, or SU
    bymonthdayDays of the month
    byyeardayDays of the year
    byweeknoOrdinals specifying weeks of the year
    bymonthMonths of the year
    bysetposValues which correspond to the nth occurrence within the set of events
    wkstDay on which the workweek starts
    + Table: Recurrence rules + + + + Recurrence rule property + Description + + + freq + Yearly, monthly, weekly, or daily + + + count + Until count. If the count is 3, 3 instances are generated. + + + interval + Interval is a positive integer representing how often the recurrence rule repeats + + + byday + MO, TU, WE, TH, FR, SA, or SU + + + bymonthday + Days of the month + + + byyearday + Days of the year + + + byweekno + Ordinals specifying weeks of the year + + + bymonth + Months of the year + + + bysetpos + Values which correspond to the nth occurrence within the set of events + + + wkst + Day on which the workweek starts + + +

    Exceptions

    If one of the instances of a recurring event is modified (such as its summary or date) or deleted, it is called an exception. For example, if 2nd instance date is modified from 16th to 17th, 17th is the exception.

    - +
    - - - + + + + - - - + + + + +

    2012-10-22 Tuesday

    - - -
    Table: Exception example -
    Event
    Event InstancesExceptions
    Exceptions
    Recurrence rules:
    • Start date on 2012-10-09 (Tuesday)
    • Frequency set to WEEKLY
    • Interval set to 1
    • Count set to 3
    -
    2012-10-09 Tuesday

    2012-10-16 Tuesday > modified

    -

    2012-10-22 Tuesday

    2012-10-17 Tuesday
    + + +

    To get the changes in an exception, use the calendar_db_get_changes_exception_by_version() function. The instances and exceptions are deleted together when the original event is deleted.

    @@ -285,24 +276,24 @@ calendar_db_add_changed_cb(_calendar_event._uri, __event_changed_cb, NULL);When a filter is ready, it can be set as a property of a query. Other query properties allow configuring how the returned results are grouped and sorted.

    The operator precedence in filters is determined by the order in which the conditions and filters are added. The following table shows an example of how the operator precedence works.

    - +
    - - - - - - + + + + + + + - - - +Condition C3 + + + AND
    F1
    AND
    - F2 + F2 - - -
    Table: Filter conditions -
    ConditionResult
    ConditionResult
    Condition C1
    OR
    Condition C2
    AND
    -Condition C3
    (C1 OR C2) AND C3
    (C1 OR C2) AND C3
    Filter F1:
    Condition C1
    OR
    @@ -318,47 +309,47 @@ Condition C3
    (C5 AND F1) AND F2
    -Meaning (C5 AND (C1 OR C2)) AND (C3 OR C4)
    +Meaning (C5 AND (C1 OR C2)) AND (C3 OR C4) + + +

    The following code creates a filter, accepting events with high priority or those that include the word "meeting" in their description.

    calendar_filter_h filter = NULL;
    -
    + 
     // Create a filter returning event type records
     calendar_filter_create(_calendar_event._uri, &filter);
    -
    + 
     // Add a 'priority equals high' condition
     calendar_filter_add_int(filter, _calendar_event.priority, CALENDAR_MATCH_EQUAL, CALENDAR_EVENT_PRIORITY_HIGH);
    -
    + 
     // Add OR operator
     calendar_filter_add_operator(filter, CALENDAR_FILTER_OPERATOR_OR);
    -
    + 
     // Add a 'description contains "meeting"' condition
     calendar_filter_add_str(filter, _calendar_event.description, CALENDAR_MATCH_CONTAINS, "meeting");
    - +

    Insert the filter into the query and execute the query:

    calendar_query_h query = NULL;
     calendar_list_h list = NULL;
    -
    + 
     // Create a query returning event type records
     calendar_query_create(_calendar_event._uri, &query);
    -
    + 
     // Add the filter
     calendar_query_set_filter(query, filter);
    -
    + 
     // Execute the query, results are returned in a list
     calendar_db_get_records_with_query(query, 0, 0, &list);
    -
    + 
     calendar_filter_destroy(filter);
     calendar_query_destroy(query);
    -
    + 
     // Use the list
    -
    + 
     calendar_list_destroy(list, true);

    Projections

    @@ -415,48 +406,48 @@ calendar_record_h event2 = NULL; calendar_db_get_record(_calendar_event._uri, event_id, &event2);

    Basic Types

    -

    Records contain properties of basic types: integer, lli (long integer, long long int), double, string, bool, and time. The time type holds either a long long int, or 3 integers (year, month, day).

    +

    Records contain properties of basic types: integer, lli (long integer, long long int), double, string, bool, and time. The time type holds either a long long int, or 3 integers (year, month, day).

    The following table lists the setter and getter functions for each type.

    - +
    - - - - + Table: Setter and getter functions + + + + + - - - + + + - - - + + + - - + + - - + + - - + + - - -
    - Table: Setter and getter functions -
    PropertySetter
    PropertySetter Getter
    integer
    integer calendar_record_set_int calendar_record_get_int
    long long integer
    long long integer calendar_record_set_lli calendar_record_get_lli
    double
    double calendar_record_set_double calendar_record_get_double
    string
    string calendar_record_set_str calendar_record_get_str
    calendar_time_s
    calendar_time_s calendar_record_set_caltime calendar_record_get_caltime
    + + + -

    Children

    +

    Children

    Certain type of records hold "child list" properties. If a record has a property of this type, it can be a parent of other records, called child records. For example, the attendee records can hold an event identifier in their event_id property. The event is the parent record of the child attendee records.

    The following code example creates an event and inserts it into the default event book.

    @@ -464,13 +455,13 @@ calendar_db_get_record(_calendar_event._uri, event_id, &event2);
    // Create an event
     calendar_record_h event = NULL;
     calendar_record_create(_calendar_event._uri, &event);
    -
    + 
     // Set event summary
     calendar_record_set_str(event, _calendar_event.summary, "Meeting");
    -
    + 
     // Put the event into the default calendar book for events
     calendar_record_set_int(event, _calendar_event.calendar_book_id, book_id);
    -
    + 
     // Insert calendar book into the database
     int event_id = 0;
     calendar_db_insert_record(event, &event_id);
    @@ -481,12 +472,11 @@ calendar_record_destroy(event, true);

    Reminders

    The following figure illustrates how the alarm process works.

    - -

    Figure: Alarm process

    + +

    Figure: Alarm process

    Alarm process

    -

    To get reminder when alarm is triggered, reminder mime name should be set by App. -

    After reminder mime name is set, insert an alarm as a child of an event record:

    +

    To get a reminder when an alarm is triggered, the application must set the reminder mime name. After the reminder mime name is set, insert an alarm as a child of an event record:

    // Set alarm
     calendar_record_h alarm = NULL;
     calendar_record_create(_calendar_alarm._uri, &alarm);
    @@ -496,18 +486,17 @@ calendar_record_set_lli(alarm, _calendar_alarm.time, (1404036000 - 60)); // Befo
     // Add alarm as child
     calendar_record_add_child_record(event, _calendar_event.calendar_alarm, alarm);
    -

    When the registered alarm is triggered and alarm manager notifies, calendar service calls packages which have the reminder mime name.

    - +

    When the registered alarm is triggered and the alarm manager notices it, the calendar service calls those packages that have the reminder mime name.

    Time Structure

    The calendar time structure, calendar_caltime_s, is defined as follows:

    typedef struct
     {
        calendar_time_type_e type;
    -   union
    +   union 
        {
           long long int utime;
    -      struct
    +      struct 
           {
              int year;
              int month;
    @@ -518,31 +507,31 @@ calendar_record_add_child_record(event, _calendar_event.calendar_alarm, alarm);<
     

    Use this structure when setting the calendar time (_CALENDAR_PROPERTY_CALTIME) properties of the records.

    The time structure can hold 2 types of data: UTC time (long long int) and date, given as year, month, and day of the month (3 integers). These types are identified by the values of the calendar_time_type_e variable, and they determine the usage of the structure.

    - +
    - - - - + + + + + - - - - - - - - - - - - - - -
    Table: Data types -
    IdentifierType
    IdentifierType Name Purpose
    CALENDAR_TIME_UTIMElong long intutimeUTC time, used to describe non-all-day events
    CALENDAR_TIME_LOCALTIMEstructdateDate only (year, month, and day of the month), used to describe all day events.
    + + + CALENDAR_TIME_UTIME + long long int + utime + UTC time, used to describe non-all-day events + + + CALENDAR_TIME_LOCALTIME + struct + date + Date only (year, month, and day of the month), used to describe all day events. + + +

    UTC Time Usage

    Structures with UTC time are used for non-all-day events. In such cases, you must convert local time to UTC time. The local time zone identifier must be stored in the record, in the corresponding property.

    @@ -550,7 +539,7 @@ calendar_record_add_child_record(event, _calendar_event.calendar_alarm, alarm);<

    When converting local time to UTC time, use the function illustrated in the following example. It converts the given date and time to the corresponding UTC time, considering the given time zone (first argument). The function uses the i18n API.

    #define ms2sec(ms) (long long int)(ms / 1000.0)
    -
    + 
     long long int _time_convert_itol(char *tzid, int y, int mon, int d, int h, int min, int s)
     {
        int ret = 0;
    @@ -562,7 +551,7 @@ long long int _time_convert_itol(char *tzid, int y, int mon, int d, int h, int m
     
        i18n_ulocale_get_default((const char **)&loc_default);
        ret = i18n_ucalendar_create(utf16_timezone, -1, loc_default, I18N_UCALENDAR_GREGORIAN, &ucal);
    -   if (I18N_ERROR_NONE != ret)
    +   if (I18N_ERROR_NONE != ret) 
        {
           dlog_print(DLOG_DEBUG, LOG_TAG, "i18n_ucalendar_create() is failed (%d)\n", ret);
     
    @@ -573,7 +562,7 @@ long long int _time_convert_itol(char *tzid, int y, int mon, int d, int h, int m
     
        i18n_udate date;
        ret = i18n_ucalendar_get_milliseconds(ucal, &date);
    -   if (I18N_ERROR_NONE != ret)
    +   if (I18N_ERROR_NONE != ret) 
        {
           dlog_print(DLOG_DEBUG, LOG_TAG, "i18n_ucalendar_create() is failed (%d)\n", ret);
           i18n_ucalendar_destroy(ucal);
    @@ -589,24 +578,24 @@ long long int _time_convert_itol(char *tzid, int y, int mon, int d, int h, int m
     
    // Fill calendar time structures (start and end time)
     calendar_time_s st = {0};
     calendar_time_s et = {0};
    -
    + 
     st.type = CALENDAR_TIME_UTIME;
     st.time.utime = _time_convert_itol("Asia/Seoul", 2012, 9, 15, 11, 0, 0);
    -
    + 
     et.type = CALENDAR_TIME_UTIME;
     et.time.utime = _time_convert_itol("Asia/Seoul", 2012, 9, 15, 12, 0, 0);
    -
    + 
     // Create an event record
    -
    + 
     // Set local time zone of start time
     calendar_record_set_str(event, _calendar_event.start_tzid, "Asia/Seoul");
    -
    + 
     // Set start time
     calendar_record_set_caltime(event, _calendar_event.start_time, st);
    -
    + 
     // Set local time zone of end time
     calendar_record_set_str(event, _calendar_event.end_tzid, "Asia/Seoul");
    -
    + 
     // Set end time
     calendar_record_set_caltime(event, _calendar_event.end_time, et);
    @@ -619,23 +608,23 @@ calendar_record_set_caltime(event, _calendar_event.end_time, et);

    Generic access functions can be used (according to data-view declarations) to access calendar views. A data-view is almost the same as a database "VIEW", which limits access and guarantees performance. A "record" represents a single row of the data-views.

    The _calendar_instance_utime and _calendar_instance_localtime views are not offered, but combinations with another views are provided.

    - +
    - - - - - - + Table: Calendar views + + + + + + + +_calendar_extended_property - - -
    - Table: Calendar views -
    Editable viewRead-only view
    Editable viewRead-only view
    _calendar_book
    _calendar_event
    _calendar_todo
    _calendar_timezone
    _calendar_attendee
    _calendar_alarm
    -_calendar_extended_property
    _calendar_updated_info
    _calendar_event_calendar_book
    _calendar_todo_calendar_book
    @@ -644,9 +633,9 @@ calendar_record_set_caltime(event, _calendar_event.end_time, et); _calendar_instance_localtime_calendar_book
    _calendar_instance_utime_calendar_book_extended
    _calendar_instance_localtime_calendar_book_extended
    + + +

    The _calendar_updated_info view is used when identifying record changes depending on the version. The other read-only views are a combination of editable views for UI convenience:

    • _calendar_event + _calendar_book = _calendar_event_calendar_book
    • @@ -656,14 +645,14 @@ calendar_record_set_caltime(event, _calendar_event.end_time, et);

    Properties

    The record types that have *_id as their property hold identifiers of other records. For example, the attendee and alarm views hold the ID of their corresponding events or todos in the event_id or todo_id property (as children of the corresponding event or todo records).

    The record type properties are other records. For example, an event record has attendee and alarm properties, which means that records of those types can be children of the event type records. The following figure illustrates macros in a calendar_view.h header file.

    - -

    Figure: Properties

    -

    Properties

    + +

    Figure: Properties

    +

    Properties

    // Create an event with _calendar_event view
     calendar_record_h event = NULL;
     calendar_record_create(_calendar_event._uri, &event);
    -
    + 
     // Set event summary to _calendar_event view
     calendar_record_set_str(event, _calendar_event.summary, "Meeting");
     
    @@ -716,7 +705,7 @@ calendar_vcalendar_parse_to_calendar(stream, &list); // Jobs for list calendar_list_destroy(list, true); - +
    @@ -738,4 +727,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/social/contact_n.htm b/org.tizen.guides/html/native/social/contact_n.htm index 3d63bff..3d6a6a1 100644 --- a/org.tizen.guides/html/native/social/contact_n.htm +++ b/org.tizen.guides/html/native/social/contact_n.htm @@ -16,7 +16,7 @@ @@ -46,17 +47,6 @@

    Contact features provide functions for managing contact information, such as address books, groups, persons, and phone logs.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    -

    A contact object is always associated with a specific address book. A person object is an aggregation of one or more contacts associated with the same person.

    The following figure illustrates the contact structure. There are 3 instances of the same contact in different address books. Person1 is an aggregation of those instances (Contact1, Contact2, and Contact3).

    @@ -73,7 +63,7 @@
  • Insert contacts to and remove them from the contacts database.
  • Use filters and queries to search and organize contacts.
  • Accounts -
    • Handle accounts using an account ID created with the Account Manager API.
    • +
      • Handle accounts using an account ID created with the Account Manager API (in mobile and wearable applications).
      • Have the related account ID of 0 because local device address book has no account.
      • Create only one address book each.
    • Address books @@ -144,7 +134,7 @@ free(ids);

      Database Change Notifications

      -

      To detect the contact database changes, use the Database API functions. Register a callback with the contacts_db_add_changed_cb() function. To unregister the callback and ignore database changes, use the contacts_db_remove_changed_cb() function.

      +

      To detect the contact database changes, use the Database API functions (in mobile and wearable applications). Register a callback with the contacts_db_add_changed_cb() function. To unregister the callback and ignore database changes, use the contacts_db_remove_changed_cb() function.

      Clients wait contacts change notifications on the client side. If the contact is changed by another module, the server publishes a notification. The notification module broadcasts to the subscribed modules and a user callback function is called with the user data. The following example registers person changes notification callback:

      @@ -672,7 +662,7 @@ contacts_record_destroy(contact, true);

      Figure: Properties

      Properties

      -

      For more information, see the View/Property API.

      +

      For more information, see the View/Property API (in mobile and wearable applications).

      vCards

      The Contact Service provides functions for parsing and making vCards. The vCard APIs are based on the vCard v3.0 specification.

      @@ -721,10 +711,10 @@ contacts_vcard_make_from_contact(contact, &vcard_stream); free(vcard_stream); contacts_record_destroy(contact, true); + - - - + +
  • @@ -746,4 +736,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/social/service_adaptor_n.htm b/org.tizen.guides/html/native/social/service_adaptor_n.htm index 450521d..c95d918 100644 --- a/org.tizen.guides/html/native/social/service_adaptor_n.htm +++ b/org.tizen.guides/html/native/social/service_adaptor_n.htm @@ -17,7 +17,7 @@ @@ -40,6 +39,8 @@

    You can manage adaptors, which function as agents between the Service Adaptor Client and the related plugins, to take advantage of various services. For example, the Auth and Storage adaptors allow you to access the Auth and Service Plugins to use services, such as Amazon, Box, Dropbox, Google Drive, Onedrive, and Sugarsync.

    +

    This feature is supported in mobile applications only.

    +

    Figure: Service adaptor structure

    Service adaptor structure

    diff --git a/org.tizen.guides/html/native/social/social_guide_n.htm b/org.tizen.guides/html/native/social/social_guide_n.htm index 569140d..a51d6b6 100644 --- a/org.tizen.guides/html/native/social/social_guide_n.htm +++ b/org.tizen.guides/html/native/social/social_guide_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -34,21 +34,19 @@

    Social

    -

    Social features include managing personal data, such as contacts, schedules, and accounts on the device.

    +

    Social features include managing personal data, such as contacts and schedules, on the device.

    +

    The main social features are:

      -
    • Service Adaptor -

      Allows you to work with cloud storages and services by managing authentication, contact information and file transfers to and from the cloud.

    • +
    • Contacts

      Allows you to work with contact information in your application by retrieving and managing individual contact information, searching for contacts, and receiving address book change notifications.

    -

    The following guides apply in mobile applications only:

    - +

    The following guides apply in mobile applications only:

      -
    • Account Manager -

      Allows you to work with accounts in your application by creating, managing and removing individual accounts.

    • Calendar

      Allows you to work with personal scheduling data by managing calendars, events, and todos, and setting reminders and recurrence properties. You can also search for calendar book entries and receive calendar book change notifications.

    • -
    • Contacts

      Allows you to work with contact information in your application by retrieving and managing individual contact information, searching for contacts, and receiving address book change notifications.

    • +
    • Service Adaptor +

      Allows you to work with cloud storages and services by managing authentication, contact information and file transfers to and from the cloud.

    diff --git a/org.tizen.guides/html/native/system/device_n.htm b/org.tizen.guides/html/native/system/device_n.htm index 56080fd..5bbb1a3 100644 --- a/org.tizen.guides/html/native/system/device_n.htm +++ b/org.tizen.guides/html/native/system/device_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/system/dlog_n.htm b/org.tizen.guides/html/native/system/dlog_n.htm index 32a3b33..4e0609b 100644 --- a/org.tizen.guides/html/native/system/dlog_n.htm +++ b/org.tizen.guides/html/native/system/dlog_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -29,6 +29,7 @@
  • Error Type
  • Error Handling with dlog
  • dlogutil
  • +
  • Architecture
  • Related Info

      @@ -44,10 +45,6 @@

      The dlog logging service consists of the dlogutil dlog library, and it supports sending log messages to a circular log device. The log device is a circular buffer used to collect log messages from various applications and the system.

      -

      Figure: Architecture

      - -

      Architecture

      -

      The dlog service sends a log message to the circular buffer with APIs, including Priority and Tag information. With this information, it is easy to filter and check the messages with dlogutil.

      Before using dlog, you should know which priorities and tags to use and where to write (format, buffer).

      @@ -298,6 +295,14 @@ dlogutil [<option>] ... [<filter-spec>] ... +

      Architecture

      + +

      The following figure illustrates the general architecture of the dlog logging service.

      +

      Figure: Architecture

      + +

      Architecture

      + +
    diff --git a/org.tizen.guides/html/native/system/media_keys_n.htm b/org.tizen.guides/html/native/system/media_keys_n.htm index 3e25776..5118179 100644 --- a/org.tizen.guides/html/native/system/media_keys_n.htm +++ b/org.tizen.guides/html/native/system/media_keys_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/system/runtime_info_n.htm b/org.tizen.guides/html/native/system/runtime_info_n.htm index 361e892..b788805 100644 --- a/org.tizen.guides/html/native/system/runtime_info_n.htm +++ b/org.tizen.guides/html/native/system/runtime_info_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/system/sensors_n.htm b/org.tizen.guides/html/native/system/sensors_n.htm index 1204f8d..0b81743 100644 --- a/org.tizen.guides/html/native/system/sensors_n.htm +++ b/org.tizen.guides/html/native/system/sensors_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/system/settings_n.htm b/org.tizen.guides/html/native/system/settings_n.htm index 6e88570..3deec9e 100644 --- a/org.tizen.guides/html/native/system/settings_n.htm +++ b/org.tizen.guides/html/native/system/settings_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -175,13 +175,6 @@ - SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME - int - GETTER, NOTIFIER - Backlight time (in seconds). - - - SYSTEM_SETTINGS_KEY_SOUND_LOCK bool GETTER, NOTIFIER diff --git a/org.tizen.guides/html/native/system/storage_n.htm b/org.tizen.guides/html/native/system/storage_n.htm index a17d8ea..aed0d65 100644 --- a/org.tizen.guides/html/native/system/storage_n.htm +++ b/org.tizen.guides/html/native/system/storage_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/system/sysinfo_n.htm b/org.tizen.guides/html/native/system/sysinfo_n.htm index 0672fd7..c2109b9 100644 --- a/org.tizen.guides/html/native/system/sysinfo_n.htm +++ b/org.tizen.guides/html/native/system/sysinfo_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -247,12 +247,22 @@ bool The platform returns true for this key, if the device supports location positioning. + + http://tizen.org/feature/location.geofence + bool + The platform returns true for this key and the http://tizen.org/feature/location key, if the device supports the geofence feature. + http://tizen.org/feature/location.gps bool The platform returns true for this key and the http://tizen.org/feature/location key, if the device supports the Global Positioning System (GPS). + http://tizen.org/feature/location.gps.satellite + bool + The platform returns true for this key and the http://tizen.org/feature/location.gps key, if the device has a GPS chip that supports satellite information. + + http://tizen.org/feature/location.wps bool The platform returns true for this key and the http://tizen.org/feature/location key, if the device supports the Wi-Fi-based Positioning System (WPS). @@ -365,11 +375,16 @@ bool The platform returns true for this key, if the device supports Bluetooth Object Push Profile (OPP). - - http://tizen.org/feature/network.internet - bool - The platform returns true for this key, if the device supports internet access. - + + http://tizen.org/feature/network.ethernet + bool + The platform returns true for this key, if the device supports Ethernet. + + + http://tizen.org/feature/network.internet + bool + The platform returns true for this key, if the device supports Internet access. + http://tizen.org/feature/network.nfc bool @@ -430,6 +445,11 @@ the Tizen reference implementation. The platform returns true for this key and the http://tizen.org/feature/network.telephony key, if the device supports MMS. + http://tizen.org/feature/network.telephony.sms + bool + The platform returns true for this key and the http://tizen.org/feature/network.telephony key, if the device supports SMS. + + http://tizen.org/feature/network.tethering bool The platform returns true for this key, if the device supports any kind of tethering. @@ -787,6 +807,11 @@ the Tizen reference implementation. The platform returns true for this key and the http://tizen.org/feature/sensor.barometer key, if the device supports the wake-up operation by the barometer sensor. + http://tizen.org/feature/sensor.geomagnetic_rotation_vector + bool + The platform returns true for this key, if the device supports the geomagnetic-based rotation vector sensor. + + http://tizen.org/feature/sensor.gesture_recognition bool The platform returns true for this key, if the device supports the gesture recognition. @@ -802,6 +827,16 @@ the Tizen reference implementation. The platform returns true for this key, if the device supports the gyro sensor. + http://tizen.org/feature/sensor.gyroscope_rotation_vector + bool + The platform returns true for this key, if the device supports the gyroscope-based rotation vector sensor. + + + http://tizen.org/feature/sensor.gyroscope.uncalibrated + bool + The platform returns true for this key, if the device supports the uncalibrated gyroscope sensor. + + http://tizen.org/feature/sensor.gyroscope.wakeup bool The platform returns true for this key and the http://tizen.org/feature/sensor.gyroscope key, if the device supports the wake-up operation by the gyro sensor. @@ -814,17 +849,17 @@ the Tizen reference implementation. http://tizen.org/feature/sensor.heart_rate_monitor.led_green bool - The platform returns true for this key, if the device supports the green LED sensor of the heart rate monitor. + The platform returns true for this key, if the device supports the LED green sensor of the heart rate monitor. http://tizen.org/feature/sensor.heart_rate_monitor.led_ir bool - The platform returns true for this key, if the device supports the infrared LED sensor of the heart rate monitor. + The platform returns true for this key, if the device supports the LED infrared sensor of the heart rate monitor. http://tizen.org/feature/sensor.heart_rate_monitor.led_red bool - The platform returns true for this key, if the device supports the red LED sensor of the heart rate monitor. + The platform returns true for this key, if the device supports the LED red sensor of the heart rate monitor. http://tizen.org/feature/sensor.humidity @@ -837,11 +872,16 @@ the Tizen reference implementation. The platform returns true for this key, if the device supports the linear acceleration sensor. - http://tizen.org/feature/sensor.magnetometer + http://tizen.org/feature/sensor.magnetometer bool The platform returns true for this key, if the device supports the magnetic sensor. + http://tizen.org/feature/sensor.magnetometer.uncalibrated + bool + The platform returns true for this key, if the device supports the uncalibrated geomagnetic sensor. + + http://tizen.org/feature/sensor.magnetometer.wakeup bool The platform returns true for this key and the http://tizen.org/feature/sensor.magnetometer key, if the device supports the wake-up operation by the magnetic sensor. @@ -951,8 +991,13 @@ the Tizen reference implementation. Type Description + + http://tizen.org/feature/speech.control + bool + The platform returns true for this key, if the device supports voice control. + - http://tizen.org/feature/speech.recognition + http://tizen.org/feature/speech.recognition bool The platform returns true for this key, if the device supports speech recognition (STT). @@ -998,6 +1043,16 @@ the Tizen reference implementation. Description + http://tizen.org/feature/vision.barcode_detection + bool + The platform returns true for this key, if the device supports the barcode detection feature. + + + http://tizen.org/feature/vision.barcode_generation + bool + The platform returns true for this key, if the device supports the barcode generation feature. + + http://tizen.org/feature/vision.face_recognition bool The platform returns true for this key, if the device supports face recognition. diff --git a/org.tizen.guides/html/native/system/system_guide_n.htm b/org.tizen.guides/html/native/system/system_guide_n.htm index d738ce1..d0209c8 100644 --- a/org.tizen.guides/html/native/system/system_guide_n.htm +++ b/org.tizen.guides/html/native/system/system_guide_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/system/t-trace_n.htm b/org.tizen.guides/html/native/system/t-trace_n.htm index ead4889..cc12363 100644 --- a/org.tizen.guides/html/native/system/t-trace_n.htm +++ b/org.tizen.guides/html/native/system/t-trace_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm b/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm index 663cf79..073261d 100644 --- a/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm +++ b/org.tizen.guides/html/native/telephony/phonenumber_util_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/telephony/telephony_guide_n.htm b/org.tizen.guides/html/native/telephony/telephony_guide_n.htm index 46cb284..04b783c 100644 --- a/org.tizen.guides/html/native/telephony/telephony_guide_n.htm +++ b/org.tizen.guides/html/native/telephony/telephony_guide_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/telephony/telephony_info_n.htm b/org.tizen.guides/html/native/telephony/telephony_info_n.htm index a0496c7..4e29c74 100644 --- a/org.tizen.guides/html/native/telephony/telephony_info_n.htm +++ b/org.tizen.guides/html/native/telephony/telephony_info_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/ui/eom_n.htm b/org.tizen.guides/html/native/ui/eom_n.htm index facae06..464001b 100644 --- a/org.tizen.guides/html/native/ui/eom_n.htm +++ b/org.tizen.guides/html/native/ui/eom_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/ui/minicontrol_n.htm b/org.tizen.guides/html/native/ui/minicontrol_n.htm new file mode 100644 index 0000000..dc6d58f --- /dev/null +++ b/org.tizen.guides/html/native/ui/minicontrol_n.htm @@ -0,0 +1,76 @@ + + + + + + + + + + + + + Minicontrol + + + + + +
    + +

    Minicontrol

    +

    Minicontrol is small application view that can be shown on the quick panel or lock screen.

    + +

    The main features of the Minicontrol API include:

    +
      +
    • Creating a minicontrol +

      You can create minicontrols using the Minicontrol provider API, which requires the http://tizen.org/privilege/minicontrol.provider privilege:

      +
      • To create a minicontrol, use the minicontrol_create_window() function, which returns an Evas_Object of the minicontrol window.
      • +
      • To send a request, use the minicontrol_send_event() function to get a minicontrol handle and set the details.
      +
    • +
    • Hosting minicontrols +

      You can host minicontrols, such as lock screens, on your application using the Minicontrol viewer API, which requires the http://tizen.org/privilege/minicontrol.viewer privilege:

      +
      • To host minicontrols, use the minicontrol_viewer_set_event_cb() function for listening to the request from minicontrol providers.
      • +
      • When you get the creation request from a minicontrol provider, use the minicontrol_viewer_add() function to add the minicontrol on your application.
      +
    • +
    + +

    Figure: Minicontrol on a quick panel (left) and lock screen (right)

    +

    Minicontrol on a quick panel (left) and lock screen (right) Minicontrol on a quick panel (left) and lock screen (right)

    + + + +
    + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.guides/html/native/ui/ui_guide_n.htm b/org.tizen.guides/html/native/ui/ui_guide_n.htm index 9fe4c3c..fcf9a1b 100644 --- a/org.tizen.guides/html/native/ui/ui_guide_n.htm +++ b/org.tizen.guides/html/native/ui/ui_guide_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -36,9 +36,10 @@

    The main UI features are:

    • External Output Manager

      Enables you to handle external output devices.

    • +
    • Minicontrol

      Enables you to create minicontrols on the quick panel or the lock screen, and hide a minicontrol viewer.

    -

    For more information about implementing the UI for your application using the EFL features, see EFL.

    +

    For more information about implementing the UI for your application using the EFL features, see EFL.

    diff --git a/org.tizen.guides/html/native/uix/ime_n.htm b/org.tizen.guides/html/native/uix/ime_n.htm index e947a7b..b926ebe 100644 --- a/org.tizen.guides/html/native/uix/ime_n.htm +++ b/org.tizen.guides/html/native/uix/ime_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/uix/stt_n.htm b/org.tizen.guides/html/native/uix/stt_n.htm index c95e4c4..26544ff 100644 --- a/org.tizen.guides/html/native/uix/stt_n.htm +++ b/org.tizen.guides/html/native/uix/stt_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/uix/tts_n.htm b/org.tizen.guides/html/native/uix/tts_n.htm index 91d69c7..2461a26 100644 --- a/org.tizen.guides/html/native/uix/tts_n.htm +++ b/org.tizen.guides/html/native/uix/tts_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/uix/uix_guide_n.htm b/org.tizen.guides/html/native/uix/uix_guide_n.htm index 0903492..36315f7 100644 --- a/org.tizen.guides/html/native/uix/uix_guide_n.htm +++ b/org.tizen.guides/html/native/uix/uix_guide_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/uix/voicecontrol_elm_n.htm b/org.tizen.guides/html/native/uix/voicecontrol_elm_n.htm index 5689bbd..b17aca9 100644 --- a/org.tizen.guides/html/native/uix/voicecontrol_elm_n.htm +++ b/org.tizen.guides/html/native/uix/voicecontrol_elm_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/uix/voicecontrol_guide_n.htm b/org.tizen.guides/html/native/uix/voicecontrol_guide_n.htm index d63d03f..f4a36df 100644 --- a/org.tizen.guides/html/native/uix/voicecontrol_guide_n.htm +++ b/org.tizen.guides/html/native/uix/voicecontrol_guide_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/uix/voicecontrol_n.htm b/org.tizen.guides/html/native/uix/voicecontrol_n.htm index 9845ecd..bb1da68 100644 --- a/org.tizen.guides/html/native/uix/voicecontrol_n.htm +++ b/org.tizen.guides/html/native/uix/voicecontrol_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/web/web_guide_n.htm b/org.tizen.guides/html/native/web/web_guide_n.htm index 07d3eee..e59ddd7 100644 --- a/org.tizen.guides/html/native/web/web_guide_n.htm +++ b/org.tizen.guides/html/native/web/web_guide_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    @@ -40,7 +40,7 @@
    • WebView

      Enables you to access the Web pages and Web content.

      -

      The WebView API implements the EFL WebKit (EWK), which covers various features for Web browsing, such as loading and displaying Web pages and navigating through the browsing history. EFL APIs (in mobile and wearable applications), such as evas_*, elm_*, and eina_*, are used to build up a complete application supporting Web browsing.

      +

      The WebView API implements the EFL WebKit (EWK), which covers various features for Web browsing, such as loading and displaying Web pages and navigating through the browsing history. The EFL APIs (in mobile and wearable applications), such as evas_*, elm_*, and eina_*, are used to build up a complete application supporting Web browsing.

    diff --git a/org.tizen.guides/html/web/guides_w.htm b/org.tizen.guides/html/web/guides_w.htm index 4f23775..19d6db4 100644 --- a/org.tizen.guides/html/web/guides_w.htm +++ b/org.tizen.guides/html/web/guides_w.htm @@ -18,7 +18,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    Related Info

    @@ -35,6 +35,15 @@

    Tizen Web guides introduce the various features that you can use in creating Tizen Web applications.

    +

    Select the feature you are interested in and see what Tizen offers for your application:

    + + + @@ -45,17 +54,6 @@
    - -

    Select the feature you are interested in and see what Tizen offers for your application:

    - - - - diff --git a/org.tizen.guides/html/web/tizen/application/alarm_w.htm b/org.tizen.guides/html/web/tizen/application/alarm_w.htm index a3d2d58..f2e8fca 100644 --- a/org.tizen.guides/html/web/tizen/application/alarm_w.htm +++ b/org.tizen.guides/html/web/tizen/application/alarm_w.htm @@ -16,7 +16,7 @@
    -

    Mobile Web Wearable Web

    +

    Mobile Web Wearable Web

    @@ -34,17 +34,7 @@

    Tizen enables you to schedule an application to be run at a specific time. When an alarm is triggered, the application is launched (unless it is already running).

    - - - - - - - - - -
    Note
    The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

    All mandatory APIs are supported on the Tizen Emulators.

    +

    The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

    The main features of the Alarm API include:

      diff --git a/org.tizen.guides/html/web/tizen/application/app_guide_w.htm b/org.tizen.guides/html/web/tizen/application/app_guide_w.htm index 0cb9f49..a10fc76 100644 --- a/org.tizen.guides/html/web/tizen/application/app_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/application/app_guide_w.htm @@ -16,7 +16,7 @@
      -

      Mobile Web Wearable Web

      +

      Mobile Web Wearable Web

      @@ -37,7 +37,9 @@
      • Alarm

        Allows you to schedule an application to be run at a specific time

      • Application

        Allows you to retrieve information about the applications installed or running on the device.

      • +
      • Application Group

        Allows you to define the application launch mode and group your applications into entities that can be managed together.

      • Package

        Allows you to retrieve information about packages and manage package installation.

      • +

      The following guides apply in mobile applications only:

      diff --git a/org.tizen.guides/html/web/tizen/application/appgroup_w.htm b/org.tizen.guides/html/web/tizen/application/appgroup_w.htm index 4e4c2e5..4d5b046 100644 --- a/org.tizen.guides/html/web/tizen/application/appgroup_w.htm +++ b/org.tizen.guides/html/web/tizen/application/appgroup_w.htm @@ -16,7 +16,7 @@
      -

      Mobile native Wearable native

      +

      Mobile Web Wearable Web

      @@ -34,23 +34,16 @@

      Application Group

      You can define the application launch mode and group your applications into entities that can be managed together.

      -

      The main features of the Application Group API include:

      +

      The main application group features include:

      • Defining the application launch mode -

        You can set the application launch mode in the config.xml file with one of the following values: +

        You can set the application launch mode in the config.xml file (in mobile and wearable applications) with one of the following values:

        • The SINGLE launch mode means that the application is launched as a main application (in a new group).
        • The GROUP launch mode means that the application can be launched as a sub application belonging to the same group as the caller application which is causing the application to be launched.
        -

        Additionally, if the launch mode is not set to the value SINGLE - in config.xml file and when the application is launched by the - launchAppControl() function - with the ApplicationControl object, - the launchMode property of this object overrides the launch mode of the called application. - If the launch mode in config.xml is set to SINGLE, - the value of that property ApplicationControl.launchMode - is ignored and the sub application is always called in SINGLE mode.

        +

        Additionally, if the launch mode is not set to SINGLE in the config.xml file and the application is launched by the launchAppControl() function (in mobile and wearable applications) with the ApplicationControl object (in mobile and wearable applications), the launchMode property of this object overrides the launch mode of the called application. If the launch mode in the config.xml file is set to SINGLE, the value of the ApplicationControl.launchMode property is ignored and the sub application is always called in the SINGLE mode.

      • Managing the application group

        Applications in a same group act as if they are in 1 stack. For example, if an application A wants to send an email using an email application B, the application A can launch the email application B, making the email application B a sub application in the same group as the application A. When both applications are running, and the user presses the home button, both applications are hidden. When the user later resumes the caller application (application A), the email application B is shown on top of the caller application.

        diff --git a/org.tizen.guides/html/web/tizen/application/application_w.htm b/org.tizen.guides/html/web/tizen/application/application_w.htm index 25e4fd5..9fcb63c 100644 --- a/org.tizen.guides/html/web/tizen/application/application_w.htm +++ b/org.tizen.guides/html/web/tizen/application/application_w.htm @@ -16,7 +16,7 @@
        -

        Mobile Web Wearable Web

        +

        Mobile Web Wearable Web

        @@ -40,18 +40,7 @@

        Application management and launch features include retrieving information about the applications installed or currently running on the device, such as application name, icon path, version details, and application ID. You can also receive notifications if applications are updated or removed, or new applications are installed. You can also perform application management tasks, such as launching, closing, or exiting a running application.

        - - - - - - - - - -
        Note
        The Application API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

        All mandatory APIs are supported on the Tizen Emulators.

        -
        +

        The Application API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

        The Tizen Application API provides means to interact with other applications using the ApplicationControl (in mobile and wearable applications) and RequestedApplicationControl (in mobile and wearable applications) interfaces. The application uses the application control to request a specific operation to be performed. The operation can be, for example, making a phone call, browsing local files so the user can pick an image of their choosing, or starting a video player with a specific movie. The Web application can also register itself as able to perform such operations. It can then be launched by another application and respond by using the RequestedApplicationControl interface.

        The main application management and launch features are:

        @@ -81,7 +70,17 @@

        The application control uses the following primary information:

        • Application ID

          Used to identify the provider application of the requested application control. Besides the application ID, a platform-defined application control has a special alias name for the application ID with the prefix tizen. For example, the platform phone application has the alias application ID of tizen.phone.

          -

          Tizen Alias ID is deprecated since Tizen 2.3.1.

        • + + + + + + + + + +
          Note
          The Tizen alias ID is deprecated since Tizen 2.3.1.
          +
        • Operation

          Describes an action to be performed by the provider application. The operation ID of the platform-provided operation is in the http://tizen.org/appcontrol/operation/<verb> format. For example, http://tizen.org/appcontrol/operation/view. @@ -184,8 +183,17 @@

          Browsing a Web Page

          The browsing a Web page application control service allows you to display Web pages in your own application using the device's Web browser.

          Application ID
          -

          This application control can be accessed using aliased application ID of "tizen.internet".

          -

          Tizen Alias ID is deprecated since Tizen 2.3.1.

          +

          This application control can be accessed using the aliased application ID of "tizen.internet".

          + + + + + + + + + +
          Note
          The Tizen alias ID is deprecated since Tizen 2.3.1.
          VIEW Operation

          This application control supports the http://tizen.org/appcontrol/operation/view operation only.

          This operation launches a Web browser and displays a specific Web page. The device user can access other Web pages, manage bookmarks, search for text on the Web page, and modify brightness and Internet settings. If the Internet connection is not available or if the specified Web page does not exist, an error message is displayed.

          @@ -194,15 +202,24 @@ var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view",                                               "http://www.tizen.org", null, null); -tizen.application.launchAppControl(appControl, "tizen.internet", +tizen.application.launchAppControl(appControl, "tizen.internet",                                    function() {console.log("launch application control succeed");},                                    function(e) {/* Error handling*/}, null); -} +

          Selecting a File

          The selecting a file application control service allows you to handle media files (image, audio, or video) in your own application.

          Application ID
          -

          This application control can be accessed using aliased application ID of "tizen.filemanager".

          -

          Tizen Alias ID is deprecated since Tizen 2.3.1.

          +

          This application control can be accessed using the aliased application ID of "tizen.filemanager".

          + + + + + + + + + +
          Note
          The Tizen alias ID is deprecated since Tizen 2.3.1.
          PICK Operation

          This application control supports the http://tizen.org/appcontrol/operation/pick operation only.

          This operation displays a list of specific type of media files found in the Media folder on the device or memory card, and returns the selected files back to your own application. The device user can browse all the subfolders and select items from one of the subfolders. The operation only displays files that are of the specified type. You can also display all types of media files by defining all as the type in the operation input data.

          @@ -233,10 +250,10 @@ var appControlReplyCallback =    } } -tizen.application.launchAppControl(appControl, "tizen.filemanager", +tizen.application.launchAppControl(appControl, "tizen.filemanager",                                    function() {console.log("launch application control succeed");},                                    function(e) {/* Error handling */}, appControlReplyCallback); - +

          Launching an Application with Application Controls

          @@ -336,16 +353,15 @@ tizen.application.launchAppControl(appControl, null, successCb, errCb, null);

          Launching Platform Applications

          -

          The Tizen platform provides predefined application controls, such as phone, file manager, image viewer, and Internet. You can run Tizen base applications explicitly with the aliased application IDs.

          -

          Tizen Alias ID is deprecated since Tizen 2.3.1.

          +

          The Tizen platform provides predefined application controls, such as phone, file manager, image viewer, and Internet. You can run Tizen base applications explicitly with the aliased application IDs.

          The following code example demonstrates an ApplicationControl interface instance for explicitly launching the image viewer for cropping an image:

           /* Assuming that the filesystem virtual root "images" has been resolved and saved in variable images */
           var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/image/crop",
                                                         images.resolve("image12.jpg").toURI(),
                                                         "image/*", null , null);
          -tizen.application.launchAppControl(appControl, "tizen.imageviewer", successCb, errCb, null); 
          - +tizen.application.launchAppControl(appControl, "tizen.imageviewer", successCb, errCb, null); +

          The aliased application ID (tizen.imageviewer) is used, and a crop operation on the image12.jpg file is launched.

          @@ -354,9 +370,12 @@ tizen.application.launchAppControl(appControl, "tizen.imageviewer", su - +
          Note
          If you are unsure about whether a user's device has a specific application, use one of the standard Tizen platform applications, such as the phone, image viewer, or file manager, because some version of these applications is available on all Tizen devices. The platform applications use predefined platform application controls and aliased application IDs, which also simplifies the task of launching them. -

          Tizen Alias ID is deprecated since Tizen 2.3.1.

          -
          +
            +
          • The Tizen alias ID is deprecated since Tizen 2.3.1.
          • +
          • If you are unsure about whether a user's device has a specific application, use one of the standard Tizen platform applications, such as the phone, image viewer, or file manager, because some version of these applications is available on all Tizen devices. The platform applications use predefined platform application controls and aliased application IDs, which also simplifies the task of launching them.
          • +
          +
          @@ -376,14 +395,9 @@ tizen.application.findAppControl(appControl, function(appInfos, appCtrl) }, function(e) {/* Error handling */}); -

          Application Group

          -

          - An application can be launched in a separate instance or in the same group as a calling application. The way how the application is called is determined by the launch mode. - There are two launch modes SINGLE - and GROUP. - For more information see Application Group -

          +

          Application Group

          +

          An application can be launched in a separate instance or in the same group as a calling application. The way the application is called is determined by the launch mode. There are 2 launch modes: SINGLE and GROUP. For more information, see Application Group.

          Exporting Application Control Functionality

          @@ -437,31 +451,33 @@ var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/    <mime name="audio/*"/> </tizen:app-control> -

          Using "appcontrol" event instead of page reloading

          +

          Using the appcontrol Event Instead of Page Reloading

          -

          When a web application receives an application control request from another application, the receiving application finds the proper page for that request and loads that page. If the found page is already loaded and displayed, the page is reloaded (refreshed) to process the incoming application control request. However, in some case, a web application may handle an application control request without reloading the page in order to keep the previous context.

          -

          From Tizen 2.4 onwards, the web runtime provides a way to handle application control requests without page reloading by extending the <tizen:app-control> element of the config.xml file and sending a new appcontrol event to the receiving application.

          -

          The following code example demonstrates a service description in the config.xml file which can handle an image editing application control request and does not reload the web page.

          +

          When a Web application receives an application control request from another application, the receiving application finds the proper page for that request and loads that page. If the found page is already loaded and displayed, the page is reloaded (refreshed) to process the incoming application control request. However, in some cases, a Web application is able to handle the application control request without reloading the page in order to keep the previous context.

          +

          From Tizen 2.4 onwards, the Web runtime provides a way to handle application control requests without page reloading by extending the <tizen:app-control> element of the config.xml file and sending a new appcontrol event to the receiving application.

          +

          The following code example demonstrates a service description in the config.xml file, which can handle an image editing application control request and does not reload the Web page:

           <tizen:app-control>
          -   <src name="edit.html" reload="disable"/>
          +   <src name="edit.html" reload="disable"/>
              <operation name="http://tizen.org/appcontrol/operation/edit"/>
              <mime name="image/*"/>
           </tizen:app-control>
          -

          The reload attribute is newly added to the src element. The reload attribute is used to set whether the page should or should not be reloaded when an application control request is received. The reload attribute is optional and the default value is enable. If the reload attribute is not set in the src element, the default value is set to enable and the page will reload.

          -

          If the currently loaded page is selected by an incoming application control request, and the reload attribute of the service description is set to disable, then an appcontrol event is dispatched to that page instead of reloading that page. By using an appcontrol event listener, the web application can get the requested information by calling the getRequestedAppControl() method of the Application interface. An appcontrol event is only dispatched if the reload attribute of the service description is set to disable.

          -

          The following code example demonstrates adding an appcontrol event listener and handling an event:

          +

          The reload attribute is added to the src element (in mobile and wearable applications), and used to set whether the page must be reloaded when an application control request is received. The reload attribute is optional and the default value is enable. If the reload attribute is not set in the src element, the default value is set to enable and the page reloads.

          +

          If the currently loaded page is selected by an incoming application control request, and the reload attribute of the service description is set to disable, an appcontrol event is dispatched to that page instead of reloading it. By using an appcontrol event listener, the Web application can get the requested information by calling the getRequestedAppControl() method of the Application interface. An appcontrol event is only dispatched, if the reload attribute of the service description is set to disable.

          +

          The following example demonstrates adding an appcontrol event listener and handling an event:

          -Window.addEventListener("appcontrol", function onAppControl()
          +window.addEventListener("appcontrol", function onAppControl()
           {
              var reqAppControl = tizen.application.getCurrentApplication.getRequestedAppControl();
              if (reqAppControl)
              {
          -      // handle application control request
          +      // Handle the application control request
              }
           });
          + +
        @@ -484,4 +500,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.guides/html/web/tizen/application/data_w.htm b/org.tizen.guides/html/web/tizen/application/data_w.htm index 632f5cc..0c41a22 100644 --- a/org.tizen.guides/html/web/tizen/application/data_w.htm +++ b/org.tizen.guides/html/web/tizen/application/data_w.htm @@ -16,7 +16,7 @@
        -

        Mobile Web

        +

        Mobile Web

        @@ -34,16 +34,7 @@

        Data control allows you to read and modify data stored and provided by another application. The application storing and controlling the data is called a DataControl provider application. The application using the data is called a DataControl consumer application. A single DataControl provider can serve multiple DataControl consumers.

        - - - - - - - - - -
        Note
        This feature is supported in mobile applications only.
        +

        This feature is supported in mobile applications only.

        The main data control features are:

          diff --git a/org.tizen.guides/html/web/tizen/application/package_w.htm b/org.tizen.guides/html/web/tizen/application/package_w.htm index e74a0aa..7802870 100644 --- a/org.tizen.guides/html/web/tizen/application/package_w.htm +++ b/org.tizen.guides/html/web/tizen/application/package_w.htm @@ -16,7 +16,7 @@
          -

          Mobile Web Wearable Web

          +

          Mobile Web Wearable Web

          @@ -33,17 +33,7 @@

          Package

          Package management and installation features include retrieving detailed information about packages, such as package name, icon path, version details, and package ID. You can receive notifications if packages are updated or removed, or new packages are installed. You can also perform package management tasks, such as installing or uninstalling packages.

          - - - - - - - - - -
          Note
          The Package API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

          All mandatory APIs are supported on the Tizen Emulators.

          +

          The Package API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

          The main package features are:

            diff --git a/org.tizen.guides/html/web/tizen/communication/bluetooth_w.htm b/org.tizen.guides/html/web/tizen/communication/bluetooth_w.htm index c1f6512..1ecbc39 100644 --- a/org.tizen.guides/html/web/tizen/communication/bluetooth_w.htm +++ b/org.tizen.guides/html/web/tizen/communication/bluetooth_w.htm @@ -16,7 +16,7 @@
            -

            Mobile Web Wearable Web

            +

            Mobile Web Wearable Web

            @@ -34,17 +34,7 @@

            You can use Bluetooth functionalities in your application, such as managing the local Bluetooth adapter, bonding, and exchanging data between Bluetooth-enabled devices. The Bluetooth standard provides a peer-to-peer (P2P) data exchange functionality over short distance between compliant devices.

            - - - - - - - - - -
            Note
            The Bluetooth API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

            The Bluetooth API is not supported on any Tizen Emulators.

            +

            The Bluetooth API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Bluetooth API is not supported on any Tizen Emulators.

            The main features of the Bluetooth API include:

              diff --git a/org.tizen.guides/html/web/tizen/communication/comm_guide_w.htm b/org.tizen.guides/html/web/tizen/communication/comm_guide_w.htm index ad6ad5c..2d1eeb6 100644 --- a/org.tizen.guides/html/web/tizen/communication/comm_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/communication/comm_guide_w.htm @@ -16,7 +16,7 @@
              -

              Mobile Web Wearable Web

              +

              Mobile Web Wearable Web

              diff --git a/org.tizen.guides/html/web/tizen/communication/messaging_w.htm b/org.tizen.guides/html/web/tizen/communication/messaging_w.htm index 9842022..13f569b 100644 --- a/org.tizen.guides/html/web/tizen/communication/messaging_w.htm +++ b/org.tizen.guides/html/web/tizen/communication/messaging_w.htm @@ -16,7 +16,7 @@
              -

              Mobile Web

              +

              Mobile Web

              @@ -33,16 +33,7 @@

              Tizen enables you to create applications with messaging functionalities for SMS, MMS, and email.

              - - - - - - - - - -
              Note
              This feature is supported in mobile applications only.
              +

              This feature is supported in mobile applications only.

              The messaging process used in HTML5 involves Uniform Resource Identifiers (URIs), which form values of attributes, such as tel, mailto, and sms. These attributes invoke external services which then perform the messaging tasks. The Messaging API minimizes your coding efforts by providing one-step capabilities to perform all high-level messaging-related operations.

              diff --git a/org.tizen.guides/html/web/tizen/communication/nfc_w.htm b/org.tizen.guides/html/web/tizen/communication/nfc_w.htm index 8cdbfa1..d2873d3 100644 --- a/org.tizen.guides/html/web/tizen/communication/nfc_w.htm +++ b/org.tizen.guides/html/web/tizen/communication/nfc_w.htm @@ -16,7 +16,7 @@
              -

              Mobile Web Wearable Web

              +

              Mobile Web Wearable Web

              @@ -35,18 +35,7 @@

              Near Field Communication (NFC) service enables information exchange between NFC-enabled devices (called "peers") or tags. The NFC-enabled devices can share contacts, photos, and videos, and can also act as smart cards. You can use an NFC-enabled device to communicate with NFC tags for a variety of activities, such as paying the grocery bill or downloading a coupon.

              - - - - - - - - - -
              Note
              The NFC API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

              The NFC API is not supported on any Tizen Emulators.

              -
              +

              The NFC API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The NFC API is not supported on any Tizen Emulators.

              NFC provides the following advantages over short-range communication technologies, such as Bluetooth:

                diff --git a/org.tizen.guides/html/web/tizen/communication/push_w.htm b/org.tizen.guides/html/web/tizen/communication/push_w.htm index f8f273a..ad613cc 100644 --- a/org.tizen.guides/html/web/tizen/communication/push_w.htm +++ b/org.tizen.guides/html/web/tizen/communication/push_w.htm @@ -16,7 +16,7 @@
                -

                Mobile Web Wearable Web

                +

                Mobile Web Wearable Web

                @@ -34,19 +34,7 @@

                Tizen enables you to receive push notifications from a push server. The push service is a client daemon that maintains a permanent connection between the device and the push server to process the registration and deregistration requests, and deliver push notifications to the application. If the application is connected, the push service passes the notification data over the connection. Otherwise, the push service sends UI notifications with the data. The notifications are delivered when the user launches the application and selects the posting mode. The architecture of the Tizen Push service is described in the mobile native Push guide.

                - - - - - - - - - - -
                Note
                The Push API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                The Push API is supported on all Tizen Emulators.

                -
                +

                The Push API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Push API is supported on all Tizen Emulators.

                To receive push notifications for your application:

                  diff --git a/org.tizen.guides/html/web/tizen/communication/secure_element_w.htm b/org.tizen.guides/html/web/tizen/communication/secure_element_w.htm index f635ce0..703bb59 100644 --- a/org.tizen.guides/html/web/tizen/communication/secure_element_w.htm +++ b/org.tizen.guides/html/web/tizen/communication/secure_element_w.htm @@ -16,7 +16,7 @@
                  -

                  Mobile Web Wearable Web

                  +

                  Mobile Web Wearable Web

                  @@ -34,18 +34,7 @@

                  Tizen enables you to access secure elements in a device. You can access various secure elements, such as UICC and SIM cards, embedded secure elements, and secure SD cards.

                  - - - - - - - - - -
                  Note
                  The Secure Element API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                  The Secure Element API is not supported on any Tizen Emulators.

                  -
                  +

                  The Secure Element API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Secure Element API is not supported on any Tizen Emulators.

                  The main features of the Secure Element API include:

                    diff --git a/org.tizen.guides/html/web/tizen/content/content_guide_w.htm b/org.tizen.guides/html/web/tizen/content/content_guide_w.htm index 9af045e..93315eb 100644 --- a/org.tizen.guides/html/web/tizen/content/content_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/content/content_guide_w.htm @@ -16,7 +16,7 @@
                    -

                    Mobile Web Wearable Web

                    +

                    Mobile Web Wearable Web

                    diff --git a/org.tizen.guides/html/web/tizen/content/content_w.htm b/org.tizen.guides/html/web/tizen/content/content_w.htm index 5650178..542bc37 100644 --- a/org.tizen.guides/html/web/tizen/content/content_w.htm +++ b/org.tizen.guides/html/web/tizen/content/content_w.htm @@ -16,7 +16,7 @@
                    -

                    Mobile Web Wearable Web

                    +

                    Mobile Web Wearable Web

                    @@ -36,17 +36,7 @@

                    Tizen enables you to search for content (images, videos, music or other) located on the local device storage. You can also perform content management tasks, such as viewing and updating content attributes.

                    - - - - - - - - - -
                    Note
                    The Content API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                    All mandatory APIs are supported on the Tizen Emulators.

                    +

                    The Content API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. ll mandatory APIs are supported on the Tizen Emulators.

                    The main features of Content API include:

                      diff --git a/org.tizen.guides/html/web/tizen/content/download_w.htm b/org.tizen.guides/html/web/tizen/content/download_w.htm index 17bfe46..4f864fe 100644 --- a/org.tizen.guides/html/web/tizen/content/download_w.htm +++ b/org.tizen.guides/html/web/tizen/content/download_w.htm @@ -16,7 +16,7 @@
                      -

                      Mobile Web Wearable Web

                      +

                      Mobile Web Wearable Web

                      @@ -35,17 +35,7 @@

                      Tizen enables you to download files from the Internet. You can also monitor the download progress and status.

                      - - - - - - - - - -
                      Note
                      The Download API is mandatory for the Tizen mobile profile, but optional for the wearable profile. This means that it is supported in all mobile devices, but may not be supported in all wearable devices. -

                      The Download API is supported on all Tizen Emulators.

                      +

                      The Download API is mandatory for the Tizen mobile profile, but optional for the wearable profile. This means that it is supported in all mobile devices, but may not be supported in all wearable devices. The Download API is supported on all Tizen Emulators.

                      The main features of the Download API include:

                        diff --git a/org.tizen.guides/html/web/tizen/content/exif_w.htm b/org.tizen.guides/html/web/tizen/content/exif_w.htm index 215da4d..55ab1c9 100644 --- a/org.tizen.guides/html/web/tizen/content/exif_w.htm +++ b/org.tizen.guides/html/web/tizen/content/exif_w.htm @@ -16,7 +16,7 @@
                        -

                        Mobile Web Wearable Web

                        +

                        Mobile Web Wearable Web

                        @@ -35,18 +35,7 @@

                        Tizen enables you to access and modify EXIF information in a JPEG file (with the common .jpg extension).

                        - - - - - - - - - -
                        Note
                        The Exif API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                        The Exif API is supported on all Tizen Emulators.

                        -
                        +

                        The Exif API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The Exif API is supported on all Tizen Emulators.

                        The main features of the Exif API include:

                          diff --git a/org.tizen.guides/html/web/tizen/guides_tizen_w.htm b/org.tizen.guides/html/web/tizen/guides_tizen_w.htm index 076dcce..dbcc2d7 100644 --- a/org.tizen.guides/html/web/tizen/guides_tizen_w.htm +++ b/org.tizen.guides/html/web/tizen/guides_tizen_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          @@ -34,19 +34,6 @@

                          Tizen Web guides introduce the various features that you can use in creating Tizen Web applications.

                          - - - - - - - - - -
                          Note
                          In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional. -

                          The mandatory APIs are always available on all Tizen devices. The optional APIs provide functionality that depends on the available device hardware or software capabilities, and they may not be available in all Tizen devices. For example, the Bluetooth and NFC API hardware features are optional, and not supported on all devices.

                          -

                          To determine the availability of optional APIs, use the tizen.systeminfo.getCapability() method of the System Information API (in mobile and wearable applications).

                          -

                          Note that all mandatory APIs are supported on the Tizen Emulators, while the optional APIs may or may not be supported. For the details of each API, see Tizen Web Device API Reference.

                          Select the feature you are interested in and see what Tizen offers for your application.

                          The following guides describe features provided by the Tizen Web Device API:

                          @@ -54,7 +41,7 @@
                        • Tizen

                          Enables you to handle generic events and sort and filter data.

                        • Application -

                          Enables you to configure application properties, manage application data, packages, alarms and launch applications

                        • +

                          Enables you to configure application properties, and manage application data, packages, and alarms, and launch applications.

                        • Communication

                          Enables you to send data to networks and other applications, and receive data back from them.

                        • Content @@ -71,7 +58,22 @@

                          Enables you to manage the user's personal data, such as contacts, calendars, and call and browsing history, on the device.

                        -

                        For more information about implementing the UI for your application using the Advanced UI Framework (TAU) features, see TAU.

                        + + + + + + + + + + +
                        Note
                        In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional. +

                        The mandatory APIs are always available on all Tizen devices. The optional APIs provide functionality that depends on the available device hardware or software capabilities, and they may not be available in all Tizen devices. For example, the Bluetooth and NFC API hardware features are optional, and not supported on all devices.

                        +

                        To determine the availability of optional APIs, use the tizen.systeminfo.getCapability() method of the System Information API (in mobile and wearable applications).

                        +

                        Note that all mandatory APIs are supported on the Tizen Emulators, while the optional APIs may or may not be supported. For the details of each API, see Tizen Web Device API Reference.

                        + +

                        For more information about implementing the UI for your application using the Advanced UI Framework (TAU) features, see TAU.

                        In addition to the Tizen Web Device API guides above, you can study the following features:

                          diff --git a/org.tizen.guides/html/web/tizen/ime/ime_w.htm b/org.tizen.guides/html/web/tizen/ime/ime_w.htm index 3ecabd5..1d313a5 100644 --- a/org.tizen.guides/html/web/tizen/ime/ime_w.htm +++ b/org.tizen.guides/html/web/tizen/ime/ime_w.htm @@ -16,7 +16,7 @@
                          -

                          Wearable Web

                          +

                          Wearable Web

                          @@ -37,16 +37,7 @@

                          IME Application

                          - - - - - - - - - -
                          Note
                          This feature is supported in wearable applications only.
                          +

                          This feature is supported in wearable applications only.

                          Tizen Web IME (Input Method Editor) applications are written in HTML5 for Tizen, combining HTML, JavaScript, and CSS into a package that can be installed on a Tizen device, such as Samsung Gear, or the Tizen Emulator. Both the Tizen device and the Emulator must run Tizen version 2.3 or later to run Web IME applications.

                          diff --git a/org.tizen.guides/html/web/tizen/input_output/archive_w.htm b/org.tizen.guides/html/web/tizen/input_output/archive_w.htm index 754f2b5..501b9e1 100644 --- a/org.tizen.guides/html/web/tizen/input_output/archive_w.htm +++ b/org.tizen.guides/html/web/tizen/input_output/archive_w.htm @@ -16,7 +16,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          @@ -34,17 +34,7 @@

                          Tizen enables you to operate on the zip archive files.

                          - - - - - - - - - -
                          Note
                          The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                          The Archive API is supported on all Tizen Emulators.

                          +

                          The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The Archive API is supported on all Tizen Emulators.

                          To use the Archive API, your application must have the following privileges:

                          • http://tizen.org/privilege/filesystem.read
                          • diff --git a/org.tizen.guides/html/web/tizen/input_output/filesystem_w.htm b/org.tizen.guides/html/web/tizen/input_output/filesystem_w.htm index b98e0f5..802292a 100644 --- a/org.tizen.guides/html/web/tizen/input_output/filesystem_w.htm +++ b/org.tizen.guides/html/web/tizen/input_output/filesystem_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            @@ -34,17 +34,7 @@

                            Tizen enables you to manage the files and directories in the device file system.

                            - - - - - - - - - -
                            Note
                            The Filesystem API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Filesystem API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            The Filesystem API provides access to accessible parts of the file system, which are represented as virtual root locations. The virtual roots form a collection of locations that function as a single virtual device file system. The following table lists the supported virtual roots.

                            diff --git a/org.tizen.guides/html/web/tizen/input_output/io_guide_w.htm b/org.tizen.guides/html/web/tizen/input_output/io_guide_w.htm index ad75438..647a3f1 100644 --- a/org.tizen.guides/html/web/tizen/input_output/io_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/input_output/io_guide_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            diff --git a/org.tizen.guides/html/web/tizen/input_output/message_port_w.htm b/org.tizen.guides/html/web/tizen/input_output/message_port_w.htm index 222e284..5202274 100644 --- a/org.tizen.guides/html/web/tizen/input_output/message_port_w.htm +++ b/org.tizen.guides/html/web/tizen/input_output/message_port_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            @@ -34,18 +34,7 @@

                            Tizen Web applications can communicate with other Web or native applications. The message data type for the communication is map data, which consists of a string key and value pair.

                            - -
                            - - - - - - - - -
                            Note
                            The Message Port API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Message Port API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            You can send and receive messages through 2 types of message ports:

                            • The LocalMessagePort interface (in mobile and wearable applications) is used to register your message port and prepare to receive messages from other applications. diff --git a/org.tizen.guides/html/web/tizen/localization/localization_w.htm b/org.tizen.guides/html/web/tizen/localization/localization_w.htm index c62cedf..ddb1f34 100644 --- a/org.tizen.guides/html/web/tizen/localization/localization_w.htm +++ b/org.tizen.guides/html/web/tizen/localization/localization_w.htm @@ -20,7 +20,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Localization

                              @@ -31,7 +31,7 @@

                              Create a directory for each locale that has localized content under the locales directory in package root. The locale names are defined in the W3C IANA language subtag registry.

                              The Web Runtime loads the proper resource for the current locale according to the W3C widget using the following mark-up:

                              -
                              +
                               ┬index.html
                               └locales
                                 â””en
                              diff --git a/org.tizen.guides/html/web/tizen/multimedia/media_controller_w.htm b/org.tizen.guides/html/web/tizen/multimedia/media_controller_w.htm
                              index 8aee622..d616882 100644
                              --- a/org.tizen.guides/html/web/tizen/multimedia/media_controller_w.htm
                              +++ b/org.tizen.guides/html/web/tizen/multimedia/media_controller_w.htm
                              @@ -16,7 +16,7 @@
                               
                                
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              @@ -34,17 +34,7 @@

                              Tizen provides a functionality for you to communicate between the media controller server and client.

                              - - - - - - - - - -
                              Note
                              The Media Controller API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Media Controller API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              To manage the media using the Media Controller API, you have to develop 2 applications:

                              diff --git a/org.tizen.guides/html/web/tizen/multimedia/media_key_w.htm b/org.tizen.guides/html/web/tizen/multimedia/media_key_w.htm index 40873b7..988c343 100644 --- a/org.tizen.guides/html/web/tizen/multimedia/media_key_w.htm +++ b/org.tizen.guides/html/web/tizen/multimedia/media_key_w.htm @@ -16,7 +16,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              @@ -34,17 +34,7 @@

                              Tizen enables you to handle media keys in your application.

                              - - - - - - - - - -
                              Note
                              The Media Key API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                              The Media Key API is not supported on any Tizen Emulators.

                              +

                              The Media Key API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Media Key API is not supported on any Tizen Emulators.

                              The media keys are used to control multimedia playback. The user can click keys, such as PLAY and FAST FORWARD, and you can detect the key clicks in your application and change the playback accordingly.

                              diff --git a/org.tizen.guides/html/web/tizen/multimedia/multimedia_guide_w.htm b/org.tizen.guides/html/web/tizen/multimedia/multimedia_guide_w.htm index f14f6c1..5ec5d93 100644 --- a/org.tizen.guides/html/web/tizen/multimedia/multimedia_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/multimedia/multimedia_guide_w.htm @@ -16,7 +16,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              diff --git a/org.tizen.guides/html/web/tizen/multimedia/sound_w.htm b/org.tizen.guides/html/web/tizen/multimedia/sound_w.htm index 497bf6d..2dcfecc 100644 --- a/org.tizen.guides/html/web/tizen/multimedia/sound_w.htm +++ b/org.tizen.guides/html/web/tizen/multimedia/sound_w.htm @@ -16,7 +16,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              @@ -34,17 +34,7 @@

                              Tizen enables you to control the volume level of several sound types and get information about the current sound mode and the state of the current sound devices. The available sound types include, for example, system, notifications, alarms, and media.

                              - - - - - - - - - -
                              Note
                              The Sound API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Sound API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              The main features of the Sound API include:

                                diff --git a/org.tizen.guides/html/web/tizen/service/service_w.htm b/org.tizen.guides/html/web/tizen/service/service_w.htm index 36b3926..5604b80 100644 --- a/org.tizen.guides/html/web/tizen/service/service_w.htm +++ b/org.tizen.guides/html/web/tizen/service/service_w.htm @@ -16,7 +16,7 @@
                                -

                                Wearable Web

                                +

                                Wearable Web

                                @@ -38,16 +38,7 @@

                                Service Application

                                - - - - - - - - - -
                                Note
                                This feature is supported in wearable applications only.

                                The web service application is OPTIONAL feature, which means that it may not be supported in all wearable devices.

                                +

                                This feature is supported in wearable applications only. The Web service application is an optional feature, which means that it may not be supported in all wearable devices.

                                A service application is a type of Tizen Web application that provides an environment for running JavaScript in the background without a graphical user interface (the application follows the ECMA-262 specification). The service application is used to perform tasks which need to run periodically or continuously but do not require user interaction. For example, a service application can be used for getting data or listening to platform events in the background. As service applications do not have UI components, they run on top of a more light-weight runtime than UI applications. Therefore, you can expect them to perform better and consume less memory.

                                diff --git a/org.tizen.guides/html/web/tizen/social/account_w.htm b/org.tizen.guides/html/web/tizen/social/account_w.htm index fc70e6d..4c8c8a0 100644 --- a/org.tizen.guides/html/web/tizen/social/account_w.htm +++ b/org.tizen.guides/html/web/tizen/social/account_w.htm @@ -16,7 +16,7 @@
                                -

                                Mobile Web

                                +

                                Mobile Web

                                @@ -35,16 +35,7 @@

                                You can use existing configured on-line accounts and providers, and create new accounts of known types.

                                - - - - - - - - - -
                                Note
                                This feature is supported in mobile applications only.
                                +

                                This feature is supported in mobile applications only.

                                The basic account management concepts are:

                                • Provider diff --git a/org.tizen.guides/html/web/tizen/social/bookmark_w.htm b/org.tizen.guides/html/web/tizen/social/bookmark_w.htm index 94c8145..5c6da32 100644 --- a/org.tizen.guides/html/web/tizen/social/bookmark_w.htm +++ b/org.tizen.guides/html/web/tizen/social/bookmark_w.htm @@ -16,7 +16,7 @@
                                  -

                                  Mobile Web

                                  +

                                  Mobile Web

                                  @@ -36,16 +36,7 @@

                                  You can manage the Tizen Web browser bookmarks by retrieving the current bookmark list. You can create or delete both bookmark folders and items.

                                  - - - - - - - - - -
                                  Note
                                  This feature is supported in mobile applications only.
                                  +

                                  This feature is supported in mobile applications only.

                                  The main features of the Bookmark API include:

                                    diff --git a/org.tizen.guides/html/web/tizen/social/calendar_w.htm b/org.tizen.guides/html/web/tizen/social/calendar_w.htm index 707db60..012d196 100644 --- a/org.tizen.guides/html/web/tizen/social/calendar_w.htm +++ b/org.tizen.guides/html/web/tizen/social/calendar_w.htm @@ -16,7 +16,7 @@
                                    -

                                    Mobile Web

                                    +

                                    Mobile Web

                                    @@ -37,16 +37,7 @@

                                    Tizen enables you to manage your schedule and tasks.

                                    A calendar is a collection of events or tasks, depending upon the calendar type. Each event or task has a series of attributes, such as purpose, starting time, and duration.

                                    - - - - - - - - - -
                                    Note
                                    This feature is supported in mobile applications only.
                                    +

                                    This feature is supported in mobile applications only.

                                    diff --git a/org.tizen.guides/html/web/tizen/social/call_history_w.htm b/org.tizen.guides/html/web/tizen/social/call_history_w.htm index 363167b..a597cc3 100644 --- a/org.tizen.guides/html/web/tizen/social/call_history_w.htm +++ b/org.tizen.guides/html/web/tizen/social/call_history_w.htm @@ -16,7 +16,7 @@
                                    -

                                    Mobile Web

                                    +

                                    Mobile Web

                                    @@ -36,16 +36,7 @@

                                    You can access information about various telephony services for circuit-switched telephony and voice over IP (VoIP). You can browse the call history of a device, remove call history entries, and monitor changes.

                                    -
                                    - - - - - - - - -
                                    Note
                                    This feature is supported in mobile applications only.
                                    +

                                    This feature is supported in mobile applications only.

                                    The main features of the Call History API include:

                                      diff --git a/org.tizen.guides/html/web/tizen/social/contact_w.htm b/org.tizen.guides/html/web/tizen/social/contact_w.htm index 7676c47..14b6e04 100644 --- a/org.tizen.guides/html/web/tizen/social/contact_w.htm +++ b/org.tizen.guides/html/web/tizen/social/contact_w.htm @@ -16,7 +16,7 @@
                                      -

                                      Mobile Web

                                      +

                                      Mobile Web

                                      @@ -36,16 +36,7 @@

                                      Tizen enables you to manage the contacts and persons listed in your address books. A Contact object is always associated with a specific address book. A Person object is an aggregation of one or more contacts associated with the same person.

                                      - - - - - - - - - -
                                      Note
                                      This feature is supported in mobile applications only.
                                      +

                                      This feature is supported in mobile applications only.

                                      The main features of the Contact API include:

                                        diff --git a/org.tizen.guides/html/web/tizen/social/data_sync_w.htm b/org.tizen.guides/html/web/tizen/social/data_sync_w.htm index e48427a..21470c4 100644 --- a/org.tizen.guides/html/web/tizen/social/data_sync_w.htm +++ b/org.tizen.guides/html/web/tizen/social/data_sync_w.htm @@ -16,7 +16,7 @@
                                        -

                                        Mobile Web

                                        +

                                        Mobile Web

                                        @@ -35,18 +35,17 @@

                                        You can synchronize device data, such as contacts and calendar events, with the OMA DS server using the OMA DS (Data Synchronization) 1.2 protocol.

                                        - - - - - - - - - -
                                        Note
                                        This feature is supported in mobile applications only.
                                        +

                                        This feature is supported in mobile applications only.

                                        - + +

                                        The main features of the Data Synchronization API include:

                                        +
                                          +
                                        • Checking for free profile slot

                                          Tizen sets a limitation on the number of supported OMA DS profiles on the device, so you must first check whether there is a profile slot available.

                                          You can check whether sync profile slots are available using the getProfilesNum() and getMaxProfilesNum() methods of the DataSynchronizationManager interface.

                                        • +
                                        • Creating a sync profile

                                          You can create a profile using the SyncProfileInfo interface. You can define the profile name and provide various information defined using the SyncInfo and SyncServiceInfo interfaces.

                                        • +
                                        • Retrieving synchronization process information

                                          After starting the synchronization process using the startSync() method of the DataSynchronizationManager interface, you can monitor the progress of the operation. Use the SyncProgressCallback interface to define listeners for receiving notifications. After the synchronization is completed, you can retrieve statistics using the getLastSyncStatistics() method.

                                        • +
                                        + +
                                        @@ -56,12 +55,6 @@
                                        Note
                                        -

                                        The main features of the Data Synchronization API include:

                                        -
                                          -
                                        • Checking for free profile slot

                                          Tizen sets a limitation on the number of supported OMA DS profiles on the device, so you must first check whether there is a profile slot available.

                                          You can check whether sync profile slots are available using the getProfilesNum() and getMaxProfilesNum() methods of the DataSynchronizationManager interface.

                                        • -
                                        • Creating a sync profile

                                          You can create a profile using the SyncProfileInfo interface. You can define the profile name and provide various information defined using the SyncInfo and SyncServiceInfo interfaces.

                                        • -
                                        • Retrieving synchronization process information

                                          After starting the synchronization process using the startSync() method of the DataSynchronizationManager interface, you can monitor the progress of the operation. Use the SyncProgressCallback interface to define listeners for receiving notifications. After the synchronization is completed, you can retrieve statistics using the getLastSyncStatistics() method.

                                        • -
                                        diff --git a/org.tizen.guides/html/web/tizen/social/social_guide_w.htm b/org.tizen.guides/html/web/tizen/social/social_guide_w.htm index e1fc8e7..4f853dc 100644 --- a/org.tizen.guides/html/web/tizen/social/social_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/social/social_guide_w.htm @@ -16,7 +16,7 @@
                                        -

                                        Mobile Web

                                        +

                                        Mobile Web

                                        @@ -35,16 +35,7 @@

                                        Social features include managing call and browsing history, bookmarks, and calendars, and synchronizing device data.

                                        - - - - - - - - - -
                                        Note
                                        The Social API domain is supported in mobile applications only.
                                        +

                                        The Social API domain is supported in mobile applications only.

                                        The main social features are:

                                          diff --git a/org.tizen.guides/html/web/tizen/system/fm_radio_w.htm b/org.tizen.guides/html/web/tizen/system/fm_radio_w.htm index 9de359b..f1c212d 100644 --- a/org.tizen.guides/html/web/tizen/system/fm_radio_w.htm +++ b/org.tizen.guides/html/web/tizen/system/fm_radio_w.htm @@ -16,7 +16,7 @@
                                          -

                                          Mobile Web

                                          +

                                          Mobile Web

                                          @@ -33,16 +33,7 @@

                                          Tizen enables you to access and control the FM radio on the device.

                                          - - - - - - - - - -
                                          Note
                                          This feature is supported in mobile applications only.
                                          +

                                          This feature is supported in mobile applications only.

                                          The main features of the FM Radio API include:

                                            diff --git a/org.tizen.guides/html/web/tizen/system/ham_w.htm b/org.tizen.guides/html/web/tizen/system/ham_w.htm index 9c960ea..92fda64 100644 --- a/org.tizen.guides/html/web/tizen/system/ham_w.htm +++ b/org.tizen.guides/html/web/tizen/system/ham_w.htm @@ -16,7 +16,7 @@
                                            -

                                            Mobile Web Wearable Web

                                            +

                                            Mobile Web Wearable Web

                                            @@ -34,17 +34,7 @@

                                            Tizen enables you to access the human activity data from various sensors on the device.

                                            - - - - - - - - - -
                                            Note
                                            The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                                            The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).

                                            +

                                            The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).

                                            The main features of the Human Activity Monitor API include:

                                              diff --git a/org.tizen.guides/html/web/tizen/system/power_w.htm b/org.tizen.guides/html/web/tizen/system/power_w.htm index b12219e..69c8f1e 100644 --- a/org.tizen.guides/html/web/tizen/system/power_w.htm +++ b/org.tizen.guides/html/web/tizen/system/power_w.htm @@ -16,7 +16,7 @@
                                              -

                                              Mobile Web Wearable Web

                                              +

                                              Mobile Web Wearable Web

                                              @@ -36,17 +36,7 @@

                                              Tizen enables you to access a device's power resource. Currently, the screen and CPU power resources are supported, allowing you to request a specific power state and control the brightness of the screen.

                                              - - - - - - - - - -
                                              Note
                                              The Power API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                              All mandatory APIs are supported on the Tizen Emulators.

                                              +

                                              The Power API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                                              The Power API allows you to request and release a minimum power state for the screen and CPU. The request locks the screen to a minimum state and keeps the device bright and awake. For example, if you set the minimum power state to SCREEN_NORMAL, the device display always remains in the SCREEN_NORMAL level and never goes down to the SCREEN_DIM level.

                                              The levels you can request are described in the following table.

                                              diff --git a/org.tizen.guides/html/web/tizen/system/sensor_w.htm b/org.tizen.guides/html/web/tizen/system/sensor_w.htm index d012138..1c4e33c 100644 --- a/org.tizen.guides/html/web/tizen/system/sensor_w.htm +++ b/org.tizen.guides/html/web/tizen/system/sensor_w.htm @@ -16,7 +16,7 @@
                                              -

                                              Mobile Web Wearable Web

                                              +

                                              Mobile Web Wearable Web

                                              @@ -35,17 +35,7 @@

                                              Tizen provides interfaces and methods to manage sensor data from various sensors on the device. The main purpose of a sensor is to provide a value for the relevant environment parameter.

                                              - - - - - - - - - -
                                              Note
                                              The Sensor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                                              The Sensor API is supported on all Tizen Emulators.

                                              +

                                              The Sensor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Sensor API is supported on all Tizen Emulators.

                                              The main features of the Sensor API include:

                                                diff --git a/org.tizen.guides/html/web/tizen/system/system_guide_w.htm b/org.tizen.guides/html/web/tizen/system/system_guide_w.htm index 2805215..ba0ca72 100644 --- a/org.tizen.guides/html/web/tizen/system/system_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/system/system_guide_w.htm @@ -16,7 +16,7 @@
                                                -

                                                Mobile Web Wearable Web

                                                +

                                                Mobile Web Wearable Web

                                                diff --git a/org.tizen.guides/html/web/tizen/system/system_info_w.htm b/org.tizen.guides/html/web/tizen/system/system_info_w.htm index 9bfe828..12a41b7 100644 --- a/org.tizen.guides/html/web/tizen/system/system_info_w.htm +++ b/org.tizen.guides/html/web/tizen/system/system_info_w.htm @@ -57,7 +57,7 @@ tr.images td {
                                                -

                                                Mobile Web Wearable Web

                                                +

                                                Mobile Web Wearable Web

                                                @@ -76,17 +76,7 @@ tr.images td {

                                                Tizen enables you to access the device's system properties (both hardware and capability). You can obtain various device and system details, such as the current battery level, amount of available storage, and state of the cellular network connection.

                                                - - - - - - - - - -
                                                Note
                                                The System Information API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                                All mandatory APIs are supported on the Tizen Emulators.

                                                +

                                                The System Information API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                                                The main features of the System Information API include:

                                                  diff --git a/org.tizen.guides/html/web/tizen/system/system_setting_w.htm b/org.tizen.guides/html/web/tizen/system/system_setting_w.htm index a8ccb2e..4e4dbe2 100644 --- a/org.tizen.guides/html/web/tizen/system/system_setting_w.htm +++ b/org.tizen.guides/html/web/tizen/system/system_setting_w.htm @@ -16,7 +16,7 @@
                                                  -

                                                  Mobile Web Wearable Web

                                                  +

                                                  Mobile Web Wearable Web

                                                  @@ -35,17 +35,7 @@

                                                  Tizen enables you to access the device's settings for the home and lock screen wallpaper, the incoming call ringtone, and email notification tone.

                                                  - - - - - - - - - -
                                                  Note
                                                  The System Setting API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                                  The System Setting API is supported on the Tizen mobile Emulator and partly supported on the Tizen wearable Emulator (only the home screen and incoming call features).

                                                  +

                                                  The System Setting API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The System Setting API is supported on the Tizen mobile Emulator and partly supported on the Tizen wearable Emulator (only the home screen and incoming call features).

                                                  The following table lists the supported system setting properties.

                                                  diff --git a/org.tizen.guides/html/web/tizen/system/time_w.htm b/org.tizen.guides/html/web/tizen/system/time_w.htm index a044b0c..7276f63 100644 --- a/org.tizen.guides/html/web/tizen/system/time_w.htm +++ b/org.tizen.guides/html/web/tizen/system/time_w.htm @@ -16,7 +16,7 @@
                                                  -

                                                  Mobile Web Wearable Web

                                                  +

                                                  Mobile Web Wearable Web

                                                  @@ -36,18 +36,7 @@

                                                  Tizen enables you to use locale-specific calendar features by retrieving date and time information. You can also change the date, time, and time zone, and make some date- and time-related calculations. The Time API overcomes several limitations of the JavaScript Date object.

                                                  Locale refers to the set of information that is specific to a language and a country. It affects the numeric formats (decimal and list separators), date formats, and the character sorting order. It determines how a locale-specific functionality behaves; for example, how numbers are displayed or strings converted to dates.

                                                  - -
                                                  - - - - - - - - -
                                                  Note
                                                  The Time API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                                  All mandatory APIs are supported on the Tizen Emulators.

                                                  +

                                                  The Time API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                                                  The main features of the Time API include:

                                                    diff --git a/org.tizen.guides/html/web/tizen/system/web_setting_w.htm b/org.tizen.guides/html/web/tizen/system/web_setting_w.htm index 82a8d6e..6d60fab 100644 --- a/org.tizen.guides/html/web/tizen/system/web_setting_w.htm +++ b/org.tizen.guides/html/web/tizen/system/web_setting_w.htm @@ -16,7 +16,7 @@
                                                    -

                                                    Mobile Web

                                                    +

                                                    Mobile Web

                                                    @@ -34,16 +34,7 @@

                                                    Tizen enables you to set Web view properties.

                                                    - - - - - - - - - -
                                                    Note
                                                    This feature is supported in mobile applications only.
                                                    +

                                                    This feature is supported in mobile applications only.

                                                    The main features of the Web Setting API include:

                                                      diff --git a/org.tizen.guides/html/web/tizen/tizen/tizen_guide_w.htm b/org.tizen.guides/html/web/tizen/tizen/tizen_guide_w.htm index 11fa506..006bffe 100644 --- a/org.tizen.guides/html/web/tizen/tizen/tizen_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/tizen/tizen_guide_w.htm @@ -16,7 +16,7 @@
                                                      -

                                                      Mobile Web Wearable Web

                                                      +

                                                      Mobile Web Wearable Web

                                                      @@ -40,17 +40,7 @@

                                                      Tizen

                                                      Tizen features include handling events and organizing data.

                                                      - - - - - - - - - -
                                                      Note
                                                      The Tizen API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                                      All mandatory APIs are supported on the Tizen Emulators.

                                                      +

                                                      The Tizen API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                                                      The main Tizen features are:

                                                        @@ -78,13 +68,16 @@

                                                        Managing Location Coordinates

                                                        -

                                                        You can use the SimpleCoordinates interface (in mobile and wearable applications) to incorporate location information into your application. For example, you can simply use it to define coordinates:

                                                        var coordinates = new tizen.SimpleCoordinates(37.5665, 126.9779);

                                                        You can also define a latitude and longitude for a calendar event:

                                                        var event = new tizen.CalendarEvent(
                                                        +  

                                                        You can use the SimpleCoordinates interface (in mobile and wearable applications) to incorporate location information into your application. For example, you can simply use it to define coordinates:

                                                        var coordinates = new tizen.SimpleCoordinates(37.5665, 126.9779);

                                                        You can also define a latitude and longitude for a calendar event:

                                                        +
                                                        +var event = new tizen.CalendarEvent(
                                                         {
                                                            description:"hospital", 
                                                            geolocation: new tizen.SimpleCoordinates(37.4889, 127.0876),
                                                            startDate: new tizen.TZDate(2011, 11, 1, 14, 0), 
                                                            duration: new tizen.TimeDuration(2, "HOURS")
                                                        -});
                                                        +}); +

                                                        Sorting and Filtering Data

                                                        The Tizen API provides a set of basic definitions and interfaces that are used in the Tizen Device API. The Tizen API contains filters and sorting modes for query methods, generic success and error event handlers, a generic error interface, and a simple coordinate interface for defining location information.

                                                        diff --git a/org.tizen.guides/html/web/tizen/ui/badge_w.htm b/org.tizen.guides/html/web/tizen/ui/badge_w.htm index a59141a..7ca8f3a 100644 --- a/org.tizen.guides/html/web/tizen/ui/badge_w.htm +++ b/org.tizen.guides/html/web/tizen/ui/badge_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        @@ -36,17 +36,7 @@

                                                        When an application has new information requiring user attention, such as missed calls or new messages, it has a number in the upper right hand corner of the application icon. This number is called a badge. For example, when a new message is received, the badge appears on the application icon. The badge remains until the user reads the message.

                                                        - - - - - - - - - -
                                                        Note
                                                        The Badge API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                                        All mandatory APIs are supported on the Tizen Emulators.

                                                        +

                                                        The Badge API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                                                        Figure: Badge

                                                        Badge

                                                        diff --git a/org.tizen.guides/html/web/tizen/ui/noti_w.htm b/org.tizen.guides/html/web/tizen/ui/noti_w.htm index 863726f..5f7194e 100644 --- a/org.tizen.guides/html/web/tizen/ui/noti_w.htm +++ b/org.tizen.guides/html/web/tizen/ui/noti_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        @@ -35,18 +35,7 @@

                                                        Tizen enables you to provide notifications about application events.

                                                        - - - - - - - - - -
                                                        Note
                                                        The Notification API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                                                        All mandatory APIs are supported on the Tizen Emulators.

                                                        -
                                                        +

                                                        The Notification API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                                                        The main features of the Notification API include:

                                                          diff --git a/org.tizen.guides/html/web/tizen/ui/ui_guide_w.htm b/org.tizen.guides/html/web/tizen/ui/ui_guide_w.htm index 24bbe84..9fdf63d 100644 --- a/org.tizen.guides/html/web/tizen/ui/ui_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/ui/ui_guide_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/communication/comm_guide_w.htm b/org.tizen.guides/html/web/w3c/communication/comm_guide_w.htm index 97ee093..5dbc0a2 100644 --- a/org.tizen.guides/html/web/w3c/communication/comm_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/communication/comm_guide_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          @@ -36,7 +36,7 @@
                                                          • HTML5 Web Messaging

                                                            Enables you to send and receive data between Web sites and through a message channel.

                                                          • WebSocket

                                                            Enables you to connect to the socket server, and send and receive data.

                                                          • -
                                                          • XMLHttpRequest Level 1 and 2

                                                            Enables you to use cross-origin resource sharing (CORS) to request and send data of various content types, and to monitor the operation progress.

                                                          • +
                                                          • XMLHttpRequest (Level 1 and 2)

                                                            Enables you to use cross-origin resource sharing (CORS) to request and send data of various content types, and to monitor the operation progress.

                                                          The following guides apply in mobile applications only:

                                                          diff --git a/org.tizen.guides/html/web/w3c/communication/server_sent_w.htm b/org.tizen.guides/html/web/w3c/communication/server_sent_w.htm index 9f35229..cbb8754 100644 --- a/org.tizen.guides/html/web/w3c/communication/server_sent_w.htm +++ b/org.tizen.guides/html/web/w3c/communication/server_sent_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          @@ -31,16 +31,7 @@

                                                          Server-Sent Events

                                                          - - - - - - - - - -
                                                          Note
                                                          This feature is supported in mobile applications only.
                                                          +

                                                          This feature is supported in mobile applications only.

                                                          Server-Sent Events feature is used to realize server push in a Web environment. The server push feature has evolved over time from a hidden IFrame through Ajax polling and Comet to the current implementation of server-sent events.

                                                          The Server-Sent Events API defines a simple data structure and interface, and a communication mechanism to realize the server push. In addition, it can handle the received data in the general DOM event format. However, the API repeatedly requests the data from the client to the server, so it is not a complete server push.

                                                          diff --git a/org.tizen.guides/html/web/w3c/communication/web_messaging_w.htm b/org.tizen.guides/html/web/w3c/communication/web_messaging_w.htm index 3f0a72e..a945e16 100644 --- a/org.tizen.guides/html/web/w3c/communication/web_messaging_w.htm +++ b/org.tizen.guides/html/web/w3c/communication/web_messaging_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/communication/websocket_w.htm b/org.tizen.guides/html/web/w3c/communication/websocket_w.htm index 0d2aece..223274c 100644 --- a/org.tizen.guides/html/web/w3c/communication/websocket_w.htm +++ b/org.tizen.guides/html/web/w3c/communication/websocket_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/communication/xmlhttprequest_w.htm b/org.tizen.guides/html/web/w3c/communication/xmlhttprequest_w.htm index 52450ad..c942dc1 100644 --- a/org.tizen.guides/html/web/w3c/communication/xmlhttprequest_w.htm +++ b/org.tizen.guides/html/web/w3c/communication/xmlhttprequest_w.htm @@ -10,13 +10,13 @@ - XMLHttpRequest Level 1 and 2 + XMLHttpRequest (Level 1 and 2)
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          @@ -27,7 +27,7 @@

                                                        Related Info

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

                                                        XMLHttpRequest Level 1 and 2

                                                        +

                                                        XMLHttpRequest (Level 1 and 2)

                                                        You can send requests to and receive them from a Web server using JavaScript.

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/battery_w.htm b/org.tizen.guides/html/web/w3c/device/battery_w.htm index fc31fef..ca86400 100644 --- a/org.tizen.guides/html/web/w3c/device/battery_w.htm +++ b/org.tizen.guides/html/web/w3c/device/battery_w.htm @@ -17,7 +17,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/browser_state_w.htm b/org.tizen.guides/html/web/w3c/device/browser_state_w.htm index e3269ec..7aee3e6 100644 --- a/org.tizen.guides/html/web/w3c/device/browser_state_w.htm +++ b/org.tizen.guides/html/web/w3c/device/browser_state_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web

                                                        +

                                                        Mobile Web

                                                        @@ -31,16 +31,7 @@

                                                        HTML5 Browser state

                                                        - - - - - - - - - -
                                                        Note
                                                        This feature is supported in mobile applications only.
                                                        +

                                                        This feature is supported in mobile applications only.

                                                        You can access information about the network connection state of the browser.

                                                        The navigator.onLine attribute returns false, if the browser cannot establish a connection to the network when a remote page is requested. To track the changes in the connection state, you must subscribe to the applicable events: online and offline. The events can be executed in the Window or WorkerGlobalScope object.

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/device_guide_w.htm b/org.tizen.guides/html/web/w3c/device/device_guide_w.htm index 7bcf749..2a19862 100644 --- a/org.tizen.guides/html/web/w3c/device/device_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/device/device_guide_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/device_orientation_w.htm b/org.tizen.guides/html/web/w3c/device/device_orientation_w.htm index c9558d6..aa4e439 100644 --- a/org.tizen.guides/html/web/w3c/device/device_orientation_w.htm +++ b/org.tizen.guides/html/web/w3c/device/device_orientation_w.htm @@ -17,7 +17,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/screen_orientation_w.htm b/org.tizen.guides/html/web/w3c/device/screen_orientation_w.htm index a3e1c1d..8dd99ee 100644 --- a/org.tizen.guides/html/web/w3c/device/screen_orientation_w.htm +++ b/org.tizen.guides/html/web/w3c/device/screen_orientation_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web

                                                        +

                                                        Mobile Web

                                                        @@ -31,16 +31,7 @@

                                                        Screen Orientation

                                                        - - - - - - - - - -
                                                        Note
                                                        This feature is supported in mobile applications only.
                                                        +

                                                        This feature is supported in mobile applications only.

                                                        You can manage the screen orientation state through the Screen interface.

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/touch_w.htm b/org.tizen.guides/html/web/w3c/device/touch_w.htm index 092d3bc..1d162e4 100644 --- a/org.tizen.guides/html/web/w3c/device/touch_w.htm +++ b/org.tizen.guides/html/web/w3c/device/touch_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/device/vibration_w.htm b/org.tizen.guides/html/web/w3c/device/vibration_w.htm index cbc09f4..d9252e9 100644 --- a/org.tizen.guides/html/web/w3c/device/vibration_w.htm +++ b/org.tizen.guides/html/web/w3c/device/vibration_w.htm @@ -17,7 +17,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/graphics/canvas_w.htm b/org.tizen.guides/html/web/w3c/graphics/canvas_w.htm index dcf5049..6723ff5 100644 --- a/org.tizen.guides/html/web/w3c/graphics/canvas_w.htm +++ b/org.tizen.guides/html/web/w3c/graphics/canvas_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

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

                                                        The HTML5 canvas allows you to use graphics on the screen, and draw and manage various shapes. The HTML Canvas 2D Context API (in mobile or wearable applications) defines a special canvas element that expresses images or shapes with JavaScript. To use the canvas, you must insert a <canvas> element in the HTML page.

                                                        -

                                                        In the mobile applications only, in HTML5, the HTML5 SVG API (in mobile or wearable applications) provides similar features as the canvas. Their difference is that SVG expresses graphics using vectors, while the canvas is based on pixels. To express complex graphics, use the canvas, and to express graphics with a liberal expansion or reduction, use SVG. +

                                                        In mobile applications only, in HTML5, the HTML5 SVG API (in mobile or wearable applications) provides similar features as the canvas. Their difference is that SVG expresses graphics using vectors, while the canvas is based on pixels. To express complex graphics, use the canvas, and to express graphics with a liberal expansion or reduction, use SVG.

                                                        @@ -84,7 +84,7 @@ indicated, and then creates the image in the canvas. The created image is pixel-
                                                      • Create the applications with the following logic:
                                                        1. Load an image.
                                                        2. Render the loaded image in the random location of the canvas.
                                                        3. -
                                                        4. Use the requestAnimationFrame() method of the Timing control for script-based animations API (in mobile or wearable applications) to change the color of the loaded image, based on different times.
                                                        5. +
                                                        6. Use the requestAnimationFrame() method of the Timing control for script-based animations API (in mobile or wearable applications) to change the color of the loaded image, based on different times.
                                                        7. Create a logic that measures FPS (frames per second) in order to check the performance.
                                                      • Execute the applications and measure the FPS.
                                                      • Increase only the number of objects so that the same 1~N images, under the same conditions, are shown repeatedly based on 1~N.
                                                      • diff --git a/org.tizen.guides/html/web/w3c/graphics/graphics_guide_w.htm b/org.tizen.guides/html/web/w3c/graphics/graphics_guide_w.htm index d9ee89b..c66031b 100644 --- a/org.tizen.guides/html/web/w3c/graphics/graphics_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/graphics/graphics_guide_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/graphics/svg_w.htm b/org.tizen.guides/html/web/w3c/graphics/svg_w.htm index 9b11bfe..1631aad 100644 --- a/org.tizen.guides/html/web/w3c/graphics/svg_w.htm +++ b/org.tizen.guides/html/web/w3c/graphics/svg_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/guides_w3c_w.htm b/org.tizen.guides/html/web/w3c/guides_w3c_w.htm index 49f5e21..3fdd9be 100644 --- a/org.tizen.guides/html/web/w3c/guides_w3c_w.htm +++ b/org.tizen.guides/html/web/w3c/guides_w3c_w.htm @@ -18,7 +18,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        Related Info

                                                        @@ -59,7 +59,7 @@

                                                        Enables you to take advantage of supplementary features, such as full screen views, typed arrays, and the WebGL graphics library.

                                                        -

                                                        For more information about implementing the UI for your application using the W3C features, see W3C.

                                                        +

                                                        For more information about implementing the UI for your application using the W3C features, see W3C.

                                                        diff --git a/org.tizen.guides/html/web/w3c/location/geolocation_w.htm b/org.tizen.guides/html/web/w3c/location/geolocation_w.htm index 135e744..5d9be45 100644 --- a/org.tizen.guides/html/web/w3c/location/geolocation_w.htm +++ b/org.tizen.guides/html/web/w3c/location/geolocation_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        @@ -37,16 +37,6 @@

                                                        Geolocation defines a location information interface. Common sources of location information are GPS, location inferred from the network (such as IP address), RFID, Wi-Fi, Bluetooth MAC address, and GSM/CDMA cell IDs. The Geolocation interface is implemented by the Navigator object instances. The location information is represented by the latitude and longitude coordinates.

                                                        -
                                                        - - - - - - - - -
                                                        Note
                                                        In almost all cases, the location information reveals the location of the device user. To provide privacy for the user, a confirmation mechanism is provided for the geolocation features.

                                                        The Geolocation interface allows you to retrieve position information with "one-shot" position requests (with the getCurrentPosition() method) or repeated position updates (with the watchPosition() method). Both methods take the following parameters:

                                                          @@ -61,6 +51,18 @@
                                                        + + + + + + + + + + +
                                                        Note
                                                        In almost all cases, the location information reveals the location of the device user. To provide privacy for the user, a confirmation mechanism is provided for the geolocation features.
                                                        +
                                                        diff --git a/org.tizen.guides/html/web/w3c/location/location_guide_w.htm b/org.tizen.guides/html/web/w3c/location/location_guide_w.htm index a4fbee2..4fd18c2 100644 --- a/org.tizen.guides/html/web/w3c/location/location_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/location/location_guide_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/media/getusermedia_w.htm b/org.tizen.guides/html/web/w3c/media/getusermedia_w.htm index 159d639..fe92ee9 100644 --- a/org.tizen.guides/html/web/w3c/media/getusermedia_w.htm +++ b/org.tizen.guides/html/web/w3c/media/getusermedia_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/media/media_capture_w.htm b/org.tizen.guides/html/web/w3c/media/media_capture_w.htm index b71229b..b5d8b13 100644 --- a/org.tizen.guides/html/web/w3c/media/media_capture_w.htm +++ b/org.tizen.guides/html/web/w3c/media/media_capture_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web

                                                        +

                                                        Mobile Web

                                                        @@ -31,16 +31,7 @@

                                                        HTML Media Capture

                                                        - - - - - - - - - -
                                                        Note
                                                        This feature is supported in mobile applications only.
                                                        +

                                                        This feature is supported in mobile applications only.

                                                        Media capture uses the capture attribute of the HTMLInputElement interface to activate features, such as camera or microphone, to enable direct media capture when the user is uploading a file.

                                                        diff --git a/org.tizen.guides/html/web/w3c/media/media_guide_w.htm b/org.tizen.guides/html/web/w3c/media/media_guide_w.htm index cbb2777..972f059 100644 --- a/org.tizen.guides/html/web/w3c/media/media_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/media/media_guide_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/media/video_audio_w.htm b/org.tizen.guides/html/web/w3c/media/video_audio_w.htm index bb8e430..d456229 100644 --- a/org.tizen.guides/html/web/w3c/media/video_audio_w.htm +++ b/org.tizen.guides/html/web/w3c/media/video_audio_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/media/webaudio_w.htm b/org.tizen.guides/html/web/w3c/media/webaudio_w.htm index 24f44a7..db9950c 100644 --- a/org.tizen.guides/html/web/w3c/media/webaudio_w.htm +++ b/org.tizen.guides/html/web/w3c/media/webaudio_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web

                                                        +

                                                        Mobile Web

                                                        @@ -31,16 +31,7 @@

                                                        Web Audio

                                                        - - - - - - - - - -
                                                        Note
                                                        This feature is supported in mobile applications only.
                                                        +

                                                        This feature is supported in mobile applications only.

                                                        Tizen provides a high quality sound by setting space and direction through audio data, and synthesizing them. It is used in the audio engines of the sophisticated games to mix, process, and filter effects.

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/jquery_performance_improvement_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/jquery_performance_improvement_w.htm index b0b32b0..d49e996 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/jquery_performance_improvement_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/jquery_performance_improvement_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/js_performance_improvement_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/js_performance_improvement_w.htm index e772d67..1c9983b 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/js_performance_improvement_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/js_performance_improvement_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/minify_js_css_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/minify_js_css_w.htm index 1b5ee75..c085ede 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/minify_js_css_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/minify_js_css_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/page_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/page_w.htm index 9caf8ee..3f72d7c 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/page_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/page_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/performance_guide_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/performance_guide_w.htm index 05261fb..683784f 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/performance_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/performance_guide_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/timing_control_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/timing_control_w.htm index 834776a..3054325 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/timing_control_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/timing_control_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        diff --git a/org.tizen.guides/html/web/w3c/perf_opt/web_workers_w.htm b/org.tizen.guides/html/web/w3c/perf_opt/web_workers_w.htm index 14e2432..f126d3f 100644 --- a/org.tizen.guides/html/web/w3c/perf_opt/web_workers_w.htm +++ b/org.tizen.guides/html/web/w3c/perf_opt/web_workers_w.htm @@ -16,7 +16,7 @@
                                                        -

                                                        Mobile Web Wearable Web

                                                        +

                                                        Mobile Web Wearable Web

                                                        @@ -40,16 +40,7 @@

                                                        Web workers run JavaScript in an independent thread instead of the main UI thread, improving the JavaScript performance without affecting the UI.

                                                        Web workers are not DOM-dependent. They handle pure data, which makes them especially suitable for JavaScript code that takes a long time to execute.

                                                        - - - - - - - - - -
                                                        Note
                                                        Workers use a same-origin policy and therefore using some of the browser resources, such as DOM, document, window, and parent, is not possible, and they must be activated by creating separate JavaScript files. However, ECMA JavaScript and the methods included in the Web Workers API, such as postMessage(), location, navigator, and importScripts() can be used. The self and location attributes are also supported.
                                                        +

                                                        The main features of the Web Workers API include:

                                                        • Creating workers @@ -68,6 +59,17 @@ If a worker triggers a message event, the + + + Note + + + Workers use a same-origin policy and therefore using some of the browser resources, such as DOM, document, window, and parent, is not possible, and they must be activated by creating separate JavaScript files. However, ECMA JavaScript and the methods included in the Web Workers API, such as postMessage(), location, navigator, and importScripts() can be used. The self and location attributes are also supported. + + + +

                                                          JavaScript Performance

                                                          JavaScript was originally used for simple inspections and request handling. Therefore, the execution time was not an issue. However, with more advanced UI usage, the use of JavaScript code has been increased and become more complicated, significantly influencing the application performance.

                                                          diff --git a/org.tizen.guides/html/web/w3c/security/cors_w.htm b/org.tizen.guides/html/web/w3c/security/cors_w.htm index e8d1f4d..97a8510 100644 --- a/org.tizen.guides/html/web/w3c/security/cors_w.htm +++ b/org.tizen.guides/html/web/w3c/security/cors_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/security/iframe_w.htm b/org.tizen.guides/html/web/w3c/security/iframe_w.htm index a75e536..0a79ccd 100644 --- a/org.tizen.guides/html/web/w3c/security/iframe_w.htm +++ b/org.tizen.guides/html/web/w3c/security/iframe_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/security/security_guide_w.htm b/org.tizen.guides/html/web/w3c/security/security_guide_w.htm index 344c9de..8248eec 100644 --- a/org.tizen.guides/html/web/w3c/security/security_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/security/security_guide_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          @@ -36,8 +36,9 @@

                                                          The main security features are:

                                                            -
                                                          • HTML5 iframe element

                                                            Enables you to allow or block specific HTML elements on a Web page.

                                                          • Cross-Origin Resource Sharing

                                                            Enables you to make cross-origin requests to resources, allowing a client-side Web application to obtain data retrieved from another origin.

                                                          • +
                                                          • HTML5 iframe element

                                                            Enables you to allow or block specific HTML elements on a Web page.

                                                          • +
                                                          diff --git a/org.tizen.guides/html/web/w3c/storage/appcache_w.htm b/org.tizen.guides/html/web/w3c/storage/appcache_w.htm index b106dee..5313533 100644 --- a/org.tizen.guides/html/web/w3c/storage/appcache_w.htm +++ b/org.tizen.guides/html/web/w3c/storage/appcache_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          @@ -32,16 +32,7 @@

                                                          HTML5 Application caches

                                                          - - - - - - - - - -
                                                          Note
                                                          This feature is supported in mobile applications only.
                                                          +

                                                          This feature is supported in mobile applications only.

                                                          HTML5 application caches can be used to store and utilize resources needed in Web applications, such as HTML, CSS, and JavaScript files, and images.

                                                          You can cache certain files in the browser to use them in an offline state, or define them to be always updated from the server.

                                                          diff --git a/org.tizen.guides/html/web/w3c/storage/file_w.htm b/org.tizen.guides/html/web/w3c/storage/file_w.htm index d953b98..27d37a6 100644 --- a/org.tizen.guides/html/web/w3c/storage/file_w.htm +++ b/org.tizen.guides/html/web/w3c/storage/file_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/storage/indexdb_w.htm b/org.tizen.guides/html/web/w3c/storage/indexdb_w.htm index 88476d5..a58e1c8 100644 --- a/org.tizen.guides/html/web/w3c/storage/indexdb_w.htm +++ b/org.tizen.guides/html/web/w3c/storage/indexdb_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/storage/storage_guide_w.htm b/org.tizen.guides/html/web/w3c/storage/storage_guide_w.htm index 12f9a0a..1724925 100644 --- a/org.tizen.guides/html/web/w3c/storage/storage_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/storage/storage_guide_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/storage/web_storage_w.htm b/org.tizen.guides/html/web/w3c/storage/web_storage_w.htm index dd1f8b2..44e9345 100644 --- a/org.tizen.guides/html/web/w3c/storage/web_storage_w.htm +++ b/org.tizen.guides/html/web/w3c/storage/web_storage_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web Wearable Web

                                                          +

                                                          Mobile Web Wearable Web

                                                          diff --git a/org.tizen.guides/html/web/w3c/storage/websql_w.htm b/org.tizen.guides/html/web/w3c/storage/websql_w.htm index 6eedeaf..fa918f5 100644 --- a/org.tizen.guides/html/web/w3c/storage/websql_w.htm +++ b/org.tizen.guides/html/web/w3c/storage/websql_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          @@ -31,17 +31,8 @@

                                                          Web SQL Database

                                                          - - - - - - - - - -
                                                          Note
                                                          This feature is supported in mobile applications only.
                                                          - +

                                                          This feature is supported in mobile applications only.

                                                          +

                                                          The Web SQL database provides a way to store databases that can be queried using various SQL statements.

                                                          diff --git a/org.tizen.guides/html/web/w3c/supplement/camera_w.htm b/org.tizen.guides/html/web/w3c/supplement/camera_w.htm index b39c258..5ed9b7d 100644 --- a/org.tizen.guides/html/web/w3c/supplement/camera_w.htm +++ b/org.tizen.guides/html/web/w3c/supplement/camera_w.htm @@ -16,7 +16,7 @@

                                                          -

                                                          Wearable Web

                                                          +

                                                          Wearable Web

                                                          @@ -33,16 +33,7 @@

                                                          Camera API (Tizen Extension)

                                                          - - - - - - - - - -
                                                          Note
                                                          This feature is supported in wearable applications only.
                                                          +

                                                          This feature is supported in wearable applications only.

                                                          You can use the camera features in the Tizen wearable Web applications.

                                                          The main features of the Camera API (Tizen Extension) API include:

                                                          diff --git a/org.tizen.guides/html/web/w3c/supplement/fullscreen_w.htm b/org.tizen.guides/html/web/w3c/supplement/fullscreen_w.htm index 417a135..80e6492 100644 --- a/org.tizen.guides/html/web/w3c/supplement/fullscreen_w.htm +++ b/org.tizen.guides/html/web/w3c/supplement/fullscreen_w.htm @@ -16,7 +16,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          @@ -31,16 +31,7 @@

                                                          FullScreen API - Mozilla

                                                          - - - - - - - - - -
                                                          Note
                                                          This feature is supported in mobile applications only.
                                                          +

                                                          This feature is supported in mobile applications only.

                                                          You can display an element in the fullscreen mode:

                                                          • With the webkitRequestFullScreen() method, you can convert a specific element to fullscreen.
                                                          • diff --git a/org.tizen.guides/html/web/w3c/supplement/supplement_guide_w.htm b/org.tizen.guides/html/web/w3c/supplement/supplement_guide_w.htm index 9bc0e44..35708b2 100644 --- a/org.tizen.guides/html/web/w3c/supplement/supplement_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/supplement/supplement_guide_w.htm @@ -16,7 +16,7 @@
                                                            -

                                                            Mobile Web Wearable Web

                                                            +

                                                            Mobile Web Wearable Web

                                                            diff --git a/org.tizen.guides/html/web/w3c/supplement/typedarray_w.htm b/org.tizen.guides/html/web/w3c/supplement/typedarray_w.htm index badb380..2b407a7 100644 --- a/org.tizen.guides/html/web/w3c/supplement/typedarray_w.htm +++ b/org.tizen.guides/html/web/w3c/supplement/typedarray_w.htm @@ -16,7 +16,7 @@
                                                            -

                                                            Mobile Web Wearable Web

                                                            +

                                                            Mobile Web Wearable Web

                                                            diff --git a/org.tizen.guides/html/web/w3c/supplement/webgl_w.htm b/org.tizen.guides/html/web/w3c/supplement/webgl_w.htm index 691071e..541f51f 100644 --- a/org.tizen.guides/html/web/w3c/supplement/webgl_w.htm +++ b/org.tizen.guides/html/web/w3c/supplement/webgl_w.htm @@ -16,7 +16,7 @@
                                                            -

                                                            Mobile Web Wearable Web

                                                            +

                                                            Mobile Web Wearable Web

                                                            diff --git a/org.tizen.guides/html/web/w3c/useful/performance_w.htm b/org.tizen.guides/html/web/w3c/useful/performance_w.htm index 970648a..59e9407 100644 --- a/org.tizen.guides/html/web/w3c/useful/performance_w.htm +++ b/org.tizen.guides/html/web/w3c/useful/performance_w.htm @@ -16,7 +16,7 @@
                                                            -

                                                            Wearable Web

                                                            +

                                                            Wearable Web

                                                            @@ -35,16 +35,7 @@

                                                            Performance Improvement

                                                            - - - - - - - - - -
                                                            Note
                                                            This feature is supported in wearable applications only.
                                                            +

                                                            This feature is supported in wearable applications only.

                                                            With the following instructions, you can improve the performance of your wearable Web applications. The instructions summarize some representative tips that are frequently used in the Web community.

                                                              diff --git a/org.tizen.guides/html/web/w3c/useful/sound_policy_w.htm b/org.tizen.guides/html/web/w3c/useful/sound_policy_w.htm index b94dd25..6071a2f 100644 --- a/org.tizen.guides/html/web/w3c/useful/sound_policy_w.htm +++ b/org.tizen.guides/html/web/w3c/useful/sound_policy_w.htm @@ -22,11 +22,13 @@
                                                              -

                                                              Mobile Web

                                                              +

                                                              Mobile Web

                                                              Tizen WebKit Tap Sound Policy

                                                              +

                                                              This feature is supported in mobile applications only.

                                                              +

                                                              To provide responsiveness on user interaction, Tizen WebKit plays sounds when a user taps an element and specific conditions are fulfilled.

                                                              Sound is not played in case of a tap event for:

                                                                diff --git a/org.tizen.guides/html/web/w3c/useful/useful_guide_w.htm b/org.tizen.guides/html/web/w3c/useful/useful_guide_w.htm index cf0b44e..621b852 100644 --- a/org.tizen.guides/html/web/w3c/useful/useful_guide_w.htm +++ b/org.tizen.guides/html/web/w3c/useful/useful_guide_w.htm @@ -19,7 +19,7 @@
                                                                -

                                                                Mobile Web Wearable Web

                                                                +

                                                                Mobile Web Wearable Web

                                                                Useful Guides for W3C/HTML5 Features

                                                                diff --git a/org.tizen.guides/index.xml b/org.tizen.guides/index.xml index ed4afe5..ad1df44 100644 --- a/org.tizen.guides/index.xml +++ b/org.tizen.guides/index.xml @@ -10,6 +10,7 @@ + @@ -83,7 +84,7 @@ - + @@ -94,8 +95,8 @@ + - @@ -121,14 +122,22 @@ - + + - + + - - + + + + + + + + @@ -137,8 +146,8 @@ - + @@ -159,11 +168,12 @@ + - + @@ -187,14 +197,14 @@ - + - + @@ -203,10 +213,9 @@ - - + - + @@ -225,6 +234,7 @@ + @@ -236,8 +246,5 @@ - - - diff --git a/org.tizen.sampledescriptions/META-INF/MANIFEST.MF b/org.tizen.sampledescriptions/META-INF/MANIFEST.MF index 88f81e0..5938022 100644 --- a/org.tizen.sampledescriptions/META-INF/MANIFEST.MF +++ b/org.tizen.sampledescriptions/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 1 -Bundle-Name: Tizen Sample Applications +Bundle-Name: Tizen Sample Descriptions Bundle-SymbolicName: org.tizen.sampledescriptions;singleton=true Bundle-Version: 2.4.0 Bundle-Vendor: The Linux Foundation diff --git a/org.tizen.sampledescriptions/html/cover_page.htm b/org.tizen.sampledescriptions/html/cover_page.htm index 8a97391..08bbf80 100644 --- a/org.tizen.sampledescriptions/html/cover_page.htm +++ b/org.tizen.sampledescriptions/html/cover_page.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile Web Wearable Web Mobile native Wearable native

                                                                +

                                                                Mobile Wearable

                                                                Tizen
                                                                diff --git a/org.tizen.sampledescriptions/html/images/bundle_data_sink_view_sd.png b/org.tizen.sampledescriptions/html/images/bundle_data_sink_view_sd.png index 73a67bd..8820c18 100644 Binary files a/org.tizen.sampledescriptions/html/images/bundle_data_sink_view_sd.png and b/org.tizen.sampledescriptions/html/images/bundle_data_sink_view_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/bundle_data_source_basic_view_sd.png b/org.tizen.sampledescriptions/html/images/bundle_data_source_basic_view_sd.png index 534ce17..5e1c110 100644 Binary files a/org.tizen.sampledescriptions/html/images/bundle_data_source_basic_view_sd.png and b/org.tizen.sampledescriptions/html/images/bundle_data_source_basic_view_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/bundle_data_source_filled_view_sd.png b/org.tizen.sampledescriptions/html/images/bundle_data_source_filled_view_sd.png index 76350b0..54d4a62 100644 Binary files a/org.tizen.sampledescriptions/html/images/bundle_data_source_filled_view_sd.png and b/org.tizen.sampledescriptions/html/images/bundle_data_source_filled_view_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/mediacontrol_client_sd.png b/org.tizen.sampledescriptions/html/images/mediacontrol_client_sd.png new file mode 100644 index 0000000..c8de205 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/mediacontrol_client_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/mediacontrol_server_sd.png b/org.tizen.sampledescriptions/html/images/mediacontrol_server_sd.png new file mode 100644 index 0000000..db89559 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/mediacontrol_server_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_data_sink_view_sd.png b/org.tizen.sampledescriptions/html/images/messageport_data_sink_view_sd.png new file mode 100644 index 0000000..ab209d3 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_data_sink_view_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_data_source_view_sd.png b/org.tizen.sampledescriptions/html/images/messageport_data_source_view_sd.png new file mode 100644 index 0000000..40fc25d Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_data_source_view_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_edje_layout_data_sink_sd.png b/org.tizen.sampledescriptions/html/images/messageport_edje_layout_data_sink_sd.png new file mode 100644 index 0000000..36a1a85 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_edje_layout_data_sink_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_edje_layout_data_source_sd.png b/org.tizen.sampledescriptions/html/images/messageport_edje_layout_data_source_sd.png new file mode 100644 index 0000000..a450169 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_edje_layout_data_source_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_edje_layout_main_sd.png b/org.tizen.sampledescriptions/html/images/messageport_edje_layout_main_sd.png new file mode 100644 index 0000000..92564f9 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_edje_layout_main_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_edje_structure_data_sink_sd.png b/org.tizen.sampledescriptions/html/images/messageport_edje_structure_data_sink_sd.png new file mode 100644 index 0000000..4c01779 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_edje_structure_data_sink_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_edje_structure_data_source_sd.png b/org.tizen.sampledescriptions/html/images/messageport_edje_structure_data_source_sd.png new file mode 100644 index 0000000..e76c406 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_edje_structure_data_source_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_ui_layout_data_sink_sd.png b/org.tizen.sampledescriptions/html/images/messageport_ui_layout_data_sink_sd.png new file mode 100644 index 0000000..1bcd184 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_ui_layout_data_sink_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_ui_layout_data_source_sd.png b/org.tizen.sampledescriptions/html/images/messageport_ui_layout_data_source_sd.png new file mode 100644 index 0000000..2ae87d6 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_ui_layout_data_source_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_ui_layout_main_sd.png b/org.tizen.sampledescriptions/html/images/messageport_ui_layout_main_sd.png new file mode 100644 index 0000000..243aa6d Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_ui_layout_main_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_ui_structure_data_sink_sd.png b/org.tizen.sampledescriptions/html/images/messageport_ui_structure_data_sink_sd.png new file mode 100644 index 0000000..454c392 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_ui_structure_data_sink_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_ui_structure_data_source_sd.png b/org.tizen.sampledescriptions/html/images/messageport_ui_structure_data_source_sd.png new file mode 100644 index 0000000..09e7b42 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_ui_structure_data_source_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_workflow_message_structure_sd.png b/org.tizen.sampledescriptions/html/images/messageport_workflow_message_structure_sd.png new file mode 100644 index 0000000..5596970 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_workflow_message_structure_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_workflow_startup_sd.png b/org.tizen.sampledescriptions/html/images/messageport_workflow_startup_sd.png new file mode 100644 index 0000000..bf17348 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_workflow_startup_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_workflow_text_receive_sd.png b/org.tizen.sampledescriptions/html/images/messageport_workflow_text_receive_sd.png new file mode 100644 index 0000000..4b5ad2a Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_workflow_text_receive_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/messageport_workflow_text_send_sd.png b/org.tizen.sampledescriptions/html/images/messageport_workflow_text_send_sd.png new file mode 100644 index 0000000..2cdbab9 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/messageport_workflow_text_send_sd.png differ diff --git a/org.tizen.sampledescriptions/html/images/mn_division.png b/org.tizen.sampledescriptions/html/images/mn_division.png index 1f7e337..faecb28 100644 Binary files a/org.tizen.sampledescriptions/html/images/mn_division.png and b/org.tizen.sampledescriptions/html/images/mn_division.png differ diff --git a/org.tizen.sampledescriptions/html/images/mobile_s_n.png b/org.tizen.sampledescriptions/html/images/mobile_s_n.png new file mode 100644 index 0000000..ad8c779 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/mobile_s_n.png differ diff --git a/org.tizen.sampledescriptions/html/images/mobile_s_w.png b/org.tizen.sampledescriptions/html/images/mobile_s_w.png new file mode 100644 index 0000000..f86df29 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/mobile_s_w.png differ diff --git a/org.tizen.sampledescriptions/html/images/mobile_s_wn.png b/org.tizen.sampledescriptions/html/images/mobile_s_wn.png new file mode 100644 index 0000000..ec30fd2 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/mobile_s_wn.png differ diff --git a/org.tizen.sampledescriptions/html/images/mw_division.png b/org.tizen.sampledescriptions/html/images/mw_division.png index 8fc3efa..c4a8655 100644 Binary files a/org.tizen.sampledescriptions/html/images/mw_division.png and b/org.tizen.sampledescriptions/html/images/mw_division.png differ diff --git a/org.tizen.sampledescriptions/html/images/n_division.png b/org.tizen.sampledescriptions/html/images/n_division.png index d687bc5..5a0b8f6 100644 Binary files a/org.tizen.sampledescriptions/html/images/n_division.png and b/org.tizen.sampledescriptions/html/images/n_division.png differ diff --git a/org.tizen.sampledescriptions/html/images/uicomponent_mobile.png b/org.tizen.sampledescriptions/html/images/uicomponent_mobile.png index 156068e..0968c1a 100644 Binary files a/org.tizen.sampledescriptions/html/images/uicomponent_mobile.png and b/org.tizen.sampledescriptions/html/images/uicomponent_mobile.png differ diff --git a/org.tizen.sampledescriptions/html/images/w_division.png b/org.tizen.sampledescriptions/html/images/w_division.png index 88d9959..443a1ea 100644 Binary files a/org.tizen.sampledescriptions/html/images/w_division.png and b/org.tizen.sampledescriptions/html/images/w_division.png differ diff --git a/org.tizen.sampledescriptions/html/images/wearable_s_n.png b/org.tizen.sampledescriptions/html/images/wearable_s_n.png new file mode 100644 index 0000000..02e3791 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/wearable_s_n.png differ diff --git a/org.tizen.sampledescriptions/html/images/wearable_s_w.png b/org.tizen.sampledescriptions/html/images/wearable_s_w.png new file mode 100644 index 0000000..379a9c5 Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/wearable_s_w.png differ diff --git a/org.tizen.sampledescriptions/html/images/wearable_s_wn.png b/org.tizen.sampledescriptions/html/images/wearable_s_wn.png new file mode 100644 index 0000000..280245d Binary files /dev/null and b/org.tizen.sampledescriptions/html/images/wearable_s_wn.png differ diff --git a/org.tizen.sampledescriptions/html/images/wn_division.png b/org.tizen.sampledescriptions/html/images/wn_division.png index 11a7876..dca667f 100644 Binary files a/org.tizen.sampledescriptions/html/images/wn_division.png and b/org.tizen.sampledescriptions/html/images/wn_division.png differ diff --git a/org.tizen.sampledescriptions/html/images/ww_division.png b/org.tizen.sampledescriptions/html/images/ww_division.png index 65e7ab7..5f5160c 100644 Binary files a/org.tizen.sampledescriptions/html/images/ww_division.png and b/org.tizen.sampledescriptions/html/images/ww_division.png differ diff --git a/org.tizen.sampledescriptions/html/index.htm b/org.tizen.sampledescriptions/html/index.htm index f191479..90a32ba 100644 --- a/org.tizen.sampledescriptions/html/index.htm +++ b/org.tizen.sampledescriptions/html/index.htm @@ -54,6 +54,7 @@
                                                              • Systeminfo
                                                              • TouchPaint
                                                              • UIComponent
                                                              • +

                                                            • Wearable Web @@ -104,13 +105,15 @@
                                                            • HybridServiceApp
                                                            • Lockscreen
                                                            • Media App
                                                            • +
                                                            • Media-controller-client
                                                            • +
                                                            • Media-controller-server
                                                            • +
                                                            • Message Port
                                                            • Notification Manager
                                                            • Paint
                                                            • Pedometer
                                                            • Piano
                                                            • Preference
                                                            • Puzzle
                                                            • -
                                                            • Quickpanel
                                                            • Scheduler
                                                            • Scroller Index
                                                            • SelfCamera
                                                            • @@ -180,7 +183,7 @@
                                                            • (Rectangle) UI Dialer
                                                            • Analog Watch
                                                            • Digital-Watch
                                                            • -
                                                            • EvasGLCube
                                                            • +
                                                            • EvasGLCube
                                                            • GLView11Cube
                                                            • GLViewCube
                                                            • GLViewShader
                                                            • diff --git a/org.tizen.sampledescriptions/html/mobile_n/application_control_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/application_control_sd_mn.htm index 55c5e32..88328ba 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/application_control_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/application_control_sd_mn.htm @@ -20,21 +20,21 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Application Control Sample Overview

                                                              -

                                                              The Application Control sample application uses the App Control API to search for applications supporting specific operations. The following operations have been selected in this application:

                                                              +

                                                              The Application Control sample application uses the App Control API to search for applications supporting specific operations. The following operations have been selected in this application:

                                                              • APP_CONTROL_OPERATION_VIEW: enables data display
                                                              • APP_CONTROL_OPERATION_PICK: picks an item from the data
                                                              • APP_CONTROL_OPERATION_COMPOSE: composes (for example a message)
                                                              -

                                                              The figure below illustrates the application view.

                                                              -

                                                              Figure: Application control view

                                                              +

                                                              The following figure illustrates the application view.

                                                              +

                                                              Figure: Application Control view

                                                              Application control view

                                                              -

                                                              In the main window the application launch panel enables the user to choose one of the available operations, and search, run, and stop found applications. The message composing area enables the user to compose a message, set the destination address, and send it using the default email application.

                                                              +

                                                              In the main window, the application launch panel enables the user to choose one of the available operations, and search, run, and stop found applications. The message composing area enables the user to compose a message, set the destination address, and send it using the default email application.

                                                              Prerequisites

                                                              To ensure proper application execution, the following privileges must be set:

                                                              @@ -48,10 +48,11 @@

                                                              Implementation

                                                              Application Launch Panel

                                                              -

                                                              The controller_search_app() function is invoked on a search button click event.

                                                              +

                                                              The controller_search_app() function is invoked on a search button click event:

                                                              -void controller_search_app(int selected_operation_id)
                                                              +void 
                                                              +controller_search_app(int selected_operation_id)
                                                               {
                                                                  app_control_h app_control = NULL;
                                                               
                                                              @@ -76,7 +77,8 @@ void controller_search_app(int selected_operation_id)
                                                               
                                                               

                                                              After the call to the app_control_foreach_app_matched() function, the app_control_application_matched_cb() function is called for each installed application that meets the criteria specified by the operation type. On each call to this function, one radio button is added to the popup window.

                                                              -static bool app_control_application_matched_cb(app_control_h app_control, const char *appid, void *user_data)
                                                              +static bool 
                                                              +app_control_application_matched_cb(app_control_h app_control, const char *appid, void *user_data)
                                                               {
                                                                  bool new_radio_group = false;
                                                               
                                                              @@ -96,9 +98,10 @@ static bool app_control_application_matched_cb(app_control_h app_control, const
                                                               

                                                              Once the user has chosen an application from the popup window, the Execute button becomes available. The following code is invoked upon the click event.

                                                              -

                                                              The following code launches the selected application using app_control_send_launch_request() API function. Note that it also sets some additional operation data using the app_control_add_extra_data() function. This way, if the application supports these data keys, its behaviour is altered. For instance, the email application is started in the message creation mode. All the necessary message fields are filled with the defined extra data and the message is ready to be sent.

                                                              +

                                                              The controller_execute() function launches the selected application using the app_control_send_launch_request() function. Note that it also sets some additional operation data using the app_control_add_extra_data() function. This way, if the application supports these data keys, its behavior is altered. For instance, the email application is started in the message creation mode. All the necessary message fields are filled with the defined extra data and the message is ready to be sent.

                                                              -void controller_execute(void)
                                                              +void 
                                                              +controller_execute(void)
                                                               {
                                                                  // Declare the variables
                                                               
                                                              @@ -135,10 +138,11 @@ void controller_execute(void)
                                                               
                                                               

                                                              Message Composing Area

                                                              -

                                                              This sample application also gives the user the possibility to compose a message and launch the default email application for the message to be sent. When Send message button is clicked, the following code is executed:

                                                              +

                                                              This sample application gives the user the possibility to compose a message and launch the default email application for the message to be sent. When Send message button is clicked, the following code is executed:

                                                              -void controller_send_message(const char *email_address, const char *email_body)
                                                              +void 
                                                              +controller_send_message(const char *email_address, const char *email_body)
                                                               {
                                                                  app_control_h app_control = NULL;
                                                               
                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/bluetoothchat_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/bluetoothchat_sd_mn.htm
                                                              index 1598d1c..506563f 100644
                                                              --- a/org.tizen.sampledescriptions/html/mobile_n/bluetoothchat_sd_mn.htm
                                                              +++ b/org.tizen.sampledescriptions/html/mobile_n/bluetoothchat_sd_mn.htm
                                                              @@ -20,29 +20,30 @@
                                                               
                                                               
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Bluetooth Chat Sample Overview

                                                              -

                                                              The Bluetooth Chat sample application demonstrates how you can send and receive data between two devices.

                                                              +

                                                              The Bluetooth Chat sample application demonstrates how you can send and receive data between 2 devices.

                                                              The following figure illustrates the screens of the sample application.

                                                              Figure: Bluetooth Chat screens

                                                              Bluetooth screens Bluetooth screens

                                                              -

                                                              The main screen has 2 buttons for finding devices and creating a server. The chat room screen is created with the [UI Sample] MessageBubble sample application.

                                                              +

                                                              The main screen has 2 buttons for finding devices (Search friends) and creating a server (Wait a friend). The chat room screen is created with the [UI Sample] MessageBubble sample application.

                                                              Implementation

                                                              -

                                                              By clicking the buttons, the application calls the bt_mgr_initialize() function, and checks whether the Bluetooth is on or off. If Bluetooth is off, the application calls the Bluetooth ON/OFF application to turn on Bluetooth.

                                                              +

                                                              After a button click, the application calls the bt_mgr_initialize() function, and checks whether Bluetooth is on or off. If Bluetooth is off, the application calls the Bluetooth ON/OFF application to switch Bluetooth on.

                                                              Figure: Bluetooth ON/OFF application

                                                              Bluetooth ON/OFF application Bluetooth ON/OFF application

                                                              -

                                                              If the bt_mgr_initialize() function is called and Bluetooth is on, it draws proper layouts according to the roles of the application, as a client or a server.

                                                              +

                                                              If the bt_mgr_initialize() function is called and Bluetooth is on, the application draws proper layouts according to its current role (client or server):

                                                              -void bt_mgr_initialize(void *data, bt_mgr_type type)
                                                              +void 
                                                              +bt_mgr_initialize(void *data, bt_mgr_type type)
                                                               {
                                                                  appdata_s *ad = NULL;
                                                                  bt_adapter_state_e bt_ad_state = BT_ADAPTER_DISABLED;
                                                              @@ -90,7 +91,8 @@ void bt_mgr_initialize(void *data, bt_mgr_type type)
                                                                     }
                                                                  }
                                                               }
                                                              -static void _onoff_operation(void)
                                                              +static void 
                                                              +_onoff_operation(void)
                                                               {
                                                                  int ret = 0;
                                                                  app_control_h service = NULL;
                                                              @@ -112,9 +114,10 @@ static void _onoff_operation(void)
                                                               
                                                               

                                                              Client

                                                              -

                                                              A client is an application which is started by clicking the button, Search Friends. It draws its own layout by the _search_layout_create() function, which is called by the bt_mgr_initialize() function. The layout is a list of the found devices.

                                                              +

                                                              To start the client application, click Search Friends. The client draws its own layout by the _search_layout_create() function, which is called by the bt_mgr_initialize() function. The layout is a list of the found devices.

                                                              -static void _search_layout_create(appdata_s *ad)
                                                              +static void 
                                                              +_search_layout_create(appdata_s *ad)
                                                               {
                                                                  int ret = 0;
                                                               
                                                              @@ -139,9 +142,10 @@ static void _search_layout_create(appdata_s *ad)
                                                               }
                                                               
                                                              -

                                                              While drawing the list, the application starts finding devices by the _discovery_start() function. Set the device discovery state changed callback, and update the list whenever new device is found.

                                                              +

                                                              While drawing the list, the application starts finding devices with the _discovery_start() function. Set the device discovery state changed callback, and update the list whenever a new device is found.

                                                              -static void _discovery_start(appdata_s *ad)
                                                              +static void 
                                                              +_discovery_start(appdata_s *ad)
                                                               {
                                                                  bt_error_e ret = BT_ERROR_NONE;
                                                               
                                                              @@ -157,8 +161,9 @@ static void _discovery_start(appdata_s *ad)
                                                                  ret_if(ret != BT_ERROR_NONE);
                                                               }
                                                               
                                                              -static void _adapter_discovery_state_changed_cb(int result, bt_adapter_device_discovery_state_e discovery_state, 
                                                              -                                                bt_adapter_device_discovery_info_s *discovery_info, void *user_data)
                                                              +static void 
                                                              +_adapter_discovery_state_changed_cb(int result, bt_adapter_device_discovery_state_e discovery_state, 
                                                              +                                    bt_adapter_device_discovery_info_s *discovery_info, void *user_data)
                                                               {
                                                                  appdata_s *ad = NULL;
                                                                  bt_adapter_device_discovery_info_s *new_device_info = NULL;
                                                              @@ -206,10 +211,11 @@ static void _adapter_discovery_state_changed_cb(int result, bt_adapter_device_di
                                                               }
                                                               
                                                              -

                                                              If an item on the list is clicked, the application starts to bond with the target device, and requests to connect to the target server.

                                                              +

                                                              If an item on the list is clicked, the application starts to bond with the target device, and requests to connect to the target server:

                                                              -static void _socket_conn_state_changed_cb(int result, bt_socket_connection_state_e connection_state, 
                                                              -                                          bt_socket_connection_s *connection, void *user_data)
                                                              +static void 
                                                              +_socket_conn_state_changed_cb(int result, bt_socket_connection_state_e connection_state, 
                                                              +                              bt_socket_connection_s *connection, void *user_data)
                                                               {
                                                                  appdata_s *ad = (appdata_s *)user_data;
                                                                  ret_if(!ad);
                                                              @@ -243,7 +249,8 @@ static void _socket_conn_state_changed_cb(int result, bt_socket_connection_state
                                                                  }
                                                               }
                                                               
                                                              -static void _device_bond_created_cb(int result, bt_device_info_s *device_info, void *user_data)
                                                              +static void 
                                                              +_device_bond_created_cb(int result, bt_device_info_s *device_info, void *user_data)
                                                               {
                                                                  int ret = 0;
                                                               
                                                              @@ -271,25 +278,26 @@ static void _device_bond_created_cb(int result, bt_device_info_s *device_info, v
                                                               
                                                                  return;
                                                               
                                                              -DEL_NOTI:
                                                              +   DEL_NOTI:
                                                               
                                                              -   if (s_info.noti) 
                                                              -   {
                                                              -      evas_object_del(s_info.noti);
                                                              -      s_info.noti = NULL;
                                                              -   }
                                                              +      if (s_info.noti) 
                                                              +      {
                                                              +         evas_object_del(s_info.noti);
                                                              +         s_info.noti = NULL;
                                                              +      }
                                                               
                                                              -   return;
                                                              +      return;
                                                               }
                                                               
                                                              -

                                                              If successfully connected with the target, the _socket_conn_state_changed_cb() function is called and the application moves to the chat room layout by calling the _bt_chat_room_layout_create() function.

                                                              +

                                                              When the application is successfully connected with the target, the _socket_conn_state_changed_cb() function is called and the application moves to the chat room layout by calling the _bt_chat_room_layout_create() function.

                                                              Server

                                                              -

                                                              A server is an application which is started by clicking Wait a friend. The role of this application is making a server for chatting, and waiting for a client. Before drawing the proper layout, the application checks whether the device is discoverable or not by the _search_layout_create() function. If the device is not discoverable, the application calls the Bluetooth Visibility Application.

                                                              +

                                                              To start the server application, click Wait a friend. The role of this application is making a server for chatting, and waiting for a client. Before drawing the proper layout, the application checks whether the device is discoverable by using the _search_layout_create() function. If the device is not discoverable, the application calls the Bluetooth Visibility application.

                                                              -static void _visibility_operation_set(void)
                                                              +static void 
                                                              +_visibility_operation_set(void)
                                                               {
                                                                  app_control_h service = NULL;
                                                                  int ret = 0;
                                                              @@ -309,9 +317,10 @@ static void _visibility_operation_set(void)
                                                               }
                                                               
                                                              -

                                                              A server application also registers the callback for detecting the state of the socket connection. The callback function is same as that of client. The application creates a server, and when the socket connection state changes to BT_SOCKET_CONNECTED, it moves to the chat room layout.

                                                              +

                                                              A server application also registers the callback for detecting the state of the socket connection. The callback function is same as that of the client. The application creates a server, and when the socket connection state changes to BT_SOCKET_CONNECTED, it moves to the chat room layout.

                                                              -static void _server_layout_create(appdata_s *ad)
                                                              +static void 
                                                              +_server_layout_create(appdata_s *ad)
                                                               {
                                                                  Evas_Object *layout = NULL;
                                                                  Evas_Object *progress = NULL;
                                                              @@ -341,20 +350,20 @@ static void _server_layout_create(appdata_s *ad)
                                                               
                                                                  return;
                                                               
                                                              -ERROR:
                                                              -   if (layout) 
                                                              -   {
                                                              -      evas_object_del(layout);
                                                              -      layout = NULL;
                                                              -   }
                                                              +   ERROR:
                                                              +      if (layout) 
                                                              +      {
                                                              +         evas_object_del(layout);
                                                              +         layout = NULL;
                                                              +      }
                                                               
                                                              -   if (progress) 
                                                              -   {
                                                              -      evas_object_del(progress);
                                                              -      progress = NULL;
                                                              -   }
                                                              +      if (progress) 
                                                              +      {
                                                              +         evas_object_del(progress);
                                                              +         progress = NULL;
                                                              +      }
                                                               
                                                              -   return;
                                                              +      return;
                                                               }
                                                               
                                                              @@ -365,7 +374,8 @@ ERROR:
                                                            • Draw the layout:
                                                              -static Evas_Object *_main_view_create(appdata_s *ad)
                                                              +static Evas_Object 
                                                              +*_main_view_create(appdata_s *ad)
                                                               {
                                                                  Evas_Object *main_scroller = NULL;
                                                                  Evas_Object *input_field_table = NULL;
                                                              @@ -410,23 +420,24 @@ static Evas_Object *_main_view_create(appdata_s *ad)
                                                               
                                                                  return main_scroller;
                                                               
                                                              -ERROR:
                                                              -   if (main_scroller) 
                                                              -   {
                                                              -      evas_object_del(main_scroller);
                                                              -      main_scroller = NULL;
                                                              -   }
                                                              +   ERROR:
                                                              +      if (main_scroller) 
                                                              +      {
                                                              +         evas_object_del(main_scroller);
                                                              +         main_scroller = NULL;
                                                              +      }
                                                               
                                                              -   if (input_field_table) 
                                                              -   {
                                                              -      evas_object_del(input_field_table);
                                                              -      input_field_table = NULL;
                                                              -   }
                                                              +      if (input_field_table) 
                                                              +      {
                                                              +         evas_object_del(input_field_table);
                                                              +         input_field_table = NULL;
                                                              +      }
                                                               
                                                              -   return NULL;
                                                              +      return NULL;
                                                               }
                                                               
                                                              -static void _on_main_scroller_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                              +static void 
                                                              +_on_main_scroller_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                               {
                                                                  if (s_info.main_box) 
                                                                  {
                                                              @@ -456,8 +467,9 @@ static void _on_main_scroller_del_cb(void *data, Evas *e, Evas_Object *obj, void
                                                               
                                                            • Manage the connection state changes:
                                                              -static void _socket_conn_state_changed_cb(int result, bt_socket_connection_state_e connection_state, 
                                                              -                                          bt_socket_connection_s *connection, void *user_data)
                                                              +static void 
                                                              +_socket_conn_state_changed_cb(int result, bt_socket_connection_state_e connection_state, 
                                                              +                              bt_socket_connection_s *connection, void *user_data)
                                                               {
                                                                  Evas_Object *noti = NULL;
                                                                  appdata_s *ad = NULL;
                                                              @@ -478,7 +490,8 @@ static void _socket_conn_state_changed_cb(int result, bt_socket_connection_state
                                                               
                                                            • Receive the data:
                                                              -static void _socket_data_received_cb(bt_socket_received_data_s *data, void *user_data)
                                                              +static void 
                                                              +_socket_data_received_cb(bt_socket_received_data_s *data, void *user_data)
                                                               {
                                                                  Evas_Object *bubble_table = NULL;
                                                                  char *message = NULL;
                                                              @@ -500,26 +513,27 @@ static void _socket_data_received_cb(bt_socket_received_data_s *data, void *user
                                                               
                                                                  return;
                                                               
                                                              -ERROR:
                                                              -   if (bubble_table) 
                                                              -   {
                                                              -      evas_object_del(bubble_table);
                                                              -      bubble_table = NULL;
                                                              -   }
                                                              +   ERROR:
                                                              +      if (bubble_table) 
                                                              +      {
                                                              +         evas_object_del(bubble_table);
                                                              +         bubble_table = NULL;
                                                              +      }
                                                               
                                                              -   if (message) 
                                                              -   {
                                                              -      free(message);
                                                              -      message = NULL;
                                                              -   }
                                                              +      if (message) 
                                                              +      {
                                                              +         free(message);
                                                              +         message = NULL;
                                                              +      }
                                                               
                                                              -   return;
                                                              +      return;
                                                               }
                                                               
                                                              -

                                                              The chat room is created by calling the bt_chat_room_layout_create() function. The function draws the layout for chatting, and unsets the callback of connection state change and reregisters it. It also registers the data received callback. When the message is received from the target, the application makes a message bubble for a new message.

                                                              +

                                                              The chat room is created by calling the bt_chat_room_layout_create() function. The function draws the layout for chatting, and unsets the connection state change callback and reregisters it. It also registers the data received callback. When the message is received from the target, the application makes a message bubble for a new message.

                                                              -void bt_chat_room_layout_create(appdata_s *ad)
                                                              +void 
                                                              +bt_chat_room_layout_create(appdata_s *ad)
                                                               {
                                                                  Evas_Object *main_scroller = NULL;
                                                                  int ret = -1;
                                                              @@ -543,7 +557,8 @@ void bt_chat_room_layout_create(appdata_s *ad)
                                                               
                                                               
                                                            • Send a message:
                                                              -static void _message_send(appdata_s *ad)
                                                              +static void 
                                                              +_message_send(appdata_s *ad)
                                                               {
                                                                  Evas_Object *bubble_table = NULL;
                                                                  Evas_Object *noti = NULL;
                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/bundle_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/bundle_sd_mn.htm
                                                              index a1706d1..062a517 100644
                                                              --- a/org.tizen.sampledescriptions/html/mobile_n/bundle_sd_mn.htm
                                                              +++ b/org.tizen.sampledescriptions/html/mobile_n/bundle_sd_mn.htm
                                                              @@ -20,7 +20,7 @@
                                                               
                                                               
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Bundle Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/cairo_basic_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/cairo_basic_sd_mn.htm index 8b13090..861e3ed 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/cairo_basic_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/cairo_basic_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Cairo Basic Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/cairo_evasgl_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/cairo_evasgl_sd_mn.htm index 0c140a6..a5f2204 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/cairo_evasgl_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/cairo_evasgl_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Cairo EvasGL Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/calculator_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/calculator_sd_mn.htm index 1e4eea6..8b735cf 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/calculator_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/calculator_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Calculator Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/contacts_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/contacts_sd_mn.htm index 05535a8..df058f3 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/contacts_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/contacts_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Contacts Sample Overview

                                                              @@ -52,10 +52,14 @@

                                                              The application uses the contacts-svc module to work with the contacts database and the elementary module to support the UI requirements.

                                                              -

                                                              You must declare the following privileges in the application manifest file to be able to execute the application:

                                                              -
                                                              <privilege>http://tizen.org/privilege/contact.write</privilege>
                                                              -<privilege>http://tizen.org/privilege/contact.read</privilege>
                                                              +

                                                              Prerequisites

                                                              +

                                                              To ensure proper application execution, the following privileges must be set:

                                                              +
                                                                +
                                                              • http://tizen.org/privilege/contact.write
                                                              • +
                                                              • http://tizen.org/privilege/contact.read
                                                              • +
                                                              +

                                                              Source Files

                                                              You can create and view the sample application project including the source files in the IDE.

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/evas_gl_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/evas_gl_sd_mn.htm index ecbb738..f1281b9 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/evas_gl_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/evas_gl_sd_mn.htm @@ -11,7 +11,7 @@ - EvasGLCube Sample Overview + EvasGLCube Sample Overview @@ -21,10 +21,10 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              -

                                                              EvasGLCube Sample Overview

                                                              +

                                                              EvasGLCube Sample Overview

                                                              The EvasGLCube sample application demonstrates how to implement a rotatable cube on the screen using EvasGL with the Tizen SDK. The sample shows how to handle polygon geometry, and how to write a simple vertex and fragment shader for the cube. EvasGL is similar to the EGL™ layer and is related to GLView.

                                                              @@ -34,16 +34,16 @@ Note - The application presented in this overview is not a full Tizen application, since it does not use the Application Framework. The application simply starts and runs.

                                                              A 3D application using the OpenGL ES must use the GLView. EvasGL can be used in special cases, such as a multi-thread.

                                                              + The application presented in this overview is not a full Tizen application, since it does not use the Application Framework. The application simply starts and runs.

                                                              A 3D application using the OpenGL ES must use the GLView. EvasGL can be used in special cases, such as a multi-thread.

                                                              The following figure illustrates the main screen of the EvasGLCube.

                                                              - -

                                                              Figure: EvasGLCube screen

                                                              -

                                                              EvasGLCube screen

                                                              - + +

                                                              Figure: EvasGLCube screen

                                                              +

                                                              EvasGLCube screen

                                                              +

                                                              Setting up the OpenGL ES Surface

                                                              The EvasGL interface is similar to the EGL interface. It can be connected to Evas so that OpenGL ES code works with Evas 2D objects.

                                                              This sample shows how to implement with EvasGL to use OpenGL ES:

                                                              @@ -58,7 +58,7 @@
                                                              EVAS_GL_GLOBAL_GLES2_DEFINE();
                                                              -

                                                              The EvasGL or GLView program uses the wrapper functions by the supported Evas GL. The wrapper function's interface is the same as OpenGL ES's. This macro can provide a set of convenience wrapper function tables.

                                                              +

                                                              The EvasGL or GLView program uses the wrapper function by the supported Evas GL. The wrapper function's interface is the same as OpenGL ES's. This macro can provide a set of convenience wrapper function tables.

                                                               Evas_Object *add_win(const char *name)
                                                               {
                                                              @@ -74,7 +74,7 @@ Evas_Object *add_win(const char *name)
                                                                  return win;
                                                               }
                                                               
                                                              -

                                                              Before creating the Elm Window, we set the GL Rendering Engine using the elm_config_accel_preference_set("opengl") because EvasGL runs with EvasGL Render Engine.

                                                              +

                                                              Before creating the Elm Window, set the GL Rendering Engine using the elm_config_accel_preference_set("opengl") function because EvasGL runs with EvasGL Render Engine.

                                                              Setting up Callbacks

                                                              @@ -123,11 +123,11 @@ static void init_evasgl(appdata_s *ad)    evas_object_event_callback_add(ad->img, EVAS_CALLBACK_MOUSE_MOVE, mouse_move_cb, ad);    ani = ecore_animator_add(animate_cb, ad->img); -   evas_object_data_set(ad->img, "ani", ani); -   elm_object_content_set(ad->conform,ad->img); +   evas_object_data_set(ad->img, "ani", ani); +   elm_object_content_set(ad->conform, ad->img); }
                                                              -

                                                              To use EvasGL, we first create it, then set its configuration, and create the Evas GL surface and context. For rendering, we connect EvasGL with the Evas Object Image using the evas_object_image_native_surface_set().

                                                              +

                                                              To use EvasGL, create it, set its configuration, and create the Evas GL surface and context. For rendering, connect EvasGL with the Evas Object Image using the evas_object_image_native_surface_set() function.

                                                            • Resize callbacks. @@ -144,16 +144,16 @@ static void win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_i       ad->sfc = NULL;    } -   evas_object_geometry_get(obj, NULL, NULL, &ad->surface_w, &ad->surface_h); -   evas_object_image_size_set(ad->img, ad->surface_w, ad->surface_h); -   evas_object_resize(ad->img, ad->surface_w, ad->surface_h); +   evas_object_geometry_get(obj, NULL, NULL, &ad->surface_w, &ad->surface_h); +   evas_object_image_size_set(ad->img, ad->surface_w, ad->surface_h); +   evas_object_resize(ad->img, ad->surface_w, ad->surface_h);    evas_object_show(ad->img);    if (!ad->sfc)    {       Evas_Native_Surface ns; -      ad->sfc = evas_gl_surface_create(ad->evasgl, ad->cfg, ad->surface_w, ad->surface_h); +      ad->sfc = evas_gl_surface_create(ad->evasgl, ad->cfg, ad->surface_w, ad->surface_h);       evas_gl_native_surface_get(ad->evasgl, ad->sfc, &ns);       evas_object_image_native_surface_set(ad->img, &ns);       evas_object_image_pixels_dirty_set(ad->img, EINA_TRUE); @@ -165,7 +165,7 @@ static void win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_i
                                                            • Draw callbacks.

                                                              The Evas GL draw callback function is registered by the following Evas Object Image function:

                                                              - evas_object_image_pixels_get_callback_set(ad->img, img_pixel_cb, ad);
                                                              +evas_object_image_pixels_get_callback_set(ad->img, img_pixel_cb, ad);
                                                               

                                                              This callback function is provided for on-demand mode. Especially, if Evas GL uses EVAS_GL_OPTIONS_DIRECT, all OpenGL ES options are called in this callback function.

                                                              @@ -191,19 +191,20 @@ static void img_pixel_cb(void *data, Evas_Object *obj)
                                                                     glBindBuffer(GL_ARRAY_BUFFER, ad->vbo);
                                                                     glBufferData(GL_ARRAY_BUFFER, 3 * 72 * 4, cube_vertices,GL_STATIC_DRAW);
                                                                     init_matrix(view);
                                                              -      if (ad->surface_w > ad->surface_h)
                                                              +      if (ad->surface_w > ad->surface_h) 
                                                                     {
                                                              -         aspect = (float)ad->surface_w / ad->surface_h;
                                                              +         aspect = (float)ad->surface_w / ad->surface_h;
                                                                        view_set_ortho(view, -1.0 * aspect, 1.0 * aspect, -1.0, 1.0, -1.0, 1.0);
                                                                     }
                                                              -      else {
                                                              -         aspect = (float)ad->surface_h / ad->surface_w;
                                                              +      else 
                                                              +      {
                                                              +         aspect = (float)ad->surface_h / ad->surface_w;
                                                                        view_set_ortho(view, -1.0, 1.0, -1.0 * aspect,  1.0 *aspect, -1.0, 1.0);
                                                                     }
                                                                     ad->initialized = EINA_TRUE;
                                                                  }
                                                               
                                                              -   glViewport(0, 0, ad->surface_w, ad->surface_h);
                                                              +   glViewport(0, 0, ad->surface_w, ad->surface_h);
                                                                  glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
                                                                  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                                                               
                                                              @@ -243,7 +244,7 @@ static Eina_Bool animate_cb(void *data)
                                                               }
                                                               
                                                              -

                                                              The evas_object_image_pixels_dirty_set() function sets dirty bit of the Evas Object image which is connected Evas GL. After that, the evas_object_image_pixels_get_callback_set() callback function is called whenever Evas renders.

                                                              +

                                                              The evas_object_image_pixels_dirty_set() function sets the dirty bit of the Evas Object image which is connected Evas GL. After that, the evas_object_image_pixels_get_callback_set() callback function is called whenever Evas renders.

                                                            • Delete callbacks. @@ -252,7 +253,7 @@ static Eina_Bool animate_cb(void *data) static void img_del_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) {    appdata_s *ad = data; -   Ecore_Animator *ani = evas_object_data_get(ad->img, "ani"); +   Ecore_Animator *ani = evas_object_data_get(ad->img, "ani");    ecore_animator_del(ani);    // Free the GL resources when image object is deleted @@ -294,4 +295,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/file_manager_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/file_manager_sd_mn.htm index 08ddce3..f138cd4 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/file_manager_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/file_manager_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              File Manager Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/glview11_cube_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/glview11_cube_sd_mn.htm index e4a5e6b..9ac1c51 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/glview11_cube_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/glview11_cube_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              GLView11Cube Sample Overview

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

                                                              Initializing the Application

                                                              -

                                                              The easiest tool to use OpenGL ES within an EFL application is to rely on the Elementary GLView widget.

                                                              +

                                                              The easiest tool to use OpenGL ES within an EFL application is to rely on the Elementary GLView component.

                                                              Current GLView can support both GLES 2.0 and 1.1. GLView with the GLES 1.1 basic application has a similar format as the other GLView application.

                                                              Create a basic application:

                                                              @@ -56,7 +56,7 @@
                                                               #include <dlog.h>
                                                               
                                                              -

                                                              The GLView application should include the header files as the <Evas_GL.h> and <Elementary.h>. The <efl_extension.h> header file is for key events and the <dlog.h> header file is for logs view.

                                                              +

                                                              The GLView application should include the header files as the <Evas_GL.h> and <Elementary.h>. The <efl_extension.h> header file is for key events and the <dlog.h> header file is for the logs view.

                                                               #define S(a) evas_object_show(a)
                                                               
                                                              @@ -164,7 +164,7 @@ _glview_create(appdata_s *ad)
                                                               

                                                              To set up callbacks:

                                                              1. Set the initialization callback. -

                                                                The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface created. This is called from the main loop, as are the 3 other callbacks.

                                                                +

                                                                The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created. This is called from the main loop, as are the 3 other callbacks.

                                                                 #include <Elementary_GL_Helpers.h>
                                                                @@ -231,14 +231,14 @@ void resize_gl(Evas_Object *obj)
                                                              2. Set the draw callback.

                                                                The draw callback is called whenever a new frame has to be drawn. The exact moment when this function is called depends on the policy set when calling.

                                                                -   elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
                                                                +elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);

                                                              Another policy is ELM_GLVIEW_POLICY_ALWAYS.

                                                              The application can now draw anything using GL primitives when this callback is triggered. All draw operations are restricted to the surface of the GLView object previously created. The following example covers the whole window:

                                                               void draw_gl(Evas_Object *obj)
                                                               {
                                                              -ELEMENTARY_GLVIEW_USE(obj);
                                                              +   ELEMENTARY_GLVIEW_USE(obj);
                                                               
                                                                  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                                                                  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
                                                              @@ -298,7 +298,7 @@ _anim_cb(void *data)
                                                               		 Note 
                                                               		 
                                                               		 
                                                              -		 OpenGL ES 1.1 application can be implemented in Tizen. However, if OpenGL ES 1.1 and OpenGL ES 2.0 are used together, they cannot be used in the same file.
                                                              +		 OpenGL ES 1.1 application can be implemented in Tizen. However, if OpenGL ES 1.1 and OpenGL ES 2.0 are used together, they cannot be used in the same file. 
                                                               		 
                                                               	    
                                                               	  
                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/glview_cube_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/glview_cube_sd_mn.htm
                                                              index f6c86bc..6eb8eea 100644
                                                              --- a/org.tizen.sampledescriptions/html/mobile_n/glview_cube_sd_mn.htm
                                                              +++ b/org.tizen.sampledescriptions/html/mobile_n/glview_cube_sd_mn.htm
                                                              @@ -21,12 +21,12 @@
                                                               
                                                               
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              GLViewCube Sample Overview

                                                              -

                                                              This sample demonstrates how to render with OpenGL ES 2.0 using an Elementary GLView Widget. It goes through the creation of a simple UI and how to draw a rotating cube using simple vertex and fragment shaders.

                                                              +

                                                              This sample demonstrates how to render with OpenGL ES 2.0 using an Elementary GLView component. It goes through the creation of a simple UI and how to draw a rotating cube using simple vertex and fragment shaders.

                                                              @@ -54,14 +54,12 @@ #include "glviewcube_utils.h" ELEMENTARY_GLVIEW_GLOBAL_DEFINE(); -... + static bool app_create(void *data) { -...    // Create and initialize GLView    gl = elm_glview_add(ad->conform);    ELEMENTARY_GLVIEW_GLOBAL_USE(gl); -... } @@ -69,7 +67,7 @@ static bool app_create(void *data)
                                                              1. Set the initialization callback.

                                                                The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created.

                                                                -

                                                                This callback function initializes shaders using the init_shaders(obj).

                                                                +

                                                                This callback function initializes shaders using the init_shaders(obj) function.

                                                                 static void init_gl(Evas_Object *obj) 
                                                                @@ -82,7 +80,6 @@ static void init_gl(Evas_Object *obj)
                                                                       glEnable(GL_DEPTH_TEST);
                                                                       ad->initialized = EINA_TRUE;
                                                                    }
                                                                -      ...
                                                                 }
                                                                 
                                                              2. @@ -90,7 +87,7 @@ static void init_gl(Evas_Object *obj)
                                                              3. Initialize the shaders.
                                                                1. The shader instances for the fragment and vertex shader are compiled and created by passing the shader type as a parameter to the glCreateShader() function. -

                                                                  We should Load the shader objects, and use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                                                  +

                                                                  Load the shader objects, use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                                                   static void init_shaders(Evas_Object *obj) 
                                                                   {
                                                                  @@ -106,7 +103,7 @@ static void init_shaders(Evas_Object *obj)
                                                                      glShaderSource(ad->fgmt_shader, 1, &p, NULL);
                                                                      glCompileShader(ad->fgmt_shader);
                                                                   
                                                                2. -
                                                                3. Once the shader objects loaded, a shader program is created. The program attaches and links the shader objects to the shader program. +
                                                                4. Once the shader objects have been loaded, a shader program is created. The program attaches and links the shader objects to the shader program.
                                                                      ad->program = glCreateProgram();
                                                                      glAttachShader(ad->program, ad->vtx_shader);
                                                                  @@ -139,7 +136,7 @@ static void init_shaders(Evas_Object *obj)
                                                                   static void resize_gl(Evas_Object *obj) 
                                                                   {
                                                                      appdata_s *ad = evas_object_data_get(obj, "ad");
                                                                  -   elm_glview_size_get(obj, &ad->glview_w, &ad->glview_h);
                                                                  +   elm_glview_size_get(obj, &ad->glview_w, &ad->glview_h);
                                                                   }
                                                                   
                                                                5. @@ -153,7 +150,6 @@ static void resize_gl(Evas_Object *obj)
                                                                   static void draw_gl(Evas_Object *obj) 
                                                                   {
                                                                  -   ...
                                                                      glViewport(0, 0, ad->glview_w, ad->glview_h);
                                                                   
                                                                  @@ -167,7 +163,7 @@ static void draw_gl(Evas_Object *obj)    glEnableVertexAttribArray(ad->idx_position);    glEnableVertexAttribArray(ad->idx_color); - +
                                                                6. The glUniformMatrix4fv() function modifies the values of the 4x4 MVP (Model View/Projection) uniform matrix according to the vertices information of the cube. An MVP matrix is created with data after each vertex of the cube has passed through 2 transformation stages: The first transformation state is the model view transformation, which includes translation, rotation, and scaling of objects. The second state is projection, which includes changes in the perspective or orthography. @@ -179,7 +175,8 @@ static void draw_gl(Evas_Object *obj)
                                                                      glDrawElements(GL_TRIANGLES, cube_indices_count, 				
                                                                                     GL_UNSIGNED_SHORT, cube_indices);
                                                                  -	
                                                                  +} +
                                                              4. @@ -190,14 +187,13 @@ static void draw_gl(Evas_Object *obj) static Eina_Bool anim(void *data) {    elm_glview_changed_set(data); +    return EINA_TRUE; } static bool app_create(void *data) { -      ...    ani = ecore_animator_add(anim, gl); -      ... } diff --git a/org.tizen.sampledescriptions/html/mobile_n/glview_shader_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/glview_shader_sd_mn.htm index be72b75..69f6b07 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/glview_shader_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/glview_shader_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                GLViewShader Sample Overview

                                                                @@ -53,14 +53,12 @@ #include "glviewcube_utils.h" ELEMENTARY_GLVIEW_GLOBAL_DEFINE(); -... + static bool app_create(void *data) { -   ...    // Create and initialize GLView    gl = elm_glview_add(ad->conform);    ELEMENTARY_GLVIEW_GLOBAL_USE(gl); -   ... } @@ -71,7 +69,7 @@ static bool app_create(void *data)
                                                              5. Set the initialization callback.

                                                                The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created.

                                                                This callback function initializes shaders using the init_shaders(obj) function.

                                                                -

                                                                A Vertex Buffer Object (VBO) allows vertex array data to be stored in a high-performance graphics memory on the server, to maximize data transfer efficiency.

                                                                +

                                                                A Vertex Buffer Object (VBO) allows vertex array data to be stored in a high-performance graphics memory on the server to maximize data transfer efficiency.

                                                                A VBO is created in the application for the teapot vertices. Additionally, an Index Buffer Object (IBO) is created for the indices. The glGenBuffers() function specifies an array in which the buffer object name is stored.

                                                                The glBindBuffer() function binds the buffer object to a specified target. In this case, the target is GL_ARRAY_BUFFER.

                                                                The glBufferData() function is used to create a new data storage for the current buffer object. The parameters of the function are the buffer object target, the data store size, the array of teapot vertices, and the usage function of the data store (in this case, GL_STATIC_DRAW).

                                                                @@ -79,11 +77,11 @@ static bool app_create(void *data) static void init_gl(Evas_Object *obj) {    appdata_s *ad = evas_object_data_get(obj, "ad"); -         ... +    if (!ad->initialized)    {       init_shaders(obj); -         ... +       glEnable(GL_DEPTH_TEST);       glGenBuffers(1, &ad->idx_vbo); @@ -105,10 +103,9 @@ static void init_gl(Evas_Object *obj)
                                                              6. Initialize the shaders:
                                                                  -
                                                                1. Vertex and fragment shaders are created and compiled by passing shader parameters to theglCreateShader() function. -

                                                                  We should load the shader objects, use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                                                  +
                                                                2. Vertex and fragment shaders are created and compiled by passing the shader parameters to the glCreateShader() function. +

                                                                  Load the shader objects, use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                                                  -	
                                                                   static void init_shaders(Evas_Object *obj) 
                                                                   {
                                                                      appdata_s *ad = evas_object_data_get(obj, "ad");
                                                                  @@ -123,7 +120,7 @@ static void init_shaders(Evas_Object *obj)
                                                                      glShaderSource(ad->fgmt_shader, 1, &p, NULL);
                                                                      glCompileShader(ad->fgmt_shader);
                                                                   
                                                                3. -
                                                                4. Once the shader objects are loaded, a shader program is created. The program attaches and links the shader objects to the shader program. +
                                                                5. Once the shader objects have been loaded, a shader program is created. The program attaches and links the shader objects to the shader program.
                                                                      ad->program = glCreateProgram();
                                                                      glAttachShader(ad->program, ad->vtx_shader);
                                                                  @@ -133,7 +130,7 @@ static void init_shaders(Evas_Object *obj)
                                                                   
                                                                6. Get the location for each attribute in the shader program using the glGetUniformLocation() and glGetAttribLocation() functions. If the shader program attributes, such as u_mvpMatrix and a_position are valid, these functions return an integer value that represents the index location of the attributes. For invalid attributes, the return value is -1. -

                                                                  The glGetUniformLocation() retrieves the location of the uniform related to groups of vertices or pixels, such as model view matrix, projection matrix, or light position. The glGetAttribLocation() retrieves the location of the attributes trelated to a vertex or pixel, such as position vector, normal vector, or vertex color.

                                                                  +

                                                                  The glGetUniformLocation() function retrieves the location of the uniform related to groups of vertices or pixels, such as the model view matrix, projection matrix, or light position. The glGetAttribLocation() function retrieves the location of the attributes related to a vertex or pixel, such as position vector, normal vector, or vertex color.

                                                                      ad->idx_light_dir = glGetUniformLocation(ad->program, "u_light_dir");
                                                                      ad->idx_mvp = glGetUniformLocation(ad->program, "u_mvpMatrix");
                                                                  @@ -170,12 +167,10 @@ static void resize_gl(Evas_Object *obj)
                                                                   
                                                                  1. The glViewport() function specifies the affine transformation of the x and y values from normalized device coordinates to window coordinates as specified by the elm_glview_size_get() function.
                                                                    -
                                                                     static void draw_gl(Evas_Object *obj) 
                                                                     {
                                                                    -   ...
                                                                        elm_glview_size_get(obj, &ad->glview_w, &ad->glview_h);
                                                                    -   ...
                                                                    +
                                                                        glViewport(0, 0, ad->glview_w, ad->glview_h);
                                                                     
                                                                  2. @@ -186,7 +181,7 @@ static void draw_gl(Evas_Object *obj)    glUniform4fv(ad->idx_light_dir, 1, ad->light_dir);    glUniformMatrix4fv(ad->idx_mvp, 1, GL_FALSE, ad->mvp);    glUniform1f(ad->idx_time_stamp, ad->time_stamp); -
                                                                  +
                                                                7. The glVertexAttribPointer() function is used to define an array of generic vertex attribute data. These attributes are parameters associated with each vertex of the teapot. In this case, they are position and normal. @@ -201,14 +196,14 @@ static void draw_gl(Evas_Object *obj)          sizeof(float) * 6, (void*) (sizeof(float) * 3));    glEnableVertexAttribArray(ad->idx_vnormal);    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ad->idx_ibo); - +
                                                                8. Once the vertex arrays have been enabled, the actual process of rendering graphics primitives from the array data occurs using the glDrawElements() function.
                                                                      glDrawElements(GL_TRIANGLES, MAX_F_COUNT * 3,
                                                                                     GL_UNSIGNED_SHORT, 0);
                                                                  -	
                                                                  +
                                                                9. The glFlush() function empties all buffers causing all issued commands to be executed as quickly as they are accepted by the rendering engine. @@ -221,23 +216,22 @@ static void draw_gl(Evas_Object *obj)    glBindBuffer(GL_ARRAY_BUFFER, 0);    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } - +
                                                              7. Add an animator. -

                                                                The application regularly triggers the update of the GLView using the elm_glview_changed_set() function.

                                                                +

                                                                The application regularly triggers an update of the GLView using the elm_glview_changed_set() function.

                                                                 static Eina_Bool anim(void *data) 
                                                                 {
                                                                    elm_glview_changed_set(data);
                                                                +
                                                                    return EINA_TRUE;
                                                                 }
                                                                 
                                                                 static bool app_create(void *data) 
                                                                 {
                                                                -      ...
                                                                    ani = ecore_animator_add(anim, gl);
                                                                -      ...
                                                                 }
                                                                 
                                                              8. diff --git a/org.tizen.sampledescriptions/html/mobile_n/gps_consumer_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/gps_consumer_sd_mn.htm index 5e88fe1..8f1870b 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/gps_consumer_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/gps_consumer_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                GPS Consumer Sample Overview

                                                                @@ -79,7 +79,7 @@ _msg_port_cb(int local_port_id, const char *remote_app_id, const char *remote_po       {          return;       } -      dlog_print(DLOG_INFO, LOG_TAG, ("Received message from %s: satellites_count %s", remote_app_id, satellites_count_str); +      dlog_print(DLOG_INFO, LOG_TAG, "Received message from %s: satellites_count %s", remote_app_id, satellites_count_str);       _satellites_update(satellites_count_str);    }    else if (!strncmp(msg_type, MESSAGE_TYPE_POSITION_UPDATE, strlen(msg_type))) @@ -89,7 +89,7 @@ _msg_port_cb(int local_port_id, const char *remote_app_id, const char *remote_po       {          return;       } -      dlog_print(DLOG_INFO, LOG_TAG, ("Received message from %s: position data: %s %s", remote_app_id, latitude_str, longitude_str); +      dlog_print(DLOG_INFO, LOG_TAG, "Received message from %s: position data: %s %s", remote_app_id, latitude_str, longitude_str);       _position_update(latitude_str, longitude_str);    } } @@ -193,7 +193,7 @@ _map_create(Evas_Object *parent)

                                                                The minimum zoom level with which the overlay is displayed is set with the elm_map_overlay_displayed_zoom_min_set() function.

                                                                 // Create circle boundary
                                                                -dlog_print(DLOG_INFO, LOG_TAG, ("Circle boundary overlay at %lf, %lf", circle_longitude, circle_latitude);
                                                                +dlog_print(DLOG_INFO, LOG_TAG, "Circle boundary overlay at %lf, %lf", circle_longitude, circle_latitude);
                                                                 
                                                                 s_view_data.boundary_overlay = elm_map_overlay_circle_add(s_view_data.map, circle_longitude, circle_latitude, BOUNDARY_CIRCLE_RADIUS_REL);
                                                                 if (!s_view_data.boundary_overlay)
                                                                @@ -210,9 +210,9 @@ elm_map_overlay_displayed_zoom_min_set(s_view_data.boundary_overlay, ZOOM_LEVEL)
                                                                       
                                                                 // Create location bounds - BOUNDARY_CIRCLE_RADIUS [m] circle with center defined by initial coordinates
                                                                 circle_coords.longitude = circle_longitude;
                                                                - circle_coords.latitude = circle_latitude;
                                                                +circle_coords.latitude = circle_latitude;
                                                                 
                                                                -dlog_print(DLOG_INFO, LOG_TAG, ("center: %lf %lf, radius %lf", circle_coords.longitude, circle_coords.latitude, BOUNDARY_CIRCLE_RADIUS_M);
                                                                +dlog_print(DLOG_INFO, LOG_TAG, "center: %lf %lf, radius %lf", circle_coords.longitude, circle_coords.latitude, BOUNDARY_CIRCLE_RADIUS_M);
                                                                 int ret = location_bounds_create_circle(circle_coords, BOUNDARY_CIRCLE_RADIUS_M, &s_view_data.bounds);
                                                                 if (ret != LOCATIONS_ERROR_NONE)
                                                                 {
                                                                @@ -220,7 +220,7 @@ if (ret != LOCATIONS_ERROR_NONE)
                                                                 
                                                                    return;
                                                                 }
                                                                -dlog_print(DLOG_INFO, LOG_TAG, ("Circle bounds created - %.1fm radius, center at %f, %f", BOUNDARY_CIRCLE_RADIUS_M, circle_coords.longitude, circle_coords.latitude);
                                                                +dlog_print(DLOG_INFO, LOG_TAG, "Circle bounds created - %.1fm radius, center at %f, %f", BOUNDARY_CIRCLE_RADIUS_M, circle_coords.longitude, circle_coords.latitude);
                                                                       
                                                                @@ -295,4 +295,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/gps_service_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/gps_service_sd_mn.htm index c568c71..cbcaef9 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/gps_service_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/gps_service_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                GPS Service Sample Overview

                                                                @@ -274,7 +274,7 @@ _send_message(bundle *b) {    if (!b)    { -      dlog_print(DLOG_ERROR, LOG_TAG, "Can not send message, the bundle is NULL"); +      dlog_print(DLOG_ERROR, LOG_TAG, "Cannot send message, the bundle is NULL");       return false;    } @@ -315,4 +315,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/hybridservice_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/hybridservice_sd_mn.htm index 2d65388..9431fd0 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/hybridservice_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/hybridservice_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                HybridServiceApp Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/lockscreen_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/lockscreen_sd_mn.htm index 5e699d3..01b0e1b 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/lockscreen_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/lockscreen_sd_mn.htm @@ -20,7 +20,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                Lockscreen Sample Overview

                                                                @@ -42,6 +42,21 @@

                                                                To make this application work, the user must select it as a default lockscreen through the Settings menu.

                                                                +

                                                                Prerequisites

                                                                +

                                                                This application requires the following privileges to be set:

                                                                +
                                                                  +
                                                                • http://tizen.org/privilege/keymanager
                                                                • +
                                                                • http://tizen.org/privilege/display
                                                                • +
                                                                +

                                                                This application also has a special category attribute set in the tizen-mainfest.xml file:

                                                                +
                                                                +<ui-application appid="packageName" auto-restart="true" exec="appName" multiple="false" 
                                                                +                nodisplay="true" on-boot="true" taskmanage="false" type="capp">
                                                                +   <!--Common application attributes-->
                                                                +   <category name="http://tizen.org/category/lockapp"/>
                                                                +</ui-application>
                                                                +
                                                                +

                                                                Implementation

                                                                The application follows the MVC pattern. Aside from the standard native application module with the main() function, it consists of the following components:

                                                                  @@ -50,7 +65,7 @@
                                                                • main_window.c, lock.c, and swipe_lock.c modules serving as views
                                                                -

                                                                The application initialization takes place with the controller_application_start() function. This function creates the main window and sets the current lock type based on user preferences. It also sets the current lockscreen background. But most of all, it registers callbacks for the following events:

                                                                +

                                                                The application initialization takes place with the start_application() function. This function creates the main window and sets the current lock type based on user preferences. It also sets the current lockscreen background. But most of all, it registers callbacks for the following events:

                                                                • Successful unlock using swipe gesture
                                                                • Lockscreen background change (using the Settings application)
                                                                • @@ -59,22 +74,22 @@
                                                                   bool
                                                                  -controller_application_start(void)
                                                                  +start_application(void)
                                                                   {
                                                                  -   if (!main_window_create())
                                                                  +   if (!create_main_window())
                                                                      {
                                                                         // Error handling
                                                                      }
                                                                   
                                                                  -   current_lock_set();
                                                                  +   __set_current_lock();
                                                                      // Add a controller swipe callback to the main window
                                                                  -   main_window_callbacks_add(swipe_unlocked_cb);
                                                                  +   add_main_window_callbacks(__swipe_unlocked_cb);
                                                                      // Add a lockscreen background image change callback, the image is selected in Settings application
                                                                  -   wallpaper_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, NULL)
                                                                  +   __wallpaper_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, NULL)
                                                                      // Add a callback for the background change (also changed using the Settings application)
                                                                  -   system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, wallpaper_changed_cb, NULL);
                                                                  +   system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, __wallpaper_changed_cb, NULL);
                                                                      // Add a callback to listen to LCD on/off events
                                                                  -   device_add_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_cb, NULL);
                                                                  +   device_add_callback(DEVICE_CALLBACK_DISPLAY_STATE, __device_cb, NULL);
                                                                   
                                                                      return true;
                                                                   }
                                                                  @@ -84,51 +99,51 @@ controller_application_start(void)
                                                                   
                                                                   

                                                                  To activate the lockscreen:

                                                                  -
                                                                  1. Each time the LCD display is switched on, the currently selected lock type is activated through the device_cb() callback function: +
                                                                    1. Each time the LCD display is switched on, the currently selected lock type is activated through the __device_cb() callback function:
                                                                       static void
                                                                      -device_cb(device_callback_e type, void *value, void *user_data)
                                                                      +__device_cb(device_callback_e type, void *value, void *user_data)
                                                                       {
                                                                          switch ((display_state_e)value)
                                                                          {
                                                                             case DISPLAY_STATE_NORMAL:
                                                                      -         current_lock_set();
                                                                      +         __set_current_lock();
                                                                                break;
                                                                             case DISPLAY_STATE_SCREEN_DIM:
                                                                                break;
                                                                             case DISPLAY_STATE_SCREEN_OFF:
                                                                                break;
                                                                             default:
                                                                      -         current_lock_set();
                                                                      +         __set_current_lock();
                                                                                break;
                                                                          }
                                                                       }
                                                                       
                                                                    2. -
                                                                    3. The settings_get_lock_type() model function is used to obtain the current lock type. +
                                                                    4. The get_lock_type() model function is used to obtain the current lock type.

                                                                      With this sample application, you can add other types of lock implementations of your own. To do that, modify the lockscreen_type_t enumeration type.

                                                                       static void
                                                                      -current_lock_set(void)
                                                                      +__set_current_lock(void)
                                                                       {
                                                                          switch(settings_get_lock_type())
                                                                          {
                                                                             case LOCKSCREEN_NONE:
                                                                      -         main_window_swipe_lock_deactivate();
                                                                      +         deactivate_main_window_swipe_lock();
                                                                                break;
                                                                             case LOCKSCREEN_SWIPE:
                                                                      -         main_window_swipe_lock_activate();
                                                                      +         activate_main_window_swipe_lock();
                                                                                break;
                                                                             default:
                                                                                break;
                                                                          }
                                                                       }
                                                                       
                                                                    5. -
                                                                    6. The user interface is created with the main_window_create() function. It consists of a background and a swipe lock view. +
                                                                    7. The user interface is created with the create_main_window() function. It consists of a background and a swipe lock view.
                                                                       bool
                                                                      -main_window_create(void)
                                                                      +create_main_window(void)
                                                                       {
                                                                          s_main_window_data.win = elm_win_add(NULL, PACKAGE, ELM_WIN_DOCK);
                                                                       
                                                                      @@ -139,11 +154,11 @@ main_window_create(void)
                                                                          // Default alpha is 0
                                                                          elm_win_alpha_set(s_main_window_data.win, EINA_TRUE);
                                                                       
                                                                      -   evas_object_smart_callback_add(s_main_window_data.win, "delete,request", delete_cb, NULL);
                                                                      +   evas_object_smart_callback_add(s_main_window_data.win, "delete,request", __delete_cb, NULL);
                                                                       
                                                                      -   if (!background_create(s_main_window_data.screen_width, s_main_window_data.screen_height) ||
                                                                      +   if (!__create_background(s_main_window_data.screen_width, s_main_window_data.screen_height) ||
                                                                             // Create the swipe lock to cover the entire window
                                                                      -      !swipe_create(s_main_window_data.screen_width, s_main_window_data.screen_height))
                                                                      +      !__create_swipe(s_main_window_data.screen_width, s_main_window_data.screen_height)
                                                                          {
                                                                             return false;
                                                                          }
                                                                      @@ -159,30 +174,30 @@ main_window_create(void)
                                                                       
                                                                       

                                                                      To unlock the device:

                                                                      -
                                                                      1. The controller module uses the main_window_callbacks_add() function to register its callbacks for the user interface. Consequently, the module is notified whenever the user successfully unlocks the device with a swipe gesture, and the swipe_unlocked_cb() function is invoked. +
                                                                        1. The controller module uses the add_main_window_callbacks() function to register its callbacks for the user interface. Consequently, the module is notified whenever the user successfully unlocks the device with a swipe gesture, and the __swipe_unlocked_cb() function is invoked.
                                                                           void
                                                                          -main_window_callbacks_add(swipe_unlock_cb unlock_cb)
                                                                          +add_main_window_callbacks(swipe_unlock_cb unlock_cb)
                                                                           {
                                                                              if (!s_main_window_data.swipe_unlock_cb || unlock_cb)
                                                                              {
                                                                          -      swipe_lock_callbacks_add(s_main_window_data.swipe_lock, swipe_drag_cb, swipe_drag_end_cb);
                                                                          +      _add_swipe_lock_callbacks(s_main_window_data.swipe_lock, __swipe_drag_cb, __swipe_drag_end_cb);
                                                                                 s_main_window_data.swipe_unlock_cb = unlock_cb;
                                                                              }
                                                                           }
                                                                           
                                                                           static void
                                                                          -swipe_unlocked_cb(void)
                                                                          +__swipe_unlocked_cb(void)
                                                                           {
                                                                          -   main_window_lock_deactivate();
                                                                          +   deactivate_main_window_swipe_lock();
                                                                           }
                                                                           
                                                                        2. -
                                                                        3. After a successful swipe, the swipe lock is deactivated using the main_window_swipe_lock_deactivate() function: +
                                                                        4. After a successful swipe, the swipe lock is deactivated using the deactivate_main_window_swipe_lock() function:
                                                                           void
                                                                          -main_window_swipe_lock_deactivate(void)
                                                                          +deactivate_main_window_swipe_lock(void)
                                                                           {
                                                                              // Hide the swipe lock UI object
                                                                              evas_object_hide(s_main_window_data.swipe_lock);
                                                                          @@ -193,17 +208,19 @@ main_window_swipe_lock_deactivate(void)
                                                                           
                                                                            

                                                                          Creating the Lockscreen View

                                                                          -

                                                                          The swipe lock view is created as the elm_layout in the lock_create() function (called from the swipe_lock_create() function). One of its parameters is the layout edj file name.

                                                                          -

                                                                          The lock_create() function +

                                                                          The swipe lock view is created as the elm_layout in the _create_lock() function (called from the _create_swipe_lock() function). One of its parameters is the layout edj file name.

                                                                          +

                                                                          The _create_lock() function associates the elm_layout with the EDJE.

                                                                          -Evas_Object * lock_create(Evas_Object * parent, const char *edje_file_name)
                                                                          +Evas_Object *_create_lock(Evas_Object *parent, const char *edje_file_name)
                                                                           {
                                                                              char layout_file_full_path[PATH_MAX] = {0,};
                                                                           
                                                                              Evas_Object *lock = elm_layout_add(parent);
                                                                           
                                                                          -   // Error handling and layout file path obtaining
                                                                          +   // Error handling
                                                                          +
                                                                          +   compile_resource_path(edje_file_name, layout_file_full_path);
                                                                           
                                                                              if (!elm_layout_file_set(lock, layout_file_full_path, LOCK_MAIN_GROUP))
                                                                              {
                                                                          @@ -214,9 +231,9 @@ Evas_Object * lock_create(Evas_Object * parent, const char *edje_file_name)
                                                                           }
                                                                           
                                                                           Evas_Object *
                                                                          -swipe_lock_create(Evas_Object * parent)
                                                                          +_create_swipe_lock(Evas_Object *parent)
                                                                           {
                                                                          -   return lock_create(parent, SWIPE_LOCK_EDJ_FILE_NAME);
                                                                          +   return _create_lock(parent, SWIPE_LOCK_EDJ_FILE_NAME);
                                                                           }
                                                                           
                                                                          @@ -314,7 +331,7 @@ collections
                                                                           void
                                                                          -swipe_lock_drag_reset(Evas_Object *swipe_lock)
                                                                          +_reset_swipe_lock_drag(Evas_Object *swipe_lock)
                                                                           {
                                                                              elm_layout_signal_emit(swipe_lock, SWIPE_RESET_SIGNAL, SWIPE_RESET_SIGNAL_SOURCE);
                                                                           }
                                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_n/mediaapp_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/mediaapp_sd_mn.htm
                                                                          index 3581368..7ffd6ac 100644
                                                                          --- a/org.tizen.sampledescriptions/html/mobile_n/mediaapp_sd_mn.htm
                                                                          +++ b/org.tizen.sampledescriptions/html/mobile_n/mediaapp_sd_mn.htm
                                                                          @@ -21,7 +21,7 @@
                                                                           
                                                                           
                                                                          -

                                                                          Mobile native

                                                                          +

                                                                          Mobile native

                                                                          Media App Sample Overview

                                                                          @@ -95,7 +95,8 @@

                                                                          This view allows the user to decode, change the scale, and convert the pixel format of images and fit them to the display. Internally, when the resize slider is changed and released, the _slider_drag_stop_cb callback is called and the update_scale method is executed:

                                                                          -static void _update_scale(image_viewer_view *view)
                                                                          +static void 
                                                                          +_update_scale(image_viewer_view *view)
                                                                           {
                                                                              RETM_IF(NULL == view, "view is NULL");
                                                                              Evas_Object *evas_image = elm_image_object_get(view->image);
                                                                          @@ -120,7 +121,9 @@ static void _update_scale(image_viewer_view *view)
                                                                           

                                                                          This view allows the user to transform a source image into a new image with a different pixel format and size. Internally, when the Change pixel format button is clicked, the _change_format callback is called and the _process method executed:

                                                                          -int image_sample_util_resize(const int src_w, const int src_h, const uchar *src, const int dest_w, const int dest_h,  uchar *dest)
                                                                          +int 
                                                                          +image_sample_util_resize(const int src_w, const int src_h, const uchar *src, 
                                                                          +                         const int dest_w, const int dest_h,  uchar *dest)
                                                                           {
                                                                              if (src_w <= 0 || src_h <= 0 || !src || dest_w <= 0 || dest_h <= 0 || !dest)
                                                                              {
                                                                          @@ -203,10 +206,12 @@ int image_sample_util_resize(const int src_w, const int src_h, const uchar *src,
                                                                                       | ((u_int32_t) green << 8) | (blue);
                                                                                 }
                                                                              }
                                                                          +
                                                                              return IMAGE_UTIL_ERROR_NONE;
                                                                           }
                                                                           
                                                                          -static bool _process(image_converter_view *view, double scale)
                                                                          +static bool 
                                                                          +_process(image_converter_view *view, double scale)
                                                                           {
                                                                              RETVM_IF(NULL == view, false, "view is NULL");
                                                                              RETVM_IF(NULL == view->image_source, false, "view is NULL");
                                                                          @@ -228,13 +233,13 @@ static bool _process(image_converter_view *view, double scale)
                                                                              void* src_buff = evas_object_image_data_get(source_eo, EINA_FALSE);
                                                                              RETVM_IF(NULL == src_buff, false, "image_util_calculate_buffer_size error");
                                                                           
                                                                          -   error = image_util_calculate_buffer_size(dest_width , dest_height, IMAGE_UTIL_COLORSPACE_BGRA8888, &dest_size);
                                                                          +   error = image_util_calculate_buffer_size(dest_width, dest_height, IMAGE_UTIL_COLORSPACE_BGRA8888, &dest_size);
                                                                              RETVM_IF(IMAGE_UTIL_ERROR_NONE != error, false, "image_util_calculate_buffer_size error");
                                                                           
                                                                              dest_buff = malloc(dest_size);
                                                                              RETVM_IF(NULL == dest_buff, false, "malloc destination buffer error %d", dest_size);
                                                                           
                                                                          -   error = image_sample_util_resize(w, h, src_buff, dest_width , dest_height, dest_buff);
                                                                          +   error = image_sample_util_resize(w, h, src_buff, dest_width, dest_height, dest_buff);
                                                                              if (IMAGE_UTIL_ERROR_NONE == error)
                                                                              {
                                                                                 Evas_Object* im = evas_object_image_filled_add(evas_object_evas_get(view->layout));
                                                                          @@ -246,7 +251,8 @@ static bool _process(image_converter_view *view, double scale)
                                                                                    evas_object_image_data_copy_set(im, dest_buff);
                                                                           
                                                                                    char output_buf[PATH_MAX] = {'\0'};
                                                                          -         snprintf(output_buf, PATH_MAX, "%s%s%s.%s", get_resource_path(""), IMAGE_OUTPUT_DIR, image_names[view->image_id], image_file_format_to_str(converted_formats[view->convert_format_ind]));
                                                                          +         snprintf(output_buf, PATH_MAX, "%s%s%s.%s", get_resource_path(""), IMAGE_OUTPUT_DIR, image_names[view->image_id], 
                                                                          +                  image_file_format_to_str(converted_formats[view->convert_format_ind]));
                                                                                    if (EINA_FALSE == evas_object_image_save(im, output_buf, NULL, NULL))
                                                                                    {
                                                                                       ERR("evas_object_image_save error");
                                                                          @@ -279,7 +285,8 @@ static bool _process(image_converter_view *view, double scale)
                                                                           

                                                                          This view displays GIF images, and allows the user to change the pixel format. Internally, when the Next or Prev button is clicked, the _toolbar_button_clicked_cb callback is called and the _change_image method is executed:

                                                                          -static void _change_image(gif_viewer_view *this, bool to_next)
                                                                          +static void 
                                                                          +_change_image(gif_viewer_view *this, bool to_next)
                                                                           {
                                                                              RETM_IF(NULL == this, "this is NULL");
                                                                              unsigned int image_id = this->image_id;
                                                                          @@ -313,7 +320,8 @@ static void _change_image(gif_viewer_view *this, bool to_next)
                                                                           

                                                                          This view allows the user to flip and rotate images. Internally, when the Flip button is clicked, the _on_button_flip_clicked_cb callback is called:

                                                                          -static void _on_button_rotate_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                          +static void 
                                                                          +_on_button_rotate_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                           {
                                                                              RETM_IF(NULL == data, "data is NULL");
                                                                              image_flip_rotate_view *view = data;
                                                                          @@ -339,7 +347,8 @@ static void _on_button_rotate_clicked_cb(void *data, Evas_Object *obj, void *eve
                                                                           

                                                                          This view allows the user to change the image size. Internally, when the resize slider is changed, the _slider_drag_stop_cb callback is called and the _update_scale method is executed:

                                                                          -static void _update_scale(image_resize_view *view)
                                                                          +static void 
                                                                          +_update_scale(image_resize_view *view)
                                                                           {
                                                                              RETM_IF(NULL == view, "view is NULL");
                                                                              Evas_Object *evas_image = elm_image_object_get(view->image);
                                                                          @@ -363,7 +372,8 @@ static void _update_scale(image_resize_view *view)
                                                                           

                                                                          This view allows the user to change the image pixel format (RGB32, RGB16, YUV420, or YUV422). Internally, when the Change pixel format button is clicked, the _toolbar_button_clicked_cb callback is called and the _process_colorspace_convert method is executed:

                                                                          -static bool _process_colorspace_convert(color_converter_view *view)
                                                                          +static bool 
                                                                          +_process_colorspace_convert(color_converter_view *view)
                                                                           {
                                                                              long long time_begin = get_ticks();
                                                                              RETVM_IF(NULL == view, false, "view is NULL");
                                                                          @@ -385,7 +395,7 @@ static bool _process_colorspace_convert(color_converter_view *view)
                                                                              image_util_colorspace_e dest_colorspace = colorspaces[view->color_id_to];
                                                                              int error = IMAGE_UTIL_ERROR_NONE;
                                                                              unsigned int dest_size = 0;
                                                                          -   error = image_util_calculate_buffer_size(w , h, dest_colorspace, &dest_size);
                                                                          +   error = image_util_calculate_buffer_size(w, h, dest_colorspace, &dest_size);
                                                                              RETVM_IF(IMAGE_UTIL_ERROR_NONE != error, false, "image_util_calculate_buffer_size error");
                                                                           
                                                                              view->decoded_buffer = malloc(dest_size);
                                                                          @@ -405,26 +415,31 @@ static bool _process_colorspace_convert(color_converter_view *view)
                                                                           

                                                                          This view allows the user to extract frames from the input video stream. Internally, when the frame slider is changed, the _sliderbar_changed_cb callback is called and the frame_extractor_frame_get method is executed:

                                                                          -static inline rgb16 bgra_to_rgb(const bgra32 src)
                                                                          +static inline rgb16
                                                                          +bgra_to_rgb(const bgra32 src)
                                                                           {
                                                                              rgb16 result = (rgb16)
                                                                          -      ( ((src.r >> (RGB32_CHANEL_BIT_SIZE - RGB16_R_SIZE)) << RGB16_R_SHIFT)
                                                                          +      (((src.r >> (RGB32_CHANEL_BIT_SIZE - RGB16_R_SIZE)) << RGB16_R_SHIFT)
                                                                                 | ((src.g >> (RGB32_CHANEL_BIT_SIZE - RGB16_G_SIZE)) << RGB16_G_SHIFT)
                                                                                 | ((src.b >> (RGB32_CHANEL_BIT_SIZE - RGB16_B_SIZE)) << RGB16_B_SHIFT));
                                                                          +
                                                                              return result;
                                                                           }
                                                                           
                                                                          -static inline bgra32 rgb_to_bgra(const rgb16 src)
                                                                          +static inline bgra32
                                                                          +rgb_to_bgra(const rgb16 src)
                                                                           {
                                                                              bgra32 result = {};
                                                                          -   result.r = (uchar)( src >> RGB16_R_SHIFT) << (RGB32_CHANEL_BIT_SIZE - RGB16_R_SIZE);
                                                                          -   result.g = (uchar)( src >> RGB16_G_SHIFT) << (RGB32_CHANEL_BIT_SIZE - RGB16_G_SIZE);
                                                                          -   result.b = (uchar)( src >> RGB16_B_SHIFT) << (RGB32_CHANEL_BIT_SIZE - RGB16_B_SIZE);
                                                                          +   result.r = (uchar)(src >> RGB16_R_SHIFT) << (RGB32_CHANEL_BIT_SIZE - RGB16_R_SIZE);
                                                                          +   result.g = (uchar)(src >> RGB16_G_SHIFT) << (RGB32_CHANEL_BIT_SIZE - RGB16_G_SIZE);
                                                                          +   result.b = (uchar)(src >> RGB16_B_SHIFT) << (RGB32_CHANEL_BIT_SIZE - RGB16_B_SIZE);
                                                                              result.a = RGB32_DEFAULT_ALPHA;
                                                                          +
                                                                              return result;
                                                                           }
                                                                           
                                                                          -static uchar clamp(int x)
                                                                          +static uchar 
                                                                          +clamp(int x)
                                                                           {
                                                                              if (x > 255)
                                                                              {
                                                                          @@ -434,42 +449,50 @@ static uchar clamp(int x)
                                                                              {
                                                                                 x = 0;
                                                                              }
                                                                          +
                                                                              return x;
                                                                           }
                                                                           
                                                                          -static inline uchar bgra_to_yuv_y(const bgra32 src)
                                                                          +static inline uchar
                                                                          +bgra_to_yuv_y(const bgra32 src)
                                                                           {
                                                                              return ((66*src.r + 129*src.g + 25*src.b) >> 8) + 16;
                                                                           }
                                                                           
                                                                          -static inline uchar bgra_to_yuv_u(const bgra32 src)
                                                                          +static inline uchar
                                                                          +bgra_to_yuv_u(const bgra32 src)
                                                                           {
                                                                              return ((-38*src.r + -74*src.g + 112*src.b) >> 8) + 128;
                                                                           }
                                                                           
                                                                          -static inline uchar bgra_to_yuv_v(const bgra32 src)
                                                                          +static inline uchar 
                                                                          +bgra_to_yuv_v(const bgra32 src)
                                                                           {
                                                                              return ((112*src.r + -94*src.g + -18*src.b) >> 8) + 128;
                                                                           }
                                                                           
                                                                          -static inline uchar yuv_to_r(const uchar yuv_y, const uchar yuv_u, const uchar yuv_v)
                                                                          +static inline uchar 
                                                                          +yuv_to_r(const uchar yuv_y, const uchar yuv_u, const uchar yuv_v)
                                                                           {
                                                                              return clamp(yuv_y + 1.402 * (yuv_v - 128));
                                                                           }
                                                                           
                                                                          -static inline uchar yuv_to_g(const uchar yuv_y, const uchar yuv_u, const uchar yuv_v)
                                                                          +static inline uchar 
                                                                          +yuv_to_g(const uchar yuv_y, const uchar yuv_u, const uchar yuv_v)
                                                                           {
                                                                              return clamp(yuv_y - 0.344 * (yuv_u - 128) - 0.714 * (yuv_v - 128));
                                                                           }
                                                                           
                                                                          -static inline uchar yuv_to_b(const uchar yuv_y, const uchar yuv_u, const uchar yuv_v)
                                                                          +static inline uchar 
                                                                          +yuv_to_b(const uchar yuv_y, const uchar yuv_u, const uchar yuv_v)
                                                                           {
                                                                              return clamp(yuv_y + 1.772 * (yuv_u - 128));
                                                                           }
                                                                           
                                                                          -static void _convert_bgra8888_to_yuv420( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_bgra8888_to_yuv420(uchar *dest, const uchar *src,
                                                                          +                            const int width, const int height,
                                                                          +                            const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int src_stride = (s_size / height);
                                                                              unsigned int pix_count = width * height;
                                                                          @@ -477,15 +500,15 @@ static void _convert_bgra8888_to_yuv420( uchar *dest, const uchar *src,
                                                                              unsigned int vpos = upos + upos / 4;
                                                                           
                                                                              unsigned int y;
                                                                          -   for (y = 0; y < height; ++y )
                                                                          +   for (y = 0; y < height; ++y)
                                                                              {
                                                                                 const bgra32* src_pixel = (const bgra32*) &(src[y * src_stride]);
                                                                                 unsigned int dest_line_pos = width * y;
                                                                           
                                                                          -      if( !(y % 2) )
                                                                          +      if (!(y % 2))
                                                                                 {
                                                                                    unsigned int x;
                                                                          -         for (x = 0; x < width; x += 2 )
                                                                          +         for (x = 0; x < width; x += 2)
                                                                                    {
                                                                                       bgra32 pixel = src_pixel[x];
                                                                           
                                                                          @@ -502,15 +525,16 @@ static void _convert_bgra8888_to_yuv420( uchar *dest, const uchar *src,
                                                                                    unsigned int x;
                                                                                    for (x = 0; x < width; ++x)
                                                                                    {
                                                                          -            dest[dest_line_pos + x] = bgra_to_yuv_y( src_pixel[x] );
                                                                          +            dest[dest_line_pos + x] = bgra_to_yuv_y(src_pixel[x]);
                                                                                    }
                                                                                 }
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _convert_bgra8888_to_rgb565( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_bgra8888_to_rgb565(uchar *dest, const uchar *src,
                                                                          +                            const int width, const int height,
                                                                          +                            const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int src_stride = (s_size / height);
                                                                              unsigned int dest_stride = (d_size / height);
                                                                          @@ -523,14 +547,15 @@ static void _convert_bgra8888_to_rgb565( uchar *dest, const uchar *src,
                                                                                 unsigned int x;
                                                                                 for (x = 0; x < width; ++x)
                                                                                 {
                                                                          -         dest_pixel[x] = bgra_to_rgb( src_pixel[x]);
                                                                          +         dest_pixel[x] = bgra_to_rgb(src_pixel[x]);
                                                                                 }
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _convert_rgb565_to_yuv420( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_rgb565_to_yuv420(uchar *dest, const uchar *src,
                                                                          +                          const int width, const int height,
                                                                          +                          const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int src_stride = (s_size / height);
                                                                              unsigned int pix_count = width * height;
                                                                          @@ -538,41 +563,42 @@ static void _convert_rgb565_to_yuv420( uchar *dest, const uchar *src,
                                                                              unsigned int vpos = upos + upos / 4;
                                                                           
                                                                              unsigned int y;
                                                                          -   for (y = 0; y < height; ++y )
                                                                          +   for (y = 0; y < height; ++y)
                                                                              {
                                                                                 const rgb16* src_pixel = (const rgb16*) &(src[y * src_stride]);
                                                                                 unsigned int dest_line_pos = width * y;
                                                                           
                                                                          -   if ( !(y % 2) )
                                                                          -   {
                                                                          -      unsigned int x;
                                                                          -      for (x = 0; x < width; x += 2 )
                                                                          +      if (!(y % 2))
                                                                                 {
                                                                          -         bgra32 pixel = rgb_to_bgra(src_pixel[x]);
                                                                          +         unsigned int x;
                                                                          +         for (x = 0; x < width; x += 2)
                                                                          +         {
                                                                          +            bgra32 pixel = rgb_to_bgra(src_pixel[x]);
                                                                           
                                                                          -         dest[dest_line_pos + x] = bgra_to_yuv_y(pixel);
                                                                          -         dest[upos++] = bgra_to_yuv_u(pixel);
                                                                          -         dest[vpos++] = bgra_to_yuv_v(pixel);
                                                                          +            dest[dest_line_pos + x] = bgra_to_yuv_y(pixel);
                                                                          +            dest[upos++] = bgra_to_yuv_u(pixel);
                                                                          +            dest[vpos++] = bgra_to_yuv_v(pixel);
                                                                           
                                                                          -         pixel = rgb_to_bgra(src_pixel[x + 1]);
                                                                          -         dest[dest_line_pos + x + 1] = bgra_to_yuv_y(pixel);
                                                                          +            pixel = rgb_to_bgra(src_pixel[x + 1]);
                                                                          +            dest[dest_line_pos + x + 1] = bgra_to_yuv_y(pixel);
                                                                          +         }
                                                                                 }
                                                                          -   }
                                                                          -   else
                                                                          -   {
                                                                          -      unsigned int x;
                                                                          -      for (x = 0; x < width; ++x)
                                                                          +      else
                                                                                 {
                                                                          -         bgra32 pixel = rgb_to_bgra(src_pixel[x]);
                                                                          -         dest[dest_line_pos + x] = bgra_to_yuv_y(pixel);
                                                                          +         unsigned int x;
                                                                          +         for (x = 0; x < width; ++x)
                                                                          +         {
                                                                          +            bgra32 pixel = rgb_to_bgra(src_pixel[x]);
                                                                          +            dest[dest_line_pos + x] = bgra_to_yuv_y(pixel);
                                                                          +         }
                                                                                 }
                                                                              }
                                                                          -   }
                                                                           }
                                                                           
                                                                          -static void _convert_rgb565_to_bgra8888( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_rgb565_to_bgra8888(uchar *dest, const uchar *src,
                                                                          +                            const int width, const int height,
                                                                          +                            const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int src_stride = (s_size / height);
                                                                              unsigned int dest_stride = (d_size / height);
                                                                          @@ -585,14 +611,15 @@ static void _convert_rgb565_to_bgra8888( uchar *dest, const uchar *src,
                                                                                 unsigned int x;
                                                                                 for (x = 0; x < width; ++x)
                                                                                 {
                                                                          -         dest_pixel[x] = rgb_to_bgra( src_pixel[x]);
                                                                          +         dest_pixel[x] = rgb_to_bgra(src_pixel[x]);
                                                                                 }
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _convert_yuv420_to_rgb565( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_yuv420_to_rgb565(uchar *dest, const uchar *src,
                                                                          +                          const int width, const int height,
                                                                          +                          const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int pix_count = width * height;
                                                                              unsigned int dest_stride = (d_size / height);
                                                                          @@ -609,16 +636,17 @@ static void _convert_yuv420_to_rgb565( uchar *dest, const uchar *src,
                                                                                    uchar yuv_v = src[ (int)(pix_count*1.25 + (y/2)*(width/2) + x/2)];
                                                                           
                                                                                    dest_pixel[x] =
                                                                          -            ( ( yuv_to_r(yuv_y, yuv_u, yuv_v) >> (RGB32_CHANEL_BIT_SIZE - RGB16_R_SIZE)) << RGB16_R_SHIFT)
                                                                          +            ((yuv_to_r(yuv_y, yuv_u, yuv_v) >> (RGB32_CHANEL_BIT_SIZE - RGB16_R_SIZE)) << RGB16_R_SHIFT)
                                                                                       | ((yuv_to_g(yuv_y, yuv_u, yuv_v) >> (RGB32_CHANEL_BIT_SIZE - RGB16_G_SIZE)) << RGB16_G_SHIFT)
                                                                                       | ((yuv_to_b(yuv_y, yuv_u, yuv_v) >> (RGB32_CHANEL_BIT_SIZE - RGB16_B_SIZE)) << RGB16_B_SHIFT);
                                                                                 }
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _convert_yuv420_to_bgra8888( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_yuv420_to_bgra8888(uchar *dest, const uchar *src,
                                                                          +                            const int width, const int height,
                                                                          +                            const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int pix_count = width * height;
                                                                              unsigned int dest_stride = (d_size / height);
                                                                          @@ -642,9 +670,10 @@ static void _convert_yuv420_to_bgra8888( uchar *dest, const uchar *src,
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _convert_yuv422_to_bgra8888( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_yuv422_to_bgra8888(uchar *dest, const uchar *src,
                                                                          +                            const int width, const int height,
                                                                          +                            const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int dest_stride = (d_size / height);
                                                                              uchar yuv_u, yuv_v, yuv_y1, yuv_y2;
                                                                          @@ -675,9 +704,10 @@ static void _convert_yuv422_to_bgra8888( uchar *dest, const uchar *src,
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _convert_rgb888_to_bgra8888( uchar *dest, const uchar *src,
                                                                          -            const int width, const int height,
                                                                          -            const int d_size, const int s_size)
                                                                          +static void 
                                                                          +_convert_rgb888_to_bgra8888(uchar *dest, const uchar *src,
                                                                          +                            const int width, const int height,
                                                                          +                            const int d_size, const int s_size)
                                                                           {
                                                                              unsigned int src_stride = (s_size / height);
                                                                              unsigned int dest_stride = (d_size / height);
                                                                          @@ -698,23 +728,24 @@ static void _convert_rgb888_to_bgra8888( uchar *dest, const uchar *src,
                                                                              }
                                                                           }
                                                                           
                                                                          -int image_sample_util_convert_colorspace( uchar *dest , image_util_colorspace_e dest_colorspace,
                                                                          -            const uchar *src , int width, int height,
                                                                          -            image_util_colorspace_e src_colorspace)
                                                                          +int 
                                                                          +image_sample_util_convert_colorspace(uchar *dest, image_util_colorspace_e dest_colorspace,
                                                                          +                                     const uchar *src, int width, int height,
                                                                          +                                     image_util_colorspace_e src_colorspace)
                                                                           {
                                                                          -   RETVM_IF(NULL == src, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "source buffer in NULL");
                                                                          -   RETVM_IF(NULL == dest, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "destination buffer in NULL");
                                                                          -   RETVM_IF(width <= 0 || height <= 0, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "width or heightis incorrect");
                                                                          +   RETVM_IF(NULL == src, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "source buffer in NULL");
                                                                          +   RETVM_IF(NULL == dest, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "destination buffer in NULL");
                                                                          +   RETVM_IF(width <= 0 || height <= 0, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "width or heightis incorrect");
                                                                              int error = IMAGE_UTIL_ERROR_NONE;
                                                                           
                                                                          -
                                                                              if (IMAGE_UTIL_COLORSPACE_BGRA8888 != src_colorspace
                                                                                 && IMAGE_UTIL_COLORSPACE_RGB565 != src_colorspace
                                                                                 && IMAGE_UTIL_COLORSPACE_I420 != src_colorspace
                                                                                 && IMAGE_UTIL_COLORSPACE_UYVY != src_colorspace
                                                                                 && IMAGE_UTIL_COLORSPACE_RGB888 != src_colorspace)
                                                                              {
                                                                          -      ERR("src_colorspace not supported yet");
                                                                          +      ERR("src_colorspace not supported yet");
                                                                          +
                                                                                 return IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                                                                              }
                                                                           
                                                                          @@ -722,24 +753,25 @@ int image_sample_util_convert_colorspace( uchar *dest , image_util_colorspace_e
                                                                                 && IMAGE_UTIL_COLORSPACE_RGB565 != dest_colorspace
                                                                                 && IMAGE_UTIL_COLORSPACE_I420 != dest_colorspace)
                                                                              {
                                                                          -      ERR("dest_colorspace not supported yet");
                                                                          +      ERR("dest_colorspace not supported yet");
                                                                          +
                                                                                 return IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                                                                              }
                                                                           
                                                                              unsigned int dest_size = 0;
                                                                          -   error = image_util_calculate_buffer_size(width, height, dest_colorspace, &dest_size);
                                                                          -   RETVM_IF(IMAGE_UTIL_ERROR_NONE != error, error, "image_util_calculate_buffer_size error");
                                                                          +   error = image_util_calculate_buffer_size(width, height, dest_colorspace, &dest_size);
                                                                          +   RETVM_IF(IMAGE_UTIL_ERROR_NONE != error, error, "image_util_calculate_buffer_size error");
                                                                              unsigned int src_size = 0;
                                                                          -   error = image_util_calculate_buffer_size(width, height, src_colorspace, &src_size);
                                                                          -   RETVM_IF(IMAGE_UTIL_ERROR_NONE != error, error, "image_util_calculate_buffer_size error");
                                                                          +   error = image_util_calculate_buffer_size(width, height, src_colorspace, &src_size);
                                                                          +   RETVM_IF(IMAGE_UTIL_ERROR_NONE != error, error, "image_util_calculate_buffer_size error");
                                                                           
                                                                              if (dest_colorspace == src_colorspace)
                                                                              {
                                                                                 memcpy(dest, src, src_size);
                                                                          +
                                                                                 return error;
                                                                              }
                                                                           
                                                                          -
                                                                              if (IMAGE_UTIL_COLORSPACE_BGRA8888 == src_colorspace)
                                                                              {
                                                                                 if (IMAGE_UTIL_COLORSPACE_I420 == dest_colorspace)
                                                                          @@ -781,7 +813,8 @@ int image_sample_util_convert_colorspace( uchar *dest , image_util_colorspace_e
                                                                                 }
                                                                                 else
                                                                                 {
                                                                          -         ERR("dest_colorspace not supported yet");
                                                                          +         ERR("dest_colorspace not supported yet");
                                                                          +
                                                                                    return IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                                                                                 }
                                                                              }
                                                                          @@ -793,15 +826,16 @@ int image_sample_util_convert_colorspace( uchar *dest , image_util_colorspace_e
                                                                                 }
                                                                                 else
                                                                                 {
                                                                          -         ERR("dest_colorspace not supported yet");
                                                                          +         ERR("dest_colorspace not supported yet");
                                                                          +
                                                                                    return IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                                                                                 }
                                                                              }
                                                                          -
                                                                              return error;
                                                                           }
                                                                           
                                                                          -bool frame_extractor_frame_get(const frame_extractor *extractor, unsigned char **frame, int pos)
                                                                          +bool 
                                                                          +frame_extractor_frame_get(const frame_extractor *extractor, unsigned char **frame, int pos)
                                                                           {
                                                                              bool result = false;
                                                                              if (extractor && frame)
                                                                          @@ -815,7 +849,9 @@ bool frame_extractor_frame_get(const frame_extractor *extractor, unsigned char *
                                                                                    *frame = malloc(size + (extractor->width * extractor->height) * ARGB_PIXEL_SIZE);
                                                                                    if (*frame)
                                                                                    {
                                                                          -            error = image_sample_util_convert_colorspace(*frame , IMAGE_UTIL_COLORSPACE_BGRA8888, buf,  extractor->width, extractor->height, IMAGE_UTIL_COLORSPACE_RGB888);
                                                                          +            error = image_sample_util_convert_colorspace(*frame, IMAGE_UTIL_COLORSPACE_BGRA8888, buf,  
                                                                          +                                                         extractor->width, extractor->height, 
                                                                          +                                                         IMAGE_UTIL_COLORSPACE_RGB888);
                                                                                       if (IMAGE_UTIL_ERROR_NONE == error)
                                                                                       {
                                                                                          result = true;
                                                                          @@ -829,7 +865,6 @@ bool frame_extractor_frame_get(const frame_extractor *extractor, unsigned char *
                                                                                    free(buf);
                                                                                 }
                                                                              }
                                                                          -
                                                                              return result;
                                                                           }
                                                                           
                                                                          @@ -843,7 +878,8 @@ bool frame_extractor_frame_get(const frame_extractor *extractor, unsigned char *

                                                                          This view allows the user to play tone sounds from the numeric phone keypad. Internally, when any phone keypad button is clicked, the _on_keypad_btn_down_cb and _on_keypad_btn_up_cb callbacks are called and the _process method is executed:

                                                                          -static void _on_keypad_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                          +static void 
                                                                          +_on_keypad_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                           {
                                                                              tone_player_view *view = data;
                                                                              if (view)
                                                                          @@ -860,7 +896,8 @@ static void _on_keypad_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *
                                                                           

                                                                          Tone player

                                                                          -static void _on_keypad_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                          +static void 
                                                                          +_on_keypad_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                           {
                                                                              tone_player_view *view = data;
                                                                              if (view)
                                                                          @@ -877,7 +914,8 @@ static void _on_keypad_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *ev
                                                                           

                                                                          Audio in-out

                                                                          -static void _audio_in_start(audio_inout *obj)
                                                                          +static void 
                                                                          +_audio_in_start(audio_inout *obj)
                                                                           {
                                                                              audio_buffer *buf = obj->buffer;
                                                                              char *samples = buf->samples;
                                                                          @@ -927,7 +965,8 @@ static void _audio_in_start(audio_inout *obj)
                                                                           

                                                                          Audio equalizer

                                                                          -static void _set_equalizer_layout(equalizer_view *view, Evas_Object *parent)
                                                                          +static void 
                                                                          +_set_equalizer_layout(equalizer_view *view, Evas_Object *parent)
                                                                           {
                                                                              Evas_Object *box = elm_box_add(parent);
                                                                              elm_box_horizontal_set(box, EINA_FALSE);
                                                                          @@ -968,7 +1007,8 @@ static void _set_equalizer_layout(equalizer_view *view, Evas_Object *parent)
                                                                           

                                                                          Initialize and render openGL:

                                                                          -void _gles_cube_view_glview_init(Evas_Object *obj)
                                                                          +void 
                                                                          +_gles_cube_view_glview_init(Evas_Object *obj)
                                                                           {
                                                                              gles_cube_view_data *view = evas_object_data_get(obj, GLVIEW_VIEW_DATA_NAME);
                                                                              RETM_IF(!view, "View data is NULL");
                                                                          @@ -982,7 +1022,8 @@ void _gles_cube_view_glview_init(Evas_Object *obj)
                                                                              api->glEnable(GL_DEPTH_TEST);
                                                                           }
                                                                           
                                                                          -void _gles_cube_view_glview_render(Evas_Object *obj)
                                                                          +void 
                                                                          +_gles_cube_view_glview_render(Evas_Object *obj)
                                                                           {
                                                                              gles_cube_view_data *view = evas_object_data_get(obj, GLVIEW_VIEW_DATA_NAME);
                                                                              RETM_IF(!view, "View data is NULL");
                                                                          @@ -1010,7 +1051,8 @@ void _gles_cube_view_glview_render(Evas_Object *obj)
                                                                           

                                                                          This view allows the user to play different media sources, such as MP3, AMR, WAV, MP4, and AAC. Internally, when the Play button is clicked, the _start_player callback is called, which prepares the selected media and plays it.

                                                                          -static void _start_player(media_player_view *view)
                                                                          +static void 
                                                                          +_start_player(media_player_view *view)
                                                                           {
                                                                              player_state_e state;
                                                                              player_get_state(view->player, &state);
                                                                          @@ -1050,7 +1092,8 @@ static void _start_player(media_player_view *view)
                                                                           

                                                                          Multi Play

                                                                          -static void _on_genlist_item_selected_cb(void *data, Evas_Object *obj, void *event_info)
                                                                          +static void 
                                                                          +_on_genlist_item_selected_cb(void *data, Evas_Object *obj, void *event_info)
                                                                           {
                                                                              Elm_Object_Item *item = (Elm_Object_Item *) event_info;
                                                                              player_data *player = elm_object_item_data_get(item);
                                                                          @@ -1083,7 +1126,8 @@ static void _on_genlist_item_selected_cb(void *data, Evas_Object *obj, void *eve
                                                                           

                                                                          This view allows the user to display the camera preview and media player at the same window. Initially, both the camera and the player should be created and initiated:

                                                                          -static player_h _create_player(camera_player_view *this)
                                                                          +static player_h 
                                                                          +_create_player(camera_player_view *this)
                                                                           {
                                                                              player_h player = NULL;
                                                                           
                                                                          @@ -1121,7 +1165,8 @@ static player_h _create_player(camera_player_view *this)
                                                                           

                                                                          When the Start button is clicked, camera streaming and video player streaming start simultaneously:

                                                                          -static void _start_camera(camera_player_view *this)
                                                                          +static void 
                                                                          +_start_camera(camera_player_view *this)
                                                                           {
                                                                              if (!this->camera)
                                                                              {
                                                                          @@ -1140,7 +1185,8 @@ static void _start_camera(camera_player_view *this)
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _start_player(camera_player_view *this)
                                                                          +static void 
                                                                          +_start_player(camera_player_view *this)
                                                                           {
                                                                              if (!this->player)
                                                                              {
                                                                          @@ -1169,7 +1215,8 @@ static void _start_player(camera_player_view *this)
                                                                           

                                                                          This view allows the user to record camera streaming and play another video stream at the same time. Initially, both the camera recorder and the player should be created and initiated:

                                                                          -static void _create_video_recorder(video_recorder_player_view *view)
                                                                          +static void 
                                                                          +_create_video_recorder(video_recorder_player_view *view)
                                                                           {
                                                                              window_obj *win_obj = view->app->win;
                                                                              Evas_Object *win = win_obj->win;
                                                                          @@ -1202,7 +1249,8 @@ static void _create_video_recorder(video_recorder_player_view *view)
                                                                           

                                                                          When the Start button is clicked, recording a video stream to a file and playing another video stream at the same time begins. The recorded file is played after the recording is finished.

                                                                          -static void _stop_video_recorder(video_recorder_player_view *view)
                                                                          +static void 
                                                                          +_stop_video_recorder(video_recorder_player_view *view)
                                                                           {
                                                                              if (view->recorder)
                                                                              {
                                                                          @@ -1218,7 +1266,8 @@ static void _stop_video_recorder(video_recorder_player_view *view)
                                                                           static void _on_record_completed(video_recorder_player_view *view)
                                                                           {
                                                                              win_set_view_style(view->app->win, STYLE_DEFAULT_WINDOW);
                                                                          -   Elm_Object_Item *video_player_navi_item = video_player_view_add(view->app, view->navi, get_data_path(RECORDERED_3GP_VIDEO), NULL, NULL);
                                                                          +   Elm_Object_Item *video_player_navi_item = video_player_view_add(view->app, view->navi, 
                                                                          +                                                                   get_data_path(RECORDERED_3GP_VIDEO), NULL, NULL);
                                                                              elm_naviframe_item_pop_cb_set(video_player_navi_item, _video_player_navi_item_pop_cb, view);
                                                                           }
                                                                           
                                                                          @@ -1229,7 +1278,8 @@ static void _on_record_completed(video_recorder_player_view *view)

                                                                          This view allows the user to capture a separate frame from the camera stream as an image and display it in the saved images. There are numerous settings that can be used to adjust the capturing process and to customize the camera stream style, quality, and filtering. Initially, the camera view should be prepared and started:

                                                                          -static void _create_camera(camera_capture_view *view)
                                                                          +static void 
                                                                          +_create_camera(camera_capture_view *view)
                                                                           {
                                                                              window_obj *win_obj = view->app->win;
                                                                              Evas_Object *win = win_obj->win;
                                                                          @@ -1263,7 +1313,9 @@ static void _start_camera(camera_capture_view *view)
                                                                           

                                                                          When the Capture button is clicked, it takes a frame shot of the current camera view and places it into a scrollable gallery down the view.

                                                                          -static void _on_camera_capture_cb(camera_image_data_s *image, camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data)
                                                                          +static void 
                                                                          +_on_camera_capture_cb(camera_image_data_s *image, camera_image_data_s *postview, 
                                                                          +                      camera_image_data_s *thumbnail, void *user_data)
                                                                           {
                                                                              camera_capture_view *view = user_data;
                                                                           
                                                                          @@ -1285,12 +1337,14 @@ static void _on_camera_capture_cb(camera_image_data_s *image, camera_image_data_
                                                                           

                                                                          Each newly created frame can be viewed with the image viewer:

                                                                          -static void _on_thumb_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                          +static void 
                                                                          +_on_thumb_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                           {
                                                                              thumbnail_data *thumbnail = data;
                                                                              if (thumbnail)
                                                                              {
                                                                          -      if (capture_image_viewer_add(thumbnail->view->app, thumbnail->view->navi, thumbnail->image_path, _on_capture_image_viewer_del_cb, thumbnail->view))
                                                                          +      if (capture_image_viewer_add(thumbnail->view->app, thumbnail->view->navi, 
                                                                          +                                   thumbnail->image_path, _on_capture_image_viewer_del_cb, thumbnail->view))
                                                                                 {
                                                                                    thumbnail->view->activated = false;
                                                                                    _stop_camera(thumbnail->view);
                                                                          @@ -1310,7 +1364,8 @@ static void _on_thumb_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                           

                                                                          Video recorder

                                                                          -static void _create_video_recorder(video_recorder_view *view)
                                                                          +static void 
                                                                          +_create_video_recorder(video_recorder_view *view)
                                                                           {
                                                                              if (view->recorder)
                                                                              {
                                                                          @@ -1331,7 +1386,8 @@ static void _create_video_recorder(video_recorder_view *view)
                                                                           

                                                                          When the Start button is clicked, it starts to record a video. The recorded video can be played in the Media player.

                                                                          -static void _start_video_recorder(video_recorder_view *view)
                                                                          +static void 
                                                                          +_start_video_recorder(video_recorder_view *view)
                                                                           {
                                                                              if (view->recorder)
                                                                              {
                                                                          @@ -1344,7 +1400,8 @@ static void _start_video_recorder(video_recorder_view *view)
                                                                           

                                                                          This view allows the user to record audio streaming and play the recorded audio. There are several settings that can be used to adjust audio quality and pre-processing. Initially, the audio recorder should be created and prepared:

                                                                          -static void _recorder_create(audio_recorder_view *view)
                                                                          +static void 
                                                                          +_recorder_create(audio_recorder_view *view)
                                                                           {
                                                                              if (recorder_create_audiorecorder(&view->recorder) == RECORDER_ERROR_NONE)
                                                                              {
                                                                          @@ -1379,7 +1436,8 @@ static void _recorder_create(audio_recorder_view *view)
                                                                           

                                                                          When the Start button is clicked, it starts to record the audio stream. The recorded audio can be played in the Media player.

                                                                          -static void _recorder_start(audio_recorder_view *view)
                                                                          +static void 
                                                                          +_recorder_start(audio_recorder_view *view)
                                                                           {
                                                                              if (view->recorder)
                                                                              {
                                                                          @@ -1391,7 +1449,9 @@ static void _recorder_start(audio_recorder_view *view)
                                                                                 }
                                                                              }
                                                                           }
                                                                          -static void _recorder_stop(audio_recorder_view *view)
                                                                          +
                                                                          +static void 
                                                                          +_recorder_stop(audio_recorder_view *view)
                                                                           {
                                                                              if (view->recorder)
                                                                              {
                                                                          @@ -1408,7 +1468,8 @@ static void _recorder_stop(audio_recorder_view *view)
                                                                              }
                                                                           }
                                                                           
                                                                          -static void _on_ctrl_btn_pressed_cb(void *data, Evas_Object *obj, void *event_info)
                                                                          +static void 
                                                                          +_on_ctrl_btn_pressed_cb(void *data, Evas_Object *obj, void *event_info)
                                                                           {
                                                                              audio_recorder_view *view = data;
                                                                           
                                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_n/mediacontroller_client_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/mediacontroller_client_sd_mn.htm
                                                                          new file mode 100644
                                                                          index 0000000..626957d
                                                                          --- /dev/null
                                                                          +++ b/org.tizen.sampledescriptions/html/mobile_n/mediacontroller_client_sd_mn.htm
                                                                          @@ -0,0 +1,174 @@
                                                                          +
                                                                          +
                                                                          +
                                                                          +	
                                                                          +	
                                                                          +	
                                                                          +	
                                                                          +		
                                                                          +	
                                                                          +	
                                                                          +	
                                                                          +	
                                                                          +	Media-controller-client Sample Overview
                                                                          +
                                                                          +
                                                                          +
                                                                          +
                                                                          +
                                                                          +
                                                                          + +
                                                                          +
                                                                          +

                                                                          Mobile native

                                                                          +
                                                                          +

                                                                          Media-controller-client Sample Overview

                                                                          +

                                                                          The media-controller-client sample application demonstrates how you can create a custom media controller client type application. This sample application is based on a simple lockscreen application.

                                                                          +

                                                                          The following figure illustrates the main view of the media-controller-client sample application.

                                                                          + +

                                                                          Figure: Media-controller-client main view

                                                                          +

                                                                          + Media-controller-client main view +

                                                                          + +

                                                                          Prerequisites

                                                                          +

                                                                          To ensure proper application execution, the following privilege must be set:

                                                                          +
                                                                            +
                                                                          • http://tizen.org/privilege/mediacontroller.client
                                                                          • +
                                                                          + +

                                                                          Implementation

                                                                          + +

                                                                          To use the media controller client:

                                                                          +
                                                                            +
                                                                          1. Create the media controller client handle in the __create_player_client() function. The function sets the callbacks to receive the update event from the media controller server. +
                                                                            +static void 
                                                                            +__create_player_client(void)
                                                                            +{
                                                                            +   int ret = mc_client_create(&s_player_data.player_client);
                                                                            +
                                                                            +   if (ret != MEDIA_CONTROLLER_ERROR_NONE) 
                                                                            +   {
                                                                            +      dlog_print(DLOG_ERROR, LOG_TAG, "Media controller client creation [%d]", ret);
                                                                            +
                                                                            +      return;
                                                                            +   }
                                                                            +
                                                                            +   // Callbacks on server events
                                                                            +   mc_client_set_server_update_cb(s_player_data.player_client, __player_state_changed_cb, NULL);
                                                                            +   mc_client_set_playback_update_cb(s_player_data.player_client, __playback_updated_cb, NULL);
                                                                            +   mc_client_set_metadata_update_cb(s_player_data.player_client, __metadata_updated_cb, NULL);
                                                                            +   mc_client_set_shuffle_mode_update_cb(s_player_data.player_client, __shuffle_mode_updated_cb, NULL);
                                                                            +   mc_client_set_repeat_mode_update_cb(s_player_data.player_client, __repeat_mode_updated_cb, NULL);    
                                                                            +
                                                                            +   return;
                                                                            +} 
                                                                            +
                                                                            +
                                                                          2. + +
                                                                          3. Initialize the media information with the latest server information in the __create_player_client() function. The function can also get the latest media information using the mc_client_get_latest_server_info() and mc_client_get_server_xxx() functions. The server name is necessary to use the mc_client_get_server_xxx() functions. To get the server name, use the mc_client_foreach_server() or mc_client_get_latest_server_info() function. +
                                                                            +static void 
                                                                            +__create_player_client(void)
                                                                            +{
                                                                            +   int ret = mc_client_create(&s_player_data.player_client);
                                                                            +
                                                                            +   ret = mc_client_foreach_server(s_player_data.player_client, __server_list_cb, NULL);
                                                                            +
                                                                            +   ret = mc_client_get_latest_server_info(s_player_data.player_client, &server_name, &server_state);
                                                                            +
                                                                            +   if (ret == MEDIA_CONTROLLER_ERROR_NONE
                                                                            +       && server_name
                                                                            +       && !s_player_data.connected) 
                                                                            +   {
                                                                            +      s_player_data.app_name = strdup(server_name);
                                                                            +
                                                                            +      mc_client_get_server_playback_info(s_player_data.player_client, s_player_data.app_name, &s_player_data.playback_info);
                                                                            +      mc_client_get_server_metadata(s_player_data.player_client, s_player_data.app_name, &s_player_data.metadata);
                                                                            +      mc_client_get_server_shuffle_mode(s_player_data.player_client, s_player_data.app_name, &shuffle_mode);
                                                                            +      mc_client_get_server_repeat_mode(s_player_data.player_client, s_player_data.app_name, &repeat_mode);
                                                                            +   } 
                                                                            +   else 
                                                                            +   {
                                                                            +      dlog_print(DLOG_DEBUG, LOG_TAG, "Didn't get information about latest server");
                                                                            +   }
                                                                            +   return;
                                                                            +} 
                                                                            +
                                                                            +
                                                                          4. + +
                                                                          5. Send the playback state command to the media controller server application with the mc_client_send_playback_state_command() function. This function can change the playback state of the media controller server. +
                                                                            +static void 
                                                                            +__play_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                            +{
                                                                            +   mc_client_send_playback_state_command(s_player_data.player_client, s_player_data.app_name, MEDIA_PLAYBACK_STATE_PLAYING);
                                                                            +   dlog_print(DLOG_DEBUG, LOG_TAG, "Send Play command to player app [%s]", s_player_data.app_name);
                                                                            +}
                                                                            +
                                                                            +static void 
                                                                            +__prev_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                            +{
                                                                            +   mc_client_send_playback_state_command(s_player_data.player_client, s_player_data.app_name, MEDIA_PLAYBACK_STATE_PREV_FILE);
                                                                            +   dlog_print(DLOG_DEBUG, LOG_TAG, "Send Previous track command to player app [%s]", s_player_data.app_name);
                                                                            +}
                                                                            +
                                                                            +static void 
                                                                            +__next_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                                            +{
                                                                            +   mc_client_send_playback_state_command(s_player_data.player_client, s_player_data.app_name, MEDIA_PLAYBACK_STATE_NEXT_FILE);
                                                                            +   dlog_print(DLOG_DEBUG, LOG_TAG, "Send Next track command to player app [%s]", s_player_data.app_name);
                                                                            +}
                                                                            +
                                                                            +
                                                                          6. + +
                                                                          7. Unset the callbacks with the mc_client_unset_xxx_update_cb() functions. The media controller client handle must be destroyed using the mc_client_destroy() function. +
                                                                            +static void 
                                                                            +__destroy_player_client(void)
                                                                            +{
                                                                            +   mc_client_unset_server_update_cb(s_player_data.player_client);
                                                                            +   mc_client_unset_playback_update_cb(s_player_data.player_client);
                                                                            +   mc_client_unset_metadata_update_cb(s_player_data.player_client);
                                                                            +   mc_client_unset_shuffle_mode_update_cb(s_player_data.player_client);
                                                                            +   mc_client_unset_repeat_mode_update_cb(s_player_data.player_client);
                                                                            +
                                                                            +   mc_client_destroy(s_player_data.player_client);
                                                                            +   mc_client_destroy_playback(s_player_data.playback_info);
                                                                            +   mc_client_destroy_metadata(s_player_data.metadata);
                                                                            +
                                                                            +   if (s_player_data.app_name) 
                                                                            +   {
                                                                            +      free(s_player_data.app_name);
                                                                            +   }
                                                                            +   return;
                                                                            +}
                                                                            +
                                                                            +
                                                                          8. +
                                                                          + + + + +
                                                                          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/mediacontroller_server_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/mediacontroller_server_sd_mn.htm new file mode 100644 index 0000000..78f4ba5 --- /dev/null +++ b/org.tizen.sampledescriptions/html/mobile_n/mediacontroller_server_sd_mn.htm @@ -0,0 +1,163 @@ + + + + + + + + + + + + + Media-controller-server Sample Overview + + + + +
                                                                          +
                                                                          + +
                                                                          +
                                                                          +

                                                                          Mobile native

                                                                          +
                                                                          +

                                                                          Media-controller-server Sample Overview

                                                                          +

                                                                          The media-controller-server sample application demonstrates how you can create a custom media controller server type application. This sample application is based on a simple music application.

                                                                          +

                                                                          The following figure illustrates the main view of the media-controller-server sample application.

                                                                          + +

                                                                          Figure: Media-controller server main view

                                                                          +

                                                                          + Media-controller-server main view +

                                                                          + +

                                                                          Prerequisites

                                                                          +

                                                                          To ensure proper application execution, the following privilege must be set:

                                                                          +
                                                                            +
                                                                          • http://tizen.org/privilege/mediacontroller.server
                                                                          • +
                                                                          + +

                                                                          Implementation

                                                                          + +

                                                                          To use the media controller server:

                                                                          +
                                                                            +
                                                                          1. Create a media controller server handle in the create_player() function. The function sets the callbacks to receive commands from the media controller client. To handle the incoming playback state command, define a callback and register it using the mc_server_set_playback_state_command_received_cb() function. +
                                                                            +static void 
                                                                            +create_player(appdata_s *ad)
                                                                            +{
                                                                            +   ret = mc_server_create(&ad->player_controller);
                                                                            +   if (ret != MEDIA_CONTROLLER_ERROR_NONE) 
                                                                            +   {
                                                                            +      dlog_print(DLOG_ERROR, LOG_TAG, "mc_server_create() is failed. err = %d", ret);
                                                                            +
                                                                            +      return;
                                                                            +   }
                                                                            +   mc_server_set_playback_state_command_received_cb(ad->player_controller, _playback_state_cb, (void*)ad);
                                                                            +   mc_server_set_custom_command_received_cb(ad->player_controller, __custom_command_received_cb, (void*)ad);
                                                                            +} 
                                                                            +
                                                                            +
                                                                          2. + +
                                                                          3. Update the playback state, media metadata information, shuffle mode, and repeat mode in the play_media() function: +
                                                                            +void
                                                                            +play_media(media_info_h media_info, appdata_s *ad)
                                                                            +{
                                                                            +   mc_server_set_metadata(ad->player_controller, 0, file_name);
                                                                            +   mc_server_set_metadata(ad->player_controller, 1, artist);
                                                                            +   mc_server_set_metadata(ad->player_controller, 2, album);
                                                                            +   mc_server_set_metadata(ad->player_controller, 3, author);
                                                                            +   mc_server_set_metadata(ad->player_controller, 4, genre);
                                                                            +   mc_server_set_metadata(ad->player_controller, 5, duration_c);
                                                                            +   mc_server_set_metadata(ad->player_controller, 6, date);
                                                                            +   mc_server_set_metadata(ad->player_controller, 7, copyright);
                                                                            +   mc_server_set_metadata(ad->player_controller, 8, description);
                                                                            +   mc_server_set_metadata(ad->player_controller, 9, track_num);      
                                                                            +   mc_server_update_metadata(ad->player_controller);
                                                                            +
                                                                            +   // Update shuffle mode information for clients
                                                                            +   mc_server_update_shuffle_mode(ad->player_controller, SHUFFLE_MODE_OFF);
                                                                            +
                                                                            +   // Update repeat mode information for clients
                                                                            +   mc_server_update_repeat_mode(ad->player_controller, REPEAT_MODE_ON);
                                                                            +
                                                                            +   switch (player_state) 
                                                                            +   {
                                                                            +      // Case when the player state is playing
                                                                            +         mc_server_set_playback_state(ad->player_controller, MEDIA_PLAYBACK_STATE_PLAYING);
                                                                            +         mc_server_update_playback_info(ad->player_controller);
                                                                            +
                                                                            +      // Case when the player state is paused
                                                                            +         mc_server_set_playback_state(ad->player_controller, MEDIA_PLAYBACK_STATE_PAUSED);
                                                                            +         mc_server_update_playback_info(ad->player_controller);
                                                                            +   }
                                                                            +} 
                                                                            +
                                                                            +
                                                                          4. + +
                                                                          5. Handle the custom command in the mc_server_set_custom_command_received_cb() function and send a reply to the media controller client application with the mc_server_send_command_reply() function: +
                                                                            +void 
                                                                            +__custom_command_received_cb(const char *client_name, const char *command, bundle *data, void *user_data)
                                                                            +{
                                                                            +   ret = mc_server_send_command_reply(ad->player_controller, client_name, 0, bundle_reply);
                                                                            +   if (ret != MEDIA_CONTROLLER_ERROR_NONE)
                                                                            +      dlog_print(DLOG_ERROR, LOG_TAG, "mc_server_send_command_reply() is failed. err = %d", ret);
                                                                            +
                                                                            +   return;
                                                                            +}
                                                                            +
                                                                            +
                                                                          6. + +
                                                                          7. Unset the callbacks with the mc_client_unset_xxx_command_received_cb() functions. The media controller server handle must be destroyed using the mc_server_destroy() function. +
                                                                            +static void 
                                                                            +__destroy_player(appdata_s *ad)
                                                                            +{
                                                                            +   ret = mc_server_unset_playback_state_command_received_cb(ad->player_controller);
                                                                            +   if (ret != MEDIA_CONTROLLER_ERROR_NONE) 
                                                                            +   {
                                                                            +      dlog_print(DLOG_ERROR, LOG_TAG, "mc_server_unset_playback_state_command_received_cb() is failed. err = %d", ret);
                                                                            +   }
                                                                            +
                                                                            +   ret = mc_server_unset_custom_command_received_cb(ad->player_controller);
                                                                            +   if (ret != MEDIA_CONTROLLER_ERROR_NONE) 
                                                                            +   {
                                                                            +      dlog_print(DLOG_ERROR, LOG_TAG, "mc_server_unset_playback_state_command_received_cb() is failed. err = %d", ret);
                                                                            +   }
                                                                            +
                                                                            +   ret = mc_server_destroy(ad->player_controller);
                                                                            +   if (ret != MEDIA_CONTROLLER_ERROR_NONE) 
                                                                            +   {
                                                                            +      dlog_print(DLOG_ERROR, LOG_TAG, "mc_server_destroy() is failed. err = %d", ret);
                                                                            +   }
                                                                            +}
                                                                            +
                                                                            +
                                                                          8. +
                                                                          + + + + +
                                                                          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/messageport_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/messageport_sd_mn.htm new file mode 100644 index 0000000..09c4833 --- /dev/null +++ b/org.tizen.sampledescriptions/html/mobile_n/messageport_sd_mn.htm @@ -0,0 +1,945 @@ + + + + + + + + + + + + + + Message Port Sample Overview + + + + +
                                                                          +
                                                                          + +
                                                                          +
                                                                          +

                                                                          Mobile native

                                                                          +
                                                                          + +

                                                                          Message Port Sample Overview

                                                                          + +

                                                                          The Message Port sample demonstrates how to implement data exchange through a message port to enable custom bundled data exchange.

                                                                          +

                                                                          The following figure illustrates the main screens of the application.

                                                                          +

                                                                          Figure: Message Port screens

                                                                          +

                                                                          + Data source view + Data sink view +

                                                                          + +

                                                                          You can:

                                                                          +
                                                                            +
                                                                          • Input a text message: a user-defined text message is bundled and sent through a message port
                                                                          • +
                                                                          • Trigger trusted communication: you can change between common and trusted message sending mode
                                                                          • +
                                                                          • Send a text message: a bundled text message is sent through a message port following the trust level set by the user
                                                                          • +
                                                                          • Receive a text message: a user-defined text message is received and displayed
                                                                          • +
                                                                          + +

                                                                          The following figures illustrate the structure of the user interface (EDJE layout scripts are used).

                                                                          + +

                                                                          Figure: UI layout structure of the Data source view

                                                                          +

                                                                          + UI layout structure of the data source UI component structure of the data source +

                                                                          + +

                                                                          Figure: UI layout structure of Data sink view

                                                                          +

                                                                          + UI layout structure of the data sink UI component structure of the data sink +

                                                                          +

                                                                          The application workflow can be divided into the following logical pipelines, illustrated in the following figure:

                                                                          +
                                                                            +
                                                                          • Application startup
                                                                          • +
                                                                          • Bundled text message sending
                                                                          • +
                                                                          • Bundled text message receiving
                                                                          • +
                                                                          + +

                                                                          Figure: Application workflow

                                                                          +

                                                                          + Startup Message sending Message receiving Message structure +

                                                                          + +

                                                                          Implementation

                                                                          + +

                                                                          Type Definitions

                                                                          + +

                                                                          The main data structure is used as a placeholder for the model and view data:

                                                                          +
                                                                          +typedef struct 
                                                                          +__appdata 
                                                                          +{
                                                                          +   viewdata_s view; // View module data
                                                                          +} appdata_s;
                                                                          +
                                                                          +

                                                                          The viewdata_s structure contains references to all UI component objects created by the View module.

                                                                          +
                                                                          +typedef struct 
                                                                          +{
                                                                          +   Evas_Object* win; // Main window object
                                                                          +   Evas_Object* conform; // Conformant object
                                                                          +   Evas_Object* layout_main_panel; // Main window's layout object (embedded into the conform component)
                                                                          +   Evas_Object* main_toolbar; // Toolbar object (embedded into the PART_MAIN_TOOLBAR part of the layout_main_panel object)
                                                                          +   Elm_Object_Item *main_toolbar_item_data_source; // "Data source" item of the main_toolbar component
                                                                          +   Elm_Object_Item *main_toolbar_item_data_sink; // "Data sink" item of the main_toolbar component
                                                                          +   Evas_Object* layout_data_source; // Data source view layout (embedded into the PART_MAIN_CONTENT part of the layout_main_panel object)
                                                                          +   Evas_Object *data_source_check; // Checkbox component for toggling the trusted message port on and off (embedded into the PART_DATA_SOURCE_CHECK part of the layout_data_source object)
                                                                          +   Evas_Object *data_source_entry; // Text entry component (embedded into the PART_DATA_SOURCE_ENTRY part of the layout_data_source object)
                                                                          +   Evas_Object *data_source_button_send; // Button component for data sending (embedded into the PART_DATA_SOURCE_BUTTON part of the layout_data_source object)
                                                                          +   Evas_Object* layout_data_sink; // Data sink view layout (embedded into the PART_MAIN_CONTENT part of the layout_main_panel object)
                                                                          +   Evas_Object* sink_entry; // Message entry component (embedded into the PART_DATA_SINK_ENTRY part of the layout_data_sink object)
                                                                          +} viewdata_s;
                                                                          +
                                                                          + +

                                                                          Application Initialization

                                                                          + +

                                                                          The entire application life-cycle is implemented in the main.c file, using the common structure of the Tizen application:

                                                                          +
                                                                          +int 
                                                                          +main(int argc, char *argv[])
                                                                          +{
                                                                          +   appdata_s ad = {{0,},};
                                                                          +   // Variable declaration and initialization
                                                                          +
                                                                          +   event_callback.create = __create_app;
                                                                          +   event_callback.terminate = __terminate_app;
                                                                          +   event_callback.pause = __pause_app;
                                                                          +   event_callback.resume = __resume_app;
                                                                          +   event_callback.app_control = __control_app;
                                                                          +
                                                                          +   // Event handler assignment
                                                                          +
                                                                          +   ret = ui_app_main(argc, argv, &event_callback, &ad);
                                                                          +   // Error handling
                                                                          +
                                                                          +   return ret;
                                                                          +}
                                                                          +
                                                                          +

                                                                          The Message Port sample application is implemented using the MVC design pattern. Its initialization is done within the __app_create() callback function where the controller_initialization() function is responsible for the application initialization. When the application is terminated, the __terminate_app() callback function is called, and all the allocated resources are freed. For more information, see Controller.

                                                                          +
                                                                          +static bool 
                                                                          +__create_app(void *data)
                                                                          +{
                                                                          +   // Variable assignment
                                                                          +
                                                                          +   appdata_s *ad = (appdata_s *)data;
                                                                          +
                                                                          +   return controller_initialization(&ad->view);
                                                                          +}
                                                                          +
                                                                          +
                                                                          +static void 
                                                                          +__terminate_app(void *data)
                                                                          +{
                                                                          +   appdata_s *ad = (appdata_s *)data;
                                                                          +
                                                                          +   controller_terminate(&ad->view);
                                                                          +}
                                                                          +
                                                                          + +

                                                                          View

                                                                          + +

                                                                          The entire application layout is implemented using EDJE scripts. All top level swallows are designed for EFL Elementary component embedding. The following EDJE swallow - EFL Elementary component relations and assigned functionalities are used:

                                                                          + +
                                                                            +
                                                                          • PART_MAIN_TOOLBAR-elm_toolbar: Switches the view between the Data source and Data sink.
                                                                          • +
                                                                          • PART_DATA_SOURCE_CHECK-elm_check: Toggles the trusted port mode on and off.
                                                                          • +
                                                                          • PART_DATA_SOURCE_ENTRY-elm_entry: Custom text message edit field.
                                                                          • +
                                                                          • PART_DATA_SOURCE_BUTTON-elm_button: Bundles the custom text message and sends it to the Data sink.
                                                                          • +
                                                                          • PART_DATA_SINK_ENTRY-elm_entry: Displays received data.
                                                                          • +
                                                                          + +

                                                                          For more information, see also the UI layout structure of the Data source view and +UI layout structure of the Data sink view figures.

                                                                          +

                                                                          The following code snippets create the application layout.

                                                                          +
                                                              + + + + + + + + + + + + + + + + + + + + + + + +
                                                              + Table: UI layout code snippets and figures +
                                                              Code snippetFigure
                                                              + The main layout is defined in the main.edc file. +
                                                              +
                                                              +collections 
                                                              +{
                                                              +   group 
                                                              +   {
                                                              +      name: GROUP_MAIN;
                                                              +
                                                              +      parts 
                                                              +      {
                                                              +         // Background part occupies the entire window
                                                              +         part 
                                                              +         {
                                                              +            name: PART_MAIN_BACKGROUND;
                                                              +            type: RECT;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_MAIN_BACKGROUND
                                                              +         // Spacer occupies the entire area of PART_MAIN_BACKGROUND with a small margin all around
                                                              +         part 
                                                              +         {
                                                              +            name: PART_MAIN_PANEL;
                                                              +            type: SPACER;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_MAIN_PANEL
                                                              +         // Swallow occupies 6% of the PART_MAIN_PANEL height
                                                              +         // Designed to hold the elm_toolbar component
                                                              +         part 
                                                              +         {
                                                              +            name: PART_MAIN_TOOLBAR;
                                                              +            type: SWALLOW;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_MAIN_PANEL
                                                              +         // Swallow occupies 93% of the PART_MAIN_PANEL height
                                                              +         // Designed to hold the data source/sink layout
                                                              +         part 
                                                              +         {
                                                              +            name: PART_MAIN_CONTENT;
                                                              +            type: SWALLOW;
                                                              +         }
                                                              +      }
                                                              +   }
                                                              +}
                                                              +
                                                              +
                                                              +

                                                              + EDJE main layout +

                                                              +
                                                              + The PART_MAIN_CONTENT swallow is used as a container for: + +

                                                              The data source/sink layouts are switched by the toolbar item selection.

                                                              +
                                                              +
                                                              +collections 
                                                              +{
                                                              +   group 
                                                              +   {
                                                              +      name: GROUP_DATA_SOURCE;
                                                              +
                                                              +      parts 
                                                              +      {
                                                              +         // Part is positioned in relation to PART_MAIN_CONTENT from the main.edc file
                                                              +         // Rect plays a role of the background for the data source view and occupies
                                                              +         // the entire area of the PART_MAIN_CONTENT
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SOURCE_BACKGROUND;
                                                              +            type: RECT;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_DATA_SOURCE_BACKGROUND
                                                              +         // Swallow part occupies 10% of the PART_DATA_SOURCE_BACKGROUND height
                                                              +         // Designed to hold the elm_check component for trusted mode toggling
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SOURCE_CHECK;
                                                              +            type: SWALLOW;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_DATA_SOURCE_BACKGROUND
                                                              +         // Rect part occupies 80% of the PART_DATA_SOURCE_BACKGROUND height
                                                              +         // Background for the entry component
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SOURCE_ENTRY_BACKGROUND;
                                                              +            type: RECT;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_DATA_SOURCE_ENTRY_BACKGROUND
                                                              +         // Swallow part occupies the entire area of the underlying part
                                                              +         // Designed to hold the elm_entry component for text message input
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SOURCE_ENTRY;
                                                              +            type: SWALLOW;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_DATA_SOURCE_BACKGROUND
                                                              +         // Swallow part occupies 10% of the PART_DATA_SOURCE_BACKGROUND height
                                                              +         // Designed to hold the elm_button component for data sending
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SOURCE_BUTTON;
                                                              +            type: SWALLOW;
                                                              +         }
                                                              +      }
                                                              +   }
                                                              +}
                                                              +
                                                              +
                                                              +

                                                              + EDJE data source layout +

                                                              +
                                                              +
                                                              +collections 
                                                              +{
                                                              +   group 
                                                              +   {
                                                              +      name: GROUP_DATA_SINK;
                                                              +
                                                              +      parts 
                                                              +      {
                                                              +         // Part is positioned in relation to PART_MAIN_CONTENT from the main.edc file
                                                              +         // Rect plays a role of the background for the entry panel and occupies
                                                              +         // the entire area of the PART_MAIN_CONTENT
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SINK_BACKGROUND;
                                                              +            type: RECT;
                                                              +         }
                                                              +
                                                              +         // Part is positioned in relation to PART_DATA_SINK_BACKGROUND
                                                              +         // Swallow part occupies the entire area of PART_DATA_SINK_BACKGROUND
                                                              +         // Designed to hold the elm_entry component for displaying received data
                                                              +         part 
                                                              +         {
                                                              +            name: PART_DATA_SINK_ENTRY;
                                                              +            type: SWALLOW;
                                                              +         }
                                                              +      }
                                                              +   }
                                                              +}
                                                              +
                                                              +
                                                              +

                                                              + EDJE data sink layout +

                                                              +
                                                              + +

                                                              Based on the layout defined with EDJE scripts, the application interface is created with the view_create_base_gui() function, which takes a pointer to the structure containing view data as its parameter. The view_create_base_gui() function is invoked in the controller_initialization() function called from the __create_app() callback function. For call stack details, see Controller and Application Initialization. The following code snippet presents the general procedure of the user interface creation.

                                                              + +
                                                              +bool 
                                                              +view_create_base_gui(viewdata_s *vd)
                                                              +{
                                                              +   // Pointer to the viewdata_s structure is stored for future use
                                                              +   // Variable viewdata is declared globally in the scope of the view.c file
                                                              +   viewdata = vd;
                                                              +
                                                              +   // Main panel view creation (window, conformant, main layout, toolbar)
                                                              +   if (!__create_main_panel(vd)) 
                                                              +   {
                                                              +      // Error handling
                                                              +   }
                                                              +
                                                              +   // Data source view creation
                                                              +   if (!__create_view_data_source(vd)) 
                                                              +   {
                                                              +      // Error handling
                                                              +   }
                                                              +
                                                              +   // Data sink view creation
                                                              +   if (!__create_data_sink(vd)) 
                                                              +   {
                                                              +      // Error handling
                                                              +   }
                                                              +
                                                              +   // Data source/sink layout objects are assigned to the data field of the respective toolbar's items
                                                              +   // These layout objects are used in __toolbar_item_selected_cb() callback function to switch between the layouts
                                                              +   // depending on the toolbar item selection
                                                              +   elm_object_item_data_set(vd->main_toolbar_item_data_source, (void *)vd->layout_data_source);
                                                              +   elm_object_item_data_set(vd->main_toolbar_item_data_sink, (void *)vd->layout_data_sink);
                                                              +
                                                              +   // Data source tab is marked as selected (the __toolbar_item_selected_cb() callback function is not called automatically)
                                                              +   elm_toolbar_item_selected_set(vd->main_toolbar_item_data_source, EINA_TRUE);
                                                              +
                                                              +   // Set the vd->layout_data_source as the content of the viewdata->layout_main_panel layout because the __toolbar_item_selected_cb()
                                                              +   // callback function is not called when elm_toolbar_item_selected_set() is invoked
                                                              +   elm_object_part_content_set(viewdata->layout_main_panel, PART_MAIN_CONTENT, vd->layout_data_source);
                                                              +
                                                              +   evas_object_show(vd->win);
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              + +

                                                              The entire application view creation is triggered by the view_create_base_gui() function described above. The result of the succeeding subfunction invocations is depicted in the following table.

                                                              + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                              + Table: Base view creation code snippets and figures +
                                                              DescriptionCode snippetFigure
                                                              +

                                                              __create_main_panel():

                                                              +

                                                              The main window and descendant conformant are created (vd->win and vd->conform respectively) and used as a placeholder for the main layout (vd->layout_main_panel).

                                                              +

                                                              The main layout is created with the view_generic_create_set_layout() function by loading the main group from the EDJE layout (main.edj file), and it is then embedded into the vd->layout_main_panel container. Finally, the __layout_back_cb() callback function is attached to the vd->layout_main_panel for the hardware back button handling.

                                                              +

                                                              When the EDJE layout is loaded successfully, the elm_toolbar component can be created as a descendant of the vd->layout_main_panel main layout. At the very end, the following items are appended to the newly created elm_toolbar component with the __toolbar_item_selected_cb() callback function attached:

                                                              + +

                                                              The __toolbar_item_selected_cb() callback function is responsible for switching between the layout objects embedded in the PART_MAIN_CONTENT swallow of the vd->layout_main_panel. Those layouts are defined in the data_source.edc and data_sink.edc files.

                                                              +
                                                              +
                                                              +static bool 
                                                              +__create_main_panel(viewdata_s *vd)
                                                              +{
                                                              +   vd->win = view_generic_create_window(__delete_win_request_cb);
                                                              +   // Error handling
                                                              +
                                                              +   vd->conform = view_generic_create_conformant(vd->win);
                                                              +   // Error handling
                                                              +
                                                              +   vd->layout_main_panel = view_generic_create_set_layout(vd->conform, 
                                                              +                                                          EDJ_MAIN_FILE_NAME, 
                                                              +                                                          GROUP_MAIN, NULL);
                                                              +   // Error handling
                                                              +
                                                              +   eext_object_event_callback_add(vd->layout_main_panel, EEXT_CALLBACK_BACK, 
                                                              +                                  __layout_back_cb, (void *)vd);
                                                              +
                                                              +   vd->main_toolbar = view_generic_create_toolbar(vd->layout_main_panel, 
                                                              +                                                  PART_MAIN_TOOLBAR);
                                                              +   // Error handling
                                                              +
                                                              +   vd->main_toolbar_item_data_source = elm_toolbar_item_append(vd->main_toolbar, 
                                                              +                                                               NULL, "Data source", 
                                                              +                                                               __toolbar_item_selected_cb, NULL);
                                                              +   // Error handling
                                                              +
                                                              +   vd->main_toolbar_item_data_sink = elm_toolbar_item_append(vd->main_toolbar, 
                                                              +                                                             NULL, "Data sink", 
                                                              +                                                             __toolbar_item_selected_cb, NULL);
                                                              +   // Error handling
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              +
                                                              +

                                                              + UI main layout +

                                                              +
                                                              +

                                                              __create_view_data_source():

                                                              +

                                                              The entire Data source view is created by the Data source layout loading from the data_source.edj file. The resulting layout is not inserted into the PART_MAIN_CONTENT, as this operation is performed later depending on toolbar item selection.

                                                              +

                                                              Next, the elm_check, elm_entry, and elm_button components are created and inserted into the vd->layout_data_source layout. The newly created components are used for:

                                                              +
                                                                +
                                                              • Toggling the trusted mode on and off
                                                              • +
                                                              • Text message input
                                                              • +
                                                              • Sending the text message with respect to the trusted mode
                                                              • +
                                                              +

                                                              The relevant callback function (__button_send_clicked_cb()) is attached to the created button (vd->data_source_button_send) to handle the "send" event. For more information, see User Interaction.

                                                              +

                                                              The side image depicts the vd->layout_data_source layout only.

                                                              +
                                                              +
                                                              +static bool 
                                                              +__create_view_data_source(viewdata_s *vd)
                                                              +{
                                                              +   vd->layout_data_source = view_generic_create_layout(vd->layout_main_panel, 
                                                              +                                                       EDJ_DATA_SOURCE_FILE_NAME, GROUP_DATA_SOURCE);
                                                              +   // Error handling
                                                              +
                                                              +   vd->data_source_check = view_generic_create_checkbox(vd->layout_data_source, PART_DATA_SOURCE_CHECK, 
                                                              +                                                        "<font color=#ffffff>Use trusted message port</font>");
                                                              +   // Error handling
                                                              +
                                                              +   vd->data_source_entry = view_generic_create_entry(vd->layout_data_source, PART_DATA_SOURCE_ENTRY);
                                                              +   // Error handling
                                                              +
                                                              +   elm_entry_single_line_set(vd->data_source_entry, EINA_FALSE);
                                                              +   elm_entry_line_wrap_set(vd->data_source_entry, ELM_WRAP_WORD);
                                                              +
                                                              +   vd->data_source_button_send = view_generic_create_button(vd->layout_data_source, 
                                                              +                                                            PART_DATA_SOURCE_BUTTON, "Send", 
                                                              +                                                            __button_send_clicked_cb, (void *)vd);
                                                              +   // Error handling
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              +
                                                              +

                                                              + UI data source layout +

                                                              +
                                                              +

                                                              __create_data_sink():

                                                              +

                                                              The vd->layout_data_sink layout is created based on the data_sink.edc file. The resulting layout is embedded into the PART_MAIN_CONTENT part.

                                                              +

                                                              Next, the elm_entry component is created and inserted into the vd->layout_data_sink layout. The elm_entry component plays a role of a non-editable text panel for displaying the received messages.

                                                              +
                                                              +
                                                              +static bool 
                                                              +__create_data_sink(viewdata_s *vd)
                                                              +{
                                                              +   vd->layout_data_sink = view_generic_create_layout(vd->layout_main_panel, 
                                                              +                                                     EDJ_DATA_SINK_FILE_NAME, GROUP_DATA_SINK);
                                                              +   // Error handling
                                                              +
                                                              +   vd->sink_entry = view_generic_create_entry(vd->layout_data_sink, PART_DATA_SINK_ENTRY);
                                                              +   // Error handling
                                                              +
                                                              +   elm_entry_single_line_set(vd->sink_entry, EINA_FALSE);
                                                              +   elm_entry_editable_set(vd->sink_entry, EINA_FALSE);
                                                              +   elm_entry_scrollable_set(vd->sink_entry, EINA_TRUE);
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              +
                                                              +

                                                              + UI data sink layout +

                                                              +
                                                              + +

                                                              User Interaction

                                                              + +

                                                              The interaction between the user and the sample application must follow the scheme described below:

                                                              +
                                                                +
                                                              • Text message input
                                                              • +
                                                              • Selecting whether the message is to be sent through a trusted message port
                                                              • +
                                                              • Sending message to the data sink using the Send button
                                                              • +
                                                              +

                                                              After the message is successfully sent, the user can switch the view from the Data source to Data sink, where the received data is printed in a text form.

                                                              + +

                                                              The text message sending procedure is triggered by the Send button click and implemented in the __button_send_clicked_cb() callback function:

                                                              +
                                                                +
                                                              1. The text message provided by the user is obtained from the elm_entry component available from the Data source view.
                                                              2. +
                                                              3. The state of the elm_check component is obtained, pointing to the trusted mode selection.
                                                              4. +
                                                              5. The text message is bundled and sent through the message port to the Data sink with respect to the trusted mode selection.
                                                              + +
                                                              +static void 
                                                              +__button_send_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                                                              +{
                                                              +   // Error handling
                                                              +   // Variable declaration
                                                              +
                                                              +   // Obtaining the text message and trusted mode selection state
                                                              +   if (__get_input_data(vd, &text, &trusted_port))
                                                              +      // Text message bundling and sending through message port
                                                              +      controller_data_source_send_message((const char *)text, trusted_port);
                                                              +
                                                              +   if (text)
                                                              +      free(text);
                                                              +}
                                                              +
                                                              + +

                                                              The __get_input_data() function is responsible for obtaining the user data, and its implementation boils down to the invocation of the elm_entry_entry_get() and elm_check_state_get() functions + with the vd->data_source_entry and vd->data_source_check parameters.

                                                              + +

                                                              For more information on the implementation of the controller_data_source_send_message() function, see Data Source Controller.

                                                              + +

                                                              Controller

                                                              +

                                                              The objective of the general Controller module is to handle the application initialization and termination procedures. For the function invocation contexts, see Application Initialization.

                                                              +

                                                              The controller_initialization() function handles:

                                                              + +

                                                              If any of the above functions fail, the controller_initialization() function returns a failure status which results in the application termination.

                                                              + +
                                                              +bool 
                                                              +controller_initialization(viewdata_s *vd)
                                                              +{
                                                              +   return (view_create_base_gui(vd) &&
                                                              +           controller_data_sink_init(__message_port_message_cb));
                                                              +}
                                                              +
                                                              + +

                                                              When the application is terminated, the controller_terminate() function is called. It is responsible for deleting the user interface and releasing resources. For more information on the used functions, see Data Sink Controller and View.

                                                              + +
                                                              +void 
                                                              +controller_terminate(viewdata_s *vd)
                                                              +{
                                                              +   controller_data_sink_finit();
                                                              +   view_destroy_base_gui(vd);
                                                              +}
                                                              +
                                                              + + +

                                                              Data Source Controller

                                                              +

                                                              The Data source controller module is responsible for data bundling and sending through the message port. For more information on the function triggering the entire process (controller_data_source_send_message()), see User Interaction.

                                                              + +

                                                              All user input data is passed as parameters to the controller_data_source_send_message() function:

                                                              +
                                                                +
                                                              • text: Message text provided by the user
                                                              • +
                                                              • trusted_port: User selection of the message port trust mode
                                                              • +
                                                              +

                                                              The bundle object is created and filled with the user message text by the __create_bundle() function. At the beginning, an empty bundle object is created, and then the message text is added with the text-message key name assigned to the defined BUNDLE_DATA_KEY symbol. Once it is created, the bundle object is sent to the Data sink through a message port with the __send_bundle() function.

                                                              + +
                                                              +bool 
                                                              +controller_data_source_send_message(const char *text, bool trusted_port)
                                                              +{
                                                              +   bundle *bundle_obj = NULL;
                                                              +
                                                              +   if (!__create_bundle(&bundle_obj, text))
                                                              +      return false;
                                                              +
                                                              +   if (!__send_bundle(bundle_obj, trusted_port)) 
                                                              +   {
                                                              +      model_bundle_destroy(bundle_obj);
                                                              +
                                                              +      return false;
                                                              +   }
                                                              +
                                                              +   model_bundle_destroy(bundle_obj);
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              +static bool 
                                                              +__create_bundle(bundle **bundle_obj, const char *text)
                                                              +{
                                                              +   if (!model_bundle_create(bundle_obj))
                                                              +      return false;
                                                              +
                                                              +   if (!model_bundle_add_string(bundle_obj, BUNDLE_DATA_KEY, text)) 
                                                              +   {
                                                              +      model_bundle_destroy(*bundle_obj);
                                                              +
                                                              +      return false;
                                                              +   }
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              + +

                                                              For more information on the model functions, see Bundle Model.

                                                              + +

                                                              The __send_bundle() function sends the created bundle to the Data sink:

                                                              + +
                                                              +static bool 
                                                              +__send_bundle(bundle *bundle_obj, bool trusted_port)
                                                              +{
                                                              +   if (trusted_port) 
                                                              +   {
                                                              +      return model_message_port_send_trusted_message(bundle_obj);
                                                              +   } 
                                                              +   else 
                                                              +   {
                                                              +      return model_message_port_send_message(bundle_obj);
                                                              +   }
                                                              +}
                                                              +
                                                              + +

                                                              Depending on the user selection regarding the trusted mode, the bundle is sent using:

                                                              +
                                                                +
                                                              • model_message_port_send_trusted_message()
                                                              • +
                                                              • model_message_port_send_message()
                                                              • +
                                                              +

                                                              For the implementation of both functions, see Bundle Model.

                                                              + + +

                                                              Data Sink Controller

                                                              +

                                                              The Data sink controller module is responsible for initializing and finalizing the communication channel through the message port and receiving messages. The Data sink initialization function (controller_data_sink_init()) is invoked from the controller_initialization() function contained in the general Controller module. Similarly, the finalization function (controller_data_sink_finit()) is called from the controller_terminate() function contained in the same Controller module.

                                                              +

                                                              In the message port initialization procedure, 2 new communication channels are created using the model_message_port_register_port() and model_message_port_register_trusted_port() functions with the __message_port_message_cb() and __message_port_trusted_message_cb() callback functions attached.

                                                              +

                                                              When a new message arrives, one of the 2 attached callback functions is invoked with the received data passed as the callback function's argument. The __message_port_message_cb() callback function is invoked if the message is received through non-trusted message port. The second callback function (__message_port_trusted_message_cb()) is invoked if the message is received through a trusted message port channel.

                                                              +

                                                              Additionally, the controller_data_sink_init() function takes 1 parameter + (msg_rcv_cb), which points to a callback function defined in the general Controller module. This callback function is called whenever any message from a message port is received (trusted or non-trusted).

                                                              + +
                                                              +bool 
                                                              +controller_data_sink_init(message_received_cb msg_rcv_cb)
                                                              +{
                                                              +   __message_received_cb = msg_rcv_cb;
                                                              +
                                                              +   if (!model_message_port_register_port(__message_port_message_cb, NULL))
                                                              +      return false;
                                                              +
                                                              +   if (!model_message_port_register_trusted_port(__message_port_trusted_message_cb, NULL))
                                                              +      return false;
                                                              +
                                                              +   return true;
                                                              +}
                                                              +
                                                              +void 
                                                              +controller_data_sink_finit(void)
                                                              +{
                                                              +   bool exists = false;
                                                              +
                                                              +   if (model_message_port_check_remote_port(&exists)) 
                                                              +   {
                                                              +      if (exists)
                                                              +         model_message_port_unregister_port();
                                                              +   }
                                                              +
                                                              +   exists = false;
                                                              +
                                                              +   if (model_message_port_check_trusted_remote_port(&exists)) 
                                                              +   {
                                                              +      if (exists)
                                                              +         model_message_port_unregister_trusted_port();
                                                              +   }
                                                              +}
                                                              +
                                                              + +

                                                              The general approach of data extraction from a received bundle object is based on the knowledge about its structure (see the bundle object structure in the Application workflow image). Due to the simplicity of bundled data (message text), the procedure of message extraction is limited to obtaining a text value from the known key name of the bundle object:

                                                              + +
                                                              +static void 
                                                              +__message_port_message_process(int local_port_id, const char *remote_app_id, 
                                                              +                               const char *remote_port, bool trusted_port, bundle *message)
                                                              +{
                                                              +   // Error handling
                                                              +
                                                              +   char *msg = NULL;
                                                              +   if (!model_bundle_get_string(message, BUNDLE_DATA_KEY, &msg))
                                                              +      return;
                                                              +
                                                              +   __message_received_cb(local_port_id, remote_app_id, remote_port, 
                                                              +                         trusted_port, (const char *)msg);
                                                              +}
                                                              +
                                                              + +

                                                              The __message_port_message_process() function is invoked by one of the receiving callback functions (_message_port_message_cb() and + __message_port_trusted_message_cb()). At the end of the + __message_port_message_process() function, the + __message_received_cb() callback function is called. This callback function is assigned through the msg_rcv_cb parameter of the controller_data_sink_init() function.

                                                              + +

                                                              For more information on the implementation details of the following functions, see Bundle Model and Message Port Model:

                                                              +
                                                                +
                                                              • model_bundle_get_string()
                                                              • +
                                                              • model_message_port_register_port()
                                                              • +
                                                              • model_message_port_register_trusted_port()
                                                              • +
                                                              + + +

                                                              In case the __message_received_cb() callback function is called successfully, the message text is displayed in the elm_entry component in the Data sink view (for the text output structure, see the implementation of the + __message_port_message_cb() callback function in the general Controller module). An example of the text output is depicted in the Message Port screens figure.

                                                              + + +

                                                              Bundle Model

                                                              +

                                                              The Bundle model module provides a set of wrapper functions for the Bundle API used by the Data source controller and the Data sink controller modules for the bundle object management:

                                                              +
                                                                +
                                                              • Creating and removing the bundle object: +
                                                                +bool 
                                                                +model_bundle_create(bundle **bundle_obj)
                                                                +{
                                                                +   // Bundle object is created
                                                                +   *bundle_obj = bundle_create();
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                +bool 
                                                                +model_bundle_destroy(bundle *bundle_obj)
                                                                +{
                                                                +   // Bundle object is freed
                                                                +   int ret = bundle_free(bundle_obj);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                              • +
                                                              • Adding a text string to the bundle object: +
                                                                +bool 
                                                                +model_bundle_add_string(bundle **bundle_obj, const char *key, const char *value)
                                                                +{
                                                                +   // String value assigned to the given key is added to the bundle
                                                                +   int ret = bundle_add_str(*bundle_obj, key, value);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                              • +
                                                              • Extracting a text string from the bundle object: +
                                                                +bool 
                                                                +model_bundle_get_string(bundle *bundle_obj, const char *key, char **value)
                                                                +{
                                                                +   *value = NULL;
                                                                +
                                                                +   // String value assigned to the given key is acquired from the bundle
                                                                +   int ret = bundle_get_str(bundle_obj, key, value);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                              • +
                                                              + +

                                                              Message Port Model

                                                              +

                                                              The Message port model module provides a set of wrapper functions for the Message Port API used by the Data sink controller and the Data source controller modules:

                                                              +
                                                                +
                                                              • Creating and removing the message port: +
                                                                +bool 
                                                                +model_message_port_register_port(message_port_message_cb callback, void *user_data)
                                                                +{
                                                                +   // Local message port is registered with a callback function assigned
                                                                +   // Callback function is called whenever a message is received
                                                                +   // If the returned value is non-negative, the message port is created successfully
                                                                +   // Otherwise, the ret value points to the error code
                                                                +   int ret = message_port_register_local_port(MESSAGE_PORT_REMOTE_NAME, callback, user_data);
                                                                +   // Error handling
                                                                +
                                                                +   // Identifier of a message port is stored
                                                                +   _local_port_id = ret;
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                +bool 
                                                                +model_message_port_register_trusted_port(message_port_trusted_message_cb callback, void *user_data)
                                                                +{
                                                                +   // Trusted local message port is registered with a callback function assigned
                                                                +   // Callback function is called whenever a trusted message is received
                                                                +   // If the returned value is non-negative, the trusted message port is created successfully
                                                                +   // Otherwise, the ret value points to the error code
                                                                +   int ret = message_port_register_trusted_local_port(MESSAGE_PORT_TRUSTED_REMOTE_NAME, callback, user_data);
                                                                +   // Error handling
                                                                +
                                                                +   // Identifier of a trusted message port is stored
                                                                +   _local_trusted_port_id = ret;
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                +bool 
                                                                +model_message_port_unregister_port(void)
                                                                +{
                                                                +   // Local message port is unregistered based on its identifier
                                                                +   int ret = message_port_unregister_local_port(_local_port_id);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                +bool 
                                                                +model_message_port_unregister_trusted_port(void)
                                                                +{
                                                                +   // Trusted local message port is unregistered based on its identifier
                                                                +   int ret = message_port_unregister_trusted_local_port(_local_trusted_port_id);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                + +
                                                              • +
                                                              • Checking the message port existence: +
                                                                +bool 
                                                                +model_message_port_check_remote_port(bool *exists)
                                                                +{
                                                                +   *exists = false;
                                                                +
                                                                +   // Check whether the message port with given name (MESSAGE_PORT_REMOTE_NAME) exists
                                                                +   int ret = message_port_check_remote_port(PACKAGE, MESSAGE_PORT_REMOTE_NAME, exists);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                +bool 
                                                                +model_message_port_check_trusted_remote_port(bool *exists)
                                                                +{
                                                                +   *exists = false;
                                                                +
                                                                +   // Check whether the trusted message port with given name (MESSAGE_PORT_TRUSTED_REMOTE_NAME) exists
                                                                +   int ret = message_port_check_trusted_remote_port(PACKAGE, MESSAGE_PORT_TRUSTED_REMOTE_NAME, exists);
                                                                +   // Error handling
                                                                + 
                                                                +   return true;
                                                                +}
                                                                +
                                                              • +
                                                              • Sending the bundle object: +
                                                                +bool 
                                                                +model_message_port_send_message(bundle *message)
                                                                +{
                                                                +   // Bundled message is sent over the previously created message port
                                                                +   int ret = message_port_send_message(PACKAGE, MESSAGE_PORT_REMOTE_NAME, message);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                                +bool 
                                                                +model_message_port_send_trusted_message(bundle *message)
                                                                +{
                                                                +   // Bundled message is sent over the previously created trusted message port
                                                                +   int ret = message_port_send_trusted_message(PACKAGE, MESSAGE_PORT_TRUSTED_REMOTE_NAME, message);
                                                                +   // Error handling
                                                                +
                                                                +   return true;
                                                                +}
                                                                +
                                                              • +
                                                              + + + +
                                                              + +Go to top + + + + + + + diff --git a/org.tizen.sampledescriptions/html/mobile_n/notificationmanager_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/notificationmanager_sd_mn.htm index 7dec5b6..81bb76b 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/notificationmanager_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/notificationmanager_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              NotificationManager Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/paint_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/paint_sd_mn.htm index f873f7f..db26545 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/paint_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/paint_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Paint Sample Overview

                                                              @@ -1107,4 +1107,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/pedometer_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/pedometer_sd_mn.htm index 7db893f..76d1ce8 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/pedometer_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/pedometer_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Pedometer Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/piano_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/piano_sd_mn.htm index 2b585e6..2362bd4 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/piano_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/piano_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Piano Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/preference_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/preference_sd_mn.htm index 8ea90df..ba6c3c5 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/preference_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/preference_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Preference Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/puzzle_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/puzzle_sd_mn.htm index 7920e98..1941c73 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/puzzle_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/puzzle_sd_mn.htm @@ -20,7 +20,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Puzzle Sample Overview

                                                              @@ -31,17 +31,21 @@

                                                              Figure: Puzzle main view

                                                              Puzzle main view

                                                              +

                                                              Prerequisites

                                                              +

                                                              To ensure proper application execution, the following privilege must be set:

                                                              +
                                                                +
                                                              • http://tizen.org/privilege/systemsettings
                                                              • +
                                                              +

                                                              Implementation

                                                              To create the Puzzle:

                                                                -
                                                              1. Add the required privileges. -

                                                                To use the Puzzle, the application has to request permission by adding the corresponding privileges to the tizen-manifest.xml file. In this case, the systemsettings privilege (http://tizen.org/privilege/systemsettings) is added to allow getting the system setting value.

                                                                -
                                                              2. Create the layout for the Puzzle preview.

                                                                The puzzle_create() function creates the main layout of the Puzzle application.

                                                                -void puzzle_create(appdata_s *data)
                                                                +void 
                                                                +puzzle_create(appdata_s *data)
                                                                 {
                                                                    _D("Puzzle_create");
                                                                    ret_if(!data);
                                                                @@ -100,9 +104,10 @@ void puzzle_create(appdata_s *data)
                                                                 
                                                              3. Move the piece and match the picture. -

                                                                The move_***_cb() function move the piece to ***. When moving the piece to ***, if there is a piece already, this function returns with no action.

                                                                +

                                                                The move_***_cb() function moves the piece to ***. When moving the piece to ***, if there is a piece already, this function returns with no action.

                                                                -int move_puzzle_to_right(void *data)
                                                                +int 
                                                                +move_puzzle_to_right(void *data)
                                                                 {
                                                                    retv_if(!data, 0); 
                                                                 
                                                                @@ -148,7 +153,8 @@ int move_puzzle_to_right(void *data)
                                                                 
                                                              4. Complete the puzzle.

                                                                If the image object is located in its original position, the puzzle_correct_cb() function is called to show the original picture of the puzzle.

                                                                -void puzzle_correct_cb(appdata_s *data)
                                                                +void 
                                                                +puzzle_correct_cb(appdata_s *data)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -159,7 +165,7 @@ void puzzle_correct_cb(appdata_s *data)
                                                                          return;
                                                                       }
                                                                    }
                                                                -   // Make a popup for congraturations
                                                                +   // Make a popup for congratulations
                                                                    popup = elm_popup_add(win);
                                                                    elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
                                                                 
                                                                @@ -201,7 +207,8 @@ void puzzle_correct_cb(appdata_s *data)
                                                                 
                                                                 

                                                                The user can select the level of the puzzle. Select a 4X4 puzzle or a 5X5 puzzle. To change the number of pieces, the puzzle_change() function is called. It works in the same way as the puzzle_create() function, but the value of PIECE is different.

                                                                -void _level_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                +void 
                                                                +_level_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -256,4 +263,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
                                                                 
                                                                 
                                                                 
                                                                -
                                                                +
                                                                \ No newline at end of file
                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/scheduler_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/scheduler_sd_mn.htm
                                                                index 2da1ecd..2880e80 100644
                                                                --- a/org.tizen.sampledescriptions/html/mobile_n/scheduler_sd_mn.htm
                                                                +++ b/org.tizen.sampledescriptions/html/mobile_n/scheduler_sd_mn.htm
                                                                @@ -21,7 +21,7 @@
                                                                 
                                                                 
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                Scheduler Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/scroller_index_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/scroller_index_sd_mn.htm index 246c8c3..413554f 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/scroller_index_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/scroller_index_sd_mn.htm @@ -20,7 +20,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                Scroller Index Sample Overview

                                                                @@ -96,7 +96,7 @@ Evas_Object *page_scroller_create(Evas_Object *parent, int p_width, int p_height    // Switch off limiting the scroller's minimum size to the minimum size of its content    elm_scroller_content_min_limit(page_scroller, EINA_FALSE, EINA_FALSE); -   // Set the bouncing behaviour. The bounce effect is shown when the scroller reaches the last page +   // Set the bouncing behavior. The bounce effect is shown when the scroller reaches the last page    // In this case, it must be switched off    elm_scroller_bounce_set(page_scroller, EINA_FALSE, EINA_TRUE); @@ -290,8 +290,8 @@ static Eina_Bool init_position_set_cb(void *data)    int i = 0;    // Obtain the pointer to the used objects -   page_scroller = init_data->scroller; -   index = init_data->box; +   page_scroller = init_data->scroller; +   index = init_data->box;    // Obtain active page in page scroller component    c_page = page_scroller_current_page_number_get(page_scroller); @@ -424,8 +424,8 @@ static void page_area_changed_cb(void *data, Evas_Object *obj, void *event_info)    // Set the rotation angles of the indexes    // The next page rotation angle is increased by 360 degrees because the rotate    // function does not work if the angle is lower than 0 and the scroller is moved from right to left -   indice_rotate(cb_data->box, current_page, 90 + angle); -   indice_rotate(cb_data->box, next_page, 360 + angle); +   indice_rotate(cb_data->box, current_page, 90 + angle); +   indice_rotate(cb_data->box, next_page, 360 + angle); }
                                                            @@ -453,4 +453,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/sd_mn.htm index 747b449..2b84c12 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/sd_mn.htm @@ -21,7 +21,7 @@
                                                            -

                                                            Mobile native

                                                            +

                                                            Mobile native

                                                            Mobile Native Sample Descriptions

                                                            @@ -71,7 +71,7 @@ Demonstrates how you can manage contacts. - EvasGLCube + EvasGLCube Demonstrates how you can implement a cube that can be rotated on the screen through Evas_GL. @@ -111,6 +111,18 @@ Demonstrates how you can develop media handling applications with the ability to manage different media sources. + Media-controller-client + Demonstrates how you can create a custom media controller client type application. + + + Media-controller-server + Demonstrates how you can create a custom media controller server type application. + + + Message Port + Demonstrates how you can implement a data exchange mechanism using the Message Port API. + + Notification Manager Demonstrates how you can present a notification to the user. @@ -134,10 +146,6 @@ Puzzle Demonstrates how you can implement a complex view using recursive composition of the standard EFL components. - - Quickpanel - Demonstrates how you can create a custom quickpanel window and use volume, LED, and Wi-Fi APIs to acquire and set related device settings. - Scheduler Demonstrates how you can manage scheduling of calendar events and other calendar options. @@ -169,7 +177,7 @@ System Info - Demonstrates how you how to get system information. + Demonstrates how you can get system information. Taskmanager diff --git a/org.tizen.sampledescriptions/html/mobile_n/selfcamera_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/selfcamera_sd_mn.htm index 7a79863..f57ecf5 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/selfcamera_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/selfcamera_sd_mn.htm @@ -21,7 +21,7 @@
                                                            -

                                                            Mobile native

                                                            +

                                                            Mobile native

                                                            SelfCamera Sample Overview

                                                            @@ -32,45 +32,36 @@

                                                            Figure: SelfCamera main view

                                                            SelfCamera main screen

                                                            +

                                                            Prerequisites

                                                            +

                                                            To ensure proper application execution, the following privileges must be set:

                                                            +
                                                              +
                                                            • http://tizen.org/privilege/camera
                                                            • +
                                                            • http://tizen.org/privilege/appmanager.launch
                                                            • +
                                                            +

                                                            Implementation

                                                            To use the camera:

                                                              -
                                                            1. Add required privileges. -

                                                              To use the camera, the application has to request permission by adding the corresponding privileges to the tizen-manifest.xml file. In this case, the appmanager.launch privilege is also added to allow the launch of other applications, such as the gallery.

                                                              - -
                                                              -<privileges>
                                                              -   <privilege>http://tizen.org/privilege/camera</privilege>
                                                              -   <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
                                                              -</privileges>
                                                              -
                                                              -

                                                              This can also be done using the Tizen Manifest Editor.

                                                              -
                                                            2. -
                                                            3. Create the layout for the camera preview.

                                                              The main_view_add() function creates the main layout of the SelfCamera application and adds the evas_object_image for displaying the camera preview.

                                                               Evas_Object * main_view_add(Evas_Object *navi)
                                                               {
                                                              -   ...
                                                                  // SELF_CAMERA_LAYOUT refers to "edje/self-camera.edj"
                                                                  elm_layout_file_set(view->layout, get_resource_path(SELF_CAMERA_LAYOUT), "layout");
                                                                  // Signal for default timer option to be selected
                                                                  elm_object_signal_emit(view->layout, "mouse,clicked,1", "timer_2");
                                                                  view->preview_canvas = evas_object_image_filled_add(evas_object_evas_get(view->layout));
                                                                   
                                                              -   ...
                                                                  // view->preview_canvas is placed at "elm.swallow.content"
                                                                  elm_object_part_content_set(view->layout, "elm.swallow.content", view->preview_canvas);
                                                                  view->camera_enabled = _main_view_start_preview(view); 
                                                                   
                                                              -   ...
                                                                  _main_view_thumbnail_load(view);
                                                                  _main_view_register_cbs(view);
                                                               
                                                              -   ...
                                                                  return view->layout;
                                                               } 
                                                               
                                                              @@ -122,11 +113,9 @@ static Eina_Bool _main_view_start_preview(main_view *view)
                                                               static Eina_Bool _main_view_timer_cb(void *data)
                                                               {
                                                              -   ...
                                                                  view->timer_count = view->timer_count - 1;
                                                                  if (view->timer_count > 0)
                                                                  {
                                                              -      ...
                                                                     return ECORE_CALLBACK_RENEW;
                                                                  }
                                                                  else
                                                              @@ -136,7 +125,6 @@ static Eina_Bool _main_view_timer_cb(void *data)
                                                                     {
                                                                        camera_start_capture(view->camera, _main_view_capture_cb, _main_view_capture_completed_cb, view);
                                                                     }
                                                              -      ...
                                                                     return ECORE_CALLBACK_CANCEL;
                                                                  }
                                                               }
                                                              @@ -149,7 +137,6 @@ static Eina_Bool _main_view_timer_cb(void *data)
                                                               
                                                               static void _main_view_capture_cb(camera_image_data_s *image, camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data)
                                                               {
                                                              -   ...
                                                                  if (image->format == CAMERA_PIXEL_FORMAT_JPEG)
                                                                  {
                                                                     char filename[PATH_MAX] = { '\0' };
                                                              @@ -176,7 +163,6 @@ static void _main_view_capture_cb(camera_image_data_s *image, camera_image_data_
                                                               
                                                               static void _main_view_capture_completed_cb(void *data)
                                                               {
                                                              -   ...
                                                                  camera_start_preview(view->camera);
                                                               }
                                                               
                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/sensorapp_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/sensorapp_sd_mn.htm index 0aa56fb..04e2283 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/sensorapp_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/sensorapp_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              SensorApp Sample Overview

                                                              @@ -265,8 +265,8 @@ static void _data_view_value_items_update(data_view *view, float *values)    if (view->chart && update_chart)    {       sensor_data_chart_update(view->chart, view->sensor_info->value_range, -         view->sensor_info->axes, values, data_view_item_colors, -         view->sensor_info->value_count); +                               view->sensor_info->axes, values, data_view_item_colors, +                               view->sensor_info->value_count);    } }
                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/simple_home_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/simple_home_sd_mn.htm index dc7bd94..3b9d935 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/simple_home_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/simple_home_sd_mn.htm @@ -21,7 +21,7 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Simple Homescreen Sample Overview

                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_n/sketch_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/sketch_sd_mn.htm index 1950785..7c07fb9 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/sketch_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/sketch_sd_mn.htm @@ -20,11 +20,11 @@
                                                              -

                                                              Mobile native

                                                              +

                                                              Mobile native

                                                              Sketch Sample Overview

                                                              -

                                                              The Sketch application demonstrates how to implement an image view and change the color using raw image data of the standard EFL components.

                                                              +

                                                              The Sketch application demonstrates how you can implement an image view and change the color using raw image data of the standard EFL components.

                                                              The following figure illustrates the main screen of the Sketch.

                                                              Figure: Sketch main screen

                                                              @@ -36,9 +36,10 @@

                                                              Implementation

                                                              Layout

                                                              -

                                                              The layout_create() function makes the application frame, move buttons, icons, and some icons linked to each callback function. This function creates a popup component using the elm_ popup_add() function.

                                                              +

                                                              The layout_create() function makes the application frame, move buttons, icons, and some icons linked to each callback function.

                                                              -static int _layout_create(appdata_s *ad)
                                                              +static int 
                                                              +_layout_create(appdata_s *ad)
                                                               {
                                                                  // Image
                                                                  img = image_create(ad);
                                                              @@ -52,7 +53,7 @@ static int _layout_create(appdata_s *ad)
                                                                  evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, eraser_clear_cb, ad);
                                                               
                                                                  // Palette
                                                              -   for(i =0; i<4; i++)
                                                              +   for (i = 0; i < 4; i++)
                                                                  {
                                                                     ad->temp_color[i] = 0;
                                                                     ad->save_color[i] = 0;
                                                              @@ -102,13 +103,14 @@ static int _layout_create(appdata_s *ad)
                                                               
                                                               

                                                              The image_create() function creates the white background image which consists of the arrays that each mean raw pixel data. To use the raw data as an evas_object_image, the evas_object_image_data_set() function is used.

                                                              -Evas_Object *image_create(appdata_s *ad)
                                                              +Evas_Object 
                                                              +*image_create(appdata_s *ad)
                                                               {
                                                                  Evas_Object *img = NULL;
                                                                  int pixel;
                                                                  retv_if(!ad, NULL);
                                                               
                                                              -   // image
                                                              +   // Image
                                                                  ad->canvas = malloc(4*(ad->img_w)*(ad->img_h));
                                                                  pixel = 255<<24 | 255<<16 | 255<<8 | 255;
                                                                  memset(ad->canvas, pixel, 4*(ad->img_w)*(ad->img_h));
                                                              @@ -140,12 +142,13 @@ Evas_Object *image_create(appdata_s *ad)
                                                               }
                                                               
                                                              -

                                                              When the move event callback in image object is called, the color of the moved pixel is changed by the _draw_cb() and _move_cb() functions.

                                                              +

                                                              When the move event callback in the image object is called, the color of the moved pixel is changed by the _draw_cb() and _move_cb() functions.

                                                                -
                                                              • The _draw_cb() function changes the color in the raw image data: +
                                                              • The _draw_cb() function changes the color in the raw image data:
                                                                -static void _draw_cb(int x, int y, void *data, Evas_Object* obj)
                                                                +static void 
                                                                +_draw_cb(int x, int y, void *data, Evas_Object* obj)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -167,9 +170,9 @@ static void _draw_cb(int x, int y, void *data, Evas_Object* obj)
                                                                       draw_size = ad->pen_size;
                                                                    }
                                                                 
                                                                -   for (i=draw_size*-1;i<draw_size+1;i++) 
                                                                +   for (i = draw_size* - 1; i < draw_size + 1; i++) 
                                                                    {
                                                                -      for (j=draw_size*-1;j<draw_size+1;j++) 
                                                                +      for (j = draw_size* - 1; j < draw_size + 1; j++) 
                                                                       {
                                                                          if (x - (ad->canvas_x) + i >= ad->img_w || x - (ad->canvas_x) + i <= 0 || y - (ad->canvas_y) + j >= ad->img_h || y - (ad->canvas_y) + j <=0) 
                                                                          {
                                                                @@ -185,7 +188,8 @@ static void _draw_cb(int x, int y, void *data, Evas_Object* obj)
                                                                 
                                                              • The _move_cb() function draws the line using Bresenham algorithms:
                                                                -static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                +static void 
                                                                +_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                    ret_if(!obj);
                                                                @@ -258,7 +262,7 @@ static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 
                                                                             _draw_cb(ad->prev_x, ad->prev_y, ad, img);
                                                                             p_value = 2 * dy - dx;
                                                                -            for (ndx = ad->prev_x; ndx< ad->cur_x; ndx++) 
                                                                +            for (ndx = ad->prev_x; ndx < ad->cur_x; ndx++) 
                                                                             {
                                                                                if (0 > p_value) 
                                                                                {
                                                                @@ -320,12 +324,14 @@ static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 
                                                                 

                                                                Palette

                                                                +

                                                                The create_colorselector() function is called when the palette icon is clicked. This function controls the pen's and background's color using the colorselector component that is created with the elm_colorselector_add() function.

                                                                +

                                                                Figure: Palette screen

                                                                Palette screen

                                                                -

                                                                The create_colorselector() function is called when the palette icon is clicked. This function controls the pen's and background's color using the colorselector component that is created with the elm_colorselector_add() function.

                                                                -static Evas_Object *_create_colorselector(Evas_Object *parent, appdata_s *data)
                                                                +static Evas_Object 
                                                                +*_create_colorselector(Evas_Object *parent, appdata_s *data)
                                                                 {
                                                                    retv_if(!data, NULL);
                                                                 
                                                                @@ -352,7 +358,8 @@ static Evas_Object *_create_colorselector(Evas_Object *parent, appdata_s *data)
                                                                    return colorselector;
                                                                 }
                                                                 
                                                                -static Evas_Object *_create_colorselector_layout(Evas_Object *parent, appdata_s *data)
                                                                +static Evas_Object 
                                                                +*_create_colorselector_layout(Evas_Object *parent, appdata_s *data)
                                                                 {
                                                                    retv_if(!parent, NULL);
                                                                    retv_if(!data, NULL);
                                                                @@ -375,6 +382,7 @@ static Evas_Object *_create_colorselector_layout(Evas_Object *parent, appdata_s
                                                                    {
                                                                       _E("fail to create colorselector");
                                                                       evas_object_del(layout);
                                                                +
                                                                       return NULL;
                                                                    }
                                                                    elm_object_part_content_set(layout, "colorpalette", colorselector);
                                                                @@ -386,7 +394,8 @@ static Evas_Object *_create_colorselector_layout(Evas_Object *parent, appdata_s
                                                                 
                                                                 

                                                                The _palette_button_cb() function is called when OK button is clicked. This function changes the color. If the pen checkbox is checked, the pen's color changes to the clicked color.

                                                                -static void _palette_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                +static void 
                                                                +_palette_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -402,9 +411,9 @@ static void _palette_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                    {
                                                                       pixel = 255<<24 | ad->temp_color[1]<<16 | ad->temp_color[2]<<8 | ad->temp_color[3];
                                                                 
                                                                -      for (h = 0; h< ad->img_h; h ++) 
                                                                +      for (h = 0; h < ad->img_h; h ++) 
                                                                       {
                                                                -         for (w = 0; w<ad->img_w; w++) 
                                                                +         for (w = 0; w < ad->img_w; w++) 
                                                                          {
                                                                             ad->canvas[ad->img_w*h + w] = pixel;
                                                                          }
                                                                @@ -438,12 +447,14 @@ static void _palette_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                 
                                                                 

                                                                Pen

                                                                +

                                                                The pen_cb() function is called when the pen icon is clicked. This function controls the pen size from 1 to 10 using the elm_slider_add() function.

                                                                +

                                                                Figure: Pen screen

                                                                Pen screen

                                                                -

                                                                The pen_cb() function is called when the pen icon is clicked. This function controls the pen size from 1 to 10 using the elm_slider_add() function.

                                                                -void pen_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                +void 
                                                                +pen_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -483,17 +494,18 @@ void pen_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 
                                                                    return;
                                                                 
                                                                -ERROR:
                                                                -   evas_object_del(slider);
                                                                -   evas_object_del(layout);
                                                                -   popup_destroy(popup);
                                                                +   ERROR:
                                                                +      evas_object_del(slider);
                                                                +      evas_object_del(layout);
                                                                +      popup_destroy(popup);
                                                                 
                                                                -   return;
                                                                +      return;
                                                                 }
                                                                 
                                                                -

                                                                Clicking OK button calls the pen_clicked_cb() function and saves the selected value in the slider.

                                                                +

                                                                Clicking OK calls the pen_clicked_cb() function and saves the selected value in the slider:

                                                                -static void _pen_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                +static void 
                                                                +_pen_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -515,12 +527,14 @@ static void _pen_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                 
                                                                 

                                                                Eraser

                                                                +

                                                                The eraser_cb() function is called when the eraser icon is clicked. This function controls the eraser size from 1 to 10 using a slider component. The eraser functionality is maintained until the eraser icon is clicked again.

                                                                +

                                                                Figure: Eraser screens

                                                                Eraser screens Eraser screens

                                                                -

                                                                The eraser_cb() function is called when the eraser icon is clicked. This function controls the eraser size from 1 to 10 using a slider component. The eraser functionality is maintained until the eraser icon is clicked again.

                                                                -static void _eraser_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                +static void 
                                                                +_eraser_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -556,7 +570,8 @@ static void _eraser_button_cb(void *data, Evas_Object *obj, void *event_info)
                                                                    evas_object_del(popup);
                                                                 }
                                                                 
                                                                -void eraser_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                +void 
                                                                +eraser_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -614,12 +629,12 @@ void eraser_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 
                                                                    return;
                                                                 
                                                                -ERROR:
                                                                -   evas_object_del(slider);
                                                                -   evas_object_del(layout);
                                                                -   popup_destroy(popup);
                                                                +   ERROR:
                                                                +      evas_object_del(slider);
                                                                +      evas_object_del(layout);
                                                                +      popup_destroy(popup);
                                                                 
                                                                -   return;
                                                                +      return;
                                                                 }
                                                                 
                                                                @@ -627,7 +642,8 @@ ERROR:

                                                                The save() function is called when the save icon is clicked. This function saves the image in the /opt/usr/media/Images/sketch/ directory using the evas_object_image_save() function. If a sketch directory does not exist, it is created by the mkdir() function.

                                                                -void save_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                +void 
                                                                +save_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                 {
                                                                    ret_if(!data);
                                                                 
                                                                @@ -677,10 +693,11 @@ void save_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                                                                    evas_object_image_save(ad->img,"/opt/usr/media/Images/sketch/save.jpg",NULL,"quality=100 compress=0");
                                                                 
                                                                    return;
                                                                -ERROR:
                                                                -   evas_object_del(btn);
                                                                -   evas_object_del(layout);
                                                                -   popup_destroy(popup);
                                                                +
                                                                +   ERROR:
                                                                +      evas_object_del(btn);
                                                                +      evas_object_del(layout);
                                                                +      popup_destroy(popup);
                                                                 }
                                                                 
                                                                @@ -688,7 +705,8 @@ ERROR:

                                                                All menus in the Sketch application use the popup component.

                                                                -Evas_Object *popup_create(void *data, char *title, void (*_func_cb)(void *, Evas_Object *, void *))
                                                                +Evas_Object 
                                                                +*popup_create(void *data, char *title, void (*_func_cb)(void *, Evas_Object *, void *))
                                                                 {
                                                                    appdata_s *ad = data;
                                                                    retv_if(!ad, NULL);
                                                                @@ -751,4 +769,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
                                                                 
                                                                 
                                                                 
                                                                -
                                                                +
                                                                \ No newline at end of file
                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/stopwatch_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/stopwatch_sd_mn.htm
                                                                index cb0086e..09fa2b3 100644
                                                                --- a/org.tizen.sampledescriptions/html/mobile_n/stopwatch_sd_mn.htm
                                                                +++ b/org.tizen.sampledescriptions/html/mobile_n/stopwatch_sd_mn.htm
                                                                @@ -20,12 +20,12 @@
                                                                 
                                                                 
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                Stopwatch Sample Overview

                                                                -

                                                                The Stopwatch sample demonstrates how to implement a complex view using recursive composition of the standard EFL UI components and containers in a component hierarchy. It aims to explain how to use Ecore.

                                                                -

                                                                The sample uses UI components (such as elm_conformant, elm_layout, and elm_naviframe) for the view management, containers (such as elm_grid and elm_box) for component management inside the view, UI components (such as elm_bg, elm_button, elm_list, and elm_label) for the content inside the view and Ecore (such as ecore_thread) for the operating main loop.

                                                                +

                                                                The Stopwatch sample demonstrates how you can implement a complex view using recursive composition of the standard EFL UI components and containers in a component hierarchy. It aims to explain how to use Ecore.

                                                                +

                                                                The sample uses UI components (such as elm_conformant, elm_layout, and elm_naviframe) for the view management, containers (such as elm_grid and elm_box) for component management inside the view, UI components (such as elm_bg, elm_button, elm_list, and elm_label) for the content inside the view, and Ecore (such as ecore_thread) for the operating main loop.

                                                                The following figure illustrates the main screen of the Stopwatch, the wireframe structure, and the component tree.

                                                                @@ -42,7 +42,8 @@
                                                                1. Initialize the user interface with the _create_stopwatch() callback function:
                                                                  -static void _create_stopwatch(appdata_s *ad)
                                                                  +static void 
                                                                  +_create_stopwatch(appdata_s *ad)
                                                                   {
                                                                      Elm_Object_Item *nf_it = NULL;
                                                                      Evas_Object *box1 = NULL;
                                                                  @@ -92,7 +93,7 @@ static void _create_stopwatch(appdata_s *ad)
                                                                      nf_it = elm_naviframe_item_push(ad->nf, "STOPWATCH", NULL, NULL, ad->layout, NULL);
                                                                      goto_if(!nf_it, ERROR);
                                                                   
                                                                  -   // Show window after base GUI is set up
                                                                  +   // Show the window after the base GUI is set up
                                                                      evas_object_show(ad->win);
                                                                   
                                                                      return;
                                                                  @@ -106,7 +107,8 @@ static void _create_stopwatch(appdata_s *ad)
                                                                     

                                                                  -extern Evas_Object *view_create_stopwatch_display(appdata_s *ad)
                                                                  +extern Evas_Object 
                                                                  +*view_create_stopwatch_display(appdata_s *ad)
                                                                   {
                                                                      Evas_Object *box = NULL;
                                                                      Evas_Object *grid = NULL;
                                                                  @@ -147,8 +149,8 @@ extern Evas_Object *view_create_stopwatch_display(appdata_s *ad)
                                                                   
                                                                      label = elm_label_add(grid);
                                                                      goto_if(!label, ERROR);
                                                                  -   elm_object_text_set(label, "<b><font_size=22><color=#a6a6a6>Hour             "
                                                                  -								"    Min                Sec</color></font_size></b>");
                                                                  +   elm_object_text_set(label, "<b><font_size=22><color=#a6a6a6>Hour        "
                                                                  +                       "  Min        Sec</color></font_size></b>");
                                                                      evas_object_show(label);
                                                                      elm_grid_pack(grid, label, 10, 70, 100, 100);
                                                                   
                                                                  @@ -160,13 +162,14 @@ extern Evas_Object *view_create_stopwatch_display(appdata_s *ad)
                                                                   
                                                                2. The stopwatch_button_clicked() function checks the text on the button and calls the following functions:
                                                                    -
                                                                  • _stopwatch_start_cb() function starts changing the dipslay using the ecore_thread_feedback_run() function.
                                                                  • +
                                                                  • _stopwatch_start_cb() function starts changing the display using the ecore_thread_feedback_run() function.
                                                                  • _stopwatch_stop_cb() function stops changing the display using the ecore_thread_cancel() and ecore_thread_check() functions.
                                                                  • _stopwatch_lap_cb() function appends a lap time to an elm_list using the elm_list_item_append() function.
                                                                  • _stopwatch_reset_cb() function resets the main view to the initial state.
                                                                  -extern void stopwatch_button_clicked(void *data, Evas_Object *obj, void *event_info)
                                                                  +extern void 
                                                                  +stopwatch_button_clicked(void *data, Evas_Object *obj, void *event_info)
                                                                   {
                                                                      const char *str = NULL;
                                                                      appdata_s *ad = NULL;
                                                                  @@ -203,9 +206,10 @@ extern void stopwatch_button_clicked(void *data, Evas_Object *obj, void *event_i
                                                                   
                                                                3. The thread_job() function uses the ecore_thread_feedback() function to call the GUI functions from the main thread. The function that is used to handle the feedback simply sets the text of a label. -

                                                                  To cancel a running thread, the thread_job() function also uses the ecore_thread_check() function to check whether a thread is in pending cancellation, because the ecore_thread_feedback_run() function can be used from the main loop.

                                                                  +

                                                                  To cancel a running thread, the thread_job() function also uses the ecore_thread_check() function to check whether a thread is pending cancellation, because the ecore_thread_feedback_run() function can be used from the main loop.

                                                                  -extern void thread_job(void *data, Ecore_Thread *thread)
                                                                  +extern void 
                                                                  +thread_job(void *data, Ecore_Thread *thread)
                                                                   {
                                                                      appdata_s *ad = NULL;
                                                                      viewdata_s *vd = NULL;
                                                                  diff --git a/org.tizen.sampledescriptions/html/mobile_n/systeminfo_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/systeminfo_sd_mn.htm
                                                                  index 73bf945..11c22b3 100644
                                                                  --- a/org.tizen.sampledescriptions/html/mobile_n/systeminfo_sd_mn.htm
                                                                  +++ b/org.tizen.sampledescriptions/html/mobile_n/systeminfo_sd_mn.htm
                                                                  @@ -20,32 +20,25 @@
                                                                   
                                                                   
                                                                  -

                                                                  Mobile native

                                                                  +

                                                                  Mobile native

                                                                  System Info Sample Overview

                                                                  -

                                                                  The System Info sample application demonstrates how to get information about the system.

                                                                  +

                                                                  The System Info sample application demonstrates how you can get information about the system.

                                                                  The following figure illustrates the main screen of the application.

                                                                  Figure: System Info screens

                                                                  - System info screen System info screen System Info screen + System info screens System info screens System Info screens

                                                                  -

                                                                  The application opens the main screen of system information categories. To check the information, touch the list item.

                                                                  +

                                                                  The application opens with the main screen of system information categories. To check the information, touch the list item.

                                                                  Prerequisites

                                                                  -

                                                                  The following privilege must be set:

                                                                  +

                                                                  To use the system information, the following privilege must be set:

                                                                  • http://tizen.org/privilege/systemsettings
                                                                  -

                                                                  To use the system information, the application has to request permission by adding the corresponding privileges to the tizen-manifest.xml file.

                                                                  -
                                                                  -<privileges>
                                                                  -   <privilege>http://tizen.org/privilege/systemsettings</privilege>
                                                                  -</privileges>
                                                                  -
                                                                  -

                                                                  Implementation

                                                                  To implement the application:

                                                                  @@ -56,9 +49,10 @@
                                                                4. -
                                                                5. Initialize the application using a common Tizen application structure. +
                                                                6. Initialize the application using a common Tizen application structure:
                                                                  -int main(int argc, char *argv[])
                                                                  +int 
                                                                  +main(int argc, char *argv[])
                                                                   {
                                                                      appdata_s ad = {0,};
                                                                      int ret = 0;
                                                                  @@ -91,7 +85,8 @@ int main(int argc, char *argv[])
                                                                   
                                                                   

                                                                  The initialization is done with the _create_base_gui() function:

                                                                  -static void _create_base_gui(appdata_s *ad)
                                                                  +static void 
                                                                  +_create_base_gui(appdata_s *ad)
                                                                   {
                                                                      Evas_Object *bg = NULL;
                                                                      Evas_Object *list = NULL;
                                                                  @@ -130,22 +125,23 @@ static void _create_base_gui(appdata_s *ad)
                                                                      evas_object_show(ad->navi);
                                                                      eext_object_event_callback_add(ad->navi, EEXT_CALLBACK_BACK, layout_back_cb, ad);
                                                                   
                                                                  -   // Base Layout
                                                                  +   // Base layout
                                                                      list = _create_main_list(ad);
                                                                   
                                                                  -   // Push the Main Layout to the Naviframe
                                                                  +   // Push the main layout to the naviframe
                                                                      elm_naviframe_item_push(ad->navi, "System Info", NULL, NULL, list, NULL);
                                                                   
                                                                  -   // Show window after base GUI is set up
                                                                  +   // Show the window after the base GUI is set up
                                                                      evas_object_show(ad->win);
                                                                   }
                                                                   
                                                                7. Create the main list menu. -

                                                                  Each main menu list item has a callback function for getting the system information. If one of them is clicked, the information about the category is illustrated in a genlist.

                                                                  +

                                                                  Each main menu list item has a callback function for getting the system information. If an item is clicked, the information about the category is illustrated in a genlist.

                                                                  -Evas_Object *_create_main_list(appdata_s *ad)
                                                                  +Evas_Object 
                                                                  +*_create_main_list(appdata_s *ad)
                                                                   {
                                                                      Evas_Object *list = NULL;
                                                                   
                                                                  @@ -175,9 +171,10 @@ Evas_Object *_create_main_list(appdata_s *ad)
                                                                   
                                                                8. Create the function to call when the list item is clicked. -

                                                                  The following code examples are callback functions of the camera, which is a default double label list, and of the platform, which is a grouped list. The codes of others are almost identical.

                                                                  +

                                                                  The following code example is the callback function of the camera, which is a default double label list. The codes of others are similar.

                                                                  -void camera_list_cb(void *data, Evas_Object *obj, void *event_info)
                                                                  +void 
                                                                  +camera_list_cb(void *data, Evas_Object *obj, void *event_info)
                                                                   {
                                                                      appdata_s *ad = (appdata_s *)data;
                                                                      Evas_Object *clist = NULL;
                                                                  @@ -208,10 +205,10 @@ void camera_list_cb(void *data, Evas_Object *obj, void *event_info)
                                                                      elm_naviframe_item_push(navi, "Camera", NULL, NULL, clist, NULL);
                                                                   }
                                                                   
                                                                  -
                                                                    -
                                                                  • Definitions +

                                                                    The following snippet shows the camera definitions. For more information, see the System Information guide.

                                                                    -static struct camera_info 
                                                                    +static struct 
                                                                    +camera_info 
                                                                     {
                                                                        char *description;
                                                                        char *feature_key;
                                                                    @@ -224,13 +221,11 @@ static struct camera_info
                                                                        {"Front Camera Flash", "http://tizen.org/feature/camera.front.flash"}
                                                                     };
                                                                     
                                                                    -

                                                                    For more information, see the System Information guide.

                                                                    -
                                                                  • -
                                                                  • _gl_text_get_cb callbacks -

                                                                    This genlist makes the list by a style, double_label, to distinguish a title and a content. The items of the list are illustrated by the _gl_text_get_cb() function, which uses the header file, system_info.h. To get information about the system, you can get the boolean data with the system_info_get_platform_bool() function.

                                                                    +

                                                                    This genlist makes the list with a style, double_label, to distinguish a title and a content. The items of the list are illustrated by the _gl_text_get_cb() function, which uses the header file, system_info.h. To get information about the system, you can get the boolean data with the system_info_get_platform_bool() function of the System Information API.

                                                                    -static char *_gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
                                                                    +static char 
                                                                    +*_gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
                                                                     {
                                                                        item_data_s *id = (item_data_s *)data;
                                                                        char buf[MAX_STR] = {0,};
                                                                    @@ -259,8 +254,6 @@ static char *_gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
                                                                     }
                                                                     
                                                                  • -
                                                                  -
                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/taskmanager_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/taskmanager_sd_mn.htm index 317ff38..b0066bc 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/taskmanager_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/taskmanager_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                Taskmanager Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_alignment_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_alignment_sd_mn.htm index e9fd571..24d147d 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_alignment_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_alignment_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Alignment Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_animation_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_animation_sd_mn.htm index dc6f7bb..94194c8 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_animation_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_animation_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Animation Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_animator_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_animator_sd_mn.htm index 54a9e11..e39e453 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_animator_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_animator_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Animator Sample Overview

                                                                @@ -38,7 +38,6 @@

                                                                The create_base_gui() function draws 2 different rectangles and calls the ecore_animator_frametime_set(), ecore_animator_timeline_add(), ecore_animator_add(), and ecore_timer_add() functions to give animation effects.

                                                                -
                                                                 typedef struct appdata 
                                                                 {
                                                                    Evas_Object *win;
                                                                @@ -48,22 +47,23 @@ typedef struct appdata
                                                                 static void create_base_gui(appdata_s *ad)
                                                                 {
                                                                    Evas *evas;
                                                                -   /* Window */
                                                                -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
                                                                -   elm_win_autodel_set(ad->win, EINA_TRUE);
                                                                -   if (elm_win_wm_rotation_supported_get(ad->win)) {
                                                                -   int rots[4] = { 0, 90, 180, 270 };
                                                                -   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
                                                                +   // Window
                                                                +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
                                                                +   elm_win_autodel_set(ad->win, EINA_TRUE);
                                                                +   if (elm_win_wm_rotation_supported_get(ad->win)) 
                                                                +   {
                                                                +      int rots[4] = {0, 90, 180, 270};
                                                                +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
                                                                    }
                                                                -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
                                                                -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
                                                                -   /* Base layout */
                                                                -   ad->layout = elm_layout_add(ad->win);
                                                                -   elm_layout_theme_set(ad->layout, "layout", "application", "default");
                                                                -   evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                                                                -   evas_object_show(ad->layout);
                                                                -   /* Animator */
                                                                -   evas = evas_object_evas_get(ad->layout);
                                                                +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
                                                                +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
                                                                +   // Base layout
                                                                +   ad->layout = elm_layout_add(ad->win);
                                                                +   elm_layout_theme_set(ad->layout, "layout", "application", "default");
                                                                +   evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                                                                +   evas_object_show(ad->layout);
                                                                +   // Animator
                                                                +   evas = evas_object_evas_get(ad->layout);
                                                                    rect1 = evas_object_rectangle_add(evas);
                                                                    evas_object_color_set(rect1, 0, 0, 255, 255);
                                                                    evas_object_resize(rect1, 50, 50);
                                                                @@ -78,8 +78,8 @@ static void create_base_gui(appdata_s *ad)
                                                                    timer1 = ecore_timer_add(10, _start_second_anim, rect1);
                                                                    timer2 = ecore_timer_add(5, _freeze_third_anim, anim2);
                                                                    timer3 = ecore_timer_add(10, _thaw_third_anim, anim2);
                                                                -   /* Show window after base gui is set up */
                                                                -   evas_object_show(ad->win);
                                                                +   // Show the window after the base GUI is set up
                                                                +   evas_object_show(ad->win);
                                                                 }
                                                                 
                                                                @@ -167,4 +167,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_app_store_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_app_store_sd_mn.htm index 6376a91..ffdb470 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_app_store_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_app_store_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] ApplicationStore Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_box_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_box_sd_mn.htm index 5e0a0e0..0052d0f 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_box_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_box_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Box Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_calculator_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_calculator_sd_mn.htm index 16c5026..7587e70 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_calculator_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_calculator_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Calculator Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_clock_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_clock_sd_mn.htm index be74e23..0caf1dc 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_clock_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_clock_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Clock Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_components_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_components_sd_mn.htm index b1bbea4..418a799 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_components_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_components_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                UI Components Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_1_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_1_sd_mn.htm index 2159bd8..c2a881f 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_1_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_1_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Ecore Thread 1 Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_2_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_2_sd_mn.htm index c4b1728..5f9f74b 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_2_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_2_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Ecore Thread 2 Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_3_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_3_sd_mn.htm index f4b3834..f92d1d2 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_3_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_3_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Ecore Thread 3 Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_4_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_4_sd_mn.htm index 9d82c18..c400d09 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_4_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_4_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Ecore Thread 4 Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_5_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_5_sd_mn.htm index 9c2d9e1..fc13b63 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_5_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_ecore_thread_5_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Ecore Thread 5 Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_ecoreevent_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_ecoreevent_sd_mn.htm index 6f92b1e..c732e2c 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_ecoreevent_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_ecoreevent_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] EcoreEvent Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_edc_format_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_edc_format_sd_mn.htm index 9f3a1bc..78312fd 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_edc_format_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_edc_format_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] EDCformat Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_edc_map_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_edc_map_sd_mn.htm index 76cb88f..7cc0574 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_edc_map_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_edc_map_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] EDC Map Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_elmtransit_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_elmtransit_sd_mn.htm index a36071f..cab0a64 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_elmtransit_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_elmtransit_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Elm Transit Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_email_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_email_sd_mn.htm index adb5e8e..88f57f1 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_email_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_email_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Email Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_mapping_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_mapping_sd_mn.htm index 8dacb6e..cb1faa6 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_mapping_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_mapping_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Evas Map Mapping Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_rotation_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_rotation_sd_mn.htm index 631b0bb..1883ca6 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_rotation_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_rotation_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Evas Map Rotation Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_sd_mn.htm index 5a65b4f..5c01b52 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_evas_map_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Evas Map Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_evasevent_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_evasevent_sd_mn.htm index 706c6a6..2c26f5e 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_evasevent_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_evasevent_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Evas Event Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_gallery_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_gallery_sd_mn.htm index 8bb3af2..bacf189 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_gallery_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_gallery_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Gallery Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_idler_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_idler_sd_mn.htm index ff822a9..88c6479 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_idler_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_idler_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Idler Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_image_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_image_sd_mn.htm index b705cff..6db6e24 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_image_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_image_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Image Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_inlist_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_inlist_sd_mn.htm index 0a6009f..1cb191c 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_inlist_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_inlist_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] InList Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_job_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_job_sd_mn.htm index e8d37f4..cd01314 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_job_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_job_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Job Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_language_change_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_language_change_sd_mn.htm index 0f5f9c0..7493e3b 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_language_change_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_language_change_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] LanguageChange Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_layout_samples_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_layout_samples_sd_mn.htm index a9c2835..4ce2c76 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_layout_samples_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_layout_samples_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] LayoutSample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_layout_signal_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_layout_signal_sd_mn.htm index dcde1fd..aaca933 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_layout_signal_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_layout_signal_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] LayoutSignal Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_list_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_list_sd_mn.htm index 9ce83f4..e2872b5 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_list_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_list_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] List Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_message_bubble_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_message_bubble_sd_mn.htm index 02d1e43..fb02ba7 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_message_bubble_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_message_bubble_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] MessageBubble Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_proxy_object_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_proxy_object_sd_mn.htm index 2688997..3e673f5 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_proxy_object_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_proxy_object_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Proxy Object Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_rectangle_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_rectangle_sd_mn.htm index c02f2de..b1b0300 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_rectangle_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_rectangle_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Rectangle Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_relative_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_relative_sd_mn.htm index ae5adc0..cf9f3d4 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_relative_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_relative_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] RelativePositioning Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_setting_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_setting_sd_mn.htm index 5f5c9be..39e0147 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_setting_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_setting_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Setting Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_sns_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_sns_sd_mn.htm index f4f1c51..9847b06 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_sns_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_sns_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] SNS Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_stringshare_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_stringshare_sd_mn.htm index 23ac78a..e7d6127 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_stringshare_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_stringshare_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] StringShare Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_theme_extension_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_theme_extension_sd_mn.htm index f590f76..b8d73af 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_theme_extension_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_theme_extension_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] ThemeExtension Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/ui_timer_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/ui_timer_sd_mn.htm index 1e103d1..70cea5d 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/ui_timer_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/ui_timer_sd_mn.htm @@ -21,7 +21,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                [UI Sample] Timer Sample Overview

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_n/volume_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/volume_sd_mn.htm index 9ef2912..65ab0fe 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/volume_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/volume_sd_mn.htm @@ -20,7 +20,7 @@
                                                                -

                                                                Mobile native

                                                                +

                                                                Mobile native

                                                                Volume Sample Overview

                                                                The Volume sample demonstrates how you can use the Sound Manager API to acquire and set the device sound levels. The application window consists of a list of sliders that manage the levels of different volume types.

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_w/archivemanager_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/archivemanager_mw.htm index 115ce58..22df4c2 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/archivemanager_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/archivemanager_mw.htm @@ -18,7 +18,7 @@
                                                                -

                                                                Mobile Web

                                                                +

                                                                Mobile Web

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_w/bluetoothchat_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/bluetoothchat_mw.htm index ef301c4..9cb8f1a 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/bluetoothchat_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/bluetoothchat_mw.htm @@ -18,7 +18,7 @@
                                                                -

                                                                Mobile Web

                                                                +

                                                                Mobile Web

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_w/calculator_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/calculator_mw.htm index 5620baf..1477198 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/calculator_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/calculator_mw.htm @@ -18,7 +18,7 @@
                                                                -

                                                                Mobile Web

                                                                +

                                                                Mobile Web

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_w/calendar_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/calendar_mw.htm index aee801d..1f7c02d 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/calendar_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/calendar_mw.htm @@ -18,7 +18,7 @@
                                                                -

                                                                Mobile Web

                                                                +

                                                                Mobile Web

                                                                diff --git a/org.tizen.sampledescriptions/html/mobile_w/calllog_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/calllog_mw.htm index e409f0e..2105a7c 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/calllog_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/calllog_mw.htm @@ -18,7 +18,7 @@
                                                                -

                                                                Mobile Web

                                                                +

                                                                Mobile Web

                                                                @@ -52,6 +52,14 @@
                                                              • An active SIM card
                                                              • If the call history is empty, the application cannot be used.
                                                              • The application does not work on the Emulator.
                                                              • +
                                                              • +

                                                                To ensure proper application execution, the following privileges must be set:

                                                                +
                                                                  +
                                                                • http://tizen.org/privilege/application.launch
                                                                • +
                                                                • http://tizen.org/privilege/callhistory.read
                                                                • +
                                                                • http://tizen.org/privilege/callhistory.write
                                                                • +
                                                                • http://tizen.org/privilege/contact.read
                                                                • +

                                                              Source Files

                                                              You can create and view the sample application project including the source files in the IDE.

                                                              @@ -117,17 +125,6 @@

                                                              Implementation

                                                              - - - -

                                                              The required privileges are declared in the config.xml file.

                                                              -
                                                              -<!--config.xml-->
                                                              -   <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
                                                              -   <tizen:privilege name="http://tizen.org/privilege/callhistory.read"/>
                                                              -   <tizen:privilege name="http://tizen.org/privilege/callhistory.write"/>
                                                              -   <tizen:privilege name="http://tizen.org/privilege/contact.read"/>
                                                              -

                                                              On initialization of the application layout, the Contact API is used to get phone contacts.

                                                               /* app.ui.js */
                                                              diff --git a/org.tizen.sampledescriptions/html/mobile_w/chatter_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/chatter_mw.htm
                                                              index 0d92a10..548a072 100644
                                                              --- a/org.tizen.sampledescriptions/html/mobile_w/chatter_mw.htm
                                                              +++ b/org.tizen.sampledescriptions/html/mobile_w/chatter_mw.htm
                                                              @@ -18,7 +18,7 @@
                                                               
                                                               
                                                              -

                                                              Mobile Web

                                                              +

                                                              Mobile Web

                                                              @@ -46,8 +46,17 @@

                                                              Prerequisites

                                                              • 2 devices with active SIM cards
                                                              • -
                                                              +
                                                            4. +

                                                              To ensure proper application execution, the following privileges must be set:

                                                              +
                                                                +
                                                              • http://tizen.org/privilege/application.launch
                                                              • +
                                                              • http://tizen.org/privilege/contact.read
                                                              • +
                                                              • http://tizen.org/privilege/contact.write
                                                              • +
                                                              • http://tizen.org/privilege/messaging.read
                                                              • +
                                                              • http://tizen.org/privilege/messaging.write
                                                              • +
                                                            5. +

                                                          Source Files

                                                          You can create and view the sample application project including the source files in the IDE.

                                                          @@ -104,16 +113,6 @@

                                                          Implementation

                                                          - -

                                                          The required privileges are declared in the config.xml file.

                                                          -
                                                          -<!--config.xml-->
                                                          -   <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
                                                          -   <tizen:privilege name="http://tizen.org/privilege/contact.read"/>
                                                          -   <tizen:privilege name="http://tizen.org/privilege/contact.write"/>
                                                          -   <tizen:privilege name="http://tizen.org/privilege/messaging.read"/>
                                                          -   <tizen:privilege name="http://tizen.org/privilege/messaging.write"/>
                                                          -

                                                          On application launch during the creation of the model module, the Contact API is used to get contacts from the phone address book. The returned result is a unified address book object.

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/compass_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/compass_mw.htm
                                                          index ba43fa4..b613fc3 100644
                                                          --- a/org.tizen.sampledescriptions/html/mobile_w/compass_mw.htm
                                                          +++ b/org.tizen.sampledescriptions/html/mobile_w/compass_mw.htm
                                                          @@ -18,7 +18,7 @@
                                                           
                                                           
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/contactlist_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/contactlist_mw.htm index 83663ca..e0485ec 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/contactlist_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/contactlist_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/contactsexchanger_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/contactsexchanger_mw.htm index be5ba9c..963ee4f 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/contactsexchanger_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/contactsexchanger_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/downloadmanager_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/downloadmanager_mw.htm index 732e963..cd1f401 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/downloadmanager_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/downloadmanager_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/eventmanager_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/eventmanager_mw.htm index 83a02a0..2a97872 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/eventmanager_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/eventmanager_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/exerciseplanner_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/exerciseplanner_mw.htm index a48bc6d..1851057 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/exerciseplanner_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/exerciseplanner_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/filemanager_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/filemanager_mw.htm index 3399a87..5fa7f8a 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/filemanager_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/filemanager_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/fmradio_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/fmradio_mw.htm index 99acda4..a3dd23c 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/fmradio_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/fmradio_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/hellotizen_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/hellotizen_mw.htm index 5705179..0cf2595 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/hellotizen_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/hellotizen_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          @@ -68,7 +68,7 @@

                                                          Implementation

                                                          -

                                                          The following code adds a click event listener. When a click event occurs, the Hello Tizen text changes into the Hi Gear text.

                                                          +

                                                          The following code adds a click event listener. When a click event occurs, the Hello Tizen text changes into the Hi WebApp text.

                                                           textbox.addEventListener('click', function() 
                                                           {
                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/hybridwebapp_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/hybridwebapp_mw.htm
                                                          index a36851c..315f1b8 100644
                                                          --- a/org.tizen.sampledescriptions/html/mobile_w/hybridwebapp_mw.htm
                                                          +++ b/org.tizen.sampledescriptions/html/mobile_w/hybridwebapp_mw.htm
                                                          @@ -18,7 +18,7 @@
                                                           
                                                           
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/mediacontent_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/mediacontent_mw.htm index 27e0bcf..c850eab 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/mediacontent_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/mediacontent_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          @@ -40,6 +40,14 @@

                                                          Figure: MediaContent screens

                                                          MediaContent screens

                                                          The application opens with the screen where you can choose the type of storage to check. After choosing the storage, you can choose the type of files to be retrieved. To view the details of the file, click the file name.

                                                          + +

                                                          Prerequisites

                                                          +

                                                          To ensure proper application execution, the following privileges must be set:

                                                          +
                                                            +
                                                          • http://tizen.org/privilege/content.read
                                                          • +
                                                          • http://tizen.org/privilege/content.write
                                                          • +
                                                          +

                                                          Source Files

                                                          You can create and view the sample application project including the source files in the IDE.

                                                          @@ -84,17 +92,6 @@

                                                          Implementation

                                                          - -

                                                          The config.xml file contains the specified privileges for reading from and writing to the Content API.

                                                          - -
                                                          -<?xml version="1.0" encoding="UTF-8"?>
                                                          -<widget xmlns="http://www.w3.org/ns/widgets" 
                                                          -   <tizen:privilege name="http://tizen.org/privilege/content.read" />
                                                          -   <tizen:privilege name="http://tizen.org/privilege/content.write" />
                                                          -</widget>
                                                          -
                                                          -

                                                          To get all folders from the API, use the getDirectories() method from the tizen.content object.

                                                           getFolders: function getFolders(successCallback, errorCallback) 
                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/moneybook_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/moneybook_mw.htm
                                                          index 565e2fe..b403d31 100644
                                                          --- a/org.tizen.sampledescriptions/html/mobile_w/moneybook_mw.htm
                                                          +++ b/org.tizen.sampledescriptions/html/mobile_w/moneybook_mw.htm
                                                          @@ -18,7 +18,7 @@
                                                           
                                                           
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/multiprocess_hybrid_package_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/multiprocess_hybrid_package_mw.htm index 48596ed..3ceddb2 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/multiprocess_hybrid_package_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/multiprocess_hybrid_package_mw.htm @@ -21,7 +21,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          Multi-project Hybrid Application

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/piano_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/piano_mw.htm index 1415146..5aebbaf 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/piano_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/piano_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/sd_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/sd_mw.htm index 1a5ed91..9c8acd0 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/sd_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/sd_mw.htm @@ -21,7 +21,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          Mobile Web Sample Descriptions

                                                          @@ -68,7 +68,7 @@ Calendar Demonstrates how you can create a calendar displaying the month using: @@ -223,22 +223,22 @@
                                                        • System Information API
                                                        • Package API

                                                        This sample is also explained in the tutorials: Task: System Information.

                                                        - + TouchPaint Demonstrates how you can create a simple paint application through touch events and the Canvas element using:

                                                        This sample is also explained in the tutorials: Task: Touch Paint.

                                                        - - - UIComponent - Demonstrates how you can use Tizen Advanced UI (TAU) UI components using: - -

                                                        This sample is also explained in the UI Component Reference.

                                                        - + + + UIComponent + Demonstrates how you can use Tizen Advanced UI (TAU) components using: + +

                                                        This sample is also explained in the UI Component Reference.

                                                        + @@ -290,4 +290,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/mobile_w/selfcamera_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/selfcamera_mw.htm index deace14..b708380 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/selfcamera_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/selfcamera_mw.htm @@ -18,7 +18,7 @@
                                                        -

                                                        Mobile Web

                                                        +

                                                        Mobile Web

                                                        @@ -41,6 +41,18 @@

                                                        Figure: SelfCamera screen

                                                        SelfCamera screen

                                                        The application opens with a screen that shows the front camera. To set the timer for 2, 5, or 10 seconds, click a timer option on top of the screen. To take a photo, click on the shutter button.

                                                        + +

                                                        Prerequisites

                                                        +

                                                        To ensure proper application execution, the following privileges must be set:

                                                        +
                                                          +
                                                        • http://tizen.org/privilege/application.launch
                                                        • +
                                                        • http://tizen.org/privilege/filesystem.read
                                                        • +
                                                        • http://tizen.org/privilege/filesystem.write
                                                        • +
                                                        • http://tizen.org/privilege/content.read
                                                        • +
                                                        • http://tizen.org/privilege/content.write
                                                        • +
                                                        • http://tizen.org/privilege/mediacapture
                                                        • +
                                                        +

                                                        Source Files

                                                        @@ -65,17 +77,6 @@

                                                        Implementation

                                                        To use the camera:

                                                          -
                                                        1. -

                                                          Add the required privileges.

                                                          -

                                                          To use the camera, the application has to request permissions by adding the corresponding privileges to the config.xml file. In this case, the application.launch privilege is also added to allow other applications to launch.

                                                          -
                                                          <tizen:privilege name="http://tizen.org/privilege/application.launch" />
                                                          -<tizen:privilege name="http://tizen.org/privilege/filesystem.read" />
                                                          -<tizen:privilege name="http://tizen.org/privilege/filesystem.write" />
                                                          -<tizen:privilege name="http://tizen.org/privilege/content.read" />
                                                          -<tizen:privilege name="http://tizen.org/privilege/content.write" />
                                                          -<tizen:privilege name="http://tizen.org/privilege/mediacapture" />
                                                          -
                                                          -
                                                        2. Create the layout for the camera preview.

                                                          <body>
                                                           
                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/sensorball_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/sensorball_mw.htm
                                                          index 3b67b8c..abfa067 100644
                                                          --- a/org.tizen.sampledescriptions/html/mobile_w/sensorball_mw.htm
                                                          +++ b/org.tizen.sampledescriptions/html/mobile_w/sensorball_mw.htm
                                                          @@ -18,7 +18,7 @@
                                                           
                                                           
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/soundmanager_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/soundmanager_mw.htm index 7e344b8..682256a 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/soundmanager_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/soundmanager_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/systeminfo_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/systeminfo_mw.htm index 57f620d..623d09b 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/systeminfo_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/systeminfo_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/touchpaint_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/touchpaint_mw.htm index 4ac8b8d..c39fe80 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/touchpaint_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/touchpaint_mw.htm @@ -18,7 +18,7 @@
                                                          -

                                                          Mobile Web

                                                          +

                                                          Mobile Web

                                                          diff --git a/org.tizen.sampledescriptions/html/mobile_w/uicomponent_mw.htm b/org.tizen.sampledescriptions/html/mobile_w/uicomponent_mw.htm index de272de..300fcea 100644 --- a/org.tizen.sampledescriptions/html/mobile_w/uicomponent_mw.htm +++ b/org.tizen.sampledescriptions/html/mobile_w/uicomponent_mw.htm @@ -11,41 +11,41 @@ - UIComponent Overview + UIComponent Overview
                                                          -

                                                          UIComponent Overview

                                                          -

                                                          The UIComponent sample application demonstrates how you can use TAU UI components.

                                                          +

                                                          UIComponent Overview

                                                          +

                                                          The UIComponent sample application demonstrates how you can use TAU UI components.

                                                          For information on creating the sample application project in the IDE, see Creating Sample Applications.

                                                          -

                                                          The following figure illustrates the main screen of the UIComponent.

                                                          -

                                                          Figure: UIComponent screen

                                                          -

                                                          UIComponent screen

                                                          +

                                                          The following figure illustrates the main screen of the UIComponent.

                                                          +

                                                          Figure: UIComponent screen

                                                          +

                                                          UIComponent screen

                                                          The application opens with the main screen, which shows a list of the available UI components. Click a list item to choose the UI component you want to see:

                                                            -
                                                          • Header and Footer: You can view the page layout with header and footer.
                                                          • -
                                                          • Navigation Elements: You can view various navigation components such as tabs, navigation, index scroll bar.
                                                          • -
                                                          • List: You can view various list styles.
                                                          • -
                                                          • Controls: You can view various control components.
                                                          • -
                                                          • Popup: You can view various popup, context popup and toast popup.
                                                          • -
                                                          • Gallery: You can view a gallery sample which using section-changer component.
                                                          • -
                                                          • Multimedia View: You can view multimedia element using standard HTML video and audio tag.
                                                          • +
                                                          • Header and Footer: View the page layout with header and footer.
                                                          • +
                                                          • Navigation Elements: View various navigation components, such as tabs, navigation, and index scroll bar.
                                                          • +
                                                          • List: View various list styles.
                                                          • +
                                                          • Controls: View various control components.
                                                          • +
                                                          • Popup: View various popup, context popup, and toast popup components.
                                                          • +
                                                          • Gallery: View a gallery sample using a section-changer component.
                                                          • +
                                                          • Multimedia View: View a multimedia element using a standard HTML video and audio element.

                                                          Source Files

                                                          @@ -55,22 +55,22 @@
                                                        - - + + + + + + - - - + + + - - - - - -
                                                        File name Description
                                                        components/ This directory contains the HTML and JavaScript files for UI components.
                                                        config.xml This file contains the application information for the platform to install and launch the application, including the view mode and the icon to be used in the device menu.
                                                        index.html
                                                        index.html This is a starting file from which the application starts loading. It contains the layout of the application screens.
                                                        components/ This directory contains the HTML and JavaScript files for UI Components.
                                                        - + + +
                                                        diff --git a/org.tizen.sampledescriptions/html/wearable_n/analog_watch_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/analog_watch_sd_wn.htm index ef23a7c..6d3d497 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/analog_watch_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/analog_watch_sd_wn.htm @@ -21,7 +21,7 @@
                                                        -

                                                        Wearable native

                                                        +

                                                        Wearable native

                                                        Analog Watch Sample Overview

                                                        @@ -69,7 +69,7 @@ _create_analogwatch(appdata_s *ad)
                                                      • Create the detailed layout of the analog watch. -

                                                        The _create_clock() function creates the detailed layout of the analog watch application: it makes a rectangle which is the background of the analog watch, and always sets the size of the rectangle to become a square. It also makes hands of the analog watch.

                                                        +

                                                        The _create_clock() function creates the detailed layout of the analog watch application: it makes a rectangle which is the background of the analog watch, and sets the size of the rectangle to become a square. It also makes the hands of the analog watch.

                                                         static Evas_Object *
                                                        @@ -111,7 +111,7 @@ _create_clock(appdata_s *ad)
                                                         
                                                      • Renew the time once per second. -

                                                        The app_time_tick() function is one of the watch_app_lifecycle_callback_s structure variables, and it called at least once per second. Watch applications can get the current time from the watch_time handle. Therefore, the _clock_set_info_time() function is also called once per second.

                                                        +

                                                        The app_time_tick() function is one of the watch_app_lifecycle_callback_s structure variables, and is called at least once per second. Watch applications can get the current time from the watch_time handle. Therefore, the _clock_set_info_time() function is also called once per second.

                                                         static void 
                                                        diff --git a/org.tizen.sampledescriptions/html/wearable_n/bluetoothchat_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/bluetoothchat_sd_wn.htm
                                                        index ce6fbed..2387372 100644
                                                        --- a/org.tizen.sampledescriptions/html/wearable_n/bluetoothchat_sd_wn.htm
                                                        +++ b/org.tizen.sampledescriptions/html/wearable_n/bluetoothchat_sd_wn.htm
                                                        @@ -21,7 +21,7 @@
                                                         
                                                         
                                                        -

                                                        Wearable native

                                                        +

                                                        Wearable native

                                                        (Circle) Bluetooth Chat Sample Overview

                                                        @@ -32,12 +32,12 @@

                                                        Figure: (Circle) Bluetooth Chat screens

                                                        (Circle) Bluetooth Chat screens

                                                        -

                                                        The main screen has 2 buttons for finding devices and creating a server. The chat room screen is created with the [UI Sample] MessageBubble sample application.

                                                        +

                                                        The main screen has 2 buttons for finding devices (Search friends) and creating a server (Wait a friend). The chat room screen is created with the [UI Sample] MessageBubble sample application.

                                                        Implementation

                                                        Client

                                                        -

                                                        The client application is started by clicking Search friends. The client draws its own layout (list of found devices) with the _search_layout_create() function.

                                                        +

                                                        To start the client application, click Search friends. The client draws its own layout (list of found devices) with the _search_layout_create() function.

                                                        While drawing the list, the application starts finding devices with the _discovery_start() function. Set the device discovery state changed callback, and the list updates whenever a new device is found.

                                                        @@ -68,7 +68,7 @@ _search_layout_create(appdata_s *ad) }
                                                        -

                                                        If you click an item on the list, the application starts to bond with the target device, and requests to connect to the target server. If successfully connected with the target, the _socket_conn_state_changed_cb() function is called and the application moves to chat room layout for chatting.

                                                        +

                                                        If you click an item on the list, the application starts to bond with the target device, and requests to connect to the target server. When successfully connected with the target, the _socket_conn_state_changed_cb() function is called and the application moves to the chat room layout for chatting.

                                                         static void 
                                                         _socket_conn_state_changed_cb(int result, bt_socket_connection_state_e connection_state, 
                                                        @@ -135,20 +135,20 @@ _device_bond_created_cb(int result, bt_device_info_s *device_info, void *user_da
                                                         
                                                            return;
                                                         
                                                        -DEL_NOTI:
                                                        +   DEL_NOTI:
                                                         
                                                        -   if (s_info.noti) 
                                                        -   {
                                                        -      evas_object_del(s_info.noti);
                                                        -      s_info.noti = NULL;
                                                        -   }
                                                        +      if (s_info.noti) 
                                                        +      {
                                                        +         evas_object_del(s_info.noti);
                                                        +         s_info.noti = NULL;
                                                        +      }
                                                         
                                                        -   return;
                                                        +      return;
                                                         }
                                                         

                                                        Server

                                                        -

                                                        The server application is started by clicking Wait a friend. The role of this application is to create a server for chatting, and wait for a client. Before drawing the proper layout, it checks whether the device is discoverable using the _server_create() function.

                                                        +

                                                        To start the server application, click Wait a friend. The role of this application is to create a server for chatting, and wait for a client. Before drawing the proper layout, it checks whether the device is discoverable using the _server_create() function.

                                                         static void 
                                                         _server_create(appdata_s *ad)
                                                        @@ -207,22 +207,22 @@ _server_layout_create(appdata_s *ad)
                                                         
                                                            return;
                                                         
                                                        -ERROR:
                                                        -   _E("Failed to create server layout");
                                                        +   ERROR:
                                                        +      _E("Failed to create server layout");
                                                         
                                                        -   if (layout) 
                                                        -   {
                                                        -      evas_object_del(layout);
                                                        -      layout = NULL;
                                                        -   }
                                                        +      if (layout) 
                                                        +      {
                                                        +         evas_object_del(layout);
                                                        +         layout = NULL;
                                                        +      }
                                                         
                                                        -   if (progress) 
                                                        -   {
                                                        -      evas_object_del(progress);
                                                        -      progress = NULL;
                                                        -   }
                                                        +      if (progress) 
                                                        +      {
                                                        +         evas_object_del(progress);
                                                        +         progress = NULL;
                                                        +      }
                                                         
                                                        -   return;
                                                        +      return;
                                                         }
                                                         
                                                        @@ -287,20 +287,20 @@ _main_view_create(appdata_s *ad)    return layout; -ERROR: -   if (layout) -   { -      evas_object_del(layout); -      layout = NULL; -   } +   ERROR: +      if (layout) +      { +         evas_object_del(layout); +         layout = NULL; +      } -   if (input_field) -   { -      evas_object_del(input_field); -      input_field = NULL; -   } +      if (input_field) +      { +         evas_object_del(input_field); +         input_field = NULL; +      } -   return NULL; +      return NULL; } static void @@ -388,20 +388,20 @@ _socket_data_received_cb(bt_socket_received_data_s *data, void *user_data)    return; -ERROR: -   if (bubble_table) -   { -      evas_object_del(bubble_table); -      bubble_table = NULL; -   } +   ERROR: +      if (bubble_table) +      { +         evas_object_del(bubble_table); +         bubble_table = NULL; +      } -   if (message) -   { -      free(message); -      message = NULL; -   } +      if (message) +      { +         free(message); +         message = NULL; +      } -   return; +      return; }
                            • diff --git a/org.tizen.sampledescriptions/html/wearable_n/cairo_basic_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/cairo_basic_sd_wn.htm index 390af16..94f2994 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/cairo_basic_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/cairo_basic_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) Cairo Basic Sample Overview

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/cairo_evasgl_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/cairo_evasgl_sd_wn.htm index e3e23d3..802283e 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/cairo_evasgl_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/cairo_evasgl_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) Cairo EvasGL Sample Overview

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/circleemail_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/circleemail_sd_wn.htm index 4802b84..79ef505 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/circleemail_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/circleemail_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) Email Sample Overview

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/circlerotarytimer_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/circlerotarytimer_sd_wn.htm index d6ff226..f079f4e 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/circlerotarytimer_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/circlerotarytimer_sd_wn.htm @@ -21,12 +21,12 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) Rotary Timer Sample Overview

                              -

                              The (Circle) Rotary Timer sample application demonstrates how implement a circular digital clock with a timer function in your application.

                              +

                              The (Circle) Rotary Timer sample application demonstrates how you can implement a circular digital clock with a timer function in your application.

                              The following figure illustrates the main views of the (Circle) Rotary Timer sample application.

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/circlesettings_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/circlesettings_sd_wn.htm index d01a373..62e67c4 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/circlesettings_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/circlesettings_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) Settings Sample Overview

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/circlesettingtime_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/circlesettingtime_sd_wn.htm index 0ec959c..40bed55 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/circlesettingtime_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/circlesettingtime_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) Setting Time Sample Overview

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/circleuicomponents_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/circleuicomponents_sd_wn.htm index 26b314d..12b7aeb 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/circleuicomponents_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/circleuicomponents_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              (Circle) UI Components Sample Overview

                              diff --git a/org.tizen.sampledescriptions/html/wearable_n/digital_watch_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/digital_watch_sd_wn.htm index c8b164c..2793293 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/digital_watch_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/digital_watch_sd_wn.htm @@ -21,7 +21,7 @@
                              -

                              Wearable native

                              +

                              Wearable native

                              Digital-Watch Sample Overview

                              @@ -39,8 +39,7 @@

                              To implement the watch application:

                              1. Add the header file. -

                                The Watch Application API provides functions to manage the watch application life-cycle, represent the current date and time accurately, and get a watch application window. To use the functions and data types of the Watch Application API, include the watch_app.h header file in your application: -

                                +

                                The Watch Application API provides functions to manage the watch application life-cycle, represent the current date and time accurately, and get a watch application window. To use the functions and data types of the Watch Application API, include the watch_app.h header file in your application:

                                 #include <watch_app.h>
                                 
                                diff --git a/org.tizen.sampledescriptions/html/wearable_n/evas_gl_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/evas_gl_sd_wn.htm index d231b97..8d5e56e 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/evas_gl_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/evas_gl_sd_wn.htm @@ -11,7 +11,7 @@ - EvasGLCube Sample Overview + EvasGLCube Sample Overview @@ -21,10 +21,10 @@
                                -

                                Wearable native

                                +

                                Wearable native

                                -

                                EvasGLCube Sample Overview

                                +

                                EvasGLCube Sample Overview

                                The EvasGLCube sample application demonstrates how to implement a rotatable cube on the screen using EvasGL with the Tizen SDK. The sample shows how to handle polygon geometry, and how to write a simple vertex and fragment shader for the cube. EvasGL is similar to the EGL™ layer and is related to GLView.

                                @@ -34,16 +34,16 @@ Note - The application presented in this overview is not a full Tizen application, since it does not use the Application Framework. The application simply starts and runs.

                                A 3D application using the OpenGL ES must use the GLView. EvasGL can be used in special cases, such as a multi-thread.

                                + The application presented in this overview is not a full Tizen application, since it does not use the Application Framework. The application simply starts and runs.

                                A 3D application using the OpenGL ES must use the GLView. EvasGL can be used in special cases, such as a multi-thread.

                                The following figure illustrates the main screen of the EvasGLCube.

                                - -

                                Figure: EvasGLCube screen

                                -

                                EvasGLCube screen

                                - + +

                                Figure: EvasGLCube screen

                                +

                                EvasGLCube screen

                                +

                                Setting up the OpenGL ES Surface

                                The EvasGL interface is similar to the EGL interface. It can be connected to Evas so that OpenGL ES code works with Evas 2D objects.

                                This sample shows how to implement with EvasGL to use OpenGL ES:

                                @@ -58,7 +58,7 @@
                                EVAS_GL_GLOBAL_GLES2_DEFINE();
                                -

                                The EvasGL or GLView program uses the wrapper functions by the supported Evas GL. The wrapper function's interface is the same as OpenGL ES's. This macro can provide a set of convenience wrapper function tables.

                                +

                                The EvasGL or GLView program uses the wrapper function by the supported Evas GL. The wrapper function's interface is the same as OpenGL ES's. This macro can provide a set of convenience wrapper function tables.

                                 Evas_Object *add_win(const char *name)
                                 {
                                @@ -74,7 +74,7 @@ Evas_Object *add_win(const char *name)
                                    return win;
                                 }
                                 
                                -

                                Before creating the Elm Window, we set the GL Rendering Engine using the elm_config_accel_preference_set("opengl") because EvasGL runs with EvasGL Render Engine.

                                +

                                Before creating the Elm Window, set the GL Rendering Engine using the elm_config_accel_preference_set("opengl") function because EvasGL runs with EvasGL Render Engine.

                                Setting up Callbacks

                                @@ -123,11 +123,11 @@ static void init_evasgl(appdata_s *ad)    evas_object_event_callback_add(ad->img, EVAS_CALLBACK_MOUSE_MOVE, mouse_move_cb, ad);    ani = ecore_animator_add(animate_cb, ad->img); -   evas_object_data_set(ad->img, "ani", ani); -   elm_object_content_set(ad->conform,ad->img); +   evas_object_data_set(ad->img, "ani", ani); +   elm_object_content_set(ad->conform, ad->img); } -

                                To use EvasGL, we first create it, then set its configuration, and create the Evas GL surface and context. For rendering, we connect EvasGL with the Evas Object Image using the evas_object_image_native_surface_set().

                                +

                                To use EvasGL, create it, set its configuration, and create the Evas GL surface and context. For rendering, connect EvasGL with the Evas Object Image using the evas_object_image_native_surface_set() function.

                              2. Resize callbacks. @@ -144,16 +144,16 @@ static void win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_i       ad->sfc = NULL;    } -   evas_object_geometry_get(obj, NULL, NULL, &ad->surface_w, &ad->surface_h); -   evas_object_image_size_set(ad->img, ad->surface_w, ad->surface_h); -   evas_object_resize(ad->img, ad->surface_w, ad->surface_h); +   evas_object_geometry_get(obj, NULL, NULL, &ad->surface_w, &ad->surface_h); +   evas_object_image_size_set(ad->img, ad->surface_w, ad->surface_h); +   evas_object_resize(ad->img, ad->surface_w, ad->surface_h);    evas_object_show(ad->img);    if (!ad->sfc)    {       Evas_Native_Surface ns; -      ad->sfc = evas_gl_surface_create(ad->evasgl, ad->cfg, ad->surface_w, ad->surface_h); +      ad->sfc = evas_gl_surface_create(ad->evasgl, ad->cfg, ad->surface_w, ad->surface_h);       evas_gl_native_surface_get(ad->evasgl, ad->sfc, &ns);       evas_object_image_native_surface_set(ad->img, &ns);       evas_object_image_pixels_dirty_set(ad->img, EINA_TRUE); @@ -165,7 +165,7 @@ static void win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_i
                              3. Draw callbacks.

                                The Evas GL draw callback function is registered by the following Evas Object Image function:

                                - evas_object_image_pixels_get_callback_set(ad->img, img_pixel_cb, ad);
                                +evas_object_image_pixels_get_callback_set(ad->img, img_pixel_cb, ad);
                                 

                                This callback function is provided for on-demand mode. Especially, if Evas GL uses EVAS_GL_OPTIONS_DIRECT, all OpenGL ES options are called in this callback function.

                                @@ -191,19 +191,20 @@ static void img_pixel_cb(void *data, Evas_Object *obj)
                                       glBindBuffer(GL_ARRAY_BUFFER, ad->vbo);
                                       glBufferData(GL_ARRAY_BUFFER, 3 * 72 * 4, cube_vertices,GL_STATIC_DRAW);
                                       init_matrix(view);
                                -      if (ad->surface_w > ad->surface_h)
                                +      if (ad->surface_w > ad->surface_h) 
                                       {
                                -         aspect = (float)ad->surface_w / ad->surface_h;
                                +         aspect = (float)ad->surface_w / ad->surface_h;
                                          view_set_ortho(view, -1.0 * aspect, 1.0 * aspect, -1.0, 1.0, -1.0, 1.0);
                                       }
                                -      else {
                                -         aspect = (float)ad->surface_h / ad->surface_w;
                                +      else 
                                +      {
                                +         aspect = (float)ad->surface_h / ad->surface_w;
                                          view_set_ortho(view, -1.0, 1.0, -1.0 * aspect,  1.0 *aspect, -1.0, 1.0);
                                       }
                                       ad->initialized = EINA_TRUE;
                                    }
                                 
                                -   glViewport(0, 0, ad->surface_w, ad->surface_h);
                                +   glViewport(0, 0, ad->surface_w, ad->surface_h);
                                    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
                                    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                                 
                                @@ -243,7 +244,7 @@ static Eina_Bool animate_cb(void *data)
                                 }
                                 
                                -

                                The evas_object_image_pixels_dirty_set() function sets dirty bit of the Evas Object image which is connected Evas GL. After that, the evas_object_image_pixels_get_callback_set() callback function is called whenever Evas renders.

                                +

                                The evas_object_image_pixels_dirty_set() function sets the dirty bit of the Evas Object image which is connected Evas GL. After that, the evas_object_image_pixels_get_callback_set() callback function is called whenever Evas renders.

                              4. Delete callbacks. @@ -252,7 +253,7 @@ static Eina_Bool animate_cb(void *data) static void img_del_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) {    appdata_s *ad = data; -   Ecore_Animator *ani = evas_object_data_get(ad->img, "ani"); +   Ecore_Animator *ani = evas_object_data_get(ad->img, "ani");    ecore_animator_del(ani);    // Free the GL resources when image object is deleted @@ -294,4 +295,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.sampledescriptions/html/wearable_n/glview11_cube_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/glview11_cube_sd_wn.htm index 8fbd4f3..73d1fc8 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/glview11_cube_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/glview11_cube_sd_wn.htm @@ -21,7 +21,7 @@
                                -

                                Wearable native

                                +

                                Wearable native

                                GLView11Cube Sample Overview

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

                                Initializing the Application

                                -

                                The easiest tool to use OpenGL ES within an EFL application is to rely on the Elementary GLView widget.

                                +

                                The easiest tool to use OpenGL ES within an EFL application is to rely on the Elementary GLView component.

                                Current GLView can support both GLES 2.0 and 1.1. GLView with the GLES 1.1 basic application has a similar format as the other GLView application.

                                Create a basic application:

                                @@ -56,7 +56,7 @@
                                 #include <dlog.h>
                                 
                                -

                                The GLView application should include the header files as the <Evas_GL.h> and <Elementary.h>. The <efl_extension.h> header file is for key events and the <dlog.h> header file is for logs view.

                                +

                                The GLView application should include the header files as the <Evas_GL.h> and <Elementary.h>. The <efl_extension.h> header file is for key events and the <dlog.h> header file is for the logs view.

                                 #define S(a) evas_object_show(a)
                                 
                                @@ -164,7 +164,7 @@ _glview_create(appdata_s *ad)
                                 

                                To set up callbacks:

                                1. Set the initialization callback. -

                                  The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface created. This is called from the main loop, as are the 3 other callbacks.

                                  +

                                  The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created. This is called from the main loop, as are the 3 other callbacks.

                                   #include <Elementary_GL_Helpers.h>
                                  @@ -238,7 +238,7 @@ void resize_gl(Evas_Object *obj)
                                   void draw_gl(Evas_Object *obj)
                                   {
                                  -ELEMENTARY_GLVIEW_USE(obj);
                                  +   ELEMENTARY_GLVIEW_USE(obj);
                                   
                                      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                                      glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
                                  @@ -298,7 +298,7 @@ _anim_cb(void *data)
                                   		 Note 
                                   		 
                                   		 
                                  -		 OpenGL ES 1.1 application can be implemented in Tizen. However, if OpenGL ES 1.1 and OpenGL ES 2.0 are used together, they cannot be used in the same file.
                                  +		 OpenGL ES 1.1 application can be implemented in Tizen. However, if OpenGL ES 1.1 and OpenGL ES 2.0 are used together, they cannot be used in the same file. 
                                   		 
                                   	    
                                   	  
                                  diff --git a/org.tizen.sampledescriptions/html/wearable_n/glview_cube_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/glview_cube_sd_wn.htm
                                  index cd736f2..63a8b4b 100644
                                  --- a/org.tizen.sampledescriptions/html/wearable_n/glview_cube_sd_wn.htm
                                  +++ b/org.tizen.sampledescriptions/html/wearable_n/glview_cube_sd_wn.htm
                                  @@ -21,12 +21,12 @@
                                   
                                   
                                  -

                                  Wearable native

                                  +

                                  Wearable native

                                  GLViewCube Sample Overview

                                  -

                                  This sample demonstrates how to render with OpenGL ES 2.0 using an Elementary GLView Widget. It goes through the creation of a simple UI and how to draw a rotating cube using simple vertex and fragment shaders.

                                  +

                                  This sample demonstrates how to render with OpenGL ES 2.0 using an Elementary GLView component. It goes through the creation of a simple UI and how to draw a rotating cube using simple vertex and fragment shaders.

                                  @@ -54,14 +54,12 @@ #include "glviewcube_utils.h" ELEMENTARY_GLVIEW_GLOBAL_DEFINE(); -... + static bool app_create(void *data) { -...    // Create and initialize GLView    gl = elm_glview_add(ad->conform);    ELEMENTARY_GLVIEW_GLOBAL_USE(gl); -... } @@ -69,7 +67,7 @@ static bool app_create(void *data)
                                  1. Set the initialization callback.

                                    The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created.

                                    -

                                    This callback function initializes shaders using the init_shaders(obj).

                                    +

                                    This callback function initializes shaders using the init_shaders(obj) function.

                                     static void init_gl(Evas_Object *obj) 
                                    @@ -82,7 +80,6 @@ static void init_gl(Evas_Object *obj)
                                           glEnable(GL_DEPTH_TEST);
                                           ad->initialized = EINA_TRUE;
                                        }
                                    -      ...
                                     }
                                     
                                  2. @@ -90,7 +87,7 @@ static void init_gl(Evas_Object *obj)
                                  3. Initialize the shaders.
                                    1. The shader instances for the fragment and vertex shader are compiled and created by passing the shader type as a parameter to the glCreateShader() function. -

                                      We should Load the shader objects, and use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                      +

                                      Load the shader objects, use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                       static void init_shaders(Evas_Object *obj) 
                                       {
                                      @@ -106,7 +103,7 @@ static void init_shaders(Evas_Object *obj)
                                          glShaderSource(ad->fgmt_shader, 1, &p, NULL);
                                          glCompileShader(ad->fgmt_shader);
                                       
                                    2. -
                                    3. Once the shader objects loaded, a shader program is created. The program attaches and links the shader objects to the shader program. +
                                    4. Once the shader objects have been loaded, a shader program is created. The program attaches and links the shader objects to the shader program.
                                          ad->program = glCreateProgram();
                                          glAttachShader(ad->program, ad->vtx_shader);
                                      @@ -139,7 +136,7 @@ static void init_shaders(Evas_Object *obj)
                                       static void resize_gl(Evas_Object *obj) 
                                       {
                                          appdata_s *ad = evas_object_data_get(obj, "ad");
                                      -   elm_glview_size_get(obj, &ad->glview_w, &ad->glview_h);
                                      +   elm_glview_size_get(obj, &ad->glview_w, &ad->glview_h);
                                       }
                                       
                                    5. @@ -153,7 +150,6 @@ static void resize_gl(Evas_Object *obj)
                                       static void draw_gl(Evas_Object *obj) 
                                       {
                                      -   ...
                                          glViewport(0, 0, ad->glview_w, ad->glview_h);
                                       
                                      @@ -167,7 +163,7 @@ static void draw_gl(Evas_Object *obj)    glEnableVertexAttribArray(ad->idx_position);    glEnableVertexAttribArray(ad->idx_color); - +
                                    6. The glUniformMatrix4fv() function modifies the values of the 4x4 MVP (Model View/Projection) uniform matrix according to the vertices information of the cube. An MVP matrix is created with data after each vertex of the cube has passed through 2 transformation stages: The first transformation state is the model view transformation, which includes translation, rotation, and scaling of objects. The second state is projection, which includes changes in the perspective or orthography. @@ -179,7 +175,8 @@ static void draw_gl(Evas_Object *obj)
                                          glDrawElements(GL_TRIANGLES, cube_indices_count, 				
                                                         GL_UNSIGNED_SHORT, cube_indices);
                                      -	
                                      +} +
                                  4. @@ -190,14 +187,13 @@ static void draw_gl(Evas_Object *obj) static Eina_Bool anim(void *data) {    elm_glview_changed_set(data); +    return EINA_TRUE; } static bool app_create(void *data) { -      ...    ani = ecore_animator_add(anim, gl); -      ... } diff --git a/org.tizen.sampledescriptions/html/wearable_n/glview_shader_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/glview_shader_sd_wn.htm index 022040c..50d5e7a 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/glview_shader_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/glview_shader_sd_wn.htm @@ -21,7 +21,7 @@
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    GLViewShader Sample Overview

                                    @@ -53,14 +53,12 @@ #include "glviewcube_utils.h" ELEMENTARY_GLVIEW_GLOBAL_DEFINE(); -... + static bool app_create(void *data) { -   ...    // Create and initialize GLView    gl = elm_glview_add(ad->conform);    ELEMENTARY_GLVIEW_GLOBAL_USE(gl); -   ... } @@ -71,7 +69,7 @@ static bool app_create(void *data)
                                  5. Set the initialization callback.

                                    The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created.

                                    This callback function initializes shaders using the init_shaders(obj) function.

                                    -

                                    A Vertex Buffer Object (VBO) allows vertex array data to be stored in a high-performance graphics memory on the server, to maximize data transfer efficiency.

                                    +

                                    A Vertex Buffer Object (VBO) allows vertex array data to be stored in a high-performance graphics memory on the server to maximize data transfer efficiency.

                                    A VBO is created in the application for the teapot vertices. Additionally, an Index Buffer Object (IBO) is created for the indices. The glGenBuffers() function specifies an array in which the buffer object name is stored.

                                    The glBindBuffer() function binds the buffer object to a specified target. In this case, the target is GL_ARRAY_BUFFER.

                                    The glBufferData() function is used to create a new data storage for the current buffer object. The parameters of the function are the buffer object target, the data store size, the array of teapot vertices, and the usage function of the data store (in this case, GL_STATIC_DRAW).

                                    @@ -79,11 +77,11 @@ static bool app_create(void *data) static void init_gl(Evas_Object *obj) {    appdata_s *ad = evas_object_data_get(obj, "ad"); -         ... +    if (!ad->initialized)    {       init_shaders(obj); -         ... +       glEnable(GL_DEPTH_TEST);       glGenBuffers(1, &ad->idx_vbo); @@ -105,10 +103,9 @@ static void init_gl(Evas_Object *obj)
                                  6. Initialize the shaders:
                                      -
                                    1. Vertex and fragment shaders are created and compiled by passing shader parameters to theglCreateShader() function. -

                                      We should load the shader objects, use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                      +
                                    2. Vertex and fragment shaders are created and compiled by passing the shader parameters to the glCreateShader() function. +

                                      Load the shader objects, use the GLES2 Shader compiler to read and compile the shader source code for both the fragment and the vertex shader.

                                      -	
                                       static void init_shaders(Evas_Object *obj) 
                                       {
                                          appdata_s *ad = evas_object_data_get(obj, "ad");
                                      @@ -123,7 +120,7 @@ static void init_shaders(Evas_Object *obj)
                                          glShaderSource(ad->fgmt_shader, 1, &p, NULL);
                                          glCompileShader(ad->fgmt_shader);
                                       
                                    3. -
                                    4. Once the shader objects are loaded, a shader program is created. The program attaches and links the shader objects to the shader program. +
                                    5. Once the shader objects have been loaded, a shader program is created. The program attaches and links the shader objects to the shader program.
                                          ad->program = glCreateProgram();
                                          glAttachShader(ad->program, ad->vtx_shader);
                                      @@ -133,7 +130,7 @@ static void init_shaders(Evas_Object *obj)
                                       
                                    6. Get the location for each attribute in the shader program using the glGetUniformLocation() and glGetAttribLocation() functions. If the shader program attributes, such as u_mvpMatrix and a_position are valid, these functions return an integer value that represents the index location of the attributes. For invalid attributes, the return value is -1. -

                                      The glGetUniformLocation() retrieves the location of the uniform related to groups of vertices or pixels, such as model view matrix, projection matrix, or light position. The glGetAttribLocation() retrieves the location of the attributes trelated to a vertex or pixel, such as position vector, normal vector, or vertex color.

                                      +

                                      The glGetUniformLocation() function retrieves the location of the uniform related to groups of vertices or pixels, such as the model view matrix, projection matrix, or light position. The glGetAttribLocation() function retrieves the location of the attributes related to a vertex or pixel, such as position vector, normal vector, or vertex color.

                                          ad->idx_light_dir = glGetUniformLocation(ad->program, "u_light_dir");
                                          ad->idx_mvp = glGetUniformLocation(ad->program, "u_mvpMatrix");
                                      @@ -170,12 +167,10 @@ static void resize_gl(Evas_Object *obj)
                                       
                                      1. The glViewport() function specifies the affine transformation of the x and y values from normalized device coordinates to window coordinates as specified by the elm_glview_size_get() function.
                                        -
                                         static void draw_gl(Evas_Object *obj) 
                                         {
                                        -   ...
                                            elm_glview_size_get(obj, &ad->glview_w, &ad->glview_h);
                                        -   ...
                                        +
                                            glViewport(0, 0, ad->glview_w, ad->glview_h);
                                         
                                      2. @@ -186,7 +181,7 @@ static void draw_gl(Evas_Object *obj)    glUniform4fv(ad->idx_light_dir, 1, ad->light_dir);    glUniformMatrix4fv(ad->idx_mvp, 1, GL_FALSE, ad->mvp);    glUniform1f(ad->idx_time_stamp, ad->time_stamp); -
                                      +
                                    7. The glVertexAttribPointer() function is used to define an array of generic vertex attribute data. These attributes are parameters associated with each vertex of the teapot. In this case, they are position and normal. @@ -201,14 +196,14 @@ static void draw_gl(Evas_Object *obj)          sizeof(float) * 6, (void*) (sizeof(float) * 3));    glEnableVertexAttribArray(ad->idx_vnormal);    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ad->idx_ibo); - +
                                    8. Once the vertex arrays have been enabled, the actual process of rendering graphics primitives from the array data occurs using the glDrawElements() function.
                                          glDrawElements(GL_TRIANGLES, MAX_F_COUNT * 3,
                                                         GL_UNSIGNED_SHORT, 0);
                                      -	
                                      +
                                    9. The glFlush() function empties all buffers causing all issued commands to be executed as quickly as they are accepted by the rendering engine. @@ -221,23 +216,22 @@ static void draw_gl(Evas_Object *obj)    glBindBuffer(GL_ARRAY_BUFFER, 0);    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } - +
                                  7. Add an animator. -

                                    The application regularly triggers the update of the GLView using the elm_glview_changed_set() function.

                                    +

                                    The application regularly triggers an update of the GLView using the elm_glview_changed_set() function.

                                     static Eina_Bool anim(void *data) 
                                     {
                                        elm_glview_changed_set(data);
                                    +
                                        return EINA_TRUE;
                                     }
                                     
                                     static bool app_create(void *data) 
                                     {
                                    -      ...
                                        ani = ecore_animator_add(anim, gl);
                                    -      ...
                                     }
                                     
                                  8. diff --git a/org.tizen.sampledescriptions/html/wearable_n/rectemail_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/rectemail_sd_wn.htm index 25597fb..769774c 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/rectemail_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/rectemail_sd_wn.htm @@ -21,7 +21,7 @@
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    (Rectangle) Email Sample Overview

                                    diff --git a/org.tizen.sampledescriptions/html/wearable_n/rectnotificationmanager_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/rectnotificationmanager_sd_wn.htm index dc82234..44df9e3 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/rectnotificationmanager_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/rectnotificationmanager_sd_wn.htm @@ -21,7 +21,7 @@
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    (Rectangle) NotificationManager Sample Overview

                                    @@ -31,8 +31,8 @@

                                    The following figure illustrates the main screens of the NotificationManager.

                                    -

                                    Figure: (Rectangle) Notification Manager screens

                                    -

                                    (Rectangle) Notification Manager screens

                                    +

                                    Figure: (Rectangle) NotificationManager screens

                                    +

                                    (Rectangle) NotificationManager screens

                                    The application opens with the main screen, where you can select which notification type to access: notifications or ongoing notifications. Click the notification type to view the list of notifications and their various features.

                                    @@ -50,9 +50,9 @@

                                    If the user clicks the list item related to the creation of the notification, the notify_cb() or notify_normal_cb() function is called to create the notification.

                                    If the user clicks the list item related to the removal of a notification, the remove_notification_cb() function is called to remove the notification.

                                    -static 
                                    -notification_h create_notification(const char *icon_path, const char *title_text, 
                                    -                                   const char *content_text,const char *sound_path)
                                    +static notification_h
                                    +create_notification(const char *icon_path, const char *title_text, 
                                    +                    const char *content_text,const char *sound_path)
                                     {
                                        notification_h notify = notification_create(NOTIFICATION_TYPE_NOTI);
                                        if (notify)
                                    @@ -97,7 +97,8 @@ notify_by_app_control_cb(notification_data *notify_data)
                                           const char *array_result[] = {result_1_text, result_2_text, NULL};
                                           const char *array_key[] = {SERVICE_DATA_TEXT, SERVICE_DATA_TO, NULL};
                                     
                                    -      // Set extra data to app control 
                                    +      // Set extra data to app control
                                    +
                                           notification_post(notify_data->notification);
                                        }
                                     
                                    @@ -141,7 +142,8 @@ notify_by_app_id_cb(notification_data *notify_data)
                                        notify_data->notification = create_notification(ICON2_PATH, title_text, notify_with_request, NULL);
                                        if (notify_data->notification)
                                        {
                                    -      // Set App package to app control 
                                    +      // Set the app package to app control
                                    +
                                           notification_post(notify_data->notification);
                                        }
                                     
                                    @@ -205,7 +207,8 @@ remove_badge_number_by_app_id_cb(notification_data *notify_data)
                                     

                                    The on-going notification management is implemented in the ongoing-notifications.c file.

                                    The create_ongoing_notification() function creates an on-going notification. This function sets the notification property, image, and title text.

                                    -static notification_h create_ongoing_notification(const char *image_path, const char *title_text)
                                    +static notification_h 
                                    +create_ongoing_notification(const char *image_path, const char *title_text)
                                     {
                                        notification_h ongoing_notification = notification_create(NOTIFICATION_TYPE_ONGOING);
                                        retvm_if(!ongoing_notification, NULL, "notify is NULL");
                                    @@ -220,7 +223,8 @@ static notification_h create_ongoing_notification(const char *image_path, const
                                     

                                    The delete_ongoing_notification() function removes the on-going notification, and resets the press count and progress value of this notification.

                                    -static int delete_ongoing_notification(notification_data *data)
                                    +static int 
                                    +delete_ongoing_notification(notification_data *data)
                                     {
                                        notification_data *data = ongoing_notification_data_get(type);
                                        int err = NOTIFICATION_ERROR_NONE;
                                    @@ -234,6 +238,7 @@ static int delete_ongoing_notification(notification_data *data)
                                           data->press_count = 0;
                                           data->progress_value = 0;
                                        }
                                    +
                                        return (err == NOTIFICATION_ERROR_NONE);
                                     }
                                     
                                    @@ -365,7 +370,7 @@ delete_ongoing_notification(enum ongoing_notification type)
                                  9. Manage on-going notifications using the application ID. -

                                    To notify a specified user using the application ID of the on-going activity, the ongoing_notification_by_app_id_cb() function is called. It sets the application ID to the appcontrol, so the proper application is called.

                                    +

                                    To notify a user using the application ID of the on-going activity, the ongoing_notification_by_app_id_cb() function is called. It sets the application ID to the appcontrol, so the proper application is called.

                                    The remove_ongoing_notification_by_app_id_cb() function is used to remove the notification for the specified application ID.

                                     static void 
                                    diff --git a/org.tizen.sampledescriptions/html/wearable_n/rectsettings_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/rectsettings_sd_wn.htm
                                    index 40cd926..af2e002 100644
                                    --- a/org.tizen.sampledescriptions/html/wearable_n/rectsettings_sd_wn.htm
                                    +++ b/org.tizen.sampledescriptions/html/wearable_n/rectsettings_sd_wn.htm
                                    @@ -21,7 +21,7 @@
                                     
                                     
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    (Rectangle) Settings Sample Overview

                                    diff --git a/org.tizen.sampledescriptions/html/wearable_n/rectuicomponents_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/rectuicomponents_sd_wn.htm index 4fd26f7..10dec1a 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/rectuicomponents_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/rectuicomponents_sd_wn.htm @@ -21,7 +21,7 @@
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    (Rectangle) UI Components Sample Overview

                                    diff --git a/org.tizen.sampledescriptions/html/wearable_n/rectuidialer_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/rectuidialer_sd_wn.htm index dc989c3..aa6693c 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/rectuidialer_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/rectuidialer_sd_wn.htm @@ -21,7 +21,7 @@
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    (Rectangle) UI Dialer Sample Overview

                                    diff --git a/org.tizen.sampledescriptions/html/wearable_n/sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/sd_wn.htm index ce7f04c..114fdf9 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/sd_wn.htm @@ -21,7 +21,7 @@
                                    -

                                    Wearable native

                                    +

                                    Wearable native

                                    Wearable Native Sample Descriptions

                                    @@ -102,7 +102,7 @@
                                  - + diff --git a/org.tizen.sampledescriptions/html/wearable_n/widget_animation_sd_wn.htm b/org.tizen.sampledescriptions/html/wearable_n/widget_animation_sd_wn.htm index 934cfa0..231ac0d 100644 --- a/org.tizen.sampledescriptions/html/wearable_n/widget_animation_sd_wn.htm +++ b/org.tizen.sampledescriptions/html/wearable_n/widget_animation_sd_wn.htm @@ -21,7 +21,7 @@
                                  -

                                  Wearable native

                                  +

                                  Wearable native

                                  Widget Animation Sample Overview

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/altimeter_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/altimeter_ww.htm index 4d4cf58..57f03db 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/altimeter_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/altimeter_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/analogwatch_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/analogwatch_ww.htm index 25cbe19..09773c6 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/analogwatch_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/analogwatch_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/appcalleecaller_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/appcalleecaller_ww.htm index 2e2fda9..d45ebba 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/appcalleecaller_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/appcalleecaller_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/basicwatch_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/basicwatch_ww.htm index e10b4f4..4aacd45 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/basicwatch_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/basicwatch_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/calculator_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/calculator_ww.htm index c446c82..3544fcc 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/calculator_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/calculator_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/calendar_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/calendar_ww.htm index 3e2a77a..feebaab 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/calendar_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/calendar_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/camera_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/camera_ww.htm index a8bf2fb..1797f5a 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/camera_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/camera_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/compass_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/compass_ww.htm index e8fc07f..74b927a 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/compass_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/compass_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/digitalwatch_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/digitalwatch_ww.htm index a52383a..1c2da1a 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/digitalwatch_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/digitalwatch_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/hellotizen_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/hellotizen_ww.htm index 0aab6c7..f85a50f 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/hellotizen_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/hellotizen_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/minigallery_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/minigallery_ww.htm index 3f778c6..57b8f5e 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/minigallery_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/minigallery_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/moneybook_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/moneybook_ww.htm index 48c216b..212450b 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/moneybook_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/moneybook_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/newsfeed_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/newsfeed_ww.htm index 0304a6a..916e3df 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/newsfeed_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/newsfeed_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/sd_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/sd_ww.htm index d9d80e6..a629ab6 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/sd_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/sd_ww.htm @@ -21,7 +21,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  Wearable Web Sample Descriptions

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/sensorball_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/sensorball_ww.htm index 5073b60..8067f24 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/sensorball_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/sensorball_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/spinning_arrow_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/spinning_arrow_ww.htm index fb1373f..8f3bfe9 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/spinning_arrow_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/spinning_arrow_ww.htm @@ -18,13 +18,13 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  Related Info

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/stopwatch_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/stopwatch_ww.htm index 7a0c448..6ed8229 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/stopwatch_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/stopwatch_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/sunburnmonitor_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/sunburnmonitor_ww.htm index dd77c7c..dc783f4 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/sunburnmonitor_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/sunburnmonitor_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/touchpaint_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/touchpaint_ww.htm index d545e40..6f3f6fe 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/touchpaint_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/touchpaint_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/voicerecorder_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/voicerecorder_ww.htm index 7bcc598..a068dda 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/voicerecorder_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/voicerecorder_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/wearableuicomponents_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/wearableuicomponents_ww.htm index 88526e7..bcb1a0d 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/wearableuicomponents_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/wearableuicomponents_ww.htm @@ -18,13 +18,13 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/html/wearable_w/worldclock_ww.htm b/org.tizen.sampledescriptions/html/wearable_w/worldclock_ww.htm index b4cb644..6814884 100644 --- a/org.tizen.sampledescriptions/html/wearable_w/worldclock_ww.htm +++ b/org.tizen.sampledescriptions/html/wearable_w/worldclock_ww.htm @@ -18,7 +18,7 @@
                                  -

                                  Wearable Web

                                  +

                                  Wearable Web

                                  diff --git a/org.tizen.sampledescriptions/index.xml b/org.tizen.sampledescriptions/index.xml index 78334f9..fb32366 100644 --- a/org.tizen.sampledescriptions/index.xml +++ b/org.tizen.sampledescriptions/index.xml @@ -32,6 +32,7 @@ + @@ -76,13 +77,15 @@ + + + - @@ -150,7 +153,7 @@ - + diff --git a/org.tizen.tutorials/html/images/mn_division.png b/org.tizen.tutorials/html/images/mn_division.png index 1f7e337..faecb28 100644 Binary files a/org.tizen.tutorials/html/images/mn_division.png and b/org.tizen.tutorials/html/images/mn_division.png differ diff --git a/org.tizen.tutorials/html/images/mobile_s_n.png b/org.tizen.tutorials/html/images/mobile_s_n.png new file mode 100644 index 0000000..ad8c779 Binary files /dev/null and b/org.tizen.tutorials/html/images/mobile_s_n.png differ diff --git a/org.tizen.tutorials/html/images/mobile_s_w.png b/org.tizen.tutorials/html/images/mobile_s_w.png new file mode 100644 index 0000000..f86df29 Binary files /dev/null and b/org.tizen.tutorials/html/images/mobile_s_w.png differ diff --git a/org.tizen.tutorials/html/images/mobile_s_w_optional.png b/org.tizen.tutorials/html/images/mobile_s_w_optional.png new file mode 100644 index 0000000..0434b73 Binary files /dev/null and b/org.tizen.tutorials/html/images/mobile_s_w_optional.png differ diff --git a/org.tizen.tutorials/html/images/mw_division.png b/org.tizen.tutorials/html/images/mw_division.png index 8fc3efa..c4a8655 100644 Binary files a/org.tizen.tutorials/html/images/mw_division.png and b/org.tizen.tutorials/html/images/mw_division.png differ diff --git a/org.tizen.tutorials/html/images/n_division.png b/org.tizen.tutorials/html/images/n_division.png index d687bc5..5a0b8f6 100644 Binary files a/org.tizen.tutorials/html/images/n_division.png and b/org.tizen.tutorials/html/images/n_division.png differ diff --git a/org.tizen.tutorials/html/images/w_division.png b/org.tizen.tutorials/html/images/w_division.png index 88d9959..443a1ea 100644 Binary files a/org.tizen.tutorials/html/images/w_division.png and b/org.tizen.tutorials/html/images/w_division.png differ diff --git a/org.tizen.tutorials/html/images/wearable_s_n.png b/org.tizen.tutorials/html/images/wearable_s_n.png new file mode 100644 index 0000000..02e3791 Binary files /dev/null and b/org.tizen.tutorials/html/images/wearable_s_n.png differ diff --git a/org.tizen.tutorials/html/images/wearable_s_w.png b/org.tizen.tutorials/html/images/wearable_s_w.png new file mode 100644 index 0000000..379a9c5 Binary files /dev/null and b/org.tizen.tutorials/html/images/wearable_s_w.png differ diff --git a/org.tizen.tutorials/html/images/wearable_s_w_optional.png b/org.tizen.tutorials/html/images/wearable_s_w_optional.png new file mode 100644 index 0000000..cef460c Binary files /dev/null and b/org.tizen.tutorials/html/images/wearable_s_w_optional.png differ diff --git a/org.tizen.tutorials/html/images/wn_division.png b/org.tizen.tutorials/html/images/wn_division.png index 11a7876..dca667f 100644 Binary files a/org.tizen.tutorials/html/images/wn_division.png and b/org.tizen.tutorials/html/images/wn_division.png differ diff --git a/org.tizen.tutorials/html/images/ww_division.png b/org.tizen.tutorials/html/images/ww_division.png index 65e7ab7..5f5160c 100644 Binary files a/org.tizen.tutorials/html/images/ww_division.png and b/org.tizen.tutorials/html/images/ww_division.png differ diff --git a/org.tizen.tutorials/html/index.htm b/org.tizen.tutorials/html/index.htm index 37f1d4b..3eab966 100644 --- a/org.tizen.tutorials/html/index.htm +++ b/org.tizen.tutorials/html/index.htm @@ -31,6 +31,7 @@ @@ -188,7 +189,7 @@ @@ -240,14 +241,21 @@ @@ -333,7 +341,7 @@
                                2. Connection
                                3. Bluetooth
                                4. NFC
                                5. -
                                6. SmartCard
                                7. +
                                8. Smartcard
                                9. Wi-Fi
                                10. Wi-Fi Direct
                                11. @@ -346,10 +354,9 @@
                                12. Social
                                13. System @@ -374,6 +381,7 @@
                                14. UI Framework
                                15. UIX diff --git a/org.tizen.tutorials/html/native/account/account_tutorial_n.htm b/org.tizen.tutorials/html/native/account/account_tutorial_n.htm new file mode 100644 index 0000000..1174046 --- /dev/null +++ b/org.tizen.tutorials/html/native/account/account_tutorial_n.htm @@ -0,0 +1,951 @@ + + + + + + + + + + + + + Account Manager: Managing Account Information on the Device + + + + + +
                                  + +

                                  Account Manager: Managing Account Information on the Device

                                  + + +

                                  This tutorial demonstrates how you can create, delete, and update accounts in the account database, and manage account information, such as user name, display name, domain name, and email address.

                                  + +

                                  Warm-up

                                  +

                                  Become familiar with the Account Manager API basics by learning about:

                                  + +

                                  Follow-up

                                  +

                                  Once we have learned the basics of the Account Manager API, we can now move on to more advanced tasks, including:

                                  + + +

                                  Initializing the Accounts

                                  + +

                                  To initialize the account manager:

                                  +
                                    +
                                  1. To use the functions and data types of the Account Manager API (in mobile and wearable applications), include the <account.h> header file in your application:

                                    +
                                    +#include <account.h>
                                    +
                                  2. +
                                  3. Declare the necessary global variables. To know whether a function has been executed properly, see that the return is equal to ACCOUNT_ERROR_NONE.

                                    + +
                                    +#include <stdio.h>
                                    +#include <time.h>
                                    +#include <dlog.h>
                                    +
                                    +static account_h account = NULL;
                                    +static int account_id = 0;
                                    +int ret = 0;
                                    +
                                  4. + +
                                  5. Set up the required privileges for your application:

                                    + +
                                      +
                                    • To use APIs for reading account data from the account database, add the http://tizen.org/privilege/account.read privilege to the manifest file. +
                                    • + +
                                    • To use APIs for writing account data from the account database, add the http://tizen.org/privilege/account.write privilege to the manifest file. +
                                    • + +
                                  + +

                                  Creating and Managing an Account

                                  + +

                                  To create an account, set its properties, and add it to the account database:

                                  + + +
                                    + +
                                  1. Create an account using the account_create() function and the previously defined account handle: + +
                                    +ret = account_create(&account);
                                    +
                                    +
                                  2. +
                                  3. When the account is created, you can set account properties, such as name, display name, domain name, and email address: + +
                                    +char* account_name = "Marcus";
                                    +char* display_name = "Marcus_display";
                                    +char* domain_name = "Marcus_domain";
                                    +char* email_address = "marcus@example.com";
                                    +char* image_path = "image_path";
                                    +
                                    +ret = account_set_user_name(account, account_name);
                                    +
                                    +ret = account_set_display_name(account, display_name);
                                    +
                                    +ret = account_set_domain_name(account, domain_name);
                                    +
                                    +ret = account_set_email_address(account, email_address);
                                    +
                                    +ret = account_set_icon_path(account, image_path);
                                    +
                                    +
                                  4. + +
                                  5. When the account is configured, use the account_insert_to_db() function to insert the account to the account database. Use the account ID as the second parameter (account_id): + +
                                    +ret = account_insert_to_db(account, &account_id);
                                    +
                                    +
                                  6. +
                                  + +

                                  Getting Account Information

                                  + +

                                  To get account information, such as user name, display name, domain name, and email address:

                                  + +
                                    +
                                  1. Use the account_get_total_count_from_db() function to get the total number of inserted records. +

                                    To get individual records, use the account_foreach_account_from_db() function, which iterates through all the records and invokes a callback function for each account:

                                    +
                                    +account_foreach_account_from_db(account_cb callback, void *user_data)
                                    +
                                    + +

                                    The function takes the following parameters:

                                    +
                                      +
                                    • callback: Callback function to be invoked
                                    • +
                                    • user_data: User data to be passed to the callback function
                                    • +
                                    + +
                                    +int total_count = -1;
                                    +ret = account_get_total_count_from_db(&total_count);
                                    +
                                    +ret = account_foreach_account_from_db(on_account_read, NULL);
                                    +
                                    +
                                  2. + +
                                  3. Define the callback function: +
                                    typedef bool(* account_cb)(account_h account, void *user_data)
                                    + +

                                    The callback function takes the following parameters:

                                    +
                                      +
                                    • account: Account handle
                                    • +
                                    • user_data: User data passed from the account_foreach_account_from_db() function
                                    • +
                                    + +

                                    This function retrieves information for each account.

                                    +
                                  4. +
                                  5. To get more details, use the account_get_account_id(), account_get_user_name(), account_get_display_name(), and account_get_icon_path() functions: + +
                                    +static bool 
                                    +on_account_read(account_h account, void *user_data)
                                    +{
                                    +   char *name = NULL;
                                    +   char *display_name = NULL;
                                    +   char *icon_path = NULL;
                                    +   // Get the account ID
                                    +   ret = account_get_account_id(account, &account_id);
                                    +   if (ret != ACCOUNT_ERROR_NONE)
                                    +   {
                                    +      // Error handling
                                    +      return false;
                                    +   }
                                    +   // Get the user name
                                    +   ret = account_get_user_name(account, &name);
                                    +   if (ret != ACCOUNT_ERROR_NONE)
                                    +   {
                                    +      // Error handling
                                    +      return false;
                                    +   }
                                    +   dlog_print(DLOG_INFO, LOG_TAG, "name: %s", name);
                                    +   // Get the display name
                                    +   ret = account_get_display_name(account, &display_name);
                                    +   if (ret != ACCOUNT_ERROR_NONE)
                                    +   {
                                    +      // Error handling
                                    +      return false;
                                    +   }
                                    +   dlog_print(DLOG_INFO, LOG_TAG, "display_name: %s", display_name);
                                    +   // Get the icon path
                                    +   ret = account_get_icon_path(account, &icon_path);
                                    +   if (ret != ACCOUNT_ERROR_NONE)
                                    +   {
                                    +      // Error handling
                                    +      return false;
                                    +   }
                                    +   dlog_print(DLOG_INFO, LOG_TAG, "icon_path: %s", icon_path);
                                    +
                                    +   free(name);
                                    +   free(display_name);
                                    +   free(icon_path);
                                    +
                                    +   return true;
                                    +}
                                    +
                                    +
                                  6. +
                                  + +

                                  Retrieving Accounts by Package Name

                                  + +

                                  To retrieve accounts by a specific account provider:

                                  +
                                    +
                                  1. Define the account_cb() callback for getting data of accounts as a parameter of the account_query_account_by_package_name() function: +
                                    +static bool 
                                    +account_callback(account_h account, void* user_data) // account_cb() callback
                                    +{
                                    +   // Called once for each account in the database
                                    +}
                                    +
                                  2. +
                                  3. Retrieve the accounts of a specific account provider using the account_query_account_by_package_name() function, and specifying the package name of the account provider: +
                                    int ret = -1;
                                    +char* package_name = "package_name";
                                    +ret = account_query_account_by_package_name(account_callback, package_name, NULL);
                                    +
                                  4. +
                                  + +

                                  Retrieving Account Providers by Capability

                                  + +

                                  To retrieve account providers by a specific capability:

                                  +
                                    +
                                  1. Define account_type_cb() callback for getting account providers as a parameter of the account_type_query_by_provider_feature() function. The callback takes the account provider handle as the first parameter. +
                                    +static bool 
                                    +account_type_callback(account_type_h account_type, void* user_data) // account_type_cb() callback
                                    +{
                                    +   // Called once for each account type in the database
                                    +}
                                    +
                                    +
                                  2. + +
                                  3. Retrieve the account providers of a specific capability by using the account_type_query_by_provider_feature() function: +
                                    +int ret = -1;
                                    +char* capability = "http://tizen.org/account/capability/contact";
                                    +
                                    +ret = account_type_create(&account_type);
                                    +
                                    +account_type_query_by_provider_feature(account_type_callback, capability, NULL);
                                    +
                                  4. +
                                  + +

                                  Removing an Account

                                  + +

                                  To remove an account, use the account_delete_from_db_by_id(), account_delete_from_db_by_user_name(), or account_delete_from_db_by_package_name() function. They all remove a given account record.

                                  + +
                                16. Demonstrates how you can implement a watch application.
                                  EvasGLCubeEvasGLCube Demonstrates how you can implement a cube that can be rotated on the screen through Evas_GL.
                                  + + + + + + + + +
                                  Note
                                  To get the ID needed as a parameter of the account_delete_from_db_by_id() function, use the account_get_account_id() function.
                                  + +
                                  +ret = account_delete_from_db_by_id(account_id);
                                  +
                                  + +

                                  Destroying the Account Handle

                                  + +

                                  To destroy the account handle, use the account_destroy() function:

                                  +
                                  +ret = account_destroy(account);
                                  +
                                  + +

                                  Adding an Application on the Account Screen

                                  + +

                                  To add your application on the Add account screen of the device:

                                  + +
                                    +
                                  1. Add the required information in the manifest file: +
                                    <account>
                                    +   <account-provider appid="app-id name" providerid="url style string" multiple-accounts-support="true or false">
                                    +      <icon section="account">application icon name</icon>
                                    +      <icon section="account-small">application small icon name</icon>
                                    +      <label>Application name</label>
                                    +      <label xml:lang="en-gb">Application name</label>
                                    +      <label xml:lang="ko-kr">ߖȃخʼnL݇ Lا</label>
                                    +      <capability>http://tizen.org/account/capability/contact</capability>
                                    +      <capability>http://tizen.org/account/capability/calendar</capability>
                                    +   </account-provider>
                                    +</account>
                                    + +

                                    The required information includes:

                                    +
                                    • appid="app-id name" +

                                      Application ID (for example, appid="org.tizen.account").

                                    • +
                                    • providerid="url style string" +

                                      Provider identification string (for example, providerid="http://www.tizen.org").

                                    • +
                                    • multiple-accounts-support="true or false" +

                                      Multiple account support (if your application can manage 2 or more accounts, set to true; otherwise set to false)

                                    • +
                                    • <icon section="account">application icon name</icon> +

                                      Icon displayed on the Add account screen.

                                      +

                                      The icon size must be 72x72 px and the icon file must be in the {app-root}\shared\res\ directory.

                                    • +
                                    • <icon section="account-small">application small icon name</icon> +

                                      Small icon displayed on the Other application screen to represent the account provider.

                                      +

                                      The small icon file must be in the {app-root}\shared\res\ directory.

                                    • +
                                    • <label xml:lang="en-gb">Application name</label> +

                                      Application name displayed on the Add account screen, according to the selected language.

                                      +

                                      An account provider must have at least one label tag.

                                    • +
                                    • <capability>http://tizen.org/account/capability/contact</capability> +

                                      For more information, see the Account Manager guide.

                                    +
                                  2. + +
                                  3. Create the sign-in screen UI. +

                                    When the user selects your application on the Add account screen, the Account Service launches your application with a specific operation ID (ACCOUNT_OPERATION_SIGNIN) defined in the account-types.h header file, so the sign-in screen must be displayed.

                                    + +

                                    Figure: Sign-in screen

                                    +

                                    Sign-in screen

                                    +
                                  4. +
                                  + + + + + + + + + + +
                                  Note
                                  For more information on operations and events, see the Account Manager guide.
                                  + +

                                  Performing Database Queries

                                  + +

                                  To perform database queries:

                                  + + +
                                    +
                                  1. Prepare sample content. +

                                    To perform queries, you need existing content in the database. To access the existing account, obtain it from the database. This can be done using a few functions, depending on the user requirements.

                                    +

                                    To create new content to the database:

                                    + +
                                    1. The Create_Account() function creates a new account from a given account_h handle and account details (name, display name, domain, e-mail). 3 capabilities are added to the account to demonstrate some of the query functions. The capabilities as well as user custom types can be predefined.

                                      + +

                                      After the account is created, it is added to the database. When no longer needed, destroy the account handle using the account_destroy(account) function.

                                      + +
                                      +int id[3];
                                      +static account_h account = NULL;
                                      +
                                      +Create_Account(&account, "Person", "DiplayPerson", "Person Domain", "someone1@somewho.com");
                                      +
                                      +account_set_capability(account, "Custom", ACCOUNT_CAPABILITY_ENABLED);
                                      +
                                      +account_set_capability(account, "Next", ACCOUNT_CAPABILITY_ENABLED);
                                      + 
                                      +account_set_capability(account, "Another", ACCOUNT_CAPABILITY_DISABLED);
                                      +
                                      +account_insert_to_db(account, &id[0]);
                                      +
                                      +account_destroy(account);
                                      +
                                    2. + +
                                    3. Add 2 more accounts to the database:

                                      + +
                                      +Create_Account(&account, "PersonX", "DisplayX", "Other Domain", "someone2@somewho.com");
                                      +account_insert_to_db(account, &id[1]);
                                      +
                                      +account_destroy(account);
                                      +
                                      +Create_Account(&account, "Human", "Humanity", "Everyone", "someone3@somewho.com");
                                      +
                                      +account_insert_to_db(account, &id[2]);
                                      +
                                      +account_destroy(account);
                                      +
                                      +Create_Account(&account, "LastOne", "LastDisplay", "Last Domain", "someone4@somewho.com");
                                      +account_insert_to_db(account, &id[3]);
                                      +account_destroy(account);
                                      +
                                      +
                                    4. + +
                                    5. Create an account. + +
                                      +static int 
                                      +Create_Account(account_h * account, char * account_name, char * display_name, char *  domain_name, char * email_address)
                                      +{
                                      +   account_create(account);
                                      +
                                      +   account_set_user_name(*account, account_name);
                                      +
                                      +   account_set_display_name(*account, display_name);
                                      +
                                      +   account_set_domain_name(*account, domain_name);
                                      +
                                      +   account_set_email_address(*account, email_address);
                                      +}
                                      +
                                    +
                                  2. + +
                                  3. List the accounts: +
                                    1. +

                                      List all accounts to verify the database insertion:

                                      + +
                                      +struct 
                                      +Account_Records
                                      +{
                                      +   int count;
                                      +   int tab[100];
                                      +};
                                      +
                                      +struct Account_Records rec;
                                      + 
                                      +List_Accounts(&rec);
                                      +
                                    2. + +
                                    3. When struct Account_Records* rec is not Null, List_Accounts counts all records in the database. Obtain the records using the account_foreach_account_from_db() function.

                                      + +
                                      +static void 
                                      +List_Accounts(struct Account_Records* rec)
                                      +{
                                      +   if (rec!=NULL)
                                      +   {
                                      +      rec->count=0;
                                      +   }
                                      +   account_foreach_account_from_db(on_account_read, rec);
                                      +}
                                      +
                                    4. + +
                                    5. Call the on_account_read() callback function for each found record. If void *user_data is not null, the function is counting the existing accounts. String data returned by the get functions has to be released with free. Data prepared with the sprint() function can, for example, be sent for stdout.

                                      + +
                                      +static bool 
                                      +on_account_read(account_h account, void *user_data)
                                      +{
                                      +   int account_id = 0;
                                      +   char *name = NULL;
                                      +   char *display_name = NULL;
                                      +   struct Account_Records * rec = (struct Account_Records *)user_data;
                                      +   char buf[100];
                                      +
                                      +   account_get_account_id(account, &account_id);
                                      +
                                      +   sprintf(buf,"MyCallback ID: %d\n", account_id);
                                      +
                                      +   if (user_data!=NULL)
                                      +   {
                                      +      rec->tab[rec->count++]=account_id;
                                      +   }
                                      +   account_get_user_name(account, &name);
                                      +   sprintf(buf,"MyCallback Name: %s\n", name);
                                      +
                                      +   free(name);
                                      +
                                      +   account_get_display_name(account, &display_name);
                                      +   sprintf(buf,"MyCallback Disp.: %s\n", display_name);
                                      +
                                      +   free(display_name);
                                      +
                                      +   return 0;
                                      +}
                                      +
                                    +
                                  4. +
                                  5. Query the account by its ID with the account_query_account_by_account_id() function. This function requires an existing handle to an account as an input parameter. + +
                                    +for (i=0; i<rec.count; i++)
                                    +{
                                    +   account_create(&account);
                                    +   account_query_account_by_account_id(rec.tab[i], &account);
                                    +
                                    +   Show_Account(account);
                                    +
                                    +   account_destroy(account);
                                    +}
                                    +
                                    +
                                  6. + +
                                  7. Show the account: + +
                                    +static int 
                                    +Show_Account(account_h acc)
                                    +{
                                    +   int account_id = 0;
                                    +   char *name = NULL;
                                    +   char *display_name = NULL;
                                    +   char buf[100];
                                    +
                                    +   account_get_account_id(acc, &account_id);
                                    +
                                    +   sprintf(buf,"Show_Account ID: %d\n", account_id);
                                    +
                                    +   account_get_user_name(acc, &name);
                                    +
                                    +   sprintf(buf,"Show_Account Name: %s\n", name);
                                    +
                                    +   free(name);
                                    +
                                    +   account_get_display_name(acc, &display_name);
                                    +
                                    +   sprintf(buf,"Show_Account Disp.: %s\n", display_name);
                                    +
                                    +   free(display_name);
                                    +
                                    +   return 0;
                                    +}
                                    +
                                    +
                                  8. + +
                                  9. Query the account by various attributes: +
                                    • Query by user name. +

                                      Querying data by user name requires providing a valid user name callback function. In this example, it is the same function as for for_each, but cast without the third parameter.

                                      + +
                                      +account_query_account_by_user_name(on_account_read, "Human", NULL);
                                      +
                                      +
                                    • + +
                                    • Query by package name. +

                                      By default, the accounts created in the application context have a package name set to the application name. Change it using the account_set_package_name() function. To list accounts by package name, the user can provide a name by itself or obtain it with the account_get_package_name() function.

                                      + +

                                      The account_query_account_by_package_name() function requires a callback function and a package name. In addition, the user data can be passed to the callback function as a third parameter.

                                      + +

                                      The package name has to be released when no longer needed.

                                      + +
                                      +char * package_name;
                                      +account_get_package_name(account, &package_name);
                                      +account_query_account_by_package_name(on_account_read, package_name, NULL);
                                      +free(package_name);
                                      +
                                      +
                                    • + +
                                    • Query by capability. +

                                      The following function allows the user to find all accounts with a specified capability on a specified state. Once again, the callback function is required.

                                      + +
                                      +account_query_account_by_capability(on_account_read, "Custom", ACCOUNT_CAPABILITY_ENABLED, NULL);
                                      +
                                      +
                                    • + +
                                    • Query by capability type. +

                                      This function is similar to the account_query_account_by_capability() function, but returns all accounts with a specified capability, without checking its state.

                                      + +
                                      +account_query_account_by_capability_type(on_account_read, "Next", NULL);
                                      +
                                      +
                                    • + +
                                    • Query capability by account ID. +

                                      The account_query_capability_by_account_id() function is different from the previous functions. It lists all capabilities from an account with a specified ID. In this case it requires a different type of callback, as listed below.

                                      + +
                                      +account_query_capability_by_account_id(_capability_cb, id[0], NULL);
                                      +
                                      + +

                                      The callback function prepares data to be sent to an output.

                                      + +
                                      +static bool 
                                      +_capability_cb(const char *capability_type, account_capability_state_e capability_state, void *user_data)
                                      +{
                                      +   char buf[200];
                                      +   sprintf(buf,"Found capability: %s on state %d\n", capability_type, capability_state);
                                      +
                                      +   return true;
                                      +}
                                      +
                                      +
                                  10. + +
                                  11. Destroy all account handles when they are no longer needed: + +
                                    +account_destroy(account);
                                    +
                                    +
                                  12. +
                                  + +

                                  Managing Account Secrecy

                                  + +

                                  To manage account secrecy:

                                  +
                                    +
                                  1. Select the secrecy level using the account_secrecy_state_e enumeration (in mobile and wearable applications): + +
                                    +static 
                                    +account_h account = NULL;
                                    +account_secrecy_state_e secret;
                                    + 
                                    +char buf[200];
                                    +int ret;
                                    +int id;
                                    +
                                    +// Account 1
                                    +Create_Account(&account, "Security 1", "Invalid", "NOBODY", "anony@mous.not");
                                    +
                                    +account_set_secret(account, ACCOUNT_SECRECY_INVALID);
                                    +
                                    +account_get_secret(account, &secret);
                                    +
                                    +account_insert_to_db(account, &id);
                                    +
                                    +sprintf(buf,"Account 1 secret: %d\n", secret);
                                    +
                                    +account_destroy(account);
                                    +
                                    +// Account 2
                                    +
                                    +Create_Account(&account, "Security 2", "Invisible", " NOBODY", "anony1@mous.not");
                                    +
                                    +account_set_secret(account, ACCOUNT_SECRECY_INVISIBLE);
                                    +
                                    +account_get_secret(account, &secret);
                                    +
                                    +account_insert_to_db(account, &id);
                                    +
                                    +sprintf(buf, " Account 2 secret: %d\n", secret);
                                    +
                                    +account_destroy(account);
                                    +
                                    +// Account 3
                                    +
                                    +Create_Account(&account, "Secret 3", "Visible", " NOBODY", "anony2@mous.not");
                                    +
                                    +ret = account_set_secret(account, ACCOUNT_SECRECY_VISIBLE);
                                    +
                                    +ret = account_get_secret(account, &secret);
                                    +
                                    +ret = account_insert_to_db(account, &id);
                                    +
                                    +sprintf(buf," Account 3 secret: %d\n", secret);
                                    +
                                    +account_destroy(account);
                                    +
                                    +List_Accounts(NULL);
                                    +
                                    + +

                                    Secrecy is linked only with visibility on the account settings screen. The account is still visible and can be accessed using a query or the for_each function. For further information on how to add your application to the account screen, see Adding an Application on the Account Screen.

                                    + +
                                    +// List_Account() console output
                                    +MyCallback ID: 12
                                    +MyCallback Name: Security 1
                                    +MyCallback Disp.: Invalid
                                    +-------------------
                                    +MyCallback ID: 13
                                    +MyCallback Name: Security 2
                                    +MyCallback Disp.: Invisible
                                    +-------------------
                                    +MyCallback ID: 14
                                    +MyCallback Name: Secret 3
                                    +MyCallback Disp.: Visible
                                    +
                                    +
                                  2. + +
                                  3. Destroy all account handles when they are no longer needed: + +
                                    +account_destroy(account);
                                    +
                                    +
                                  4. +
                                  + +

                                  Updating Accounts

                                  + +

                                  To update and track account data:

                                  + +
                                    +
                                  1. Subscribe notifications to track account changes. Create an account_subscribe_h instance and register a notification. + +
                                    +account_subscribe_h account_subscribe;
                                    +
                                    +account_subscribe_create(&account_subscribe);
                                    +
                                    +account_subscribe_notification(account_subscribe, _account_event_cb, NULL);
                                    +
                                    +
                                  2. + +
                                  3. Create an account. Accounts are created and then their handles are destroyed. The package name is obtained from the second account. + +
                                    +Create_Account(&account, "Updater", "Updated?", "ToUpdate", "not.up@to.date");
                                    +account_insert_to_db(account, &id);
                                    +
                                    +Show_Account(account);
                                    +account_destroy(account);
                                    +
                                    +Create_Account(&account, "Another", "Updated?", "ToUpdate", "not.up@to.date");
                                    +account_insert_to_db(account, &id);
                                    +
                                    +account_get_package_name(account, &package_name);
                                    +sprintf(buf, "Package_name: %s\n", package_name);
                                    +
                                    +Show_Account(account);
                                    +account_destroy(account);
                                    +
                                    +
                                  4. + +
                                  5. Update the account: +
                                    • To update an account by its ID:

                                      +
                                        +
                                      1. Create a handle to the account.
                                      2. +
                                      3. Get the account from the database (also possible by ID).
                                      4. +
                                      5. Make the necessary changes.
                                      6. +
                                      7. Update the account using the account handle and a valid ID.
                                      8. +
                                      9. Destroy the account handle.
                                      10. +
                                      + +
                                      +account_create(&account);
                                      +account_query_account_by_account_id(id, &account);
                                      +account_set_display_name(account, "Updated!");
                                      +account_update_to_db_by_id(account, id);
                                      +account_destroy(account);
                                      +
                                      +
                                    • + +
                                    • To update an account by its user name: +
                                        +
                                      1. Create a handle to the account.
                                      2. +
                                      3. Get the account from the database (also by ID).
                                      4. +
                                      5. Make the necessary changes.
                                      6. +
                                      7. Update the account using the account handle, a valid user name, and a package name. There can be accounts with the same user names in different packages.
                                      8. +
                                      9. Destroy the account handle.
                                      10. +
                                      + +
                                      +account_create(&account);
                                      +account_query_account_by_account_id(id, &account);
                                      +account_set_display_name(account, "Updated!");
                                      +account_update_to_db_by_user_name(account, "Another", package_name);
                                      +account_destroy(account);
                                      +
                                    +
                                  6. + +
                                  7. Create the account event callback. When any action is taking place on any account when a notification is subscribed, a callback function is invoked. The callback function provides in its parameters the event type as a string, the ID of the account associated with the actual change, and, additionally, the user data registered while subscribing the notification. + +
                                    +bool 
                                    +_account_event_cb(const char *event_type, int account_id, void *user_data)
                                    +{
                                    +   char buf[200];
                                    +
                                    +   sprintf(buf, "ACCOUNT EVENT: %s, %d\n", event_type, account_id);
                                    +
                                    +   return true;
                                    +}
                                    +
                                    +
                                  8. + +
                                  9. Show the accounts to verify the updates: + +
                                    +account_create(&account);
                                    +account_query_account_by_account_id(id, &account);
                                    +Show_Account(account);
                                    +account_destroy(account);
                                    +
                                    +
                                  10. + +
                                  11. Unsubscribe the notification when no longer needed: + +
                                    +account_unsubscribe_notification(account_subscribe);
                                    +
                                    +
                                  12. +
                                  + +

                                  Retrieving Account Types

                                  + +

                                  To retrieve account types:

                                  + +
                                    +
                                  1. Create a handle to operate on the account type: + +
                                    +account_type_h account_type;
                                    +
                                    +account_type_create(&account_type);
                                    +
                                    +
                                  2. + +
                                  3. Get the type information. +

                                    If the account type with a specified ID exists, you can get it from the database with the account_query_by_app_id() function.

                                    + +

                                    It is possible to set, for example:

                                    +
                                      +
                                    • ID
                                    • +
                                    • Labels
                                    • +
                                    • Features
                                    • +
                                    • Multiple account support (this is only a flag)
                                    • +
                                    + +

                                    To get the account types by the application ID, use the account_type_query_by_app_id() function.

                                    + +
                                    +int multiple_account_support = -1;
                                    +char *your_app_id = "com.tizen.example"; // App ID for retrieving account types
                                    +char *app_id = NULL;
                                    +char *provider_feature = NULL;
                                    +char *icon_path = NULL;
                                    +
                                    +if (account_type_query_app_id_exist(your_app_id))
                                    +{
                                    +   account_type_query_by_app_id(your_app_id, &account_type);
                                    +
                                    +   account_type_get_app_id(account_type, &app_id);
                                    +
                                    +   account_type_get_multiple_account_support(account_type, &multiple_account_support);
                                    +
                                    +   account_type_get_icon_path(account_type, &icon_path);
                                    +
                                    +   account_type_get_provider_feature(account_type, &provider_feature);
                                    +}
                                    +
                                    +
                                  4. + +
                                  5. List the account types or all the labels from a specified type with a proper callback function: + +
                                    +account_type_foreach_account_type_from_db(_account_type_cb, NULL);
                                    +
                                    +account_type_query_label_by_app_id(_account_label_cb, type_id, NULL);
                                    +
                                    + +

                                    While listing the labels, the user has access to the ID of the account type, label and its local value, and the user data passed while casting the query function.

                                    + +
                                    +bool 
                                    +_account_label_cb(char *app_id, char *label, char *locale, void *user_data)
                                    +{
                                    +   char buf[200];
                                    +
                                    +   sprintf(buf,"Get Label ID: %s LABEL: %s LOCALE %s\n", app_id, label, locale);
                                    +
                                    +   return true;
                                    +}
                                    +
                                    + +

                                    The account type callback has access to the account type and user data.

                                    + +
                                    +bool 
                                    +_account_type_cb(account_type_h account_type, void *user_data)
                                    +{
                                    +   char * id;
                                    +   int support;
                                    +   char buf[200];
                                    +
                                    +   account_type_get_app_id(account_type, &id);
                                    +
                                    +   account_type_get_multiple_account_support(account_type, &support);
                                    +   sprintf(buf,"Account Type ID: %s Multiple support %d:\n", id, support);
                                    +
                                    +   return true;
                                    +}
                                    +
                                    +
                                  6. + +
                                  7. Clean up and destroy the allocated handles: + +
                                    +free(app_id);
                                    +free(provider_feature);
                                    +free(icon_path);
                                    +
                                    +account_type_destroy(account_type);
                                    +
                                    +
                                  8. +
                                  + + + + +
                                  + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.tutorials/html/native/account/account_tutorials_n.htm b/org.tizen.tutorials/html/native/account/account_tutorials_n.htm index 1c62475..38b60d4 100644 --- a/org.tizen.tutorials/html/native/account/account_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/account/account_tutorials_n.htm @@ -16,7 +16,7 @@
                                  -

                                  Mobile native Wearable native

                                  +

                                  Mobile native Wearable native

                                  Related Info

                                  @@ -34,8 +34,9 @@

                                  The account tutorials demonstrate how to use the following features in creating Tizen native applications:

                                  The following tutorials apply in mobile applications only:

                                  diff --git a/org.tizen.tutorials/html/native/account/oauth2_tutorial_n.htm b/org.tizen.tutorials/html/native/account/oauth2_tutorial_n.htm index 5a4400b..16e3d65 100644 --- a/org.tizen.tutorials/html/native/account/oauth2_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/account/oauth2_tutorial_n.htm @@ -10,62 +10,62 @@ - oauth2: Using the Authorization Framework + OAuth 2.0: Using the Authorization Framework
                                  -

                                  oauth2: Using the Authorization Framework

                                  +

                                  OAuth 2.0: Using the Authorization Framework

                                  -

                                  This tutorial demonstrates how you can create a request for oauth2 authentication and authorization grant from a server, obtain an access token using the manager handle, and retrieve this info from the response handle returned in the callback.

                                  +

                                  This tutorial demonstrates how you can create a request for OAuth 2.0 authentication and authorization grant from a server, obtain an access token using the manager handle, and retrieve this info from the response handle returned in the callback.

                                  Warm-up

                                  -

                                  Become familiar with the oauth2 API basics by learning about:

                                  +

                                  Become familiar with the OAuth 2.0 API basics by learning about:

                                  -

                                  Initializing the oauth2 Manager

                                  +

                                  Initializing the OAuth 2.0 Manager

                                  -

                                  To initialize the oauth2 manager:

                                  +

                                  To initialize the OAuth 2.0 manager:

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

                                    +
                                  2. To use the functions and data types of the OAuth 2.0 API (in mobile and wearable applications), include the <oauth2.h> header file in your application:

                                     #include <oauth2.h>
                                     
                                  3. @@ -78,23 +78,23 @@ ret = oauth2_manager_create(&mgr)
                                17. Set up the required privileges for your application:

                                  -

                                  To use APIs for oauth2 authentication and connecting to the Web servers, add the http://tizen.org/privilege/internet privilege to the manifest file.

                                18. +

                                  To use APIs for OAuth 2.0 authentication and connecting to the Web servers, add the http://tizen.org/privilege/internet privilege to the manifest file.

                                -

                                Creating and Managing an oauth2 Request

                                +

                                Creating and Managing an OAuth 2.0 Request

                                -

                                To make a request with the oauth2 manager:

                                +

                                To make a request with the OAuth 2.0 manager:

                                  -
                                1. Create an oauth2_request_h request handle and use the oauth2_request_create() function to create the oauth2 request: +
                                2. Create an oauth2_request_h request handle and use the oauth2_request_create() function to create the OAuth 2.0 request:
                                   oauth2_request_h request = NULL;
                                   ret = oauth2_request_create(&request);
                                   
                                3. -
                                4. Set the parameters needed for making an oauth2 request. +
                                5. Set the parameters needed for making an OAuth 2.0 request.

                                  You can set various request properties, such as end points for authentication and token, grant type, user name, and password.

                                  @@ -169,7 +169,7 @@ request_auth_code(void)
                                      ret = oauth2_request_create(&request);
                                   
                                      // Set all the required parameters needed as per the Web server's
                                  -   // oauth2 authentication policy before making the request
                                  +   // OAuth 2.0 authentication policy before making the request
                                   
                                      // Set the response_type as "code"
                                      ret = oauth2_request_set_response_type(request, OAUTH2_RESPONSE_TYPE_CODE);
                                  @@ -205,7 +205,7 @@ request_auth_code(void)
                                      ret = oauth2_request_create(&request);
                                   
                                      // Set all the required parameters needed as per the Web server's
                                  -   // oauth2 authentication policy before making the request
                                  +   // OAuth 2.0 authentication policy before making the request
                                   
                                      ret = oauth2_request_set_auth_end_point_url(request, "https://login.live.com/oauth20_authorize.srf");
                                   
                                  @@ -291,7 +291,7 @@ request_access_token(void)
                                      ret = oauth2_request_create(&request);
                                   
                                      // Set all the required parameters needed as per the Web server's
                                  -   // oauth2 authentication policy before making the request
                                  +   // OAuth 2.0 authentication policy before making the request
                                   
                                      ret = oauth2_request_set_auth_end_point_url(request, "https://www.facebook.com/dialog/oauth");
                                   
                                  @@ -308,7 +308,7 @@ request_access_token(void)
                                         ret = oauth2_manager_request_token(mgr, request, token_response_cb, request);
                                         if (ret != OAUTH2_ERROR_NONE)
                                         { 
                                  -         dlog_print(DLOG_ERROR, LOG_TAG , "Access Token request failed"); 
                                  +         dlog_print(DLOG_ERROR, LOG_TAG, "Access Token request failed"); 
                                         }
                                      }
                                   }
                                  @@ -348,7 +348,7 @@ refresh_token_response_cb(oauth2_response_h response, void* user_data)
                                         int ret = oauth2_request_create(&request);
                                   
                                         // Set all the required parameters needed as per the Web server's
                                  -      // oauth2 authentication policy before making the request
                                  +      // OAuth 2.0 authentication policy before making the request
                                   
                                         ret = oauth2_request_set_refresh_token_url(request, "https://www.googleapis.com/oauth2/v3/token");
                                   
                                  @@ -379,7 +379,7 @@ request_access_token(void)
                                      ret = oauth2_request_create(&request);
                                   
                                      // Set all the required parameters needed as per the Web server's
                                  -   // oauth2 authentication policy before making the request
                                  +   // OAuth 2.0 authentication policy before making the request
                                   
                                      ret = oauth2_request_set_auth_end_point_url(request, "https://accounts.google.com/o/oauth2/auth");
                                   
                                  @@ -404,11 +404,11 @@ request_access_token(void)
                                   
                            -

                            Managing an oauth2 Response

                            +

                            Managing an OAuth 2.0 Response

                            The response from the server is bundled in the oauth2_response_h handle and returned in the callbacks, from which all the various response parameters can be obtained.

                            -

                            To manage the oauth2 response:

                            +

                            To manage the OAuth 2.0 response:

                            1. Retrieve the response parameters from the response handle. @@ -462,7 +462,7 @@ ret = oauth2_response_destroy(response);

                              Releasing the Resources

                              -

                              To free the oauth2 manager handle, use the oauth2_manager_destroy() function:

                              +

                              To free the OAuth 2.0 manager handle, use the oauth2_manager_destroy() function:

                               ret = oauth2_manager_destroy(mgr);
                              diff --git a/org.tizen.tutorials/html/native/account/sync_manager_tutorial_n.htm b/org.tizen.tutorials/html/native/account/sync_manager_tutorial_n.htm
                              index 340dc2b..dd91e3d 100644
                              --- a/org.tizen.tutorials/html/native/account/sync_manager_tutorial_n.htm
                              +++ b/org.tizen.tutorials/html/native/account/sync_manager_tutorial_n.htm
                              @@ -18,7 +18,7 @@
                               
                               
                              -

                              Mobile native

                              +

                              Mobile native

                              Content

                              @@ -26,7 +26,7 @@
                            2. Initializing the On-demand Sync
                            3. Initializing the Periodic Sync
                            4. Initializing the Data Change Sync
                            5. -
                            6. Initializing the ForEach Sync
                            7. +
                            8. Initializing the ForEach Sync
                            9. Sync adapter
                              • Setting the Callback Functions
                              • @@ -46,17 +46,7 @@

                                This tutorial demonstrates how you can manage the data synchronizing schedule and control the sync operations manually or periodically.

                                - - - - - - - - - -
                                Note
                                These features are supported in mobile applications only. To use the features of the Sync Manager API, Setting the Callback Functions should be carried out first by a service application.
                                An UI application can not initialize and set callbacks through using the Sync Adapter API. On the contrary, the Sync Manager API should be called to request sync operations by UI application.
                                - +

                                This feature is supported in mobile applications only. To use the Sync Manager API features, the service application must first set the callback functions. A UI application cannot initialize and set callbacks through the Sync Adapter API. On the contrary, the UI application must call the Sync Manager API to request sync operations.

                                Warm-up

                                Become familiar with the Sync Manager API basics by learning about:

                                @@ -65,10 +55,10 @@

                                Add an on-demand sync job scheduling for a one-time operation.

                              • Initializing the Periodic Sync

                                Add a periodic sync job scheduling with a recurring cycle.

                              • -
                              • Initializing the Data Change Sync -

                                Add a data change sync job for receiving notification whenever a specific DB changed.

                              • -
                              • Initializing the ForEach Sync -

                                Iterate all of registered sync jobs for managing them more efficiently.

                              • +
                              • Initializing the Data Change Sync +

                                Add a data change sync job for receiving a notification whenever a specific database change occurs.

                              • +
                              • Initializing the ForEach Sync +

                                Iterate all the registered sync jobs for managing them more efficiently.

                              • Sync adapter -

                                Initializing the On-demand Sync

                                -

                                To inform a service application of the time to operate one-time sync job:

                                +

                                To inform a service application of the time to operate a one-time sync job:

                                  -
                                1. Set the sync adapter callbacks in your service application first: +
                                2. Set the sync adapter callbacks in the service application first:
                                   #include <sync_adapter.h>
                                   
                                  @@ -93,16 +82,17 @@ result = sync_adapter_set_callbacks(on_start_cb, on_cancel_cb);
                                   
                                3. To use the features of the Sync Manager API, include the <sync_manager.h> header file in your UI application: -
                                  + 
                                   #include <sync_manager.h>
                                  -
                                  -
                                4. +
                            10. -
                            11. If you want to use an account, create the account and obtain some parameters which are used to call sync_manager_on_demand_sync_job() like below:

                              For more information, see Creating and Managing an Account and Managing and Using the Bundle Content.

                              +
                            12. If you want to use an account, create the account and obtain the parameters that are used to call the sync_manager_on_demand_sync_job() function. +

                              For more information, see Creating and Managing an Account and Managing and Using the Bundle Content.

                               account_h account = NULL;
                               int account_id = -1;
                              +
                               account_create(&account);
                               account_set_user_name(account, "test_name");
                               account_set_email_address(account, "test_email@samsung.com");
                              @@ -110,36 +100,46 @@ account_set_package_name(account, "data-sync-module");
                               account_set_sync_support(account, ACCOUNT_SUPPORTS_SYNC);
                               account_insert_to_db(account, &account_id);
                               
                              -const char *sync_job_name = "on_demand_sync_job";
                              +const char *sync_job_name = "on_demand_sync_job";
                               
                               bundle *sync_job_user_data = NULL;
                               sync_job_user_data = bundle_create();
                              -bundle_add_str(sync_job_user_data, "str", "String sync_job_user_data sample.");
                              +bundle_add_str(sync_job_user_data, "str", "String sync_job_user_data sample.");
                               
                               int sync_job_id = -1;
                               
                            13. -
                            14. To add an on-demand sync job: +
                            15. Add an on-demand sync job:
                              -result = sync_manager_on_demand_sync_job(account, sync_job_name, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              +result = sync_manager_on_demand_sync_job(account, sync_job_name, SYNC_OPTION_NONE, 
                              +                                         sync_job_user_data, &sync_job_id);
                               
                              -

                              This API can be used with different options each other. Below example shows the API is called with a variety of sync options. The SYNC_OPTION_NO_RETRY means a sync job will not be performed again when it fails. The SYNC_OPTION_EXPEDITED means another sync job will be operated as soon as possible. Of course, the value which is OR-ing let the other sync job operate just once with priority.

                              +

                              This function can be used with various options. The following example shows the function called with a variety of sync options. The SYNC_OPTION_NO_RETRY option means the sync job is not performed again when it fails. The SYNC_OPTION_EXPEDITED option means the another sync job is operated as soon as possible. The call with the OR structure lets the other sync job operate just once with priority.

                              +
                              -result = sync_manager_on_demand_sync_job(account, sync_job_name2, SYNC_OPTION_NO_RETRY, sync_job_user_data, &sync_job_id2);
                              -result = sync_manager_on_demand_sync_job(account, sync_job_name3, SYNC_OPTION_EXPEDITED, sync_job_user_data, &sync_job_id3);
                              -result = sync_manager_on_demand_sync_job(account, sync_job_name4, (SYNC_OPTION_NO_RETRY | SYNC_OPTION_EXPEDITED), sync_job_user_data, &sync_job_id4);
                              +result = sync_manager_on_demand_sync_job(account, sync_job_name2, SYNC_OPTION_NO_RETRY, 
                              +                                         sync_job_user_data, &sync_job_id2);
                              +result = sync_manager_on_demand_sync_job(account, sync_job_name3, SYNC_OPTION_EXPEDITED, 
                              +                                         sync_job_user_data, &sync_job_id3);
                              +result = sync_manager_on_demand_sync_job(account, sync_job_name4, 
                              +                                         (SYNC_OPTION_NO_RETRY | SYNC_OPTION_EXPEDITED), 
                              +                                         sync_job_user_data, &sync_job_id4);
                               
                              -

                              This API also can be called like below. Because, account handle and sync_job_user_data are not mandatory data:

                              +

                              This function can also be called like in the following example, because the account handle and user data are not mandatory.

                              -result = sync_manager_on_demand_sync_job(NULL, sync_job_name, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              -result = sync_manager_on_demand_sync_job(account, sync_job_name2, SYNC_OPTION_NO_RETRY, NULL, &sync_job_id2);
                              -result = sync_manager_on_demand_sync_job(NULL, sync_job_name3, SYNC_OPTION_EXPEDITED, NULL, &sync_job_id3);
                              +result = sync_manager_on_demand_sync_job(NULL, sync_job_name, SYNC_OPTION_NONE, 
                              +                                         sync_job_user_data, &sync_job_id);
                              +result = sync_manager_on_demand_sync_job(account, sync_job_name2, SYNC_OPTION_NO_RETRY, 
                              +                                         NULL, &sync_job_id2);
                              +result = sync_manager_on_demand_sync_job(NULL, sync_job_name3, SYNC_OPTION_EXPEDITED, 
                              +                                         NULL, &sync_job_id3);
                               

                              If the on-demand sync job addition process succeeds, the SYNC_ERROR_NONE value is returned.

                            16. -
                            17. When the on-demand sync is no longer needed, remove it with the sync_manager_remove_sync_job() API with its sync_job_id. If you want to stop using the account too, clean up the account handle.

                              At the end, unset the sync callbacks and release the resources with the sync_adapter_unset_callbacks() API.

                              +
                            18. When the on-demand sync is no longer needed, remove it with the sync_manager_remove_sync_job() function with its sync_job_id. If you want to stop using the account too, clean up the account handle. +

                              At the end, unset the sync callbacks and release the resources with the sync_adapter_unset_callbacks() function.

                               result = sync_manager_remove_sync_job(sync_job_id);
                               
                              @@ -156,11 +156,10 @@ sync_adapter_unset_callbacks();
                               
                            - - +

                            Initializing the Periodic Sync

                            -

                            To inform periodically a service application of the time to operate sync job with its sync interval:

                            +

                            To inform periodically a service application of the time to operate a sync job with its sync interval:

                            1. Set the sync adapter callbacks in your service application first: @@ -178,8 +177,8 @@ result = sync_adapter_set_callbacks(on_start_cb, on_cancel_cb);
                            2. -
                            3. If you want to use an account, create the account and obtain some parameters which are used to call sync_manager_add_periodic_sync_job() like below:

                              For more information, see Creating and Managing an Account and Managing and Using the Bundle Content.

                              - +
                            4. If you want to use an account, create the account and obtain the parameters that are used to call the sync_manager_add_periodic_sync_job() function. +

                              For more information, see Creating and Managing an Account and Managing and Using the Bundle Content.

                               account_h account = NULL;
                               int account_id = -1;
                              @@ -190,7 +189,7 @@ account_set_package_name(account, "data-sync-module");
                               account_set_sync_support(account, ACCOUNT_SUPPORTS_SYNC);
                               account_insert_to_db(account, &account_id);
                               
                              -const char *sync_job_name = "periodic_sync_job";
                              +const char *sync_job_name = "periodic_sync_job";
                               
                               sync_period_e sync_period = SYNC_PERIOD_INTERVAL_30MIN;
                               sync_period_e sync_period2 = SYNC_PERIOD_INTERVAL_1H;
                              @@ -199,40 +198,52 @@ sync_period_e sync_period4 = SYNC_PERIOD_INTERVAL_6H;
                               
                               bundle *sync_job_user_data = NULL;
                               sync_job_user_data = bundle_create();
                              -bundle_add_str(sync_job_user_data, "str", "String sync_job_user_data sample.");
                              +bundle_add_str(sync_job_user_data, "str", "String sync_job_user_data sample.");
                               
                               int sync_job_id = -1;
                               
                            5. - -
                            6. This API will operate sync job with given period interval. To add a periodic sync job with interval as 30 minutes: +
                            7. Add an periodic sync job with an interval as 30 minutes. +

                              This function operates sync job with the given period interval.

                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name, sync_period, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name, sync_period, SYNC_OPTION_NONE, 
                              +                                            sync_job_user_data, &sync_job_id);
                               
                              -

                              This API can be used with different options each other. Below example shows the API is called with a variety of sync options. The SYNC_OPTION_NO_RETRY means a sync job will not be performed again when it fails. The SYNC_OPTION_EXPEDITED means another sync job will be operated as soon as possible. Of course, the value which is OR-ing let the other sync job operate just once with priority.

                              +

                              This function can be used with various options. The following example shows the function called with a variety of sync options. The SYNC_OPTION_NO_RETRY option means a sync job is not performed again when it fails. The SYNC_OPTION_EXPEDITED option means another sync job is operated as soon as possible. The call with the OR structure lets the other sync job operate just once with priority.

                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name2, sync_period2, SYNC_OPTION_NO_RETRY, sync_job_user_data, &sync_job_id2);
                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name3, sync_period3, SYNC_OPTION_EXPEDITED, sync_job_user_data, &sync_job_id3);
                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name4, sync_period4, (SYNC_OPTION_NO_RETRY | SYNC_OPTION_EXPEDITED), sync_job_user_data, &sync_job_id4);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name2, sync_period2, SYNC_OPTION_NO_RETRY, 
                              +                                            sync_job_user_data, &sync_job_id2);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name3, sync_period3, SYNC_OPTION_EXPEDITED, 
                              +                                            sync_job_user_data, &sync_job_id3);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name4, sync_period4, 
                              +                                            (SYNC_OPTION_NO_RETRY | SYNC_OPTION_EXPEDITED), 
                              +                                            sync_job_user_data, &sync_job_id4);
                               
                              -

                              This API also can be called like below. Because, account handle and sync_job_user_data are not mandatory data:

                              +

                              This function can also be called like in the following example, because the account handle and user data are not mandatory.

                              -result = sync_manager_add_periodic_sync_job(NULL, sync_job_name, sync_period, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name2, sync_period2, SYNC_OPTION_NO_RETRY, NULL, &sync_job_id2);
                              -result = sync_manager_add_periodic_sync_job(NULL, sync_job_name3, sync_period3, SYNC_OPTION_EXPEDITED, NULL, &sync_job_id3);
                              +result = sync_manager_add_periodic_sync_job(NULL, sync_job_name, sync_period, SYNC_OPTION_NONE, 
                              +                                            sync_job_user_data, &sync_job_id);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name2, sync_period2, SYNC_OPTION_NO_RETRY, 
                              +                                            NULL, &sync_job_id2);
                              +result = sync_manager_add_periodic_sync_job(NULL, sync_job_name3, sync_period3, SYNC_OPTION_EXPEDITED, 
                              +                                            NULL, &sync_job_id3);
                               

                              If the periodic sync job addition process succeeds, the SYNC_ERROR_NONE value is returned.

                            8. -
                            9. This API can renew registered periodic sync job by using sync_job_name as same like below: +
                            10. The sync_manager_add_periodic_sync_job() function can renew a registered periodic sync job by using the same sync_job_name as before:
                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name, sync_period, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              -result = sync_manager_add_periodic_sync_job(account, sync_job_name, sync_period2, SYNC_OPTION_EXPEDITED, sync_job_user_data2, &sync_job_id);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name, sync_period, SYNC_OPTION_NONE, 
                              +                                            sync_job_user_data, &sync_job_id);
                              +result = sync_manager_add_periodic_sync_job(account, sync_job_name, sync_period2, SYNC_OPTION_EXPEDITED, 
                              +                                            sync_job_user_data2, &sync_job_id);
                               
                              -All the settings of the API can be reset except sync_job_name and sync_job_id which are used to manage a specific sync job. +

                              All the function parameters can be reset except sync_job_name and sync_job_id, which are used to manage a specific sync job.

                            11. -
                            12. When the periodic sync is no longer needed, remove it with the sync_manager_remove_sync_job() API with its sync_job_id. If you want to stop using the account too, clean up the account handle.

                              At the end, unset the sync callbacks and release the resources with the sync_adapter_unset_callbacks() API.

                              +
                            13. When the periodic sync is no longer needed, remove it with the sync_manager_remove_sync_job() function with its sync_job_id. If you want to stop using the account too, clean up the account handle. +

                              At the end, unset the sync callbacks and release the resources with the sync_adapter_unset_callbacks() function.

                              +
                               result = sync_manager_remove_sync_job(sync_job_id);
                               
                              @@ -253,7 +264,7 @@ sync_adapter_unset_callbacks();
                               
                               

                              Initializing the Data Change Sync

                              -

                              To inform a service application of the time to operate sync job whenever corresponding DB changed:

                              +

                              To inform a service application of the time to operate a sync job whenever a corresponding database change occurs:

                              1. Set the sync adapter callbacks in your service application first: @@ -271,7 +282,8 @@ result = sync_adapter_set_callbacks(on_start_cb, on_cancel_cb);
                            14. -
                            15. If you want to use an account, create the account and obtain some parameters which are used to call sync_manager_add_data_change_sync_job() like below:

                              For more information, see Creating and Managing an Account and Managing and Using the Bundle Content.

                              +
                            16. If you want to use an account, create the account and obtain the parameters that are used to call the sync_manager_add_data_change_sync_job() function. +

                              For more information, see Creating and Managing an Account and Managing and Using the Bundle Content.

                               account_h account = NULL;
                              @@ -292,40 +304,54 @@ const char *sync_capability_video = SYNC_SUPPORTS_CAPABILITY_VIDEO;
                               
                               bundle *sync_job_user_data = NULL;
                               sync_job_user_data = bundle_create();
                              -bundle_add_str(sync_job_user_data, "str", "String sync_job_user_data sample.");
                              +bundle_add_str(sync_job_user_data, "str", "String sync_job_user_data sample.");
                               
                               int sync_job_id = -1;
                               
                            17. -
                            18. This API will operate sync job only for registered capability. To add a data change sync job for calendar: +
                            19. The sync_manager_add_data_change_sync_job() function operates a sync job only for a registered capability. To add a data change sync job for the calendar:
                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_NONE, 
                              +                                               sync_job_user_data, &sync_job_id);
                               
                              -

                              This API can be used with different options each other. Below example shows the API is called with a variety of sync options. The SYNC_OPTION_NO_RETRY means a sync job will not be performed again when it fails. The SYNC_OPTION_EXPEDITED means another sync job will be operated as soon as possible. Of course, the value which is OR-ing let the other sync job operate just once with priority.

                              + +

                              This function can be used with various options. The following example shows the function called with a variety of sync options. The SYNC_OPTION_NO_RETRY option means a sync job is not performed again when it fails. The SYNC_OPTION_EXPEDITED option means another sync job is operated as soon as possible. The call with the OR structure lets the other sync job operate just once with priority.

                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_NO_RETRY, sync_job_user_data, &sync_job_id2);
                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_contact, SYNC_OPTION_EXPEDITED, sync_job_user_data, &sync_job_id3);
                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_image, (SYNC_OPTION_NO_RETRY | SYNC_OPTION_EXPEDITED), sync_job_user_data, &sync_job_id4);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_NO_RETRY, 
                              +                                               sync_job_user_data, &sync_job_id2);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_contact, SYNC_OPTION_EXPEDITED, 
                              +                                               sync_job_user_data, &sync_job_id3);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_image, 
                              +                                               (SYNC_OPTION_NO_RETRY | SYNC_OPTION_EXPEDITED), 
                              +                                               sync_job_user_data, &sync_job_id4);
                               
                              -

                              This API also can be called like below. Because, account handle and sync_job_user_data are not mandatory data:

                              +

                              This function can also be called like in the following example, because the account handle and user data are not mandatory.

                              +
                              -result = sync_manager_add_data_change_sync_job(NULL, sync_capability_music, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_sound, SYNC_OPTION_NO_RETRY, NULL, &sync_job_id2);
                              -result = sync_manager_add_data_change_sync_job(NULL, sync_capability_video, SYNC_OPTION_EXPEDITED, NULL, &sync_job_id3);
                              +result = sync_manager_add_data_change_sync_job(NULL, sync_capability_music, SYNC_OPTION_NONE, 
                              +                                               sync_job_user_data, &sync_job_id);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_sound, SYNC_OPTION_NO_RETRY, 
                              +                                               NULL, &sync_job_id2);
                              +result = sync_manager_add_data_change_sync_job(NULL, sync_capability_video, SYNC_OPTION_EXPEDITED, 
                              +                                               NULL, &sync_job_id3);
                               

                              If the data change sync job addition process succeeds, the SYNC_ERROR_NONE value is returned.

                            20. -
                            21. This API can renew registered data change sync job by using sync_capability as same like below: +
                            22. The sync_manager_add_data_change_sync_job() function can renew a registered data change sync job by using the same sync_capability as before:
                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_NONE, sync_job_user_data, &sync_job_id);
                              -result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_EXPEDITED, sync_job_user_data2, &sync_job_id);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_NONE, 
                              +                                               sync_job_user_data, &sync_job_id);
                              +result = sync_manager_add_data_change_sync_job(account, sync_capability_calendar, SYNC_OPTION_EXPEDITED, 
                              +                                               sync_job_user_data2, &sync_job_id);
                               
                              -All the settings of the API can be reset except sync_capability and sync_job_id which are used to manage a specific sync job. +

                              All the function parameters can be reset except sync_capability and sync_job_id, which are used to manage a specific sync job.

                            23. -
                            24. When the data change sync is no longer needed, remove it with the sync_manager_remove_sync_job() API with its sync_job_id. If you want to stop using the account too, clean up the account handle.

                              At the end, unset the sync callbacks and release the resources with the sync_adapter_unset_callbacks() API.

                              +
                            25. When the data change sync is no longer needed, remove it with the sync_manager_remove_sync_job() function with its sync_job_id. If you want to stop using the account too, clean up the account handle. +

                              At the end, unset the sync callbacks and release the resources with the sync_adapter_unset_callbacks() function.

                              +
                               result = sync_manager_remove_sync_job(sync_job_id);
                               
                              @@ -343,10 +369,9 @@ sync_adapter_unset_callbacks();
                               
                            -

                            Initializing the ForEach Sync

                            -

                            To interate all of registered sync jobs to manage sync job more efficiently:

                            +

                            To iterate all registered sync jobs to manage them more efficiently:

                            1. To use the features of the Sync Manager API, include the <sync_manager.h> header file in your UI application: @@ -355,16 +380,18 @@ sync_adapter_unset_callbacks();
                            2. -
                            3. Set the callback which is invoked and call the iterate function at the same time like below: +
                            4. Set the callback to be invoked and call the iterate function at the same time:
                               int result;
                               result = sync_manager_foreach_sync_job(sync_job_cb, NULL);
                               
                            5. -
                            6. The sync_job_cb() callback is invoked as many as existing registered sync jobs. Then, the sync jobs are verified with corresponding data. +
                            7. The sync_job_cb() callback is invoked separately for every registered sync jobs. Then, the sync jobs are verified with a corresponding data.
                              -bool sync_job_cb(account_h account, const char *sync_job_name, const char *sync_capability, int sync_job_id, bundle *sync_job_user_data, void *user_data)
                              +bool 
                              +sync_job_cb(account_h account, const char *sync_job_name, const char *sync_capability, 
                              +            int sync_job_id, bundle *sync_job_user_data, void *user_data)
                               {
                                  // Verify the registered sync jobs
                               }
                              @@ -379,6 +406,7 @@ bool sync_job_cb(account_h account, const char *sync_job_name, const char *sync_
                               
                               
                              1. To use the features of the Sync Adapter API, include the <sync_adapter.h> header file in your service application: +
                                 #include <sync_adapter.h>
                                 
                                @@ -389,24 +417,28 @@ bool sync_job_cb(account_h account, const char *sync_job_name, const char *sync_ int result; result = sync_adapter_set_callbacks(on_start_cb, on_cancel_cb);
                              -

                              When a specific event is detected or sync job is requested, the sync_adapter_start_sync_cb or sync_adapter_cancel_sync_cb can be invoked.

                              +

                              When a specific event is detected or a sync job is requested, the sync_adapter_start_sync_cb or sync_adapter_cancel_sync_cb callback can be invoked.

                            8. When the on_start_cb() callback is invoked, the predefined data sync process is performed inside the callback function. The on_cancel_cb() callback works in a similar way and cancels the data sync process.
                              -bool on_start_cb(account_h account, const char *sync_job_name, const char *sync_capability, bundle *sync_job_user_data)
                              +bool 
                              +on_start_cb(account_h account, const char *sync_job_name, 
                              +            const char *sync_capability, bundle *sync_job_user_data)
                               {
                                  // Start the data sync process
                               }
                               
                              -void on_cancel_cb(account_h account, const char *sync_job_name, const char *sync_capability, bundle *sync_job_user_data)
                              +void 
                              +on_cancel_cb(account_h account, const char *sync_job_name, 
                              +             const char *sync_capability, bundle *sync_job_user_data)
                               {
                                  // Cancel the data sync process
                               }
                               
                            9. -
                            10. If the sync operation is no longer needed, unset callbacks to free the sync adapter instance: +
                            11. When the sync operation is no longer needed, unset callbacks to free the sync adapter instance:
                               result = sync_adapter_unset_callbacks();
                               
                              diff --git a/org.tizen.tutorials/html/native/app_framework/alarm_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/alarm_tutorial_n.htm new file mode 100644 index 0000000..b7ecf3a --- /dev/null +++ b/org.tizen.tutorials/html/native/app_framework/alarm_tutorial_n.htm @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + Alarm: Setting and Managing Alarms + + + + + + +
                              + +

                              Alarm: Setting and Managing Alarms

                              + + +

                              This tutorial demonstrates how you can set various alarm and cancel them when no longer needed.

                              + +

                              Warm-up

                              +

                              Become familiar with the Alarm API basics by learning about:

                              + + + +

                              Initializing Alarms

                              + +

                              To initialize the alarm:

                              +
                              1. To use the functions and data types of the Alarm API (in mobile and wearable applications), include the <app.h> header file in your application: +
                                +#include <app.h>
                                +#include <app_alarm.h>
                                +
                              2. + +
                              3. The http://tizen.org/privilege/alarm.get and http://tizen.org/privilege/alarm.set privileges are required for the Alarm API. +
                              + +

                              Setting an Alarm after Specific Time

                              + + + + + + + + + + +
                              Note
                              Since 2.4, the alarm_schedule_after_delay() function does not support an exact period and delay for minimizing the wake-ups of the device. The system can adjust when the alarm expires.
                              + + +

                              To set an alarm after a specific time:

                              + +
                                + +
                              1. +

                                Implement the AlarmRegister application

                                +

                                AlarmRegister requires the http://tizen.org/privilege/alarm.set privilege.

                                +
                                1. +

                                  To identify which application to alarm, the Alarm API needs the app_control_h handle.

                                  +

                                  Obtain the app_control_h handle of a specific app by calling the app_control_set_app_id(app_control_h app_control, const char *app_id) function. You can get AlarmTarget app_id from the tizen-manifest.xml file.

                                  + +
                                  +bool 
                                  +init_alarm()
                                  +{
                                  +   int ret;
                                  +   int DELAY = 2;
                                  +   int REMIND = 1;
                                  +   int alarm_id;
                                  +
                                  +   app_control_h app_control = NULL;
                                  +   ret = app_control_create(&app_control);
                                  +   ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
                                  +   ret = app_control_set_app_id (app_control, "org.tizen.alarmslave");
                                  +
                                  +
                                2. + +
                                3. + +

                                  To schedule an alarm after a delay, the function requires 4 parameters:

                                  +
                                    +
                                  • [in] app_control: The destination app_control to perform the specific work when the alarm is triggered.
                                  • +
                                  • [in] delay: The amount of time before the first execution (in seconds). Since 2.4, although this is inexact, the alarm does not fire before this time.
                                  • +
                                  • [in] period: The amount of time before a subsequent alarm (in seconds). Since 2.4, this value does not guarantee accuracy. The actual interval is calculated by the OS, and the minimum value is 600 seconds.
                                  • +
                                  • [out] alarm_id The alarm ID that uniquely identifies an alarm.
                                  • +
                                  + + +
                                  +   ret = alarm_schedule_after_delay(app_control, DELAY, REMIND, &alarm_id);
                                  +
                                  +   return true;
                                  +}
                                  +
                                  +
                              2. + +
                              3. +

                                Implement the AlarmTarget application

                                +

                                A scheduled alarm calls AlarmTarget's app_control_cb callback when the alarm expires.

                                + +
                                +void 
                                +service_app_control(app_control_h app_control, void *data)
                                +{
                                +   dlog_print(DLOG_INFO, LOG_TAG, "app_control called by Alarm API.");
                                +}
                                +
                                +
                              4. +
                              + +

                              Setting an Alarm on a Specific Date

                              + +

                              To schedule an alarm on a specific date, the function requires 4 parameters:

                              + +
                                +
                              • [in] app_control: The destination app_control to perform the specific work when the alarm is triggered
                              • +
                              • [in] date: The first active alarm time
                              • +
                              • [in] period: The amount of time before a subsequent alarm (in seconds). If set to 0, there is only 1 execution.
                              • +
                              • [out] alarm_id: The alarm ID that uniquely identifies an alarm
                              • +
                              + +

                              The tm struct is included in the <time.h> header file. The following table lists the selected tm fields.

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              + Table: tm fields +
                              MemberTypeMeaningRange
                              tm_secintSeconds after the minute0-61*
                              tm_minintMinutes after the hour0-59
                              tm_hourintHours since midnight0-23
                              tm_mdayintDay of the month1-31
                              tm_monintMonths since January0-11
                              tm_yearintYears since 1900
                              + +
                              +int alarm_schedule_at_date(app_control_h app_control, struct tm* date, int period, int* alarm_id)
                              +
                              + +

                              The following code schedules app_control to invoke after 4 seconds. Modifying, for example, date.tm_mday, sets the alarm to another day of the month.

                              +
                              struct tm date;
                              +ret = alarm_get_current_time(&date);
                              +
                              +date.tm_sec+=4;
                              +ret = alarm_schedule_at_date(app, &date, 0, &alarm_id);	
                              +
                              + + + + + + + + + + +
                              Note
                              The alarm_schedule_at_date() function has been deprecated since Tizen 2.4. Use the alarm_schedule_once_at_date() function instead.
                              + + +

                              Setting a Recurring Alarm at a Specific Time of the Day

                              + + +

                              To schedule an alarm on a specific time of the day with a recurrence, use the alarm_schedule_with_recurrence_week_flag() function, which requires 4 parameters:

                              +
                                +
                              • [in] app_control: The destination app_control that performs the specific work when the alarm is triggered.
                              • +
                              • [in] date: The date on which the alarm is triggered for the first time.
                              • +
                              • [in] week_flag: The day of the week on which the alarm recurs. The value is defined with the enum alarm_week_flag_e enumerator (in mobile and wearable applications), and can be a combination of days, for example ALARM_WEEK_FLAG_TUESDAY | ALARM_WEEK_FLAG_FRIDAY. The value can also be a binary, such as 1<<3 | 1<<6.
                              • +
                              • [out] alarm_id: The unique ID that identifies the alarm.
                              • +
                              + +

                              The following code schedules app_control to invoke on TUESDAY and FRIDAY.

                              + +
                              +struct tm date;
                              +ret = alarm_get_current_time(&date);
                              +
                              +time_t time_current = mktime(&date);
                              +dlog_print(DLOG_INFO, TAG, "Schedule on date: %s ", ctime(&time_current));
                              +ret = alarm_schedule_with_recurrence_week_flag(app_control, &date, ALARM_WEEK_FLAG_TUESDAY | ALARM_WEEK_FLAG_FRIDAY, &alarm_id);
                              +
                              + +

                              Listing All Scheduled Alarms and Canceling an Alarm

                              + + +

                              To list all scheduled alarms, use the following function:

                              +
                              +int alarm_foreach_registered_alarm(alarm_registered_alarm_cb callback, void* user_data)
                              +
                              +

                              To list a scheduled alarm, the function requires 2 parameters:

                              +
                                +
                              • [in] callback: The callback function to invoke.
                              • +
                              • [in] user_data: The user data to be passed to the callback.
                              • +
                              + +

                              To cancel specific scheduled alarms, use the following function:

                              +
                              +int alarm_cancel(int alarm_id)
                              +
                              +

                              To cancel a scheduled alarm, the function requires 1 parameter:

                              +
                                +
                              • [in] alarm_id: The alarm ID that is cancelled.
                              • +
                              + +

                              The following code implements the alarm_registered_alarm_cb() function. This callback lists all registered alarms and alarm recurrence days. At the end of the function, the alarm_cancel() function is called to cancel every scheduled alarm.

                              +
                              +static bool 
                              +on_foreach_registered_alarm(int alarm_id, void *user_data)
                              +{
                              +   int flag;
                              +   int ret = 0;
                              +   struct tm date;
                              +   time_t time_current;
                              +
                              +   ret = alarm_get_scheduled_date(alarm_id, &date);
                              +   if (ret != ALARM_ERROR_NONE)
                              +   {
                              +      dlog_print(DLOG_ERROR, TAG, "Get time Error : %d ", ret);
                              +   }
                              +
                              +   // Logging scheduled alarm's info
                              +   time_current = mktime(&date);
                              +   dlog_print(DLOG_INFO, TAG, "Registered alarm:%d on date:%s ", alarm_id, ctime(&time_current));
                              +
                              +   ret = alarm_get_scheduled_recurrence_week_flag(alarm_id, &flag);
                              +   if (ret==0)
                              +   {
                              +      if (flag & ALARM_WEEK_FLAG_SUNDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on SUNDAY \n");
                              +      if (flag & ALARM_WEEK_FLAG_MONDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on MONDAY \n");
                              +      if (flag & ALARM_WEEK_FLAG_TUESDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on TUESDAY \n");
                              +      if (flag & ALARM_WEEK_FLAG_WEDNESDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on WEDNESDAY \n");
                              +      if (flag & ALARM_WEEK_FLAG_THURSDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on THURSDAY \n");
                              +      if (flag & ALARM_WEEK_FLAG_FRIDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on FRIDAY \n");
                              +      if (flag & ALARM_WEEK_FLAG_SATURDAY)
                              +         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on SATURDAY \n");
                              +   }
                              +
                              +   // Cancel scheduled alarms
                              +   ret = alarm_cancel(alarm_id);
                              +   if (ret != ALARM_ERROR_NONE) 
                              +   {
                              +      dlog_print(DLOG_ERROR, TAG, "Cancel Error : %d ", ret);
                              +   }
                              +   return true;
                              +}
                              +
                              + +
                              +ret = alarm_foreach_registered_alarm(on_foreach_registered_alarm, NULL);
                              +if (ret != ALARM_ERROR_NONE) 
                              +{
                              +   dlog_print(DLOG_ERROR, TAG, "Listing Error : %d ", ret);
                              +}
                              +
                              + + + + +
                              + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/native/app_framework/app_framework_tutorials_n.htm b/org.tizen.tutorials/html/native/app_framework/app_framework_tutorials_n.htm index 45040d9..e9436ac 100644 --- a/org.tizen.tutorials/html/native/app_framework/app_framework_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/app_framework_tutorials_n.htm @@ -18,7 +18,7 @@
                              -

                              Mobile native Wearable native

                              +

                              Mobile native Wearable native

                              Related Info

                              @@ -36,22 +36,19 @@

                              The application framework tutorials demonstrate how to use the following features in creating Tizen native applications:

                              -

                              The following tutorials apply in mobile applications only:

                              - +

                              The following tutorials apply in wearable applications only:

                              • Watch Application: Creating a Watch Application

                                Demonstrates how you can create a watch application, set the time, and use the ambient mode.

                              • diff --git a/org.tizen.tutorials/html/native/app_framework/app_manager_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/app_manager_tutorial_n.htm index 5635188..b680f91 100644 --- a/org.tizen.tutorials/html/native/app_framework/app_manager_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/app_manager_tutorial_n.htm @@ -18,7 +18,7 @@
                                -

                                Mobile native Wearable native

                                +

                                Mobile native Wearable native

                                Content

                                @@ -59,11 +59,7 @@ #include <app_manager.h> -
                              • Get the context of the currently running application. - -

                                When an application is not running, it is impossible to get its context.

                                - -

                                Call the app_manager_get_app_context() function with the ID of the application from which the context is being obtained, and the handle (app_context_h*) to the application context which is filled with the received context:

                                +
                              • Get the context of the currently running application with the app_manager_get_app_context() function. Its parameters are the ID of the application from which the context is being obtained, and the handle (app_context_h*) to the application context which is filled with the received context. When an application is not running, it is impossible to get its context.
                                @@ -164,7 +160,8 @@ ret = app_info_filter_add_string(app_info_filter, PACKAGE_INFO_PROP_APP_TYPE, &q
                                 
                              • Use the app_info_filter_cb() callback to retrieve all filtered applications and print their information:
                                -void app_info_filter_cb(app_info_filter_h app_info, void *user_data)
                                +void 
                                +app_info_filter_cb(app_info_filter_h app_info, void *user_data)
                                 {
                                    int ret;
                                 
                                diff --git a/org.tizen.tutorials/html/native/app_framework/appcontrol_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/appcontrol_tutorial_n.htm
                                new file mode 100644
                                index 0000000..79d8571
                                --- /dev/null
                                +++ b/org.tizen.tutorials/html/native/app_framework/appcontrol_tutorial_n.htm
                                @@ -0,0 +1,324 @@
                                +
                                +
                                +
                                +	
                                +	
                                +	
                                +	
                                +		
                                +	
                                +	
                                +	
                                +	
                                +
                                +	App Control: Launching Applications and Managing Groups
                                +
                                +
                                +
                                +
                                +	
                                +
                                +
                                + +

                                App Control: Launching Applications and Managing Groups

                                + + +

                                This tutorial demonstrates how you can launch other applications and manage application groups.

                                + +

                                Warm-up

                                +

                                Become familiar with the App Control API basics by learning about:

                                + + + +

                                Running Applications Using Extra Data

                                + +

                                To run a specified app_control with some preconfigured parameters:

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

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

                                  Prepare app_control.

                                  +
                                  +error_code = app_control_create(&app_control);
                                  +
                                  +ret = app_control_create(&app);
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_create() is failed. err = %d", ret);
                                  +
                                  +
                                4. +
                                5. +

                                  When the app_control is created, set the operation. In this example, the app_control launches an application which has the APP_CONTROL_OPERATION_VIEW operation and image/jpeg mime type with a message. The operation is mandatory information for the launch request. If the operation is not specified, APP_CONTROL_OPERATION_DEFAULT is used for the launch request.

                                  +
                                  +ret = app_control_set_operation(app, APP_CONTROL_OPERATION_VIEW);
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_operation() is failed. err = %d", ret);
                                  +
                                  +ret = app_control_set_mime(app, "image/jpeg");
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_mime() is failed. err = %d", ret);
                                  +
                                  + +

                                  The following table lists the available base application services.

                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + Table: Tizen base application services +
                                  ServiceOperationSchemeMIME
                                  Browsing a Web pagehttp://tizen.org/appcontrol/operation/view +
                                    +
                                  • http
                                  • +
                                  • https
                                  • +
                                  +
                                  -
                                  Displaying an image +
                                    +
                                  • file
                                  • +
                                  • http
                                  • +
                                  • https
                                  • +
                                  +
                                  +
                                    +
                                  • image/bmp
                                  • +
                                  • image/gif
                                  • +
                                  • image/jpeg
                                  • +
                                  • image/png
                                  • +
                                  +
                                  Playing a sound filefile +
                                    +
                                  • audio/aac
                                  • +
                                  • audio/amr
                                  • +
                                  • audio/mp3
                                  • +
                                  • audio/wav
                                  • +
                                  +
                                  Playing a video file +
                                    +
                                  • video/mp4
                                  • +
                                  • video/3gpp
                                  • +
                                  +
                                  Selecting a filehttp://tizen.org/appcontrol/operation/pick +
                                    +
                                  • */*
                                  • +
                                  • image/*
                                  • +
                                  • video/*
                                  • +
                                  • audio/*
                                  • +
                                  +
                                  +
                                6. + +
                                7. +

                                  Add extra data to the app_control using the app_control_add_extra_data() or app_control_add_extra_data_array() function:

                                  +
                                  +ret = app_control_add_extra_data(app, Your Message Key, message);
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_add_extra_data() is failed. err = %d", ret);
                                  +
                                  +
                                8. +
                                9. +

                                  Launch app_control using the app_control_send_launch_request() function:

                                  + +
                                  +ret = app_control_send_launch_request(app, NULL, NULL);
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_send_launch_request() is failed. err = %d", ret);
                                  +
                                  + + + + + + + + + +
                                  Note
                                  Since Tizen 2.4, service applications are only allowed to be launched explicitly and the caller must be an application in the same package. Otherwise, app_control returns an error.
                                  + +
                                10. + +
                                11. +

                                  Read the extra data set to app_control using the app_control_foreach_extra_data() function. The same function used on app_control_h returned by the app_control reply allows you to read the reply message.

                                  + +
                                  +bool
                                  +_app_control_extra_data_cb(app_control_h app_control, const char *key, void *user_data)
                                  +{
                                  +   int ret;
                                  +   char *value;
                                  +   
                                  +   ret = app_control_get_extra_data(app, key, &value);
                                  +   if (ret != APP_CONTROL_ERROR_NONE) 
                                  +   {
                                  +      dlog_print(DLOG_ERROR, LOG_TAG, "app_control_get_extra_data() is failed. err = %d", ret);
                                  +   }
                                  +   dlog_print(DLOG_DEBUG, LOG_TAG, "[value] %s", value);
                                  +
                                  +   return true;
                                  +}
                                  +
                                  +ret = app_control_foreach_extra_data(app, _app_control_extra_data_cb, 0);
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_foreach_extra_data() is failed. err = %d", ret);
                                  +
                                  +
                                12. + +
                                13. +

                                  When your work with app_control is finished, clean up. + To do this, pass the app_control handle to the + app_control_destroy() function.

                                  +
                                  +ret = app_control_destroy(app);
                                  +if (ret != APP_CONTROL_ERROR_NONE)
                                  +   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_destroy() is failed. err = %d", ret);
                                  +
                                  +
                                14. +
                                + +

                                Controlling the Launch Mode

                                + +

                                In this use case, the caller application has a Launch button. When it is clicked, an app control is used to launch a sub application within the same group.

                                + +

                                To control the launch mode:

                                +
                                  +
                                1. Create the UI with the Launch button: +
                                  +static void 
                                  +create_base_gui(appdata_s *ad)
                                  +{
                                  +   Evas_Object *bigbox, *bx, *bt;
                                  +
                                  +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
                                  +   elm_win_autodel_set(ad->win, EINA_TRUE);
                                  +
                                  +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
                                  +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
                                  +
                                  +   bigbox = elm_box_add(ad->win);
                                  +   evas_object_size_hint_weight_set(bigbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                                  +   elm_win_resize_object_add(ad->win, bigbox);
                                  +   evas_object_show(bigbox);
                                  +
                                  +   bx = elm_box_add(ad->win);
                                  +   elm_box_pack_end(bigbox, bx);
                                  +   evas_object_show(bx);
                                  +
                                  +   bt = elm_label_add(ad->win);
                                  +   elm_object_text_set(bt, "AGT3");
                                  +   elm_box_pack_end(bx, bt);
                                  +   evas_object_show(bt);
                                  +
                                  +   bt = elm_button_add(ad->win);
                                  +   elm_object_text_set(bt, "Launch");
                                  +   elm_box_pack_end(bx, bt);
                                  +   evas_object_show(bt);
                                  +   evas_object_smart_callback_add(bt, "clicked", button_click_cb, NULL);
                                  +
                                  +   evas_object_show(ad->win);
                                  +}
                                2. + +
                                3. When the button is clicked, use an app control to launch the sub application. +

                                  Define the launch mode for the application to be called using the app_control_set_launch_mode() function. The second parameter defines the launch mode with the app_control_launch_mode_e enumerator (in mobile and wearable applications).

                                  +
                                  +static void 
                                  +button_click_cb(void *data, Evas_Object *obj, void *event_info)
                                  +{
                                  +   app_control_h h;
                                  +
                                  +   app_control_create(&h);
                                  +   app_control_set_operation(h, "http://tizen.org/appcontrol/operation/view");
                                  +   app_control_set_mime(h, "application/pdf");
                                  +   app_control_set_launch_mode(h, APP_CONTROL_LAUNCH_MODE_GROUP);
                                  +   app_control_send_launch_request(h, NULL, NULL);
                                  +
                                  +   app_control_destroy(h);
                                  +}
                                  +
                                  +static void 
                                  +app_control(app_control_h app_control, void *data)
                                  +{
                                  +   // Handle the launch request
                                  +}
                                  +
                                  +
                                4. +
                                + + + + +
                                + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/native/app_framework/application_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/application_tutorial_n.htm index fc6eef2..c9e2728 100644 --- a/org.tizen.tutorials/html/native/app_framework/application_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/application_tutorial_n.htm @@ -18,35 +18,12 @@
                                -

                                Mobile native Wearable native

                                +

                                Mobile native Wearable native

                                Content

                                Related Info

                                  @@ -62,49 +39,32 @@

                                  Application: Using Alarms, Preferences, AppControl, and Other Fundamentals

                                  -

                                  This tutorial demonstrates how you can manage application fundamentals, such as application settings and service applications.

                                  +

                                  This tutorial demonstrates how you can manage application fundamentals, such as application life-cycle callbacks.

                                  Warm-up

                                  Become familiar with the Application API basics by learning about:

                                  + +

                                  For additional application-related features, see:

                                  +

                                  Handling the Application Fundamentals

                                  The Application API is the framework all Tizen applications are based on. It is simple and only handles interactions between applications and the operating system.

                                  An application starts with the main() function. It initializes the Application API and starts it.

                                  -

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

                                  +

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

                                   // Add this include to be able to use the functions from the Application API
                                   #include <app.h>
                                  @@ -123,11 +83,11 @@ main(int argc, char *argv[])
                                   

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

                                  The application's life-cycle callbacks are:

                                    -
                                  • create: first initialization, comes after ui_app_main() has been called and initializes UI.
                                  • -
                                  • control: triggered when the application is started to do something. It can be called several times during the lifespan of an application, 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's window not visible and switches to a mode which uses less resources.
                                  • -
                                  • resume: sets the application's window to be visible again.
                                  • +
                                  • create: First initialization, comes after ui_app_main() has been called and initializes UI.
                                  • +
                                  • control: Triggered when the application is started to do something. It can be called several times during the lifespan of an application, 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's window not visible and switches to a mode which uses less resources.
                                  • +
                                  • resume: Sets the application's window to be visible again.

                                  The system-related callbacks can be handled with the app_event_cb() callback:

                                  @@ -139,7 +99,7 @@ main(int argc, char *argv[])
                                • APP_EVENT_REGION_FORMAT_CHANGED: Event type responsible for refreshing the display into the new time zone.
                                -

                                A basic implementation is shown below:

                                +

                                A basic implementation is shown in the following example:

                                 #include <app.h>
                                 
                                @@ -227,575 +187,13 @@ main(int argc, char *argv[])
                                 

                                The app_control_h type is opaque and information can only be extracted from it through functions from the SDK.

                                The most interesting ones are:

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

                                If other functions are needed, check the app.h header.

                                -

                                Running Applications Using Extra Data

                                - -

                                To run a specified app_control with some preconfigured parameters:

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

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

                                  Prepare app_control.

                                  -

                                  In this example, the app_control launches an application which has the APP_CONTROL_OPERATION_VIEW operation and image/jpeg mime type with a message.

                                  -

                                  When the app_control is created, set the operation. The operation is mandatory information for the launch request. If the operation is not specified, APP_CONTROL_OPERATION_DEFAULT is used for the launch request. Add extra data to the app_control using the app_control_add_extra_data() or app_control_add_extra_data_array() function.

                                  -
                                  -error_code = app_control_create(&app_control);
                                  -
                                  -ret = app_control_create(&app);
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_create() is failed. err = %d", ret);
                                  -
                                  -ret = app_control_set_operation(app, APP_CONTROL_OPERATION_VIEW);
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_operation() is failed. err = %d", ret);
                                  -
                                  -ret = app_control_set_mime(app, "image/jpeg");
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_mime() is failed. err = %d", ret);
                                  -
                                  -ret = app_control_add_extra_data(app, Your Message Key, message);
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_add_extra_data() is failed. err = %d", ret);
                                  -
                                  - -

                                  The following table lists the available base application services.

                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                  - Table: Tizen base application services -
                                  ServiceOperationSchemeMIME
                                  Browsing a Web pagehttp://tizen.org/appcontrol/operation/view -
                                    -
                                  • http
                                  • -
                                  • https
                                  • -
                                  -
                                  -
                                  Displaying an image -
                                    -
                                  • file
                                  • -
                                  • http
                                  • -
                                  • https
                                  • -
                                  -
                                  -
                                    -
                                  • image/bmp
                                  • -
                                  • image/gif
                                  • -
                                  • image/jpeg
                                  • -
                                  • image/png
                                  • -
                                  -
                                  Playing a sound filefile -
                                    -
                                  • audio/aac
                                  • -
                                  • audio/amr
                                  • -
                                  • audio/mp3
                                  • -
                                  • audio/wav
                                  • -
                                  -
                                  Playing a video file -
                                    -
                                  • video/mp4
                                  • -
                                  • video/3gpp
                                  • -
                                  -
                                  Selecting a filehttp://tizen.org/appcontrol/operation/pick -
                                    -
                                  • */*
                                  • -
                                  • image/*
                                  • -
                                  • video/*
                                  • -
                                  • audio/*
                                  • -
                                  -
                                  -
                                4. - -
                                5. -

                                  Launch app_control.

                                  - -

                                  After preparing app_control, launch it using the app_control_send_launch_request() function:

                                  - -
                                  -ret = app_control_send_launch_request(app, NULL, NULL);
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_send_launch_request() is failed. err = %d", ret);
                                  -
                                  - - - - - - - - - -
                                  Note
                                  Since Tizen 2.4, service applications are only allowed to be launched explicitly and the caller must be an application with the same package. Otherwise, the app_control will return error.
                                  -
                                6. - -
                                7. -

                                  Get extra data.

                                  -

                                  Read the extra data set to app_control using the app_control_foreach_extra_data() function. The same function used on app_control_h returned by the app_control reply allows you to read the reply message.

                                  - -
                                  -bool _app_control_extra_data_cb(app_control_h app_control, const char *key, void *user_data)
                                  -{
                                  -   int ret;
                                  -   char *value;
                                  -   
                                  -   ret = app_control_get_extra_data(app, key, &value);
                                  -   if (ret != APP_CONTROL_ERROR_NONE) 
                                  -   {
                                  -      dlog_print(DLOG_ERROR, LOG_TAG, "app_control_get_extra_data() is failed. err = %d", ret);
                                  -   }
                                  -   dlog_print(DLOG_DEBUG, LOG_TAG, "[value] %s", value);
                                  -
                                  -   return true;
                                  -}
                                  -
                                  -ret = app_control_foreach_extra_data(app, _app_control_extra_data_cb, 0);
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_foreach_extra_data() is failed. err = %d", ret);
                                  -
                                  -
                                8. - -
                                9. -

                                  Clean up.

                                  -

                                  When your work with app_control is finished, clean up. - To do this, pass the app_control handle to the - app_control_destroy() function.

                                  -
                                  -ret = app_control_destroy(app);
                                  -if (ret != APP_CONTROL_ERROR_NONE)
                                  -   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_destroy() is failed. err = %d", ret);
                                  -
                                  -
                                10. -
                                - - -

                                Initializing Alarms

                                - -

                                To initialize the alarm:

                                -
                                1. To use the functions and data types of the Alarm API (in mobile and wearable applications), include the <app.h> header file in your application: -
                                  -#include <app.h>
                                  -#include <app_alarm.h>
                                  -
                                2. - -
                                3. The http://tizen.org/privilege/alarm.get and http://tizen.org/privilege/alarm.set privileges are required for the Alarm API. -
                                - -

                                Setting an Alarm after Specific Time

                                - - - - - - - - - - -
                                Note
                                Since 2.4, the alarm_schedule_after_delay() function does not support an exact period and delay for minimizing the wake-ups of the device. The system can adjust when the alarm expires.
                                - - -

                                To set an alarm after a specific time:

                                - -
                                  - -
                                1. -

                                  Implement the AlarmRegister application

                                  -

                                  AlarmRegister requires the http://tizen.org/privilege/alarm.set privilege.

                                  -
                                  1. -

                                    To identify which application to alarm, the Alarm API needs app_control_h.

                                    -

                                    Obtain app_control_h of a specific app by calling app_control_set_app_id(app_control_h app_control, const char *app_id);. You can get AlarmTarget app_id from the tizen-manifest.xml file.

                                    - -
                                    -bool init_alarm()
                                    -{
                                    -   int ret;
                                    -   int DELAY = 2;
                                    -   int REMIND = 1;
                                    -   int alarm_id;
                                    -
                                    -   app_control_h app_control = NULL;
                                    -   ret = app_control_create(&app_control);
                                    -   ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
                                    -   ret = app_control_set_app_id (app_control, "org.tizen.alarmslave");
                                    -
                                    -
                                  2. - -
                                  3. - -

                                    To schedule an alarm after a delay, the function requires 4 parameters:

                                    -
                                      -
                                    • [in] app_control: The destination app_control to perform the specific work when the alarm is triggered
                                    • -
                                    • [in] delay: The amount of time before the first execution (in seconds). Since 2.4, although this is inexact, the alarm does not fire before this time.
                                    • -
                                    • [in] period: The amount of time before a subsequent alarm (in seconds). Since 2.4, this value does not guarantee accuracy. The actual interval is calculated by the OS, and the minimum value is 600 seconds.
                                    • -
                                    • [out] alarm_id The alarm ID that uniquely identifies an alarm
                                    • -
                                    - - -
                                    -   ret = alarm_schedule_after_delay(app_control, DELAY, REMIND, &alarm_id);
                                    -
                                    -   return true;
                                    -}
                                    -
                                    -
                                2. - -
                                3. -

                                  Implement the AlarmTarget application

                                  -

                                  A scheduled alarm calls AlarmTarget' app_control_cb callback when the alarm expires.

                                  - -
                                  -void service_app_control(app_control_h app_control, void *data)
                                  -{
                                  -   dlog_print(DLOG_INFO, LOG_TAG, "app_control called by Alarm API.");
                                  -}
                                  -
                                  -
                                4. -
                                - -

                                Setting an Alarm on a Specific Date

                                - -

                                To schedule an alarm on a specific date, the function requires 4 parameters:

                                - -
                                  -
                                • [in] app_control: The destination app_control to perform the specific work when the alarm is triggered
                                • -
                                • [in] date: The first active alarm time
                                • -
                                • [in] period: The amount of time before a subsequent alarm (in seconds). If set to 0, there is only 1 execution.
                                • -
                                • [out] alarm_id: The alarm ID that uniquely identifies an alarm
                                • -
                                - -

                                The tm struct is included in the <time.h> header file. The following table lists the selected tm fields.

                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                - Table: tm fields -
                                MemberTypeMeaningRange
                                tm_secintSeconds after the minute0-61*
                                tm_minintMinutes after the hour0-59
                                tm_hourintHours since midnight0-23
                                tm_mdayintDay of the month1-31
                                tm_monintMonths since January0-11
                                tm_yearintYears since 1900
                                - -
                                -int alarm_schedule_at_date(app_control_h app_control, struct tm* date, int period, int* alarm_id)
                                -
                                - -

                                The following code schedules app_control to invoke after 4 seconds. Modifying, for example, date.tm_mday, sets the alarm to another day of the month.

                                -
                                struct tm date;
                                -ret = alarm_get_current_time(&date);
                                -
                                -date.tm_sec+=4;
                                -ret = alarm_schedule_at_date(app, &date, 0, &alarm_id);	
                                -
                                - - - - - - - - - - -
                                Note
                                The alarm_schedule_at_date() function has been deprecated since Tizen 2.4. Use the alarm_schedule_once_at_date() function instead.
                                - - -

                                Setting a Recurring Alarm at a Specific Time of the Day

                                - - -

                                To schedule an alarm on a specific time of the day with a recurrence, use the alarm_schedule_with_recurrence_week_flag() function, which requires 4 parameters:

                                -
                                  -
                                • [in] app_control: The destination app_control that performs the specific work when the alarm is triggered.
                                • -
                                • [in] date: The date on which the alarm is triggered for the first time.
                                • -
                                • [in] week_flag: The day of the week on which the alarm recurs. The value is defined with the enum alarm_week_flag_e enumerator (in mobile and wearable applications), and can be a combination of days, for example ALARM_WEEK_FLAG_TUESDAY | ALARM_WEEK_FLAG_FRIDAY. The value can also be a binary, such as 1<<3 | 1<<6.
                                • -
                                • [out] alarm_id: The unique ID that identifies the alarm.
                                • -
                                - -

                                The following code schedules app_control to invoke on TUESDAY and FRIDAY.

                                - -
                                -struct tm date;
                                -ret = alarm_get_current_time(&date);
                                -
                                -time_t time_current = mktime(&date);
                                -dlog_print(DLOG_INFO, TAG, "Schedule on date: %s ", ctime(&time_current));
                                -ret = alarm_schedule_with_recurrence_week_flag(app_control, &date, ALARM_WEEK_FLAG_TUESDAY | ALARM_WEEK_FLAG_FRIDAY, &alarm_id);
                                -
                                - -

                                Listing All Scheduled Alarms and Canceling an Alarm

                                - - -

                                To list all scheduled alarms, use the following function:

                                -
                                -int alarm_foreach_registered_alarm(alarm_registered_alarm_cb callback, void* user_data)
                                -
                                -

                                To list a scheduled alarm, the function requires 2 parameters:

                                -
                                  -
                                • [in] callback: The callback function to invoke.
                                • -
                                • [in] user_data: The user data to be passed to the callback.
                                • -
                                - -

                                To cancel specific scheduled alarms, use the following function:

                                -
                                -int alarm_cancel(int alarm_id)
                                -
                                -

                                To cancel a scheduled alarm, the function requires 1 parameter:

                                -
                                  -
                                • [in] alarm_id: The alarm ID that is cancelled.
                                • -
                                - -

                                The following code implements the alarm_registered_alarm_cb() function. This callback lists all registered alarms and alarm recurrence days. At the end of the function, the alarm_cancel() function is called to cancel every scheduled alarm.

                                -
                                -static bool on_foreach_registered_alarm(int alarm_id, void *user_data)
                                -{
                                -   int flag;
                                -   int ret = 0;
                                -   struct tm date;
                                -   time_t time_current;
                                -
                                -   ret = alarm_get_scheduled_date(alarm_id, &date);
                                -   if (ret != ALARM_ERROR_NONE)
                                -   {
                                -      dlog_print(DLOG_ERROR, TAG, "Get time Error : %d ", ret);
                                -   }
                                -   
                                -   // Logging scheduled alarm's info
                                -   time_current = mktime(&date);
                                -   dlog_print(DLOG_INFO, TAG, "Registered alarm:%d on date:%s ", alarm_id, ctime(&time_current));
                                -
                                -   ret = alarm_get_scheduled_recurrence_week_flag(alarm_id, &flag);
                                -   if (ret==0)
                                -   {
                                -      if (flag & ALARM_WEEK_FLAG_SUNDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on SUNDAY \n");
                                -      if (flag & ALARM_WEEK_FLAG_MONDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on MONDAY \n");
                                -      if (flag & ALARM_WEEK_FLAG_TUESDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on TUESDAY \n");
                                -      if (flag & ALARM_WEEK_FLAG_WEDNESDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on WEDNESDAY \n");
                                -      if (flag & ALARM_WEEK_FLAG_THURSDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on THURSDAY \n");
                                -      if (flag & ALARM_WEEK_FLAG_FRIDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on FRIDAY \n");
                                -      if (flag & ALARM_WEEK_FLAG_SATURDAY)
                                -         dlog_print(DLOG_INFO, TAG, "Alarm Recurrence on SATURDAY \n");
                                -   }
                                -
                                -   // Cancel scheduled alarms
                                -   ret = alarm_cancel (alarm_id);
                                -   if (ret != ALARM_ERROR_NONE) 
                                -   {
                                -      dlog_print(DLOG_ERROR, TAG, "Cancel Error : %d ", ret);
                                -   }
                                -
                                -   return true;
                                -}
                                -
                                - -
                                -ret = alarm_foreach_registered_alarm(on_foreach_registered_alarm, NULL);
                                -if (ret != ALARM_ERROR_NONE) 
                                -{
                                -      dlog_print(DLOG_ERROR, TAG, "Listing Error : %d ", ret);
                                -}
                                -
                                - - -

                                Managing Application Preferences

                                - -

                                You can set and get application preference data. Any stored preference data can also be shared with among the applications in the same package.

                                - -

                                To manage preferences:

                                - -
                                1. -

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

                                  -
                                  -#include <app.h>
                                  -#include <app_preference.h>
                                  -
                                2. - -
                                3. Store and retrieve simple type variables. -

                                  To store a variable, you must create a key-value pair. Use the following functions to create a key-value pair for a specific simple type:

                                  - -
                                  • preference_set_int (const char *key, int value)
                                  • -
                                  • preference_set_double (const char *key, double value)
                                  • -
                                  • preference_set_boolean (const char *key, bool value)
                                  - -

                                  Before storing or retrieving a variable, check whether it exists using:

                                  - -
                                  • preference_is_existing (const char *key, bool *existing)
                                  - -

                                  Use the following functions to retrieve a stored variable of a given simple type:

                                  - -
                                  • preference_get_int (const char *key, int *value)
                                  • -
                                  • preference_get_double (const char *key, double *value)
                                  • -
                                  • preference_get_boolean (const char *key, bool *value)
                                  - - -
                                  const char *integer_key = "integer_key";
                                  -int integer_value = 1;
                                  -int integer_output;
                                  -
                                  -preference_set_int(integer_key, integer_value);
                                  -
                                  -preference_is_existing(integer_key, &existing);
                                  -
                                  -preference_get_int(integer_key, &integer_output);
                                4. - - -
                                5. Store and retrieve string variables. -

                                  Use the following functions to store and retrieve string variables:

                                  - -
                                    -
                                  • preference_set_string (const char *key, const char *value)
                                  • -
                                  • preference_get_string (const char *key, char **value)
                                  • -
                                  - -

                                  Release the value returned by the get function using the free() function.

                                  -
                                  const char *string_key = "string_key";
                                  -const char *string_value = "Sample content";
                                  -char *string_output;
                                  -bool existing;
                                  -
                                  -preference_set_string(string_key, string_value);
                                  -
                                  -preference_is_existing(string_key, &existing);
                                  -
                                  -preference_get_string(string_key, &string_output);
                                  -
                                  -free(string_output);
                                6. - -
                                7. Track variables. -

                                  You can set a different callback function to each variable. The callback function is invoked each time the variable is changed.

                                  - -
                                  -int previous_value;
                                  -
                                  -preference_set_changed_cb(integer_key, preference_changed_cb_impl, &previous_value);
                                  - -

                                  Pass custom parameters to the callback function in the user_data field.

                                  - -
                                  void preference_changed_cb_impl(const char *key, void *user_data)
                                  -{
                                  -   int ret = 0;
                                  -   int integer_output = 0;
                                  -
                                  -   dlog_print(DLOG_DEBUG, LOG_TAG, "[preference_changed_cb_impl]\n");
                                  -   preference_get_int(key, &integer_output);
                                  -     
                                  -   dlog_print(DLOG_DEBUG, LOG_TAG, "Key: %s has changed its value to %d \n", 
                                  -              key, integer_output);
                                  -}
                                  - - -

                                  Unset a callback function based on a variable key.

                                  -
                                  preference_unset_changed_cb(const char *key);
                                8. - - -
                                9. List all records. -

                                  Access all the records with the foreach function. The function calls a specific callback function for each key-value pair in the database. You can pass additional data to the function in the user_data field.

                                  - -
                                  preference_foreach_item(preference_foreach_item_cb, NULL);
                                  - -

                                  If the callback function returns false, or if all the records have been opened, the foreach function ends.

                                  - -
                                  bool preference_foreach_item_cb(const char *key, void *user_data)
                                  -{
                                  -   dlog_print(DLOG_DEBUG, LOG_TAG, "[preference_foreach_item_cb]\n");
                                  -   dlog_print(DLOG_DEBUG, LOG_TAG, "Key found: %s\n", key);
                                  -   return true;
                                  -}
                                10. - -
                                11. Delete records. -

                                  Delete records one by one using a unique key. You can also delete all records for an application using the remove_all() function.

                                  - -
                                  preference_remove(const char *key)
                                  -
                                  -preference_remove_all(void)
                                - diff --git a/org.tizen.tutorials/html/native/app_framework/badge_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/badge_tutorial_n.htm index b3fa72f..63743f0 100644 --- a/org.tizen.tutorials/html/native/app_framework/badge_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/badge_tutorial_n.htm @@ -18,7 +18,7 @@
                                -

                                Mobile native Wearable native

                                +

                                Mobile native Wearable native

                                Content

                                @@ -86,100 +86,74 @@ static int ret = 0;

                                Creating a Badge

                                -

                                To create a badge for an application, call the badge_new() function:

                                -
                                badge_new(const char *writable_app_id)
                                - -

                                The application calling the badge_new() function has the ownership of the badge. And the writable_app_id parameter means the application which is to be authorized to change the badge.

                                - -
                                ret = badge_new(TEST_PKG);
                                +

                                To create a badge for an application, call the badge_new() function. The application calling the badge_new() function has the ownership of the badge. The parameter means the application which is to be authorized to change the badge.

                                +
                                +ret = badge_new(TEST_PKG);
                                 if (ret != BADGE_ERROR_NONE)
                                 {
                                    // Error handling
                                -}
                                +} +

                                Managing the Badge

                                To manage the badge:

                                  -
                                1. Get the count attribute: -

                                  The count attribute is displayed in the right corner of the badge and its value must be an integer.

                                  -

                                  To get the count attribute, call the badge_get_count() function:

                                  -
                                  badge_get_count(const char *app_id, unsigned int *count)
                                  -

                                  The function takes the following parameters:

                                  -
                                    -
                                  • [in] app_id: The name of the application that gets the count of the badge.
                                  • -
                                  • [out] count: The value of the count attribute.
                                  • -
                                  -
                                  unsigned int count = 0;
                                  +
                                2. Get the count attribute with the badge_get_count() function. The count attribute is displayed in the right corner of the badge and its value must be an integer. +

                                  The parameters are the name of the application that gets the count of the badge, and the value for the count attribute.

                                  + +
                                  +unsigned int count = 0;
                                   ret = badge_get_count(TEST_PKG, &count);
                                   if (ret != BADGE_ERROR_NONE)
                                   {
                                      // Error handling
                                  -}
                                  +} +
                                3. -
                                4. Set the count attribute: -

                                  To set the count attribute, call the badge_set_count() function:

                                  -
                                  badge_set_count(const char *app_id, unsigned int count)
                                  -

                                  The function takes the following parameters:

                                  -
                                    -
                                  • [in] app_id: The name of the application that sets the count of the badge.
                                  • -
                                  • [in] count: The new value for the count attribute.
                                  • -
                                  -
                                  ret = badge_set_count(TEST_PKG, count+1);
                                  +
                                  +
                                5. Set the count attribute with the badge_set_count() function. The parameters are the name of the application that sets the count of the badge, and the value for the count attribute. +
                                  +ret = badge_set_count(TEST_PKG, count+1);
                                   if (ret != BADGE_ERROR_NONE)
                                   {
                                      // Error handling
                                  -}
                                  +} +
                                6. -
                                7. Getting the display attribute: -

                                  You can check whether the badge is visible by getting its display attribute.

                                  -

                                  The app_id parameter refers to the application which is the owner of the badge.

                                  -

                                  To get the display attribute, call the badge_get_display() function:

                                  -
                                  badge_get_display(const char *app_id, unsigned int *is_display)
                                  -

                                  The function takes the following parameters:

                                  -
                                    -
                                  • [in] app_id: The name of the application that gets the display flag of the badge.
                                  • -
                                  • [out] is_display: The value of the display attribute (1 = badge is visible, 0 = badge is hidden).
                                  • -
                                  - -
                                  unsigned int is_displayed = false;
                                  +
                                8. Get the display attribute and check whether the badge is visible with the badge_get_display() function. The parameters are the application which owns the badge, and the value of the display attribute (1 = badge is visible, 0 = badge is hidden). +
                                  +unsigned int is_displayed = false;
                                   ret = badge_get_display(TEST_PKG, &is_displayed);
                                   if (ret != BADGE_ERROR_NONE)
                                   {
                                      // Error handling
                                  -}
                                  +} +
                                9. -
                                10. Setting the display attribute: -

                                  You can display or hide the badge by setting its display attribute accordingly.

                                  -

                                  To set the display attribute, call the badge_set_display() function:

                                  -
                                  badge_set_display(const char *app_id, unsigned int is_display)
                                  -

                                  The function takes the following parameters:

                                  -
                                    -
                                  • [in] app_id: The name of the application that gets the display flag of the badge.
                                  • -
                                  • [in] is_display: The new value for the display attribute (1 = badge is visible, 0 = badge is hidden).
                                  • -
                                  -
                                  ret = badge_set_display(TEST_PKG, 1);
                                  +
                                11. Set the display attribute with the badge_set_display() function to hide or show the badge. The parameters are the application which owns the badge, and the display attribute (1 = badge is visible, 0 = badge is hidden). +
                                  +ret = badge_set_display(TEST_PKG, 1);
                                   if (ret != BADGE_ERROR_NONE)
                                   {
                                      // Error handling
                                  -}
                                  +} +

                                Removing the Badge

                                -

                                To remove the badge from the application, call the badge_remove() function:

                                -
                                badge_remove(const char *app_id)
                                -

                                The function takes the following parameters:

                                -
                                  -
                                • [in] app_id: The ID of the application whose badge to remove.
                                • -
                                -
                                ret = badge_remove(TEST_PKG);
                                +

                                To remove the badge from the application, call the badge_remove() function. The only parameter is the ID of the application whose badge to remove.

                                + +
                                +ret = badge_remove(TEST_PKG);
                                 if (ret != BADGE_ERROR_NONE)
                                 {
                                    // Error handling
                                -}
                                +} +
                                diff --git a/org.tizen.tutorials/html/native/app_framework/bundle_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/bundle_tutorial_n.htm index 6d12a46..2171947 100644 --- a/org.tizen.tutorials/html/native/app_framework/bundle_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/bundle_tutorial_n.htm @@ -18,7 +18,7 @@
                                -

                                Mobile native Wearable native

                                +

                                Mobile native Wearable native

                                Content

                                @@ -71,17 +71,26 @@

                                Initializing a Bundle

                                +

                                To initialize a bundle:

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

                                   #include <bundle.h>
                                   
                                  +
                                2. +
                                3. Before you can perform any operations on a bundle, create the bundle instance. Each bundle is independent from other bundles and stores its own set of records.

                                  bundle* bund = NULL;
                                   
                                   bund = bundle_create();
                                  +
                                4. +

                                Adding Content to a Bundle

                                +

                                To add content to a bundle:

                                +

                                Fill a valid bundle instance with content. The content is in the form of key-value pairs. The key is always a string. The value can be of the following types:

                                @@ -136,7 +145,8 @@ bundle_add_byte(bund, "Byte", "Byte content", 12);
                                -void test_bundle_add_del_get(void)
                                +void 
                                +test_bundle_add_del_get(void)
                                 {
                                    bundle *b = NULL;
                                    int count = 0;
                                @@ -169,7 +179,8 @@ void test_bundle_add_del_get(void)
                                 

                                After the bundle_foreach() function, the _bundle_iterator_t() function is invoked for each record in the bundle:

                                -void iterate_bundle_foreach(const char *key, const int type, bundle_keyval_t *kv, void *user_data)
                                +void 
                                +iterate_bundle_foreach(const char *key, const int type, bundle_keyval_t *kv, void *user_data)
                                 {
                                    dlog_print(DLOG_DEBUG, LOG_TAG, "key : %s, type : %d ", key, type);
                                     
                                @@ -207,7 +218,8 @@ void iterate_bundle_foreach(const char *key, const int type, bundle_keyval_t *kv
                                    }    
                                 }
                                 
                                -void test_bundle_foreach(void)
                                +void 
                                +test_bundle_foreach(void)
                                 {
                                    const char *s_arr[] = {"abc", "bcd", "cde"};
                                    bundle *b;
                                @@ -225,10 +237,11 @@ void test_bundle_foreach(void)
                                  
                                 

                                To store or send a bundle over a serial connection, encode the bundle to bundle_raw (a typedef of unsigned char). To encode the bundle, call the bundle_encode() function.

                                -

                                To store the bundle, write bundle_raw to a file, for example, and then open it with the bundle_decode() function. The encoded data and created bundle must be released when no longer needed.

                                +

                                To store the bundle, write bundle_raw to a file, for example, and open it with the bundle_decode() function. The encoded data and created bundle must be released when no longer needed.

                                -void test_bundle_encode_decode(void)
                                +void 
                                +test_bundle_encode_decode(void)
                                 {
                                    bundle *b1, *b2;
                                    bundle_raw *r;
                                diff --git a/org.tizen.tutorials/html/native/app_framework/data_control_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/data_control_tutorial_n.htm
                                index a5574ec..0ed8792 100644
                                --- a/org.tizen.tutorials/html/native/app_framework/data_control_tutorial_n.htm
                                +++ b/org.tizen.tutorials/html/native/app_framework/data_control_tutorial_n.htm
                                @@ -18,7 +18,7 @@
                                 
                                 
                                -

                                Mobile native Wearable native

                                +

                                Mobile native Wearable native

                                Content

                                @@ -57,7 +57,9 @@

                                Initializing Data Controls

                                - +

                                To initialize data controls:

                                +
                                  +
                                1. To use the functions and data types of the Data Control API (in mobile and wearable applications), include the <data_control.h> header file in your application:

                                   #include <data_control.h>
                                  @@ -67,17 +69,22 @@
                                   #include <glib.h>
                                   #include <string.h>
                                   
                                  +
                                2. +
                                3. To execute this application, the <sqlite3.h>, <stdlib.h>, <glib.h>, and <string.h> header files have to be included too.

                                  +
                                4. -

                                  This data control use cases run 2 applications. Each application plays a different role: one for the consumer, the other for the provider. For the consumer application, the http://tizen.org/privilege/datasharing and http://tizen.org/privilege/appmanager.launch privileges must be added. For the provider application, in the IDE, go to tizen-manifest.xml > Advanced > Data Control > Add (Read, Write SQL and Read, Write Map) access rights.

                                  +
                                5. +

                                  This data control use cases run 2 applications. Each application plays a different role: one for the consumer, the other for the provider. For the consumer application, the http://tizen.org/privilege/datasharing and http://tizen.org/privilege/appmanager.launch privileges must be added. For the provider application, in the IDE, go to tizen-manifest.xml > Advanced > Data Control > Add (Read, Write SQL and Read, Write Map) access rights.

                                  +
                                6. +

                                Working with Map-type Data Controls

                                To get, add, remove, and set map-type data using the Data Control API:

                                  -
                                1. Implement the provider application. -

                                  The provider application stores and provides data to the consumer application.

                                  +
                                2. Implement the provider application. The provider application stores and provides data to the consumer application.

                                  The provider application has 4 operations: get, add, remove, and set. To use the map-type Data Control API, these 4 operation callbacks must be implemented.

                                  @@ -88,7 +95,8 @@ typedef struct map_data
                                   } map_data_s;
                                   
                                   static GHashTable *map_repository_test;
                                  -void get_value_request_cb(int request_id, data_control_h provider, const char *key, void *user_data)
                                  +void 
                                  +get_value_request_cb(int request_id, data_control_h provider, const char *key, void *user_data)
                                   {
                                      map_data_s* map_data = (map_data_s*)g_hash_table_lookup(map_repository_test, key);
                                   
                                  @@ -111,7 +119,8 @@ void get_value_request_cb(int request_id, data_control_h provider, const char *k
                                      }
                                   }
                                   
                                  -void set_value_request_cb(int request_id, data_control_h provider, const char *key, const char *old_value, const char *new_value, void *user_data)
                                  +void 
                                  +set_value_request_cb(int request_id, data_control_h provider, const char *key, const char *old_value, const char *new_value, void *user_data)
                                   {
                                      map_data_s* map_data = (map_data_s*)g_hash_table_lookup(map_repository_test, key);
                                      if (map_data != NULL)
                                  @@ -136,7 +145,8 @@ void set_value_request_cb(int request_id, data_control_h provider, const char *k
                                      }
                                   }
                                   
                                  -void add_value_request_cb(int request_id, data_control_h provider, const char *key, const char *value, void *user_data)
                                  +void 
                                  +add_value_request_cb(int request_id, data_control_h provider, const char *key, const char *value, void *user_data)
                                   {
                                      map_data_s* map_data = (map_data_s*)g_hash_table_lookup(map_repository_test, key);
                                   
                                  @@ -174,7 +184,8 @@ void add_value_request_cb(int request_id, data_control_h provider, const char *k
                                      }
                                   }
                                   
                                  -void remove_value_request_cb(int request_id, data_control_h provider, const char *key, const char *value, void *user_data)
                                  +void 
                                  +remove_value_request_cb(int request_id, data_control_h provider, const char *key, const char *value, void *user_data)
                                   {
                                      map_data_s* map_data = (map_data_s*)g_hash_table_lookup(map_repository_test, key);
                                   
                                  @@ -211,10 +222,12 @@ void remove_value_request_cb(int request_id, data_control_h provider, const char
                                      }
                                   }
                                   
                                  - +
                                3. +
                                4. Register the callback within the app_create(void *data) function using the data_control_provider_map_register_cb() function:

                                  -void __free_key(gpointer data)
                                  +void 
                                  +__free_key(gpointer data)
                                   {
                                      if (data)
                                      {
                                  @@ -224,7 +237,8 @@ void __free_key(gpointer data)
                                      }
                                   }
                                   
                                  -void __free_data(gpointer data)
                                  +void
                                  +__free_data(gpointer data)
                                   {
                                      if (data)
                                      {
                                  @@ -235,7 +249,8 @@ void __free_data(gpointer data)
                                   }
                                   
                                   data_control_provider_map_cb map_callback;
                                  -void initialize_datacontrol_provider()
                                  +void 
                                  +initialize_datacontrol_provider()
                                   {
                                      map_repository_test = g_hash_table_new_full(g_str_hash, g_str_equal, __free_key, __free_data);
                                   
                                  @@ -257,16 +272,15 @@ void initialize_datacontrol_provider()
                                   
                                5. -
                                6. Implement the consumer application. - -

                                  The consumer application requests get, set, add, and remove functions to the provider application and receives the results from the provider application.

                                  +
                                7. Implement the consumer application. The consumer application requests get, set, add, and remove functions to the provider application and receives the results from the provider application.

                                  Implement the response callback. The response callback receives the request result and data from the provider.

                                   // Callback functions 
                                  -void map_get_response_cb(int request_id, data_control_h provider,
                                  -                         char **ret_value_list, int ret_value_count, bool provider_ret, 
                                  -                         const char *error, void *user_data)
                                  +void
                                  +map_get_response_cb(int request_id, data_control_h provider,
                                  +                    char **ret_value_list, int ret_value_count, bool provider_ret, 
                                  +                    const char *error, void *user_data)
                                   {
                                      if (provider_ret)
                                      {
                                  @@ -282,7 +296,8 @@ void map_get_response_cb(int request_id, data_control_h provider,
                                      }
                                   }
                                   
                                  -void map_set_response_cb(int request_id, data_control_h provider, bool provider_ret, const char *error, void *user_data)
                                  +void 
                                  +map_set_response_cb(int request_id, data_control_h provider, bool provider_ret, const char *error, void *user_data)
                                   {
                                      if (provider_ret)
                                      {
                                  @@ -294,7 +309,8 @@ void map_set_response_cb(int request_id, data_control_h provider, bool provider_
                                      }
                                   }
                                   
                                  -void map_add_response_cb(int request_id, data_control_h provider, bool provider_ret, const char *error, void *user_data)
                                  +void 
                                  +map_add_response_cb(int request_id, data_control_h provider, bool provider_ret, const char *error, void *user_data)
                                   {
                                      if (provider_ret)
                                      {
                                  @@ -306,7 +322,8 @@ void map_add_response_cb(int request_id, data_control_h provider, bool provider_
                                      }
                                   }
                                   
                                  -void map_remove_response_cb(int request_id, data_control_h provider, bool provider_ret, const char *error, void *user_data)
                                  +void 
                                  +map_remove_response_cb(int request_id, data_control_h provider, bool provider_ret, const char *error, void *user_data)
                                   {
                                      if (provider_ret)
                                      {
                                  @@ -318,13 +335,15 @@ void map_remove_response_cb(int request_id, data_control_h provider, bool provid
                                      }
                                   }
                                   
                                  - +
                                8. +
                                9. To identify the provider and data, initialize a data control handler. The initializing process has to be performed within the app_create(void *data) function generated by the IDE.

                                  To grant access to the provider ID, go to the provider application tizen-manifest.xml > Advanced > Data Control.

                                   data_control_map_response_cb map_callback;
                                  -void initialize_datacontrol_consumer(appdata_s *ad)
                                  +void 
                                  +initialize_datacontrol_consumer(appdata_s *ad)
                                   {
                                      const char *provider_id = Your Provider ID;
                                      const char *data_id = "table";
                                  @@ -397,14 +416,14 @@ void initialize_datacontrol_consumer(appdata_s *ad)
                                   

                                  To insert, select, update, and delete SQL-type data using the Data Control API:

                                    -
                                  1. Implement the provider application. -

                                    The provider application stores and provides data to the consumer application.

                                    +
                                  2. Implement the provider application. The provider application stores and provides data to the consumer application.

                                    The provider application has 4 operations: insert, select, update, and delete. To use the SQL-type Data Control API, these operation callbacks have to be implemented.

                                     data_control_provider_sql_cb *sql_callback;
                                     static sqlite3* db;
                                    -void insert_request_cb(int request_id, data_control_h provider, bundle *insert_data, void *user_data)
                                    +void 
                                    +insert_request_cb(int request_id, data_control_h provider, bundle *insert_data, void *user_data)
                                     {
                                        char* command = data_control_provider_create_insert_statement(provider, insert_data);
                                        int ret = sqlite3_exec(db, command, NULL, NULL, NULL);
                                    @@ -429,7 +448,8 @@ void insert_request_cb(int request_id, data_control_h provider, bundle *insert_d
                                        free(command);
                                     }
                                     
                                    -void delete_request_cb(int request_id, data_control_h provider, const char *where, void *user_data)
                                    +void 
                                    +delete_request_cb(int request_id, data_control_h provider, const char *where, void *user_data)
                                     {
                                        dlog_print(DLOG_INFO, LOG_TAG, "[delete_request_cb] request_id(%d)", request_id);
                                        char* command = data_control_provider_create_delete_statement(provider, where);
                                    @@ -452,8 +472,9 @@ void delete_request_cb(int request_id, data_control_h provider, const char *wher
                                        free(command);
                                     }
                                     
                                    -void select_request_cb(int request_id, data_control_h provider, const char **column_list, 
                                    -                       int column_count, const char *where, const char *order, void *user_data)
                                    +void 
                                    +select_request_cb(int request_id, data_control_h provider, const char **column_list, 
                                    +                  int column_count, const char *where, const char *order, void *user_data)
                                     {
                                        sqlite3_stmt* sql_stmt = NULL;
                                     
                                    @@ -479,7 +500,8 @@ void select_request_cb(int request_id, data_control_h provider, const char **col
                                        free(command);
                                     }
                                     
                                    -void update_request_cb(int request_id, data_control_h provider, bundle *update_data, const char *where, void *user_data)
                                    +void 
                                    +update_request_cb(int request_id, data_control_h provider, bundle *update_data, const char *where, void *user_data)
                                     {
                                        char* command = data_control_provider_create_update_statement(provider, update_data, where);
                                        int ret = sqlite3_exec(db, command, NULL, NULL, NULL);
                                    @@ -501,11 +523,12 @@ void update_request_cb(int request_id, data_control_h provider, bundle *update_d
                                        free(command);
                                     }
                                     
                                    - +
                                  3. +
                                  4. Register the callback and create the database:

                                    -
                                    -int create_database()
                                    +int 
                                    +create_database()
                                     {
                                        dlog_print(DLOG_INFO, LOG_TAG,  "%s%s", app_get_data_path(), "test.db");
                                     
                                    @@ -530,7 +553,8 @@ int create_database()
                                        return ret;
                                     }
                                     
                                    -void initialize_datacontrol_provider()
                                    +void
                                    +initialize_datacontrol_provider()
                                     {
                                        dlog_print(DLOG_INFO, LOG_TAG, "initialize_datacontrol_provider ");
                                     
                                    @@ -557,14 +581,13 @@ void initialize_datacontrol_provider()
                                     
                                  5. -
                                  6. Implement the consumer application. - -

                                    The consumer application requests the insert, select, update, and delete functions to the provider application and receives the result from the provider application.

                                    +
                                  7. Implement the consumer application. The consumer application requests the insert, select, update, and delete functions to the provider application and receives the result from the provider application.

                                    Implement the response callback. The response callback receives the request result and data from the provider.

                                    -void sql_delete_response_cb(int request_id, data_control_h provider, bool provider_result, const char *error, void *user_data)
                                    +void 
                                    +sql_delete_response_cb(int request_id, data_control_h provider, bool provider_result, const char *error, void *user_data)
                                     {
                                        if (provider_result)
                                        {
                                    @@ -576,8 +599,9 @@ void sql_delete_response_cb(int request_id, data_control_h provider, bool provid
                                        }
                                     }
                                     
                                    -void sql_insert_response_cb(int request_id, data_control_h provider, long long inserted_row_id, 
                                    -                            bool provider_result, const char *error, void *user_data)
                                    +void 
                                    +sql_insert_response_cb(int request_id, data_control_h provider, long long inserted_row_id, 
                                    +                       bool provider_result, const char *error, void *user_data)
                                     {
                                        if (provider_result)
                                        {
                                    @@ -589,8 +613,9 @@ void sql_insert_response_cb(int request_id, data_control_h provider, long long i
                                        }
                                     }
                                     
                                    -void sql_select_response_cb(int request_id, data_control_h provider, result_set_cursor cursor, 
                                    -                            bool provider_result, const char *error, void *user_data)
                                    +void 
                                    +sql_select_response_cb(int request_id, data_control_h provider, result_set_cursor cursor, 
                                    +                       bool provider_result, const char *error, void *user_data)
                                     {
                                        if (provider_result)
                                        {
                                    @@ -616,7 +641,8 @@ void sql_select_response_cb(int request_id, data_control_h provider, result_set_
                                        }
                                     }
                                     
                                    -void sql_update_response_cb(int request_id, data_control_h provider, bool provider_result, const char *error, void *user_data)
                                    +void 
                                    +sql_update_response_cb(int request_id, data_control_h provider, bool provider_result, const char *error, void *user_data)
                                     {
                                        if (provider_result)
                                        {
                                    @@ -628,13 +654,15 @@ void sql_update_response_cb(int request_id, data_control_h provider, bool provid
                                        }
                                     }
                                     
                                    - +
                                  8. +
                                  9. To identify the provider and data, initialize a data control handler. The initializing process has to be performed within the app_create(void *data) function generated by the IDE.

                                    To grant access to the provider ID, go to the provider application tizen-manifest.xml > Advanced > Data Control.

                                     data_control_sql_response_cb sql_callback;
                                    -void initialize_datacontrol_consumer(appdata_s *ad)
                                    +void 
                                    +initialize_datacontrol_consumer(appdata_s *ad)
                                     {
                                        int ret;
                                     
                                    diff --git a/org.tizen.tutorials/html/native/app_framework/event_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/event_tutorial_n.htm
                                    new file mode 100644
                                    index 0000000..cc62dd8
                                    --- /dev/null
                                    +++ b/org.tizen.tutorials/html/native/app_framework/event_tutorial_n.htm
                                    @@ -0,0 +1,266 @@
                                    +
                                    +
                                    +
                                    +	
                                    +	
                                    +	
                                    +	
                                    +		
                                    +	
                                    +	
                                    +	
                                    +	
                                    +
                                    +	Event: Managing Events
                                    +
                                    +
                                    +
                                    +
                                    +	
                                    +
                                    +
                                    + +

                                    Event: Managing Events

                                    + + +

                                    This tutorial demonstrates how you can publish and subscribe to events.

                                    + + +

                                    Warm-up

                                    +

                                    Become familiar with the Event API basics by learning about:

                                    + + + +

                                    Subscribing to an Event

                                    + +

                                    To subscribe to a predefined system event or user-defined event:

                                    +
                                      +
                                    1. To use the functions and data types of the Event API (in mobile and wearable applications), include the <app_event.h> header file in your application: +
                                      +#include <app_event.h> 
                                      +
                                      +
                                    2. +
                                    3. Add an event handler. +

                                      One event can have multiple event handlers, and one handler can be registered multiple times.

                                      + +
                                      • Add an event handler for a system event: + +
                                        +static void 
                                        +battery_event_callback(const char *event_name, bundle *event_data, void *user_data) 
                                        +{
                                        +   // event_name is Event-Name 
                                        +   dlog_print(DLOG_INFO, LOG_TAG, "event_name is [%s]", event_name);
                                        +
                                        +   // event_data is Event-Data, its type is bundle
                                        +   char *battery_level_status = NULL;
                                        +   battery_level_status = bundle_get_val(event_data, EVENT_KEY_BATTERY_LEVEL_STATUS);
                                        +}
                                        +
                                        +event_handler_h handler;
                                        +
                                        +// Register the event handler
                                        +int ret = event_add_event_handler(&handler, SYSTEM_EVENT_BATTERY_LEVEL_STATUS,
                                        +                                  (event_cb)battery_event_cb, user_data);
                                        +if (ret != EVENT_ERROR_NONE)
                                        +   dlog_print(DLOG_ERROR, LOG_TAG, "err: [%d]", ret);
                                        +
                                        +
                                      • + +
                                      • Add an event handler for a user-defined event: + +

                                        When defining an event name for a user event (such as event.org.tizen.senderapp.user_event), the name format is event.{sender appid}.{user-defined name}. The {user-defined name} must:

                                        +
                                          +
                                        • Contain only the ASCII characters "[A-Z][a-z][0-9]_" and not begin with a digit.
                                        • +
                                        • Not contain the '.' (period) character.
                                        • +
                                        • Not exceed the maximum name length (127 bytes).
                                        • +
                                        • Be at least 1 byte in length.
                                        • +
                                        +
                                        +ret = event_add_event_handler("event.org.tizen.senderapp.user_event",
                                        +                              utc_event_cb_with_valid_check,
                                        +                              "CUSTOM_EVENT_KEY", &event_handler);
                                        +
                                        +if (ret != EVENT_ERROR_NONE)
                                        +   dlog_print(DLOG_ERROR, LOG_TAG, "err: [%d]", ret);
                                        +
                                        +
                                    4. + +
                                    5. When no longer needed, remove the event handler. +

                                      A registered handler can be removed when application is running, and all registered handlers are removed when the application is terminated.

                                      + +
                                      +ret = event_remove_event_handler(handler);
                                      +if (ret != EVENT_ERROR_NONE)
                                      +   dlog_print(DLOG_ERROR, LOG_TAG, "err: [%d]", ret);
                                      +
                                      +
                                    6. + +
                                    + + +

                                    Publishing an Event

                                    + +

                                    To publish an event to all listeners:

                                    + +
                                      +
                                    1. To use the functions and data types of the Event API (in mobile and wearable applications), include the <app_event.h> header file in your application: +
                                      +#include <app_event.h> 
                                      +
                                      +
                                    2. +
                                    3. Create the call back for handling the event: +
                                      +static void 
                                      +user_event_cb(const char *event_name, bundle *event_data, void *user_data)
                                      +{
                                      +   dlog_print(DLOG_INFO, LOG_TAG, "user_event_cb : %s \n", event_name);
                                      +
                                      +   return;
                                      +}
                                      +
                                      +
                                    4. +
                                    5. Register the event handler and create the bundle for handling the event data: +
                                      +int ret = EVENT_ERROR_NONE;
                                      +event_handler_h event_handler;
                                      +bundle *event_data = NULL;
                                      +
                                      +ret = event_add_event_handler("event.org.tizen.senderapp.user_event",
                                      +                              user_event_cb, "CUSTOM_EVENT_KEY", &event_handler);
                                      +
                                      +if (ret != EVENT_ERROR_NONE)
                                      +dlog_print(DLOG_ERROR, LOG_TAG, "err: [%d]", ret);
                                      +
                                      +event_data = bundle_create();
                                      +
                                      +ret = bundle_add_str(event_data, user_data_key, user_data);
                                      +
                                      +
                                    6. +
                                    7. Use the event_publish_app_event() function to publish the event: +
                                      +ret = event_publish_app_event("event.org.tizen.senderapp.user_event", event_data);
                                      +
                                      +if (ret != EVENT_ERROR_NONE)
                                      +dlog_print(DLOG_ERROR, LOG_TAG, "err: [%d]", ret);
                                      +
                                      +
                                    8. +
                                    9. When no longer needed, free the bundle: +
                                      +ret = bundle_free(event_data);
                                      +
                                      +
                                    10. +
                                    + +

                                    Managing Launch-On-Events

                                    + +

                                    To manage a Launch-On-Event:

                                    + +
                                + + + + + + + + +
                                Note
                                Only service applications can register and receive Launch-On-Events.
                                + +
                                  +
                                1. To register an interest in a Launch-On-Event, define the http://tizen.org/appcontrol/operation/launch_on_event operation in the tizen-manifest.xml file. The URI name for the operation represents the event name in the Launch-On-Event format (event://{Event_Name}). + +
                                  +<app-control>
                                  +   <operation name="http://tizen.org/appcontrol/operation/launch_on_event"/>
                                  +   <uri name="event://tizen.system.event.battery_charger_status"/>
                                  +</app-control>
                                  +
                                  + +

                                  The Launch-On-Event operation cannot be requested using the app_control_send_launch_request() function, unlike other application control operations.

                                  +
                                2. + +
                                3. Receive the event: + +
                                  +static void 
                                  +*app_control(app_control_h app_control, void *data)
                                  +{
                                  +   char *event_uri = "event://tizen.system.event.battery_charger_status";
                                  +   char *operation, char *uri, char *event_value;
                                  +   ret = app_control_get_operation(app_control, &operation);
                                  +
                                  +   if (ret == APP_CONTROL_ERROR_NONE && operation &&
                                  +       strcmp(operation, APP_CONTROL_OPERATION_LAUNCH_ON_EVENT) == 0) 
                                  +   {
                                  +      ret = app_control_get_uri(app_control, &uri);
                                  +      if (ret == APP_CONTROL_ERROR_NONE && uri) 
                                  +      {
                                  +         if (strncmp(uri, event_uri, strlen(event_uri) + 1) == 0) 
                                  +         {
                                  +            ret = app_control_get_extra_data(app_control, "battery_charger_status", &event_value);
                                  +            if (ret == APP_CONTROL_ERROR_NONE && event_value) 
                                  +            {
                                  +               free(event_value);
                                  +            }
                                  +            // Use event_add_event_handler() for further event subscriptions here
                                  +         }
                                  +         free(uri);
                                  +      }
                                  +      free(operation);
                                  +   }
                                  +}
                                  +
                                  +

                                  The application can get the event name and data in the first app_control_cb() callback, which is called after the application state changes to created.

                                  +
                                4. +
                                + + + + +
                                + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/native/app_framework/message_port_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/message_port_tutorial_n.htm index d0e7682..4d93627 100644 --- a/org.tizen.tutorials/html/native/app_framework/message_port_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/message_port_tutorial_n.htm @@ -18,7 +18,7 @@
                                -

                                Mobile native Wearable native

                                +

                                Mobile native Wearable native

                                Content

                                @@ -105,7 +105,9 @@ int message_port_register_local_port(const char* local_port, message_port_messag

                                Implement the following codes in Application 2. Implement the message_port_cb() callback function for the message_port_register_local_port() function.

                                -void message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, bool trusted_remote_port, bundle *message, void *user_data)
                                +void 
                                +message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, 
                                +                bool trusted_remote_port, bundle *message, void *user_data)
                                 {
                                    char *command = NULL;
                                    char *data = NULL;
                                @@ -150,7 +152,8 @@ int message_port_check_remote_port(const char* remote_app_id, const char* remote
                                 
                                 

                                Implement the following codes in Application 1:

                                -bool test_check_remote_port() 
                                +bool 
                                +test_check_remote_port() 
                                 {
                                    int ret;
                                    bool found;
                                @@ -160,7 +163,6 @@ bool test_check_remote_port()
                                    {
                                       dlog_print(DLOG_ERROR, TAG, "message_port_check_remote_port error : %d", ret);	   
                                    }
                                -
                                    return found;
                                 }
                                 
                                @@ -183,7 +185,8 @@ bool test_check_remote_port()
                              -void send_message(void)
                              +void 
                              +send_message(void)
                               {
                                  int ret;
                                  bundle *b = bundle_create ();
                              @@ -215,7 +218,9 @@ void send_message(void)
                                 
                                 
                               
                              -void message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, bool trusted_remote_port, bundle *message, void *user_data)
                              +void 
                              +message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, 
                              +                bool trusted_remote_port, bundle *message, void *user_data)
                               {
                               
                                  int ret;
                              @@ -244,7 +249,9 @@ void message_port_cb(int local_port_id, const char *remote_app_id, const char *r
                               	

                              Register the local port in Application 1.

                              -void message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, bool trusted_remote_port, bundle *message, void *user_data)
                              +void 
                              +message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, 
                              +                bool trusted_remote_port, bundle *message, void *user_data) 
                               {
                                  char *result = NULL;
                                  bundle_get_str(message, "result", &result);
                              @@ -281,7 +288,8 @@ else
                               
                                 

                              Implement the following codes in Application 1:

                              -void send_message_with_local_port(int local_port_id) 
                              +void 
                              +send_message_with_local_port(int local_port_id) 
                               {
                                  int ret;
                                  bundle *b = bundle_create ();
                              diff --git a/org.tizen.tutorials/html/native/app_framework/notification_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/notification_tutorial_n.htm
                              index 7db32b4..43fe6eb 100644
                              --- a/org.tizen.tutorials/html/native/app_framework/notification_tutorial_n.htm
                              +++ b/org.tizen.tutorials/html/native/app_framework/notification_tutorial_n.htm
                              @@ -18,7 +18,7 @@
                               
                               
                              -

                              Mobile native Wearable native

                              +

                              Mobile native Wearable native

                              Content

                              @@ -94,84 +94,43 @@

                              To initialize notifications:

                              1. To use the functions and data types of the Notification API (in mobile and wearable applications), include the <notification.h> header file in your application:
                                -#include <notification.h>
                              2. +#include <notification.h> +
                            12. To follow this tutorial, place an image file in, for example, your application's shared resource directory. The following variables are used in the tutorial code: -
                              static notification_h notification = NULL;
                              +
                              +static notification_h notification = NULL;
                               char *image_path[BUFLEN];
                               char * shared_path = app_get_shared_resource_path();
                               snprintf(image_path, BUFLEN, "%stutorial_native_api_application.png", shared_path);
                              -free(shared_path);
                            +free(shared_path); +

                Creating a Notification

                -

                To create a notification:

                -

                Initialize a notification handle by calling the notification_create() function:

                -
                notification_h notification_create(notification_type_e type)
                - -

                The function takes the following parameters:

                -
                  -
                • [in] type: Notification type.
                • -
                +

                Initialize a notification handle by calling the notification_create() function. It takes the notification type as a parameter. The possible values for the type parameter are listed in the _notification_type enumeration (in mobile and wearable applications).

                -

                The possible values for the type parameter are:

                -
                  -
                • NOTIFICATION_TYPE_NOTI: Create a regular notification.
                • -
                • NOTIFICATION_TYPE_ONGOING: Create an ongoing notification.
                • -
                - -

                The following example code creates an ongoing notification and checks whether the initialization was successful:

                -
                notification = notification_create(NOTIFICATION_TYPE_ONGOING);
                +
                +notification = notification_create(NOTIFICATION_TYPE_ONGOING);
                 if (notification != NULL)
                 {
                    // Notification was initialized successfully
                -}
                +} +

                Setting Notification Attributes

                You can set the following attributes for a notification:

                - -

                Setting the Notification Text

                - -

                To set the text to display in the notification view, use the notification_set_text() function:

                - -
                notification_set_text (notification_h noti, notification_text_type_e type, const char *text, const char *key, int args_type, ...)
                - -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] type: Notification text type.
                • -
                • [in] text: Text to display in the notification view.
                • -
                • [in] key: Text key for localization.
                • -
                • [in] args_type: Variable parameter for a type-value pair.
                • -
                +
              • Set the notification text. -

                The possible values for the type parameter are:

                -
                  -
                • NOTIFICATION_TEXT_TYPE_TITLE
                • -
                • NOTIFICATION_TEXT_TYPE_CONTENT
                • -
                • NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF
                • -
                • NOTIFICATION_TEXT_TYPE_EVENT_COUNT
                • -
                • NOTIFICATION_TEXT_TYPE_INFO_1
                • -
                • NOTIFICATION_TEXT_TYPE_INFO_SUB_1
                • -
                • NOTIFICATION_TEXT_TYPE_INFO_2
                • -
                • NOTIFICATION_TEXT_TYPE_INFO_SUB_2
                • -
                • NOTIFICATION_TEXT_TYPE_INFO_3
                • -
                • NOTIFICATION_TEXT_TYPE_INFO_SUB_3
                • -
                • NOTIFICATION_TEXT_TYPE_GROUP_TITLE
                • -
                • NOTIFICATION_TEXT_TYPE_GROUP_CONTENT
                • -
                • NOTIFICATION_TEXT_TYPE_GROUP_CONTENT_FOR_DISPLAY_OPTION_IS_OFF
                • -
                +

                To set the text to display in the notification view, use the notification_set_text() function. The function takes the notification handle, notification text type, the text to display in the notification view, text key for localization, and the variable parameter for a type-value pair as its parameters. The possible values for the type parameter are listed in the _notification_text_type enumeration (in mobile and wearable applications).

                +
                +int ret =0;
                +ret = notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "text", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
                +

                The notification_set_text() function sets the title and content string. If the text is formatted data (only d, f, and s are supported), set the type-value pair:

                  @@ -179,275 +138,148 @@ if (notification != NULL)
                • If f, the type is NOTIFICATION_VARIABLE_TYPE_DOUBLE and the value is a double.
                • If s, the type is NOTIFICATION_VARIABLE_TYPE_STRING and the value is a string.
                -

                If the type is NOTIFICATION_VARIABLE_TYPE_COUNT, the notification count is displayed with the text. If the value is NOTIFICATION_COUNT_POS_LEFT, the count is displayed to the left of the text. If the value is NOTIFICATION_COUNT_POS_IN, the count is displayed in the text when the text is of the d format. If the value is NOTIFICATION_COUNT_POS_RIGHT, the count is displayed to the right of the text. Variable parameters should be terminated by NOTIFICATION_VARIABLE_TYPE_NONE.

                +

                If the type is NOTIFICATION_VARIABLE_TYPE_COUNT, the notification count is displayed with the text. If the value is NOTIFICATION_COUNT_POS_LEFT, the count is displayed to the left of the text. If the value is NOTIFICATION_COUNT_POS_IN, the count is displayed in the text when the text is of the d format. If the value is NOTIFICATION_COUNT_POS_RIGHT, the count is displayed to the right of the text. Variable parameters must be terminated by NOTIFICATION_VARIABLE_TYPE_NONE.

                Check whether the operation was successful by retrieving and comparing the return value of any function to NOTIFICATION_ERROR_NONE:

                - -
                int ret =0;
                -ret = notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "text", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
                +
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                - -

                Setting the Notification Timestamp

                - -

                To set the timestamp to display in the notification text, use the notification_set_time_to_text() function:

                - -
                notification_set_time_to_text (notification_h noti, notification_text_type_e type, time_t time)
                +} +
                +
              • -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] type: Notification text type. For information about the possible values, see Setting the Notification Text.
                • -
                • [in] time_t: Timestamp to display in the notification text.
                • -
                +
              • Set the notification timestamp. -
                ret = notification_set_time_to_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, time(NULL));
                +

                To set the timestamp to display in the notification text, use the notification_set_time_to_text() function. The parameters are the notification handle, notification text type, and the timestamp. The possible values for the type parameter are listed in the _notification_text_type enumeration (in mobile and wearable applications).

                +
                +ret = notification_set_time_to_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, time(NULL));
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                - -

                Setting the Notification Image

                - -

                To set the image to display in the notification view, use the notification_set_image() function:

                - -
                notification_set_image (notification_h noti, notification_image_type_e type, const char *image_path)
                - -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] type: Notification image type.
                • -
                • [in] image_path: Absolute path and file name of the image file.
                • -
                +} +
                +
              • -

                The possible values for the type parameter are:

                -
                  -
                • NOTIFICATION_IMAGE_TYPE_ICON
                • -
                • NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR
                • -
                • NOTIFICATION_IMAGE_TYPE_ICON_FOR_LOCK
                • -
                • NOTIFICATION_IMAGE_TYPE_THUMBNAIL
                • -
                • NOTIFICATION_IMAGE_TYPE_THUMBNAIL_FOR_LOCK
                • -
                • NOTIFICATION_IMAGE_TYPE_ICON_SUB
                • -
                • NOTIFICATION_IMAGE_TYPE_BACKGROUND
                • -
                • NOTIFICATION_IMAGE_TYPE_LIST_1
                • -
                • NOTIFICATION_IMAGE_TYPE_LIST_2
                • -
                • NOTIFICATION_IMAGE_TYPE_LIST_3
                • -
                • NOTIFICATION_IMAGE_TYPE_LIST_4
                • -
                • NOTIFICATION_IMAGE_TYPE_LIST_5
                • -
                +
              • Set the notification image. +

                To set the image to display in the notification view, use the notification_set_image() function. The parameters are the notification handle, notification image type, and the image path. The possible values for the image type are listed in the _notification_image_type enumeration (in mobile and wearable applications).

                ret = notification_set_image(notification, NOTIFICATION_IMAGE_TYPE_ICON, image_path);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                 }
                +
              • -

                Setting the Notification Display Options

                +
              • Set the notification display options. -

                To set how applications display the notification, use the notification_set_display_applist() function:

                - -
                notification_set_display_applist (notification_h noti, int applist)
                - -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] applist: Notification display option. You can set multiple options with the "|" pipe operation.
                • -
                - -

                The possible values for the applist parameter are:

                -
                  -
                • NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY
                • -
                • NOTIFICATION_DISPLAY_APP_TICKER
                • -
                • NOTIFICATION_DISPLAY_APP_LOCK
                • -
                • NOTIFICATION_DISPLAY_APP_INDICATOR
                • -
                • NOTIFICATION_DISPLAY_APP_ACTIVE
                • -
                • NOTIFICATION_DISPLAY_APP_ALL
                • -
                - -

                You can combine the flags in the function by using the pipe "|" operation:

                -
                ret = notification_set_display_applist(notification, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
                +

                To set how applications display the notification, use the notification_set_display_applist() function. The parameters are the notification handle and the notification display option. You can set multiple options with the "|" pipe operation. The possible values for the display option are listed in the _notification_display_applist enumeration (in mobile and wearable applications).

                +
                +ret = notification_set_display_applist(notification, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                - -

                Setting the LED Options

                - -

                To set the LED options for a notification, use the notification_set_led() and notification_set_led_time_period() functions:

                -
                notification_set_led (notification_h noti, notification_led_op_e operation, int led_argb)
                -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] operation: LED notification operation.
                • -
                • [in] led_argb: Notification LED color.
                • -
                -

                The possible values for the operation parameter are:

                -
                  -
                • NOTIFICATION_LED_OP_ON
                • -
                • NOTIFICATION_LED_OP_ON_CUSTOM_COLOR
                • -
                +} +
                +
              • -
                notification_set_led_time_period (notification_h noti, int on_ms, int off_ms)
                -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] on_ms: Time for turning on the LED.
                • -
                • [in] off_ms: Time for turning off the LED.
                • -
                +
              • Set the LED options. -
                ret = notification_set_led(notification, NOTIFICATION_LED_OP_ON, 100);
                +

                To set the LED options for a notification, use the notification_set_led() and notification_set_led_time_period() functions.

                +

                The notification_set_led() function sets the LED operation. The parameters are the notification handle, LED notification operation, and the notification LED color. The possible values for the LED notification operation are listed in the _notification_led_op enumeration (in mobile and wearable applications).

                +
                +ret = notification_set_led(notification, NOTIFICATION_LED_OP_ON, 100);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                 }
                +
                + +

                The notification_set_led_time_period() function sets the time period when the LED is switched on and off. The parameters are the notification handle, time for switching the LED on, and time for switching the LED off.

                +
                 ret = notification_set_led_time_period(notification, 100, 100);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                - -

                Setting Notification Properties

                - -

                To set a notification property, use the notification_set_property() function:

                -
                notification_set_property (notification_h noti, int flags)
                - -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] flags: Notification property. You can set multiple properties with the "|" pipe operation.
                • -
                - -

                The possible values for the flags parameter are:

                -
                  -
                • NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE
                • -
                • NOTIFICATION_PROP_DISABLE_APP_LAUNCH
                • -
                • NOTIFICATION_PROP_DISABLE_AUTO_DELETE
                • -
                • NOTIFICATION_PROP_LAUNCH_UG
                • -
                • NOTIFICATION_PROP_DISABLE_TICKERNOTI
                • -
                • NOTIFICATION_PROP_DISABLE_UPDATE_ON_INSERT
                • -
                • NOTIFICATION_PROP_DISABLE_UPDATE_ON_DELETE
                • -
                • NOTIFICATION_PROP_VOLATILE_DISPLAY
                • -
                +} +
                +
              • +
              • Set notification properties. -
                ret = notification_set_property(notification, NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
                +

                To set a notification property, use the notification_set_property() function. The parameters are the notification handle and the notification property. You can set multiple properties with the "|" pipe operation. The possible values for the notification property are listed in the _notification_property enumeration (in mobile and wearable applications).

                +
                +ret = notification_set_property(notification, NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                - -

                Adding a button on Active Notification

                -

                To add a button on Active Notification, use the notification_add_button() function and notification_set_event_handler() function:

                -
                notification_add_button(notification_h noti, notification_button_index_e button_index)
                - -

                This function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] button_index: Button index.
                • -
                - -

                The possible values for the button_index parameter are:

                -
                  -
                • NOTIFICATION_BUTTON_1
                • -
                • NOTIFICATION_BUTTON_2
                • -
                • NOTIFICATION_BUTTON_3
                • -
                • NOTIFICATION_BUTTON_4
                • -
                • NOTIFICATION_BUTTON_5
                • -
                • NOTIFICATION_BUTTON_6
                • -
                +} +
                +
              • +
              • Add a button on the active notification. -
                notification_set_event_handler(notification_h noti, notification_event_type_e event_type, app_control_h event_handler)
                +

                To add a button on the active notification, use the notification_add_button() and notification_set_event_handler() functions.

                -

                This function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                • [in] button_index: Button index.
                • -
                • [in] event_handler: app control handle.
                • -
                +

                The parameters to the notification_add_button() function are the notification handle and the button index. The possible values for the button index parameter are listed in the _notification_button_index enumeration (in mobile and wearable applications).

                -

                The possible values for the event_type parameter are:

                -
                  -
                • NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1
                • -
                • NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_2
                • -
                • NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_3
                • -
                • NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_4
                • -
                • NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_5
                • -
                • NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_6
                • -
                +

                The parameters to the notification_set_event_handler() function are the notification handle, the button index, and the app control handle. The possible values for the app control handle are listed in the _notification_event_type enumeration (in mobile and wearable applications).

                -
                -noti_errnotification_add_button(noti, NOTIFICATION_BUTTON_1);
                -if (noti_err != NOTIFICATION_ERROR_NONE) {
                +noti_err = notification_add_button(noti, NOTIFICATION_BUTTON_1);
                +if (noti_err != NOTIFICATION_ERROR_NONE) 
                +{
                    // Error handling
                 }
                 
                 app_control_h app_control = NULL;
                 
                -app_control_create(&app_control);
                -app_control_set_app_id(app_control, "org.tizen.app");
                +app_control_create(&app_control);
                +app_control_set_app_id(app_control, "org.tizen.app");
                 noti_err  = notification_set_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1, app_control);
                -if (noti_err != NOTIFICATION_ERROR_NONE) {
                +if (noti_err != NOTIFICATION_ERROR_NONE) 
                +{
                    // Error handling
                 }
                 
                 app_control_destroy(app_control);
                -}
                - -

                Posting a Notification

                - -

                To post a notification to the database, use the notification_post() function:

                -
                notification_post (notification_h noti)
                -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • + +
                +

                Posting a Notification

                -
                ret = notification_post(notification);
                +

                To post a notification to the database, use the notification_post() function. The function takes the notification handle as a parameter.

                +
                +ret = notification_post(notification);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                +} +

                Updating Notification Content

                -

                To update the content of a notification, use the notification_update() function:

                -
                notification_update (notification_h noti)
                -

                The function takes the following parameters:

                -
                  -
                • [in] noti: Notification handle.
                • -
                +

                To update the content of a notification, use the notification_update() function. The function takes the notification handle as a parameter.

                The notification_update() function works only for ongoing notifications.

                -
                ret = notification_update (notification);
                +
                +ret = notification_update (notification);
                 if (ret != NOTIFICATION_ERROR_NONE)
                 {
                    // Error handling
                -}
                +} +

                Deleting a Notification

                To delete a notification:

                -
                1. To delete a notification from the database, use the notification_delete() function: -
                  notification_delete(notification_h noti)
                  -

                  The function takes the following parameters:

                  -
                    -
                  • [in] noti: Notification handle.
                  • -
                  +
                  1. To delete a notification from the database, use the notification_delete() function. The function takes the notification handle as a parameter. -
                    ret = notification_delete(notification);
                    +
                    +ret = notification_delete(notification);
                     if (ret != NOTIFICATION_ERROR_NONE)
                     {
                        // Error handling
                     }
                  2. -
                  3. After deleting the notification, free the internal structure data of the notification handle by calling the notification_free() function:

                    -
                    notification_free (notification_h noti)
                    - -

                    The function takes the following parameters:

                    -
                      -
                    • [in] noti: Notification handle.
                    • -
                    +
                  4. After deleting the notification, free the internal structure data of the notification handle by calling the notification_free() function. The function takes the notification handle as a parameter.

                    ret = notification_free(notification);
                     if (ret != NOTIFICATION_ERROR_NONE)
                    @@ -490,7 +322,8 @@ ecore_timer_add(1, timeout_func, NULL);
                     
                  5. To update the progress bar, use the notification_load_by_tag() function for getting the notification handle:
                    -static Eina_Bool timeout_func(void *data)
                    +static 
                    +Eina_Bool timeout_func(void *data)
                     {
                        static int i = 0;
                        double progress = 0;
                    @@ -509,10 +342,8 @@ static Eina_Bool timeout_func(void *data)
                     
                           return ECORE_CALLBACK_DONE; 
                        } 
                    -
                        return ECORE_CALLBACK_PASS_ON;
                     }
                    -
                     

                  Figure: Progress bar

                  diff --git a/org.tizen.tutorials/html/native/app_framework/package_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/package_tutorial_n.htm index fd5d066..d4c75fe 100644 --- a/org.tizen.tutorials/html/native/app_framework/package_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/package_tutorial_n.htm @@ -18,7 +18,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  Content

                  diff --git a/org.tizen.tutorials/html/native/app_framework/preference_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/preference_tutorial_n.htm new file mode 100644 index 0000000..015fa2e --- /dev/null +++ b/org.tizen.tutorials/html/native/app_framework/preference_tutorial_n.htm @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + Preference: Managing Preferences + + + + + + +
                  + +

                  Preference: Managing Preferences

                  + + +

                  This tutorial demonstrates how you can manage application preferences.

                  + +

                  Warm-up

                  +

                  Become familiar with the Preference API basics by learning about:

                  + + + +

                  Managing Application Preferences

                  + +

                  You can set and get application preference data. Any stored preference data can also be shared with among the applications in the same package.

                  + +

                  To manage preferences:

                  + +
                  1. +

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

                    +
                    +#include <app.h>
                    +#include <app_preference.h>
                    +
                  2. + +
                  3. Store and retrieve simple type variables. +

                    To store a variable, you must create a key-value pair. Use the following functions to create a key-value pair for a specific simple type:

                    + +
                    • preference_set_int(const char *key, int value)
                    • +
                    • preference_set_double(const char *key, double value)
                    • +
                    • preference_set_boolean(const char *key, bool value)
                    + +

                    Before storing or retrieving a variable, check whether it exists using:

                    + +
                    • preference_is_existing(const char *key, bool *existing)
                    + +

                    Use the following functions to retrieve a stored variable of a given simple type:

                    + +
                    • preference_get_int(const char *key, int *value)
                    • +
                    • preference_get_double(const char *key, double *value)
                    • +
                    • preference_get_boolean(const char *key, bool *value)
                    + + +
                    +const char *integer_key = "integer_key";
                    +int integer_value = 1;
                    +int integer_output;
                    +
                    +preference_set_int(integer_key, integer_value);
                    +
                    +preference_is_existing(integer_key, &existing);
                    +
                    +preference_get_int(integer_key, &integer_output);
                    +
                  4. + + +
                  5. Use the following functions to store and retrieve string variables: + +
                      +
                    • preference_set_string(const char *key, const char *value)
                    • +
                    • preference_get_string(const char *key, char **value)
                    • +
                    + +

                    Release the value returned by the get function using the free() function.

                    +
                    +const char *string_key = "string_key";
                    +const char *string_value = "Sample content";
                    +char *string_output;
                    +bool existing;
                    +
                    +preference_set_string(string_key, string_value);
                    +
                    +preference_is_existing(string_key, &existing);
                    +
                    +preference_get_string(string_key, &string_output);
                    +
                    +free(string_output);
                    +
                  6. + +
                  7. Track variables. +

                    You can set a different callback function to each variable. The callback function is invoked each time the variable is changed.

                    + +
                    +int previous_value;
                    +
                    +preference_set_changed_cb(integer_key, preference_changed_cb_impl, &previous_value);
                    +
                    + +

                    Pass custom parameters to the callback function in the user_data field.

                    + +
                    +void 
                    +preference_changed_cb_impl(const char *key, void *user_data)
                    +{
                    +   int ret = 0;
                    +   int integer_output = 0;
                    +
                    +   dlog_print(DLOG_DEBUG, LOG_TAG, "[preference_changed_cb_impl]\n");
                    +   preference_get_int(key, &integer_output);
                    +     
                    +   dlog_print(DLOG_DEBUG, LOG_TAG, "Key: %s has changed its value to %d \n", 
                    +              key, integer_output);
                    +}
                    +
                    + + +

                    Unset a callback function based on a variable key.

                    +
                    preference_unset_changed_cb(const char *key);
                  8. + + +
                  9. List all records with the foreach function. The function calls a specific callback function for each key-value pair in the database. You can pass additional data to the function in the user_data field. + +
                    preference_foreach_item(preference_foreach_item_cb, NULL);
                    + +

                    If the callback function returns false, or if all the records have been opened, the foreach function ends.

                    + +
                    +bool 
                    +preference_foreach_item_cb(const char *key, void *user_data)
                    +{
                    +   dlog_print(DLOG_DEBUG, LOG_TAG, "[preference_foreach_item_cb]\n");
                    +   dlog_print(DLOG_DEBUG, LOG_TAG, "Key found: %s\n", key);
                    +
                    +   return true;
                    +}
                    +
                  10. + +
                  11. Delete records one by one using a unique key. You can also delete all records for an application using the remove_all() function. + +
                    +preference_remove(const char *key)
                    +
                    +preference_remove_all(void)
                    +
                  + + + + +
                  + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/native/app_framework/service_app_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/service_app_tutorial_n.htm index b676429..7ed0d76 100644 --- a/org.tizen.tutorials/html/native/app_framework/service_app_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/service_app_tutorial_n.htm @@ -18,7 +18,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  Content

                  @@ -63,41 +63,46 @@
                  • -

                    Add a callback for initializing the service application. This callback is called when the application is launched.

                    -

                    Use the callback to write the necessary initialization code, such as setting up the dbus connection.

                    -

                    The callback returns a Boolean value. If there is a critical error during the launch, the return is false, thereby cancelling the launch. Otherwise, the return is true.

                    -

                    The callback receives user data.

                    -
                    bool service_app_create(void *data)
                    +

                    Add a callback for initializing the service application. This callback is called when the application is launched. Use the callback to write the necessary initialization code, such as setting up the dbus connection.

                    +

                    The callback returns a Boolean value. If there is a critical error during the launch, the return is false, thereby cancelling the launch. Otherwise, the return is true. The callback receives user data.

                    +
                    +bool 
                    +service_app_create(void *data)
                     {
                        dlog_print(DLOG_DEBUG, LOG_TAG, "%s", __func__);
                     
                        return true;
                    -}
                    +} +
                  • -

                    Add a callback for terminating the service application. This callback is called when the application terminates.

                    -

                    Use the callback to release all resources, especially any allocations and shared resources used by other applications.

                    -

                    The callback returns nothing: Its return type is void.

                    -

                    The service_app_exit() function quits the application's main loop internally.

                    -
                    void __service_app_terminate(void *data)
                    +

                    Add a callback for terminating the service application. This callback is called when the application terminates. Use the callback to release all resources, especially any allocations and shared resources used by other applications.

                    +

                    The callback returns nothing: Its return type is void. The service_app_exit() function quits the application's main loop internally.

                    +
                    +void
                    +__service_app_terminate(void *data)
                     {
                        dlog_print(DLOG_DEBUG, LOG_TAG, "%s", __func__);
                        service_app_exit();
                     
                        return;
                    -}
                    +} +
                  • Add a control callback for handling service requests from other applications. This callback is called when the service application receives an app_control request from another application.

                    -
                    void __service_app_control (app_control_h app_control, void *data)
                    +
                    +void
                    +__service_app_control(app_control_h app_control, void *data)
                     {
                        dlog_print(DLOG_DEBUG, LOG_TAG, "%s", __func__);
                        service_app_exit();
                     
                        return;
                    -}
                    +} +
                  @@ -112,7 +117,9 @@
                2. Add the low memory callback for handling the low memory event. This callback is called when the device is low on memory.

                  -
                  void service_app_low_memory_callback(void *data)
                  +
                  +void 
                  +service_app_low_memory_callback(void *data)
                   {
                      dlog_print(DLOG_DEBUG, LOG_TAG, "%s", __func__);
                      service_app_exit();
                  @@ -124,7 +131,9 @@
                   
                   
                3. Add the low battery callback for handling the low battery event. This callback is called when the device is low on battery power.

                  -
                  void service_app_low_battery_callback(void *data)
                  +
                  +void 
                  +service_app_low_battery_callback(void *data)
                   {
                      dlog_print(DLOG_DEBUG, LOG_TAG, "%s", __func__);
                      service_app_exit();
                  @@ -142,7 +151,9 @@
                   
                   

                  Set the callbacks in the service_app_event_callback_s structure. This structure is passed to the function that starts the service application.

                  -
                  int main(int argc, char* argv[])
                  +
                  +int 
                  +main(int argc, char* argv[])
                   {
                      appdata_s ad = {0,};
                      service_app_lifecycle_callback_s event_callback = {0,};
                  diff --git a/org.tizen.tutorials/html/native/app_framework/shortcut_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/shortcut_tutorial_n.htm
                  index 359ff2e..b94b7ca 100644
                  --- a/org.tizen.tutorials/html/native/app_framework/shortcut_tutorial_n.htm
                  +++ b/org.tizen.tutorials/html/native/app_framework/shortcut_tutorial_n.htm
                  @@ -18,20 +18,19 @@
                   	
                   

              Related Info

              @@ -40,27 +39,15 @@

              Shortcut: Adding a Shortcut to Home

              -

              This tutorial demonstrates how you can add shortcuts on the home screen, and track when shortcuts are added to the home screen.

              - - - - - - - - - -
              Note
              This feature is supported in mobile applications only.
              +

              This tutorial demonstrates how you can add shortcuts and widgets on the home screen, and track when they are added to the home screen.

              Warm-up

              Become familiar with the Shortcut API basics by learning about:

              -
              • Adding a Widget -

                Add a widget to the home screen.

              • +

                Add a widget to the home screen.

              Adding a Shortcut

              @@ -69,18 +56,23 @@
                -
              1. To use the functions and data types of the Shortcut API, include the <shortcut_manager.h> header file in your application:

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

                 #include <shortcut_manager.h>
                 
              3. -
              4. To add a shortcut, use the shortcut_add_to_home() function:

                +
              5. Add a shortcut using the shortcut_add_to_home() function:

                + +
                +shortcut_add_to_home("Music Player", LAUNCH_BY_APP, NULL, "/path/to/icon", 1, result_cb, NULL);
                +
                -
                shortcut_add_to_home("Music Player", LAUNCH_BY_APP, NULL, "/path/to/icon", 1, result_cb, NULL);

                To add a shortcut, you have to know the package name and set an icon for the application. The icon parameter can be set to NULL (as above) to add a default icon for the application.

              6. -
              7. To track possible errors, define a callback function:

                -
                static int result_cb(int ret, void *data)
                +
              8. Define a callback function to track possible errors:

                +
                +static int 
                +result_cb(int ret, void *data)
                 {
                    if (ret < 0)
                    {
                @@ -94,20 +86,23 @@
                 

              Adding a Widget

              -

              To add a Widget to the home screen from your application:

              +

              To add a widget to the home screen from your application:

                -
              1. -

                Before adding a widget on the home screen, a widget application must be prepared. Refer the Widget application tutorial and create a widget application

                -
              2. -
              3. To add a widget, use the shortcut_add_to_home_widget() function:

                +
              4. Before adding a widget on the home screen, a widget application must be prepared. For more information on creating a widget application, see Widget Application Tutorial.

              5. -
                shortcut_add_to_home_widget("alter_name", WIDGET_SIZE_1x1, "org.tizen.testwidget", "/opt/media/Pictures/alter_icon.png", -1.0f, 0, result_cb, NULL);
                +
              6. Add a widget with the shortcut_add_to_home_widget() function:

                -

                To add a widget, you have to know the widget id and supported sizes.

                -

                Alter name and icon will be shown when the widget is not available.

              7. +
                +shortcut_add_to_home_widget("alter_name", WIDGET_SIZE_1x1, "org.tizen.testwidget", 
                +                            "/opt/media/Pictures/alter_icon.png", -1.0f, 0, result_cb, NULL);
                +
                + +

                To add a widget, you have to know the widget ID and supported sizes. The alter name and icon are shown when the widget is not available.

                -
              8. To track possible errors, define a callback function:

                -
                static int result_cb(int ret, void *data)
                +
              9. Define a callback function to track possible errors:

                +
                +static int 
                +result_cb(int ret, void *data)
                 {
                    if (ret < 0)
                    {
                diff --git a/org.tizen.tutorials/html/native/app_framework/watch_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/watch_tutorial_n.htm
                index de4ef17..ea396a5 100644
                --- a/org.tizen.tutorials/html/native/app_framework/watch_tutorial_n.htm
                +++ b/org.tizen.tutorials/html/native/app_framework/watch_tutorial_n.htm
                @@ -18,7 +18,7 @@
                 
                 
                -

                Wearable native

                +

                Wearable native

                Content

                @@ -45,16 +45,7 @@

                This tutorial demonstrates how you can create a watch application, set the time, and use the ambient mode.

                - - - - - - - - - -
                Note
                This feature is supported in wearable applications only.
                +

                This feature is supported in wearable applications only.

                Warm-up

                Become familiar with the Watch Application API basics by learning about:

                @@ -95,7 +86,8 @@
                • The create callback is called before the application main loop starts. In this callback, you can initialize the application resources, such as create windows and data structures.
                  -bool app_create(int width, int height, void* user_data)
                  +bool 
                  +app_create(int width, int height, void* user_data)
                   {
                      // Hook to take necessary actions before the main event loop starts
                      // This usually means initializing the UI and application data
                  @@ -106,7 +98,8 @@ bool app_create(int width, int height, void* user_data)
                   
                • The app_control callback is called when another application sends a launch request to the application.
                  -void app_control(app_control_h app_control, void* user_data) 
                  +void 
                  +app_control(app_control_h app_control, void* user_data) 
                   {
                      // Handle the launch request, show the user the task requested through the "app_control" parameter
                   }
                  @@ -114,7 +107,8 @@ void app_control(app_control_h app_control, void* user_data)
                   
                • The pause callback is called when the application is completely obscured by another application and becomes invisible.
                  -void app_pause(void* user_data) 
                  +void 
                  +app_pause(void* user_data) 
                   {
                      // Take necessary actions when application becomes invisible 
                      // Release the resources needed to draw the normal watch 
                  @@ -122,7 +116,9 @@ void app_pause(void* user_data)
                   
                • The resume callback is called when the application becomes visible. -
                  void app_resume(void* user_data)
                  +
                  +void 
                  +app_resume(void* user_data)
                   {
                      // Take the necessary actions when application becomes visible
                      // Acquire the resources needed to draw the normal watch 
                  @@ -130,7 +126,9 @@ void app_pause(void* user_data)
                   
                • The terminate callback is called when the application main loop exits. -
                  void app_terminate(void* user_data)
                  +
                  +void 
                  +app_terminate(void* user_data)
                   {
                      // Release all resources
                   }
                  @@ -138,7 +136,8 @@ void app_pause(void* user_data)
                   
                • The time_tick callback is called at least once per second. The watch applications can get the current time from the watch_time time handle to draw a normal watch.
                  -void app_time_tick(watch_time_h watch_time, void* user_data)
                  +void 
                  +app_time_tick(watch_time_h watch_time, void* user_data)
                   {
                      // Called at least once per second
                      // Draw a normal watch with the hour, minute, and second
                  @@ -149,7 +148,8 @@ void app_time_tick(watch_time_h watch_time, void* user_data)
                   
                • Set the event callbacks in the watch_app_lifecycle_callback_s structure, and pass the structure to the watch_app_main() function that starts the watch application event loop:
                  -int main(int argc, char* argv[])
                  +int 
                  +main(int argc, char* argv[])
                   {
                      appdata ad = {0,};
                      watch_app_lifecycle_callback_s callback = {0,};
                  @@ -188,23 +188,27 @@ int main(int argc, char* argv[])
                   
                -void lang_changed(app_event_info_h event_info, void* user_data)
                +void 
                +lang_changed(app_event_info_h event_info, void* user_data)
                 {
                    // Take the necessary actions when the language setting changes
                 }
                  
                -void region_changed(app_event_info_h event_info, void* user_data)
                +void 
                +region_changed(app_event_info_h event_info, void* user_data)
                 {
                    // Take the necessary actions when the region setting changes
                 }
                  
                -void low_battery(app_event_info_h event_info, void* user_data)
                +void 
                +low_battery(app_event_info_h event_info, void* user_data)
                 {
                    // Take the necessary actions when the system is running low on battery
                    watch_app_exit();
                 }
                  
                -void low_memory(app_event_info_h event_info, void* user_data)
                +void 
                +low_memory(app_event_info_h event_info, void* user_data)
                 {
                    // Take the necessary actions when the system is running low on memory
                    watch_app_exit();
                @@ -212,7 +216,8 @@ void low_memory(app_event_info_h event_info, void* user_data)
                 
              10. Register the callback functions:

                -bool app_create(void *user_date)
                +bool 
                +app_create(void *user_date)
                 {
                    // Register callbacks for each system event
                    if (watch_app_add_event_handler(&handler, APP_EVENT_LANGUAGE_CHANGED, lang_changed, NULL) != APP_ERROR_NONE) 
                @@ -257,7 +262,8 @@ typedef struct
                 } 
                 appdata;
                 
                -static void __create_base_gui(appdata *ad, int width, int height)
                +static 
                +void __create_base_gui(appdata *ad, int width, int height)
                 {
                    int ret;
                    watch_time_h watch_time = NULL;
                @@ -288,8 +294,8 @@ static void __create_base_gui(appdata *ad, int width, int height)
                    __update_watch(ad, watch_time);
                 }
                 
                -
                -bool app_create(void *user_date)
                +bool 
                +app_create(void *user_date)
                 {
                    // Define system callbacks
                 
                @@ -310,13 +316,14 @@ bool app_create(void *user_date)
                 
                 

                For example, you can use the int watch_time_get_minute() method to retrieve the current minute value.

                -static void __update_watch(appdata *ad, watch_time_h watch_time)
                +static 
                +void __update_watch(appdata *ad, watch_time_h watch_time)
                 {
                    watch_text[TEXT_BUF_SIZE];
                    int hour24, minute, second;
                 
                    if (watch_time == NULL)
                -   return;
                +       return;
                 
                    watch_time_get_hour24(watch_time, &hour24);
                    watch_time_get_minute(watch_time, &minute);
                @@ -327,7 +334,8 @@ static void __update_watch(appdata *ad, watch_time_h watch_time)
                    elm_object_text_set(ad->label, watch_text);
                 } 
                 
                -static void __create_base_gui(appdata *ad, int width, int height)
                +static 
                +void __create_base_gui(appdata *ad, int width, int height)
                 {
                    // Get the window object and time handle
                 
                @@ -345,13 +353,15 @@ static void __create_base_gui(appdata *ad, int width, int height)
                 
                • The watch_app_ambient_changed_cb() callback is triggered when the ambient mode is enabled or disabled in the device. You can use the callback to initialize your ambient mode UI.

                • The watch_app_ambient_tick_cb() callback is triggered every minute while the device is in the ambient mode. You can use the callback to update the time on your watch application in the ambient mode. In this callback, do not perform time-consuming task and always update the UI as fast as possible. The platform can put the device to sleep shortly after the ambient tick expires.

                -void app_ambient_tick(watch_time_h watch_time, void* user_data)
                +void 
                +app_ambient_tick(watch_time_h watch_time, void* user_data)
                 {
                    appdata *ad = user_data;
                    __update_watch(ad, watch_time);
                 }
                 
                -void app_ambient_changed(bool ambient_mode, void* user_data)
                +void 
                +app_ambient_changed(bool ambient_mode, void* user_data)
                 {
                    if (ambient_mode) 
                    {
                @@ -362,12 +372,12 @@ void app_ambient_changed(bool ambient_mode, void* user_data)
                       // Prepare to exit the ambient mode
                    }
                 }
                -
                 
              11. Register the ambient mode callbacks:
                -int main(int argc, char* argv[])
                +int 
                +main(int argc, char* argv[])
                 {
                    appdata ad = {0,};
                    watch_app_lifecycle_callback_s callback = {0,};
                @@ -382,6 +392,7 @@ int main(int argc, char* argv[])
                    {
                       dlog_print(DLOG_ERROR, LOG_TAG, "watch_app_main() is failed. err = %d", ret);
                    }
                +
                    return ret;
                 } 
                 
                diff --git a/org.tizen.tutorials/html/native/app_framework/widget_tutorial_n.htm b/org.tizen.tutorials/html/native/app_framework/widget_tutorial_n.htm index 31d3f04..9480384 100644 --- a/org.tizen.tutorials/html/native/app_framework/widget_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/app_framework/widget_tutorial_n.htm @@ -18,7 +18,7 @@
                -

                Mobile native Wearable native

                +

                Mobile native Wearable native

                Content

                @@ -102,7 +102,7 @@ main(int argc, char *argv[])
              12. Use the widget_app_create() function to initialize any resources that can be shared among widget instances. This function is called before the main event loop starts.
                -widget_class_h widget_app_create (void *user_data)
                +widget_class_h widget_app_create(void *user_data)
                 {
                    // Hook to take necessary actions before main event loop starts
                    widget_instance_lifecycle_callback_s obj_callback = {0,};
                @@ -133,7 +133,8 @@ widget_class_h widget_app_create (void *user_data)
                 
                 
              13. Define the callback functions for the system events:
                -void widget_app_lang_changed(app_event_info_h event_info, void* user_data)
                +void 
                +widget_app_lang_changed(app_event_info_h event_info, void* user_data)
                 {
                    // Take actions when language setting changes and messages must be translated
                    char *locale = NULL;
                @@ -141,20 +142,23 @@ void widget_app_lang_changed(app_event_info_h event_info, void* user_data)
                    elm_language_set(locale);
                    free(locale);
                 }
                - 
                -void widget_app_region_changed(app_event_info_h event_info, void* user_data)
                +
                +void 
                +widget_app_region_changed(app_event_info_h event_info, void* user_data)
                 {
                    // Take actions when the time zone changes
                 }
                - 
                -void widget_app_low_battery(app_event_info_h event_info, void* user_data)
                +
                +void 
                +widget_app_low_battery(app_event_info_h event_info, void* user_data)
                 {
                    // Take actions when system is running low on battery (less than 5%)
                    // Save the work and avoid battery-intensive processes
                    widget_app_exit();
                 }
                - 
                -void widget_app_low_memory(app_event_info_h event_info, void* user_data)
                +
                +void 
                +widget_app_low_memory(app_event_info_h event_info, void* user_data)
                 {
                    // Take actions when system is running on low memory
                    // Save the work and release resources; if necessary, some apps can be killed
                @@ -182,7 +186,8 @@ widget_app_terminate(void *user_data)
                 
              14. This callback is triggered when the widget instance is created.

                Initialize resources for this widget instance and draw the UI. If bundle content is not NULL, restore the previous status.

                -int widget_instance_create(widget_context_h context, bundle *content, int w, int h, void *user_data)
                +int 
                +widget_instance_create(widget_context_h context, bundle *content, int w, int h, void *user_data)
                 {
                    widget_instance_data_s *wid = (widget_instance_data_s*) malloc(sizeof(widget_instance_data_s));
                    int ret;
                @@ -202,7 +207,9 @@ int widget_instance_create(widget_context_h context, bundle *content, int w, int
                 
              15. This callback is triggered when the widget instance is destroyed.

                Release all widget resources. If the reason for the termination is not WIDGET_APP_DESTROY_TYPE_PERMANENT, store the current status with the incoming bundle.

                -int widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e reason, bundle *content, void *user_data)
                +int 
                +widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e reason, 
                +                        bundle *content, void *user_data)
                 {
                    if (reason != WIDGET_APP_DESTROY_TYPE_PERMANENT) 
                    {
                @@ -218,7 +225,8 @@ int widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e
                 
              16. This callback is triggered when the widget instance is paused.

                Take the necessary actions since the widget instance becomes invisible. The framework can destroy a paused widget instance.

                -int widget_instance_pause(widget_context_h context, void *user_data)
                +int 
                +widget_instance_pause(widget_context_h context, void *user_data)
                 {
                    return WIDGET_ERROR_NONE;
                 }
                @@ -227,7 +235,8 @@ int widget_instance_pause(widget_context_h context, void *user_data)
                 
              17. This callback is triggered when the widget instance is resumed.

                Take the necessary actions since the widget instance becomes visible.

                -int widget_instance_resume(widget_context_h context, void *user_data)
                +int 
                +widget_instance_resume(widget_context_h context, void *user_data)
                 {
                    return WIDGET_ERROR_NONE;
                 }
                @@ -236,7 +245,8 @@ int widget_instance_resume(widget_context_h context, void *user_data)
                 
              18. This callback is triggered before the widget instance is resized.

                Take the necessary actions to accommodate the new size.

                -int widget_instance_resize(widget_context_h context, int w, int h, void *user_data)
                +int 
                +widget_instance_resize(widget_context_h context, int w, int h, void *user_data)
                 {
                    return WIDGET_ERROR_NONE;
                 } 
                @@ -245,7 +255,8 @@ int widget_instance_resize(widget_context_h context, int w, int h, void *user_da
                 
              19. This callback is triggered when a widget update event is received.

                Take the necessary actions for the widget update. If the force parameter is true, the widget can be updated even in the pause state.

                -int widget_instance_update(widget_context_h context, bundle *content, int force, void *user_data)
                +int 
                +widget_instance_update(widget_context_h context, bundle *content, int force, void *user_data)
                 {
                    return WIDGET_ERROR_NONE;
                 }
                @@ -256,7 +267,7 @@ int widget_instance_update(widget_context_h context, bundle *content, int force,
                 
                 
              20. Register the callbacks in the widget_instance_lifecycle_callback_s structure during the widget application initialization:
                -widget_class_h widget_app_create (void *user_data)
                +widget_class_h widget_app_create(void *user_data)
                 {
                    widget_instance_lifecycle_callback_s obj_callback = {0,};
                    // Register the callback functions
                @@ -330,27 +341,27 @@ widget_instance_create(widget_context_h context, bundle *content, int w, int h,
                    widget_app_context_set_tag(context, wid);
                 
                    return WIDGET_ERROR_NONE;
                -}
                +} 
                 
                -int widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e reason, bundle *content, void *user_data)
                +int 
                +widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e reason, 
                +                        bundle *content, void *user_data)
                 {
                -
                    if (reason != WIDGET_APP_DESTROY_TYPE_PERMANENT)
                    {
                       // Save the current status at the bundle object
                    }
                 
                    widget_instance_data_s *wid = NULL;
                -   widget_app_context_get_tag(context, (void**)&wid);
                +   widget_app_context_get_tag(context, (void**)&wid);
                 
                    if (wid->win)
                -       evas_object_del(wid->win);
                +      evas_object_del(wid->win);
                 
                    free(wid);
                 
                    return WIDGET_ERROR_NONE;
                 }
                -
                 

                Managing the Widget Instance

                @@ -365,21 +376,25 @@ typedef struct } user_defined_s; -int widget_instance_create(widget_context_h context, bundle *content, int w, int h, void *user_data) +int +widget_instance_create(widget_context_h context, bundle *content, int w, int h, void *user_data) {    user_defined_s *uds = (user_defined_s*)malloc(sizeof(user_defined_s));    uds->val1 = 0;    widget_app_context_set_tag(context, uds); } -int widget_instance_destroy(widget_context_h context, widget_destroy_type_e reason, bundle *content, void *user_data) +int +widget_instance_destroy(widget_context_h context, widget_destroy_type_e reason, +                        bundle *content, void *user_data) {    user_defined_s *uds = NULL;    widget_app_context_get_tag(context, (void**)&uds);    free(uds); } -int widget_instance_update(widget_context_h context, bundle *content, int force, void *user_data) +int +widget_instance_update(widget_context_h context, bundle *content, int force, void *user_data) {    user_defined_s *uds = NULL;    widget_app_context_get_tag(context, (void**)&uds); @@ -390,7 +405,8 @@ int widget_instance_update(widget_context_h context, bundle *content, int force,
              21. Get the widget instance ID:
                -int widget_instance_update(widget_context_h context, bundle *content, int force, void *user_data)
                +int 
                +widget_instance_update(widget_context_h context, bundle *content, int force, void *user_data)
                 {
                    const char *inst_id = NULL;
                    inst_id = widget_app_get_id(context);
                diff --git a/org.tizen.tutorials/html/native/base/base_tutorials_n.htm b/org.tizen.tutorials/html/native/base/base_tutorials_n.htm
                index e09d314..80efe3f 100644
                --- a/org.tizen.tutorials/html/native/base/base_tutorials_n.htm
                +++ b/org.tizen.tutorials/html/native/base/base_tutorials_n.htm
                @@ -18,7 +18,7 @@
                 
                 
                -

                Mobile native Wearable native

                +

                Mobile native Wearable native

                Related Info

                diff --git a/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm b/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm index 77b1daf..41c98c6 100644 --- a/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm @@ -18,7 +18,7 @@

            Related Info

            @@ -38,7 +38,7 @@
          • i18n API for Mobile Native
          • i18n API for Wearable Native
          - +
          @@ -49,7 +49,7 @@

          This tutorial demonstrates how you can manage numbers, date, time and locale information.

          Warm-up

          -

          Become familiar with the i18n API basics by learning about:

          +

          Become familiar with the i18n API basics by learning about:

          Managing Characters and Strings

          @@ -116,7 +118,7 @@ i18n_ucollator_create(I18N_ULOCALE_US, &coll);
        • Tertiary differences (I18N_UCOLLATOR_TERTIARY), such as case differences ("a" vs "A")
        -

        For the default value of the Ucollator's strength, use I18N_UCOLLATOR_DEFAULT_STRENGTH.

        +

        For the default value of the Ucollator's strength, use I18N_UCOLLATOR_DEFAULT_STRENGTH.

         i18n_ucollator_set_strength(coll, I18N_UCOLLATOR_DEFAULT_STRENGTH);
        @@ -195,6 +197,7 @@ i18n_ustring_copy_ua(src, "Tizen");
         const char dest[BUFLEN];
         i18n_ustring_copy_au_n(dest, src, BUFLEN);
         
      • +
      • Another way to convert a Ustring to a string is using the i18n_ustring_to_UTF8() function. Its parameters are:

        • Destination buffer
        • @@ -205,6 +208,7 @@ i18n_ustring_copy_au_n(dest, src, BUFLEN);
        • Error code variable

        To get the length of a Ustring, use the i18n_ustring_get_length() function.

        +
         i18n_uchar src[BUFLEN];
         i18n_ustring_copy_ua(src, "Tizen");
        @@ -217,7 +221,7 @@ i18n_ustring_to_UTF8(dest, BUFLEN, &dest_len, src, i18n_ustring_get_length(s
         

        Getting Unicode Block of a Character

        To get information about the location of a specified character:

          -
        1. To get information about which Unicode allocation block contains the specified character, use the i18n_uchar_get_ublock_code() function. The Unicode blocks are listed in the i18n_uchar_ublock_code_e enumeration.

          +
        2. To get information about which Unicode allocation block contains the specified character, use the i18n_uchar_get_ublock_code() function. The Unicode blocks are listed in the i18n_uchar_ublock_code_e enumeration (in mobile and wearable applications).

           i18n_uchar character = 0xC131;
           i18n_uchar_ublock_code_e ublock;
          @@ -228,7 +232,7 @@ i18n_uchar_get_ublock_code(character, &ublock);
           
           

          To get the value of a property of a specified character:

            -
          1. Properties of characters are listed in the i18n_uchar_uproperty_e enumeration. To read the value of a property, use the i18n_uchar_get_int_property_value() function.

            +
          2. Properties of characters are listed in the i18n_uchar_uproperty_e enumeration (in mobile and wearable applications). To read the value of a property, use the i18n_uchar_get_int_property_value() function.

            The following example shows how to read the East Asian width property:

            @@ -237,6 +241,7 @@ int32_t property_value;
             i18n_uchar_get_int_property_value(character, I18N_UCHAR_EAST_ASIAN_WIDTH, &property_value);
             
          +

          Normalizing Ustrings

          To normalize a Ustring:

            @@ -258,6 +263,7 @@ i18n_unormalization_get_instance(NULL, "nfc", I18N_UNORMALIZATION_DECO
          1. Size of the destination buffer
          2. Variable to store the actual length of the normalized Ustring
      +
       i18n_uchar src = 0xACE0;
       i18n_uchar dest[4];
      @@ -279,7 +285,6 @@ i18n_unormalization_normalize(normalizer, &src, 1, dest, 4, &dest_str_le
       	
    • Optional break iterator structure
    • Handle to created search iterator
    -
     i18n_uchar text[BUFLEN];
     i18n_ustring_copy_ua(text, "TIZEN");
    @@ -304,6 +309,7 @@ i18n_usearch_destroy(usearch);
     

    To change the case in a Ustring:

    1. To change all characters' case in a Ustring, use the i18n_ustring_to_upper() and i18n_ustring_to_lower() functions. The parameters of both functions are:

      +
      • Result buffer
      • Result buffer capacity
      • @@ -313,6 +319,7 @@ i18n_usearch_destroy(usearch);
      • Result length
      • Error code variable
      +
       i18n_uchar src[BUFLEN];
       i18n_ustring_copy_ua(src, "Tizen");
      @@ -330,7 +337,7 @@ i18n_ustring_to_lower(dest, BUFLEN, src, -1, I18N_ULOCALE_US, &error_code);
       	
    2. Break iterator (to find first characters of words); if NULL, standard iterator is used
    3. Locale ("" for root locale, NULL for default locale
    4. -
      +
       i18n_uchar src[BUFLEN];
       i18n_ustring_copy_ua(src, "Tizen");
       i18n_uchar dest[BUFLEN];
      @@ -340,7 +347,7 @@ i18n_ustring_to_title_new(dest, BUFLEN, src, BUFLEN, NULL, NULL);
       

    Concatenating Ustrings

    -

    To concatenate two Ustrings:

    +

    To concatenate 2 Ustrings:

    1. Use the 18n_ustring_cat_n() functions. The parameters are:

        @@ -369,6 +376,7 @@ i18n_ustring_cat(dest, src);
      • Substring which the function searches for in the string

      The result is a pointer to the first occurrence of the substring, or NULL if the substring is not found. You can use pointer arithmetic to find the index of the character at which the first occurrence begins.

      +
       i18n_uchar s[BUFLEN];
       i18n_uchar substring[BUFLEN];
      @@ -386,8 +394,7 @@ else
       
    - - +

    Managing Dates and Calendar

    @@ -414,7 +421,6 @@ else
  • Calendar type (default, Gregorian)
  • Handle to the created Ucalendar
  • -
     i18n_uchar timezone[17];
     i18n_ustring_copy_ua_n(timezone, "America/New_York", 17);
    @@ -424,7 +430,7 @@ i18n_ucalendar_create(timezone, -1, I18N_ULOCALE_US, I18N_UCALENDAR_DEFAULT, &am
     
     
  • Set a date.

    To set a date in the Ucalendar, use the i18n_ucalendar_set_date_time() function.

    -

    Provide a handle to the Ucalendar, year, month reduced by 1 (0 for January, 1 for February, and so forth; use the values of the i18n_ucalendar_months_e enumeration to avoid mistakes), day, hour, minute, and second.

    +

    Provide a handle to the Ucalendar, year, month reduced by 1 (0 for January, 1 for February, and so forth; use the values of the i18n_ucalendar_months_e enumeration, in mobile and wearable applications, to avoid mistakes), day, hour, minute, and second.

     i18n_ucalendar_set_date_time(ucalendar, 2014, I18N_UCALENDAR_JULY, 1, 9, 0, 0);

    To set a date using milliseconds from the epoch, use the i18n_ucalendar_set_milliseconds() function:

    @@ -433,7 +439,7 @@ i18n_udate udate; // udate must be set i18n_ucalendar_set_milliseconds(ucalendar, udate);
  • -

    To add a specified period to the Ucalendar, use the i18n_ucalendar_add() function. Specify a handle to the Ucalendar, a field of Ucalendar to add to (year, week, day; the value of the i18n_ucalendar_date_fields_e enumeration) and the amount to add to field (use a negative value to subtract).

    +

    To add a specified period to the Ucalendar, use the i18n_ucalendar_add() function. Specify a handle to the Ucalendar, a field of Ucalendar to add to (year, week, day; the value of the i18n_ucalendar_date_fields_e enumeration, in mobile and wearable applications) and the amount to add to field (use a negative value to subtract).

    i18n_ucalendar_add(ucalendar, I18N_UCALENDAR_HOUR, 3);
  • Get a date. @@ -475,7 +481,7 @@ i18n_ustring_copy_ua_n(format, "EEEdMMMyyyyHHmmssz", 64); i18n_uchar best_pattern[64]; i18n_udatepg_get_best_pattern(udatepg, format, 64, best_pattern, 64, &pattern_len);
  • -

    To create a date format, use the i18n_udate_create() function. Specify the style to format time, the style to format date (from the i18n_udate_format_style_e enumeration), the desired locale, the desired time zone name, the length of the time zone name, a date pattern to use, the length of the pattern, and a handle to the created date format).

    +

    To create a date format, use the i18n_udate_create() function. Specify the style to format time, the style to format date (from the i18n_udate_format_style_e enumeration, in mobile and wearable applications), the desired locale, the desired time zone name, the length of the time zone name, a date pattern to use, the length of the pattern, and a handle to the created date format).

     i18n_udate_format_h date_format;
     i18n_ustring_copy_ua_n(timezone, "Asia/Seoul", 17);
    @@ -508,11 +514,12 @@ i18n_udate_destroy(date_format);
     
  • To manage locale information:
      -
    • To get the language code associated with a locale, use the i18n_ulocale_get_language() function. Provide the: -
      • Locale symbol (such as "en_US" or "ko_KR" - the supported locales are defined in the API as I18N_ULOCALE_*)
      • -
      • Buffer for the language code
      • -
      • The size of the buffer
      • -
      • Variable to store the actual length of the language code
      • +
      • To get the language code associated with a locale, use the i18n_ulocale_get_language() function. The parameters are: +
          +
        • Locale symbol (such as "en_US" or "ko_KR" - the supported locales are defined in the API as I18N_ULOCALE_*)
        • +
        • Buffer for the language code
        • +
        • Size of the buffer
        • +
        • Variable to store the actual length of the language code
         char language[BUFLEN];
        @@ -520,45 +527,45 @@ int lang_len;
         i18n_ulocale_get_language(I18N_ULOCALE_GERMANY, language, BUFLEN, &lang_len);
         
      • -
      • To get the language ISO-3 code for the specified locale, use the i18n_ulocale_get_language() function. The argument is the locale. -
        const char *language_iso = i18n_ulocale_get_iso3_language(I18N_ULOCALE_GERMANY);
        +
      • To get the language ISO-3 code for the specified locale, use the i18n_ulocale_get_language() function. The parameter is the locale. +
        +const char *language_iso = i18n_ulocale_get_iso3_language(I18N_ULOCALE_GERMANY);
         
      • -
      • To get the full name of language for the specified locale, use the i18n_ulocale_get_display_language() function. The parameters are: +
      • To get the full name of the language for the specified locale, use the i18n_ulocale_get_display_language() function. The parameters are:
          -
        • Locale to get the full language name of
        • -
        • Locale to localize the language name (specifies the language of the obtained name)
        • -
        • Buffer for the name
        • -
        • Size of the buffer
        • -
        • Variable to store the actual size of the language name
        • +
        • Locale to get the full language name of
        • +
        • Locale to localize the language name (specifies the language of the obtained name)
        • +
        • Buffer for the name
        • +
        • Size of the buffer
        • +
        • Variable to store the actual size of the language name
        -char *locale = I18N_ULOCALE_FRENCH;
        +char *locale = I18N_ULOCALE_CANADA_FRENCH;
         i18n_uchar language_name[BUFLEN];
         int lang_len;
         i18n_ulocale_get_display_language(locale, I18N_ULOCALE_GERMANY, language_name, BUFLEN, &lang_len);
         

        In this example, the name of the "fr_CA" locale is obtained in German.

      • -
      • To get the line orientation for the specified locale, use the i18n_ulocale_get_line_orientation() function. - The parameters are: -
          -
        • Locale to get the line orientation of
        • -
        • Variable to store the returned orientation
        • -
        -
        +
      • To get the line orientation for the specified locale, use the i18n_ulocale_get_line_orientation() function. The parameters are: +
          +
        • Locale to get the line orientation of
        • +
        • Variable to store the returned orientation
        • +
        +
         char *locale = I18N_ULOCALE_ENGLISH;
         i18n_ulocale_layout_type_e type;
         i18n_ulocale_get_line_orientation(locale, &type);
         
      • -
      • To get the character orientation for the specified locale, use the i18n_ulocale_get_character_orientation() function. - The parameters are:
          -
        • Locale to get the character orientation of
        • -
        • Variable to store the returned orientation
        • -
        -
        +
      • To get the character orientation for the specified locale, use the i18n_ulocale_get_character_orientation() function. The parameters are: +
          +
        • Locale to get the character orientation of
        • +
        • Variable to store the returned orientation
        • +
        +
         char *locale = I18N_ULOCALE_ENGLISH;
         i18n_ulocale_layout_type_e type;
         i18n_ulocale_get_character_orientation(locale, &type);
        @@ -574,7 +581,9 @@ i18n_ulocale_get_character_orientation(locale, &type);
         char *locale = I18N_ULOCALE_ENGLISH;
         char *variant = malloc(sizeof(char) * BUFLEN);
         int32_t variant_len = i18n_ulocale_get_variant(locale, variant, BUFLEN);
        -

        The function returns the actual size of the variant

      • +
        +

        The function returns the actual size of the variant.

        +
      • To get a full name for the specified locale, use the i18n_ulocale_get_display_name() function. The parameters are:
          @@ -584,6 +593,7 @@ int32_t variant_len = i18n_ulocale_get_variant(locale, variant, BUFLEN);
        • Size of the buffer
        • Variable to store the actual size of the name
        +
         i18n_uchar name[BUFLEN];
         int name_len;
        @@ -591,12 +601,13 @@ i18n_ulocale_get_display_name(I18N_ULOCALE_CANADA_FRENCH, I18N_ULOCALE_GERMANY,
         

        In this example, the name of the "fr_CA" locale is obtained in German.

      • -
      • To get the default locale, use the i18n_ulocale_get_default() function. +
      • To get the default locale, use the i18n_ulocale_get_default() function:
         char *locale;
         i18n_ulocale_get_default(&locale);
        -
      • -
      • To set the default locale, use the i18n_ulocale_set_default() function. +
      • +
      • +
      • To set the default locale, use the i18n_ulocale_set_default() function:
         i18n_ulocale_set_default(I18N_ULOCALE_KOREA);
    • @@ -613,23 +624,25 @@ i18n_ulocale_set_default(I18N_ULOCALE_KOREA);
    • Create a number format.

      To start using the Unumber module, create a number format using the i18n_unumber_create() function. The parameters are:

        -
      • Number format style (see the i18n_unumber_format_style_e enumeration in documentation)
      • +
      • Number format style (such as I18N_UNUMBER_CURRENCY; see the i18n_unumber_format_style_e enumeration, in mobile and wearable applications)
      • Format pattern (only for decimal and rule-based types)
      • Length of the format pattern
      • -
      • Locale identifier (NULL for default)
      • +
      • Locale identifier (NULL for default) +

        Some identifiers (string shortcuts for specific locales) are defined in the utils_i18n_types.h header file. For example, I18N_ULOCALE_US is equal to "en_US".

      • Optional pointer to an i18n_uparse_error_s struct
      • Handle to the created number format
      -

      As format_style you can use one of the i18n_unumber_format_style_e enums, eg. I18N_UNUMBER_CURRENCY. Some Locale parameters are defined in the utils_i18n_types.h header file. They are string shortcuts for specific locale, eg. I18N_ULOCALE_US is equal to "en_US".

      + +
       i18n_unumber_format_h num_format;
       i18n_unumber_format_style_e format_style = I18N_UNUMBER_CURRENCY;
       const char* locale = I18N_ULOCALE_US;
      -i18n_unumber_create(format_style, NULL, -1, locale, NULL, &num_format);
      - -

      After creating the number format, you can use it to format a given number in the way it is used in a specified locale. After invoking:

      +i18n_unumber_create(format_style, NULL, -1, locale, NULL, &num_format); + +

      After creating the number format, you can use it to format a given number based on the rules of a specified locale:

       #define BUFLEN 64
       i18n_uchar myString[BUFLEN];
      @@ -637,17 +650,16 @@ double myNumber = 4.5;
       i18n_unumber_format_double(num_format, myNumber, myString, BUFLEN, NULL);
       
      -

      the result set in myString variable will be equal to:

      - +

      The result set in the myString variable is equal to:

       $4.50
       
      - +
    • Get a symbol associated with the number format.

      To get a symbol associated with the created number format, use the i18n_unumber_get_symbol() function. The parameters are:

      • Number format
      • -
      • Symbol to get (see the i18n_unumber_format_symbol_e enumeration in documentation)
      • +
      • Symbol to get (see the i18n_unumber_format_symbol_e enumeration, in mobile and wearable applications)
      • Destination buffer
      • Size of the buffer
      • Variable to store the length of the symbol
      • @@ -656,12 +668,15 @@ $4.50 i18n_uchar buffer[BUFLEN]; int buf_len; i18n_unumber_format_symbol_e symbol = I18N_UNUMBER_CURRENCY_SYMBOL; -i18n_unumber_get_symbol(num_format, symbol, buffer, BUFLEN, &buf_len); -

        It returns only the symbol using in given locale (here the currency $ sign). +i18n_unumber_get_symbol(num_format, symbol, buffer, BUFLEN, &buf_len); + +

        The function returns only the symbol used in the given locale, in this example, the currency $ sign.

        +
      • Destroy the number format. -

        When you finish using the number format, destroy it with the i18n_unumber_destroy() function.

        +

        When you finish using the number format, destroy it with the i18n_unumber_destroy() function:

        i18n_unumber_destroy(num_format);
      • +

        Managing Iteration Using Ubrk

        @@ -835,7 +850,7 @@ const char *keyword = NULL; int len; keyword = i18n_uenumeration_next(keywords, &len); -while (keyword != NULL) +while (keyword != NULL) {    // Use the keyword string @@ -846,8 +861,9 @@ i18n_uenumeration_destroy(keywords); + -

        Managing Timezones

        +

        Managing Time Zones

        The Timezone module represents a time zone offset, and also figures out daylight savings.

        1. To use the Timezone API (in mobile and wearable applications), include the <utils_i18n.h> header file in your application:

          @@ -855,28 +871,28 @@ i18n_uenumeration_destroy(keywords); #include <utils_i18n.h>
        2. -
        3. Retrieve timezone information: +
        4. Retrieve time zone information: -
          • To get the default timezone based on the timezone where the program is running:

            +
            • To get the default time zone based on the time zone where the program is running:

               i18n_timezone_h tmz;
               i18n_timezone_create_default(&tmz);
               
            • -
            • To get the display name of the timezone:

              +
            • To get the display name of the time zone:

               char *display_name;
               i18n_timezone_get_display_name(tmz, &display_name);
               
            • -
            • To get the timezone ID:

              +
            • To get the time zone ID:

               char *timezone_id;
               i18n_timezone_get_id(tmz, &timezone_id);
               
            • -

              To check whether a given timezone uses daylight savings time (DST):

              +

              To check whether a given time zone uses daylight savings time (DST):

               int32_t dst_savings;
               i18n_timezone_get_dst_savings(tmz, &dst_savings);
              @@ -889,7 +905,7 @@ i18n_timezone_get_dst_savings(tmz, &dst_savings);
               int32_t dst_savings;
               i18n_timezone_get_dst_savings(tmz, &dst_savings/MS_TO_MIN);
               
              -

              The result is returned in milliseconds (3600000 ms = 1 hour). In this tutorial milliseconds are changed to minutes (1 min = 60000 ms).

            • +

              The result is returned in milliseconds (3600000 ms = 1 hour). In this tutorial, milliseconds are changed to minutes (1 min = 60000 ms).

            • To get the raw GMT offset:

              @@ -897,40 +913,47 @@ i18n_timezone_get_dst_savings(tmz, &dst_savings/MS_TO_MIN);
               int32_t offset_milliseconds;
               i18n_timezone_get_raw_offset(tmz, &offset_milliseconds/MS_TO_MIN);
               
              -

              The result is returned in milliseconds. It is the number of milliseconds to add to GMT to get the local time, before taking DST into account. In this tutorial milliseconds are changed to minutes (1 min = 60000 ms).

            • +

              The result is returned in milliseconds. It is the number of milliseconds to add to GMT to get the local time, before taking DST into account. In this tutorial, milliseconds are changed to minutes (1 min = 60000 ms).

              -
            • To get the region code associated with the timezone ID:

              +
            • To get the region code associated with the time zone ID:

               char region[6];
               int32_t region_len = -1;
               i18n_timezone_get_region(timezone_id, region, &region_len, 20);
               
          • -
          • Destroy the timezone when it is no longer needed:

            +
          • Destroy the time zone when it is no longer needed:

             i18n_timezone_destroy(tmz);
            -
        - - + +

        Managing Sets

        The Uset module allows you to create sets which can contain characters and strings. You can iterate through elements of the given set and carry out various operations on the set.

        +

        To manage sets:

        +
          -

          To use Uset API (in mobile and wearable applications), include the <utils_i18n.h> header file in your application.

          -
        1. -The first step is to create a set. The code below creates an empty set: -
          +
        2. To use the Uset API (in mobile and wearable applications), include the <utils_i18n.h> header file in your application: +
          +#include <utils_i18n.h>
          +
          +
        3. + +
        4. Create a set. +

          The following example creates an empty set:

          +
           i18n_uset_h set;
           i18n_uset_create_empty(&set);
           
        5. +
        + -

        Managing characters

        -

        The set can contain characters as its elements. It's also possible to check if a set contains specified characters.

        +

        Managing Characters

        +

        The set can contain characters as its elements. It is also possible to check whether a set contains specified characters.

          -
        1. -Add characters from a string to the set: -
          -const char *text = "Example string";
          +
        2. Add characters from a string to the set: +
          +const char *text = "Example string";
           i18n_uchar u_input_text[BUFLEN];
           i18n_ustring_copy_ua(u_input_text, text);
           
          @@ -938,83 +961,82 @@ i18n_uset_add_all_code_points(set, u_input_text, -1);
           
        3. -
        4. -Get the list of characters in the set: -
          +
        5. Get the list of characters in the set: +
           int chars_count = i18n_uset_size(set);
           int i;
           
           // Get all characters in the set
          -for (i = 0; i < chars_count; i++) {
          -    i18n_uchar32 uchar = i18n_uset_char_at(set, i);
          +for (i = 0; i < chars_count; i++) 
          +{
          +   i18n_uchar32 uchar = i18n_uset_char_at(set, i);
           }
           
        6. -
        7. -Check whether the set contains the given character: -
          -i18n_ubool contains_character = i18n_uset_contains(set, 'a');
          +
        8. Check whether the set contains the given character: +
          +i18n_ubool contains_character = i18n_uset_contains(set, 'a');
           
        9. -
        10. -Check whether the set contains characters from the a - c range: -
          -i18n_ubool contains_character = i18n_uset_contains_range(set, 'a', 'c');
          +
        11. Check whether the set contains characters from the a - c range: +
          +i18n_ubool contains_character = i18n_uset_contains_range(set, 'a', 'c');
           
        12. -
        13. -Check whether the set contains characters from another set: -
          +
        14. Check whether the set contains characters from another set: +
           i18n_uset_h compare_set = NULL;
          +
           // Fill the second set
           i18n_ubool contains_character = i18n_uset_contains_all(set, compare_set);
           
        + -

        Managing strings

        -

        The set can contain strings as its elements:

        -
          -
        1. -Add a string to the set: -
          -const char *text = "Example string";
          +	

          Managing Strings

          + +

          The set can contain strings as its elements. To manage strings:

          +
            +
          • Add a string to the set: +
            +const char *text = "Example string";
             i18n_uchar u_input_text[BUFLEN];
             i18n_ustring_copy_ua(u_input_text, text);
            -
            + 
             i18n_uset_add_string(set, u_input_text, -1);
             
            -The entire string is a single element in such cases. +

            The entire string is a single element.

          • -
          • -List all strings in the set: -
            +
            +
          • List all strings in the set: +
             int strings_count = i18n_uset_get_item_count(set);
             int32_t len = 0;
             int32_t i;
            -for (i = 0; i < strings_count; ++i) {
            -    i18n_uchar32 start, end;
            -    i18n_uchar string[100];
            -    let = i18n_uset_get_item(set, i, &start, &end, string, 100);
            -    if (len != 0) {
            -        // a string was found, use the 'string' variable
            -    }
            +for (i = 0; i < strings_count; ++i) 
            +{
            +   i18n_uchar32 start, end;
            +   i18n_uchar string[100];
            +   let = i18n_uset_get_item(set, i, &start, &end, string, 100);
            +   if (len != 0) 
            +   {
            +      // String was found, use the 'string' variable
            +   }
             }
             
            -Note that the i18n_uset_get_item() function also returns ranges (an item is a string or a range). The return value is 0 if the current item is a range. Please refer to the documentation for details. +

            Note that the i18n_uset_get_item() function also returns ranges (an item is a string or a range). The return value is 0 if the current item is a range. For more information, see the API documentation.

          • -
          • -Check whether the set contains a string: -
            +
          • Check whether the set contains a string: +
             i18n_ubool contains = i18n_uset_contains_string(set, input_ustring, -1);
             
          • -
        - - +
      + diff --git a/org.tizen.tutorials/html/native/base/sqlite_tutorial_n.htm b/org.tizen.tutorials/html/native/base/sqlite_tutorial_n.htm index 0ed1cb0..ae681f1 100644 --- a/org.tizen.tutorials/html/native/base/sqlite_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/base/sqlite_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

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

      Sqlite: Managing the SQL Database

      -

      This tutorial demonstrates how you can use the open source modules, whose functions provide access to SQLite and OpenSSL and demonstrate how to encrypt and store application data. The open source modules supported by Tizen are located within the API layout.

      +

      This tutorial demonstrates how you can use the open source modules, whose functions provide access to SQLite and OpenSSL and demonstrate how to encrypt and store application data. The open source modules supported by Tizen are listed in the API modules.

      Warm-up

      Become familiar with the basics of the Sqlite API by learning about:

      @@ -162,7 +162,8 @@ CREATE TABLE IF NOT EXISTS EncryptedData(TEXT NOT NULL,
      -static int CreateTable()
      +static int 
      +CreateTable()
       {
          int ret;
          char *ErrMsg;
      @@ -183,7 +184,8 @@ static int CreateTable()
       
       

      The string delimiting characters are removed. In a real implementation, replace some more characters, such as the comment sequence.

      -void PrepareToSQL(unsigned char* msg)
      +void 
      +PrepareToSQL(unsigned char* msg)
       {
          int i = 0;
          while (msg[i]!=0x00)
      @@ -230,7 +232,8 @@ InsertRecord(decrypted_out, 1, 0, strlen(ShortMsg));
       		
    • Add a delimiting 0x00 character at the end of the byte array.
    • -static int EncryptMsg(char* in, unsigned char* out, const unsigned char* password, unsigned char *localsalt, unsigned char *vector)
      +static int 
      +EncryptMsg(char* in, unsigned char* out, const unsigned char* password, unsigned char *localsalt, unsigned char *vector)
       {
          AES_KEY encryption_key;
          int iter = (int)vector[0];
      @@ -272,7 +275,8 @@ static int EncryptMsg(char* in, unsigned char* out, const unsigned char* passwor
       	
    • Insert a record into the database.

      To insert data to the database, use the sqlite3_exec() function. A query is prepared with common C functions. The encrypted variable is stored in the database and indicates whether the DATA field in the database is encrypted.

      -static int InsertRecord(unsigned char *msg, int encrypted,
      +static int 
      +InsertRecord(unsigned char *msg, int encrypted,
                               int part, int len)
       {
          char sqlbuff[BUFLEN];
      @@ -287,7 +291,6 @@ static int InsertRecord(unsigned char *msg, int encrypted,
             dlog_print(DLOG_DEBUG, LOG_TAG, "Error: %s\n", ErrMsg);
             sqlite3_free(ErrMsg);
          }
      -
          return 0;
       }
       
      @@ -300,7 +303,8 @@ static int InsertRecord(unsigned char *msg, int encrypted,

      A message is divided into blocks 16 characters long. Each block is tagged by its own number with a parts variable. A tag is stored in the database in the PART field.

      -static int InsertMessage(unsigned char* text)
      +static int 
      +InsertMessage(unsigned char* text)
       {
          unsigned char encrypted_out[BUFLEN];
          int ret = 0;
      @@ -330,7 +334,6 @@ static int InsertMessage(unsigned char* text)
                      encrypted_out, password, salt, iv);
             InsertRecord(encrypted_out, 1, parts, retlen);
          }
      -
          return 0;
       }
       
      @@ -349,7 +352,8 @@ ShowRecords();

      To list all records, use the SELECT * FROM EncryptedData query. The callback function is invoked for each record returned by SQLite. SQLite allows passing user data to the callback function. User data is the 4th parameter of sqlite3_exec(..., ..., ..., &counter, ...).

      -static void ShowRecords()
      +static void 
      +ShowRecords()
       {
          char *sql = "select * from EncryptedData";
          int counter = 0, ret = 0;
      @@ -362,7 +366,8 @@ static void ShowRecords()
       

      Callback simply prints an obtained record. The record is passed in the form of a few arrays of strings. Argv contains the column content, azColName contains the column name. Argc is the number of columns. Counter is user data. Here it is used to indicate the record number in a row (not an SQL primary key) while listing. If the content of any column is empty, the NULL string is printed.

      -static int callback(void *counter, int argc, char **argv, char **azColName)
      +static int 
      +callback(void *counter, int argc, char **argv, char **azColName)
       {
          int *localcounter = (int *)counter;
          int i;
      @@ -386,7 +391,8 @@ static int callback(void *counter, int argc, char **argv, char **azColName)
       
       

      The SELECT * FROM EncryptedData query where ENCRYPTED='1' lists all encrypted records. The callbackdecrypt() function is invoked for each record returned by the sqlite3_exec() function. In case of an error, the SQLite API requires releasing error message memory with the sqlite3_free() function.

      -static void DecryptRecords()
      +static void 
      +DecryptRecords()
       {
          char *sql = "select * from EncryptedData where ENCRYPTED='1'";
          int counter = 0;
      @@ -412,7 +418,8 @@ static void DecryptRecords()
       
    • Decrypted data is listed
    -static int callbackdecrypt(void *counter, int argc, char **argv, char **azColName)
    +static int 
    +callbackdecrypt(void *counter, int argc, char **argv, char **azColName)
     {
        unsigned char decrypted_out[BUFLEN];
        int *localcounter = (int *)counter;
    @@ -456,7 +463,8 @@ static int callbackdecrypt(void *counter, int argc, char **argv, char **azColNam
     

    The decryption routine is similar to encryption:

    -static int DecryptMsg(unsigned char* in, unsigned char * out, const unsigned char* password, unsigned char* localsalt, unsigned char* vector)
    +static int 
    +DecryptMsg(unsigned char* in, unsigned char * out, const unsigned char* password, unsigned char* localsalt, unsigned char* vector)
     {
        AES_KEY decryption_key;
        int iter = (int)vector[0];
    @@ -505,7 +513,8 @@ static char encoding_table[] = {'A', 'B', 'C', 'D
     static char *decoding_table = NULL;
     static int mod_table[] = {0, 2, 1};
     
    -void build_decoding_table()
    +void 
    +build_decoding_table()
     {
        decoding_table = malloc(256);
        int i;
    @@ -569,11 +578,11 @@ unsigned char *base64_decode(const char *data, size_t input_length, size_t *outp
           if (j < *output_length) decoded_data[j++] = (triple >> 1 * 8) & 0xFF;
           if (j < *output_length) decoded_data[j++] = (triple >> 0 * 8) & 0xFF;
        }
    -
        return decoded_data;
     }
     
    -void base64_cleanup() 
    +void 
    +base64_cleanup() 
     {
        free(decoding_table);
        decoding_table = NULL;
    @@ -584,7 +593,8 @@ void base64_cleanup()
     
  • Main function source code:
    -int OpenSQL_AES_example_1(void)
    +int 
    +OpenSQL_AES_example_1(void)
     {
        unsigned char decrypted_out[BUFLEN];
        int ret;
    diff --git a/org.tizen.tutorials/html/native/content/content_tutorials_n.htm b/org.tizen.tutorials/html/native/content/content_tutorials_n.htm
    index 1a42bcb..4aca393 100644
    --- a/org.tizen.tutorials/html/native/content/content_tutorials_n.htm
    +++ b/org.tizen.tutorials/html/native/content/content_tutorials_n.htm
    @@ -18,7 +18,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.tutorials/html/native/content/download_tutorial_n.htm b/org.tizen.tutorials/html/native/content/download_tutorial_n.htm index 82aa5f9..aff6b12 100644 --- a/org.tizen.tutorials/html/native/content/download_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/content/download_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native

    +

    Mobile native

    Content

    @@ -39,16 +39,7 @@

    This tutorial demonstrates how you can download content asynchronously from a given URL into the device storage.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    +

    This feature is supported in mobile applications only.

    Warm-up

    @@ -108,7 +99,7 @@ error = download_set_file_name(download_id, "downloaded_file.bin");
    • Auto download

      To set an automatic download, call the download_set_auto_download() function passing the download handle and setting the second parameter to true.

      -

      This operation changes the download manager state so that it continues downloading even after the client process is terminated. Set the notification download option when using this feature, to allow the user to receive the download result when the client process is not alive.

      +

      This operation changes the download manager state so that it continues downloading even after the client process is terminated. Set the notification download option when using this feature to allow the user to receive the download result when the client process is not alive.

       error = download_set_auto_download(download_id, true);
      @@ -190,7 +181,8 @@ if (state == DOWNLOAD_STATE_DOWNLOADING)
       
    • The received parameter of the progress_cb() callback function contains the size of the data received in bytes. In this example, print out the value and the total download size.
      -static void progress_cb(int download_id, unsigned long long received, void *user_data)
      +static void 
      +progress_cb(int download_id, unsigned long long received, void *user_data)
       {
          dlog_print(DLOG_INFO, LOG_TAG, "received: %llu of %llu", received, *((unsigned long long*)user_data));
       }
    • diff --git a/org.tizen.tutorials/html/native/content/media_content_tutorial_n.htm b/org.tizen.tutorials/html/native/content/media_content_tutorial_n.htm index f6ecce1..0dec834 100644 --- a/org.tizen.tutorials/html/native/content/media_content_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/content/media_content_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      @@ -217,6 +217,7 @@

      Get information about media tags.

    • Deleting Tags

      Delete tags from the database.

    • +
  • Storage @@ -282,7 +283,8 @@ media_content_disconnect();
    1. Register a callback function to get the folder list:
      -bool gallery_folder_list_cb(media_folder_h folder, void *user_data)
      +bool 
      +gallery_folder_list_cb(media_folder_h folder, void *user_data)
       {
          media_folder_h new_folder = NULL;
          media_folder_clone(&new_folder, folder);
      @@ -303,7 +305,8 @@ GList *folder_list = NULL; // Include glib.h for this value
       media_folder_h folder_handle = NULL;
       
       ret = media_folder_foreach_folder_from_db(filter, gallery_folder_list_cb, &folder_list);
      -if (ret != MEDIA_CONTENT_ERROR_NONE) {
      +if (ret != MEDIA_CONTENT_ERROR_NONE) 
      +{
          dlog_print(DLOG_ERROR, LOG_TAG, "media_folder_foreach_folder_from_db failed: %d", ret);
       
          return ret;
      @@ -354,7 +357,8 @@ else
       
      1. Create a callback function to retrieve a media item:
        -bool gallery_media_item_cb(media_info_h media, void *user_data)
        +bool 
        +gallery_media_item_cb(media_info_h media, void *user_data)
         {
            media_info_h new_media = NULL;
            media_info_clone(&new_media, media);
        @@ -443,11 +447,12 @@ media_filter_destroy(filter);
         
        1. Define the database update callback function:
          -void _noti_cb(media_content_error_e error, int pid,
          -              media_content_db_update_item_type_e update_item,
          -              media_content_db_update_type_e update_type,
          -              media_content_type_e media_type,
          -              char *uuid, char *path, char *mime_type, void *user_data)
          +void 
          +_noti_cb(media_content_error_e error, int pid,
          +         media_content_db_update_item_type_e update_item,
          +         media_content_db_update_type_e update_type,
          +         media_content_type_e media_type,
          +         char *uuid, char *path, char *mime_type, void *user_data)
           {
              if (error == MEDIA_CONTENT_ERROR_NONE) 
              {
          @@ -537,10 +542,12 @@ media_content_unset_db_updated_cb();
           
           
        2. Retrieve album information. -

          Define the callback and retrieve the basic album information (album id, name, the artist name, and the number of media items in the album) in it.

          +

          Define the callback and retrieve the basic album information (album ID, name, the artist name, and the number of media items in the album) in it.

          If the callback returns true, the iteration continues and the callback is called for the next album, if available. If the value is false, the iteration stops.

          -
          bool media_album_list_cb(media_album_h album, void *user_data)
          +
          +bool 
          +media_album_list_cb(media_album_h album, void *user_data)
           {
              media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
           
          @@ -660,7 +667,9 @@ media_album_get_album_id(album, &id);

          Define the callback in which you can receive and handle the album content.

          As long as the callback returns true, the callback is called for the next item, if available. The iteration stops when the return value is false.

          -
          bool album_contents_info_cb(media_info_h media, void *user_data)
          +
          +bool 
          +album_contents_info_cb(media_info_h media, void *user_data)
           {
              media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
           
          @@ -701,7 +710,6 @@ media_album_get_album_id(album, &id);
             {       dlog_print(DLOG_DEBUG, LOG_TAG, "Size: %llu\n", size);    } -    return true; }
          @@ -783,9 +791,10 @@ media_filter_set_condition(filter, buf, MEDIA_CONTENT_COLLATE_DEFAULT);
          Set the offset for the filter.
          media_filter_set_offset(filter,
          -                        0, // Offset
          -                        3 // Count
          -);
          +                        // Offset +                        0, +                        // Count +                        3);
        3. The count sets the limit on the number of returned bookmarks, and the offset determines which of the found bookmarks counts as the "first". For example, if you sort the bookmarks in an ascending order and the offset is set to 1, you do not receive the earliest bookmark.

        4. @@ -810,7 +819,9 @@ media_filter_set_condition(filter, buf, MEDIA_CONTENT_COLLATE_DEFAULT);
        To read the bookmark information within a callback after finding the bookmark:

        -
        bool get_bookmarks_cb(media_bookmark_h bookmark, void* user_data)
        +
        +bool 
        +get_bookmarks_cb(media_bookmark_h bookmark, void* user_data)
         {
            char *thumb = NULL;
         
        @@ -825,7 +836,6 @@ media_filter_set_condition(filter, buf, MEDIA_CONTENT_COLLATE_DEFAULT);

        The above callback prints the thumbnail path and marked time for each found bookmark.

        @@ -1011,8 +1021,11 @@ media_filter_destroy(filter);
      2. Read folder details within the callback: -
        bool folder_cb(media_folder_h folder, void *user_data)
        -{
        +
        +bool 
        +folder_cb(media_folder_h folder, void *user_data)
        +{
        +

        The return value determines if the iterative calls of the callback continue (true) or are stopped (false).

        @@ -1188,7 +1201,9 @@ media_filter_destroy(filter);

      The following example prints the title of the media item for which it was called.

      -
      bool media_cb(media_info_h media, void *user_data)
      +
      +bool 
      +media_cb(media_info_h media, void *user_data)
       {
          char *title = NULL;
       
      @@ -1204,7 +1219,8 @@ media_filter_destroy(filter);
         }    return true; -}
      +} +
  • @@ -1237,7 +1253,8 @@ media_filter_destroy(filter);
  • Create a callback function to retrieve a media item:
    -bool gallery_media_item_cb(media_info_h media, void *user_data)
    +bool 
    +gallery_media_item_cb(media_info_h media, void *user_data)
     {
        media_info_h new_media = NULL;
        media_info_clone(&new_media, media);
    @@ -1340,7 +1357,8 @@ else
                 image_meta_get_burst_id(image_handle, &burst_id);
     
                 dlog_print(DLOG_DEBUG, LOG_TAG, "This is an image");
    -            dlog_print(DLOG_DEBUG, LOG_TAG, "Width : %d, Height : %d, Orientation : %d, Date taken : %s", width, height, orientation, datetaken);
    +            dlog_print(DLOG_DEBUG, LOG_TAG, "Width : %d, Height : %d, Orientation : %d, Date taken : %s", 
    +                       width, height, orientation, datetaken);
              }
     
              if (datetaken) free(datetaken);
    @@ -1372,7 +1390,8 @@ else
                 media_info_get_played_time(media_handle, &time_played);
     
                 dlog_print(DLOG_DEBUG, LOG_TAG, "This is a video");
    -            dlog_print(DLOG_DEBUG, LOG_TAG, "Title: %s, Album: %s, Artist: %s, Album_artist: %s \n Duration: %d, Played time: %d", title, album, artist, album_artist, duration, time_played);
    +            dlog_print(DLOG_DEBUG, LOG_TAG, "Title: %s, Album: %s, Artist: %s, Album_artist: %s \n Duration: %d, Played time: %d", 
    +                       title, album, artist, album_artist, duration, time_played);
              }
     
              free(artist);
    @@ -1392,20 +1411,8 @@ else
        }
     }
     
  • - - - - - - - - - -
    Note
    Note that the video_meta_get_played_time () and a few APIs have been deprecated since Tizen 2.4.
    -To replace video_meta_get_played_time (), use media_info_get_played_time () instead.
    -Although the deprecated APIs continue to be available, it is strongly recommended to use new APIs.
    -For more information on the deprecated information, please refer to the media content mobile API reference (link) and the media content wearable API reference (link) -
    + +
  • When the filter is no longer used, destroy the list, filter, and query:
    @@ -1496,7 +1503,8 @@ if (ret != MEDIA_CONTENT_ERROR_NONE)
     

    You also need the http://tizen.org/privilege/mediastorage or http://tizen.org/privilege/externalstorage privilege, since when you insert metadata, the media content APIs access content in the internal or external storage.

  • As scanning works asynchronously, you must a callback function:
    -void _scan_cb(media_content_error_e err, void *user_data)
    +void 
    +_scan_cb(media_content_error_e err, void *user_data)
     {
        dlog_print(DLOG_DEBUG, LOG_TAG, "Folder scanned\n");
     
    @@ -1588,7 +1596,9 @@ media_playlist_update_to_db(playlist);
  • In the callback function, cast the user data to a proper type and copy the media ID:

    -
    bool _media_info_cb(media_info_h media, void *user_data)
    +
    +bool 
    +_media_info_cb(media_info_h media, void *user_data)
     {
        char *data = NULL;
        char *id = NULL;
    @@ -1605,9 +1615,9 @@ media_playlist_update_to_db(playlist);
  •       free(id);    } -    return true; -} +} + @@ -1625,7 +1635,9 @@ media_playlist_foreach_playlist_from_db(NULL, playlist_list_cb, NULL);
  • Handle the found records.
    1. When a record is found, a callback function is invoked. A handle to the record is passed as a playlist function parameter.

      -
      static bool playlist_list_cb(media_playlist_h playlist, void* user_data) 
      +
      +static bool 
      +playlist_list_cb(media_playlist_h playlist, void* user_data) 
       {
          char *name = NULL;
          int playlist_id = 0;
      @@ -1662,14 +1674,17 @@ media_playlist_foreach_playlist_from_db(NULL, playlist_list_cb,  NULL);
          media_filter_destroy(temp_filter);
       
          return true;
      -}
    2. +} +
    3. The callback function operates on the records the same way as before. To get the media info, use the following functions:

      • media_info_get_audio()
      • media_info_get_media_id()
      • media_info_get_size()
      -
      static bool audio_list_cb(int playlist_member_id, media_info_h media_hndl, void *user_data) 
      +
      +static bool 
      +audio_list_cb(int playlist_member_id, media_info_h media_hndl, void *user_data) 
       {
          char * id;
          media_info_get_media_id(media_hndl, &id);
      @@ -1677,7 +1692,8 @@ media_playlist_foreach_playlist_from_db(NULL, playlist_list_cb,  NULL);
          free(id);
       
          return true;
      -}
  • +} +
  • Clean up. @@ -1705,29 +1721,28 @@ media_content_disconnect();
  • media_content_disconnect();
    -

    Adding Tags

    + +

    Adding Tags

    +

    To add a tag to the database, and add a file to the tag:

    1. Add the tag. -

      Use media_tag_insert_to_db() to add the tag. The result is a handle to the new tag.

      -
      +

      Use the media_tag_insert_to_db() function to add the tag. The result is a handle to the new tag.

      +
       media_tag_h tag = NULL;
      -const char *tag_name = "Tag name";
      +const char *tag_name = "Tag name";
       
       media_tag_insert_to_db(tag_name, &tag);
       
    2. Insert a media item into the tag. -

      -To insert an item into the tag, you need to know the id of the item. -One of the ways of obtaining the id is to insert a media item into the database. -In the example below, a media file is inserted and then added to the tag.

      -
      +

      To insert an item into the tag, you need to know the ID of the item. One way of obtaining the ID is to insert a media item into the database. In the following example, a media file is inserted and then added to the tag.

      +
       media_info_h image_info = NULL;
       char *image_id = NULL;
       
      -media_info_insert_to_db("path/to/image_file", &image_info);
      +media_info_insert_to_db("path/to/image_file", &image_info);
       
       media_info_get_media_id(image_info, &image_id);
       
      @@ -1736,17 +1751,18 @@ media_tag_add_media(tag, image_id);
       
    3. Update the tag. -

      After you make any changes to the tag, like change its name or add items, you need to update it.

      -
      +

      After you make any changes to the tag, such as changing its name or adding items, you need to update it.

      +
       media_tag_update_to_db(tag);
       
    4. -
    5. Destroy the tag handle.
    6. -

      After the tag has been inserted into the database and all updates to it have been made, you can destroy the handle. Note that this is not related to deleting the tag from the database.

      -
      +
    7. Destroy the tag handle. +

      After the tag has been inserted into the database and all updates to it have been made, destroy the handle. Note that this is not related to deleting the tag from the database.

      +
       media_tag_destroy(tag);
       
      +
    @@ -1759,7 +1775,8 @@ media_tag_destroy(tag);
     // glib library is used, so include glib.h
     
    -bool gallery_tag_item_cb(media_tag_h tag, void *user_data)
    +bool 
    +gallery_tag_item_cb(media_tag_h tag, void *user_data)
     {
        media_tag_h new_tag = NULL;
        media_tag_clone(&new_tag, tag);
    @@ -1770,7 +1787,8 @@ bool gallery_tag_item_cb(media_tag_h tag, void *user_data)
        return true;
     }
     
    -bool gallery_media_item_cb(media_info_h media, void *user_data)
    +bool 
    +gallery_media_item_cb(media_info_h media, void *user_data)
     {
        media_info_h new_media = NULL;
        media_info_clone(&new_media, media);
    @@ -1857,13 +1875,15 @@ else
     
    -

    Deleting Tags

    -

    Deleting a tag requires its id. In the example below, the id is obtained by calling media_tag_foreach_tag_from_db().

    +

    Deleting Tags

    + +

    To delete a tag, you need its ID. In the following example, the ID is obtained by calling the media_tag_foreach_tag_from_db() function.

    1. Define the callback. -

      Define the callback called for each found tag. The callback will add the handle of each tag to the tag list.

      -
      -bool gallery_tag_item_cb(media_tag_h tag, void *user_data)
      +

      Define the callback called for each found tag. The callback adds the handle of each tag to the tag list.

      +
      +bool 
      +gallery_tag_item_cb(media_tag_h tag, void *user_data)
       {
          media_tag_h new_tag = NULL;
       
      @@ -1876,17 +1896,18 @@ bool gallery_tag_item_cb(media_tag_h tag, void *user_data)
       
    2. Find tags. -

      Call media_tag_foreach_tag_from_db() to find tags in the database. The first parameter is a filter; if NULL, all tags are found. The second parameter is the callback, called for each found tag. The third parameter is data passed to the callback in each iteration. In this example it is a list of tag handles.

      -
      +

      Call the media_tag_foreach_tag_from_db() function to find tags in the database. The first parameter is a filter; if NULL, all tags are found. The second parameter is the callback, called for each found tag. The third parameter is data passed to the callback in each iteration. In this example, it is a list of tag handles.

      +
       GList *tag_list = NULL;
       
       media_tag_foreach_tag_from_db(NULL, gallery_tag_item_cb, &tag_list);
       
      +
    3. Iterate through the tag list.

      After the list is completed, access each element:

      -
      +
       media_tag_h tag_handle = NULL;
       int tag_id;
       char *tag_name = NULL;
      @@ -1900,8 +1921,8 @@ for (i = 0; i < len; i++)
       
    4. Delete the tag. -

      Provided that you have the tag handle, get the tag id with media_tag_get_tag_id() and delete the tag with media_tag_delete_from_db().

      -
      +

      Provided that you have the tag handle, get the tag ID with the media_tag_get_tag_id() function and delete the tag with the media_tag_delete_from_db() function.

      +
          ret = media_tag_get_tag_id(tag_handle, &tag_id);
       
          ret = media_tag_delete_from_db(tag_id);
      @@ -1910,19 +1931,18 @@ for (i = 0; i < len; i++)
       
       
    5. Destroy the tag handle.

      Now that the handle is no longer needed, it can be destroyed:

      -
      +
          ret = media_tag_destroy(tag_handle);
       }
       
    6. Free the tag list.

      After all elements have been accessed, free the tag handle list:

      -
      +
       g_list_free(tag_list);
       tag_list = NULL;
       
    7. -
    @@ -1952,7 +1972,8 @@ tag_list = NULL;
    1. Define callback functions:
      -void storage_cb(media_storage_h storage, void *user_data)
      +void 
      +storage_cb(media_storage_h storage, void *user_data)
       {
          media_storage_h new_storage = NULL;
          media_storage_clone(&new_storage, storage);
      @@ -2039,7 +2060,8 @@ media_group_foreach_group_from_db(NULL, group, group_cb, (void *) group);
       

      To find all items in the group, call the media_group_foreach_media_from_db() function. The parameters are similar to those in the media_group_foreach_media_from_db() function. The media_cb() callback is called for each found item.

      -bool group_cb(const char *name, void *user_data)
      +bool 
      +group_cb(const char *name, void *user_data)
       {
          media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
          media_group_e group = (media_group_e) user_data;
      @@ -2060,7 +2082,8 @@ bool group_cb(const char *name, void *user_data)
       
    2. Define the media_cb() callback to handle each found item:
      -bool media_cb(media_info_h media, void *user_data)
      +bool 
      +media_cb(media_info_h media, void *user_data)
       {
          media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
          char *name = NULL;
      @@ -2076,6 +2099,7 @@ bool media_cb(media_info_h media, void *user_data)
       }
       
    +

    Finding Media Item Groups Using a Filter

    To find groups containing only items matching the given criteria:

    @@ -2091,7 +2115,7 @@ media_filter_create(&filter);
  • Set the filter condition. The condition is a string used in a SQL query.

    -

    The following example searches for files containing '.jpg' in their name. The '%' characters in the query act as wildcards. Also, they should be escaped using another '%' character to avoid compiler warnings.

    +

    The following example searches for files containing '.jpg' in their name. The '%' characters in the query act as wildcards. Also, they must be escaped using another '%' character to avoid compiler warnings.

     #define BUFLEN 200 // This is just an example
    diff --git a/org.tizen.tutorials/html/native/content/mime_type_tutorial_n.htm b/org.tizen.tutorials/html/native/content/mime_type_tutorial_n.htm
    index 3eb2258..2ff0c7b 100644
    --- a/org.tizen.tutorials/html/native/content/mime_type_tutorial_n.htm
    +++ b/org.tizen.tutorials/html/native/content/mime_type_tutorial_n.htm
    @@ -18,7 +18,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/context/activity_tutorial_n.htm b/org.tizen.tutorials/html/native/context/activity_tutorial_n.htm index 6ddb43f..781a0ef 100644 --- a/org.tizen.tutorials/html/native/context/activity_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/context/activity_tutorial_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -72,7 +72,10 @@ activity_start_recognition(handle, ACTIVITY_WALK, example_activity_callback, NUL
  • When the example_activity_callback() callback is invoked, the current activity is delivered as a parameter, and you can extract the accuracy of the recognized activity: -
    void example_activity_callback(activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data)
    +
    +void 
    +example_activity_callback(activity_type_e activity, const activity_data_h data, 
    +                          double timestamp, activity_error_e error, void *user_data)
     {
        int result;
     
    diff --git a/org.tizen.tutorials/html/native/context/context_tutorials_n.htm b/org.tizen.tutorials/html/native/context/context_tutorials_n.htm
    index 126c4d7..7f39ce3 100644
    --- a/org.tizen.tutorials/html/native/context/context_tutorials_n.htm
    +++ b/org.tizen.tutorials/html/native/context/context_tutorials_n.htm
    @@ -16,7 +16,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.tutorials/html/native/context/gesture_tutorial_n.htm b/org.tizen.tutorials/html/native/context/gesture_tutorial_n.htm index 05b91e3..9b6903c 100644 --- a/org.tizen.tutorials/html/native/context/gesture_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/context/gesture_tutorial_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -74,7 +74,9 @@ gesture_create(&handle);
  • When the gesture_cb() callback function is invoked, you can retrieve the event data using the gesture_get_event() function:

    -
    void gesture_cb(gesture_type_e gesture, const gesture_data_h data, double timestamp, gesture_error_e error, void *user_data)
    +
    +void 
    +gesture_cb(gesture_type_e gesture, const gesture_data_h data, double timestamp, gesture_error_e error, void *user_data)
     {			
        gesture_event_e event;
        if (gesture == GESTURE_PICK_UP) 
    @@ -86,7 +88,8 @@ gesture_create(&handle);
  •          // Handle the event       }    } -} +} +

    If the application registered multiple gestures to a single callback function, the input parameter gesture can be used to distinguish the gesture received.

    Some gestures can return different types of events. For example, GESTURE_SHAKE can return GESTURE_SHAKE_DETECTED or GESTURE_SHAKE_FINISHED.

    diff --git a/org.tizen.tutorials/html/native/context/history_tutorial_n.htm b/org.tizen.tutorials/html/native/context/history_tutorial_n.htm index e5a28e7..b23e400 100644 --- a/org.tizen.tutorials/html/native/context/history_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/context/history_tutorial_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native

    +

    Mobile native

    Content

    @@ -39,16 +39,7 @@

    This tutorial demonstrates how you can get the history profiles of the device usage, and enumerate retrieved data lists.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    +

    This feature is supported in mobile applications only.

    Warm-up

    Become familiar with the Contextual History API basics by learning about:

    diff --git a/org.tizen.tutorials/html/native/context/trigger_tutorial_n.htm b/org.tizen.tutorials/html/native/context/trigger_tutorial_n.htm index 9881285..029d2ff 100644 --- a/org.tizen.tutorials/html/native/context/trigger_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/context/trigger_tutorial_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native

    +

    Mobile native

    Content

    @@ -47,16 +47,7 @@

    This tutorial demonstrates how you can compose and manage rules based on context states.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    +

    This feature is supported in mobile applications only.

    Warm-up

    Become familiar with the Contextual Trigger API basics by learning about:

    diff --git a/org.tizen.tutorials/html/native/graphics/cairo_tutorial_n.htm b/org.tizen.tutorials/html/native/graphics/cairo_tutorial_n.htm index b47cf1d..5760d58 100644 --- a/org.tizen.tutorials/html/native/graphics/cairo_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/graphics/cairo_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -72,7 +72,8 @@ Build the environment.

    Define the appdata structure that contains the pointers to the objects to be manipulated:

    -typedef struct appdata 
    +typedef struct 
    +appdata 
     {
        Evas_Object *win;	
        Evas_Object *img;
    @@ -108,7 +109,8 @@ ad->cairo = cairo_create(ad->surface);
     
  • To draw Cairo with some specific vector positions, use the window size that you got before. You can compare the window width and height and get the smaller length to set the square side.
    -void cairo_drawing(void *data)
    +void 
    +cairo_drawing(void *data)
     {
        appdata_s *ad = data;
        int d = 0;
    @@ -162,11 +164,12 @@ void cairo_drawing(void *data)
     }
     
  • -
  • The delete callback is triggered when the Window is destroyed from the main loop. +
  • The delete callback is triggered when the window is destroyed from the main loop.
    -static void win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
    +static void 
    +win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
     {
        appdata_s *ad = data;
        cairo_surface_destroy(ad->surface);
    @@ -246,7 +249,8 @@ cairo_gl_device_set_thread_aware(ad->cairo_device, 0);
     
  • -static void init_cairo_evasgl_drawing(appdata_s *ad)
    +static void 
    +init_cairo_evasgl_drawing(appdata_s *ad)
     {
        // Create window
        elm_config_accel_preference_set("opengl");
    @@ -301,7 +305,8 @@ static void init_cairo_evasgl_drawing(appdata_s *ad)
     
  • Draw geometrical figures in the cairo_drawing() callback function.

    The following code snippet shows how to draw some geometrical figures such as a triangle, rectangle, and circle with various styles and random positions by using the Cairo APIs.

    -void cairo_drawing(void *data)
    +void 
    +cairo_drawing(void *data)
     {
        appdata_s *ad = data;
     
    @@ -385,9 +390,10 @@ void cairo_drawing(void *data)
     
  • Resize the callback. -

    In the following code snippet, when resizing occurs, Evas GL surface is recreated and reconnected to the Evas_object image.

    +

    In the following code snippet, when resizing occurs, Evas_GL surface is recreated and reconnected to the Evas_object image.

    -static void win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
    +static void 
    +win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
     {
        appdata_s *ad = data;
     
    @@ -428,7 +434,8 @@ static void win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_i
     

    To update the Evas_object image which is connected to Evas_GL, use the evas_object_image_pixels_dirty_set() function. This updates the Evas_object image whenever Evas renders.

    -static Eina_Bool _animate_cb(void *data)
    +static Eina_Bool 
    +_animate_cb(void *data)
     {
        Evas_Object *obj = (Evas_Object *)data;
        evas_object_image_pixels_dirty_set(obj, EINA_TRUE);
    @@ -438,9 +445,10 @@ static Eina_Bool _animate_cb(void *data)
     
  • -
  • The delete callback is triggered when the Window is destroyed from the main loop. +
  • The delete callback is triggered when the window is destroyed from the main loop.
    -static void win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
    +static void 
    +win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
     {
        appdata_s *ad = data;
        cairo_surface_destroy(ad->surface);
    diff --git a/org.tizen.tutorials/html/native/graphics/graphic_comp_tutorial_n.htm b/org.tizen.tutorials/html/native/graphics/graphic_comp_tutorial_n.htm
    index e94580c..ffeba9f 100644
    --- a/org.tizen.tutorials/html/native/graphics/graphic_comp_tutorial_n.htm
    +++ b/org.tizen.tutorials/html/native/graphics/graphic_comp_tutorial_n.htm
    @@ -18,7 +18,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/graphics/graphics_tutorials_n.htm b/org.tizen.tutorials/html/native/graphics/graphics_tutorials_n.htm index 1aae492..4839283 100644 --- a/org.tizen.tutorials/html/native/graphics/graphics_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/graphics/graphics_tutorials_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.tutorials/html/native/graphics/opengl_tutorial_n.htm b/org.tizen.tutorials/html/native/graphics/opengl_tutorial_n.htm index e6405b2..f1f0d9f 100644 --- a/org.tizen.tutorials/html/native/graphics/opengl_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/graphics/opengl_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -90,9 +90,13 @@

    Creating the Basic Application

    -

    This tutorial demonstrates how you can create a multicolored 3D rotating cube using OpenGL ES 2.0 API provided by GLView library. Several concepts are explained, such as the cube geometry, the initialization phase of the model, the adjustment of this very model frame by frame, and the way to design the OpenGL ES rendering loop.

    -

    First create a basic application as explained in the Basic application tutorial. This provides a basic UI application skeleton which already makes available the window object that contains the GLView canvas.

    -

    Building the Environment

    +

    This tutorial demonstrates how you can create a multicolored 3D rotating cube using the OpenGL ES 2.0 API provided by the GLView library. Several concepts are explained, such as the cube geometry, the initialization phase of the model, the adjustment of this very model frame by frame, and the way to design the OpenGL ES rendering loop.

    +

    To create the basic application:

    +
      +
    1. Create a basic application as explained in the Basic application tutorial. The basic UI application skeleton already makes available the window object that contains the GLView canvas.

      +
    2. +
    3. Build the environment: +

      Define the application data structure that holds all the objects pertinent for the GLView application:

      • Evas_Object *win: Application window
      • @@ -102,7 +106,8 @@
      • Evas_Object *inner_box: Box object for toolbox
      -typedef struct appdata 
      +typedef struct 
      +appdata 
       {
          Evas_Object *win;
          Evas_Object *conform;
      @@ -111,98 +116,114 @@ typedef struct appdata
          Evas_Object *main_box;
          Evas_Object *inner_box;
       } appdata_s;
      -
      - -

      OpenGL ES Canvas

      +
  • -

    When developing an application with Elementary, you can create a window by using the Elementary utility function as below:

    +
  • +

    Create the OpenGL ES canvas:

    +
      +
    1. +

      When developing an application with Elementary, you can create a window by using the Elementary utility function:

       elm_config_accel_preference_set("opengl"); 
       ad->win = elm_win_util_standard_add("GLView Example", "GLView Example");
      - -

      To develop a GL application, you have to call elm_config_accel_preference_set() before creating a window which makes an application to use GPU.

      - +
    2. +
    3. +

      To develop a GL application, you have to call the elm_config_accel_preference_set() function before creating a window which makes an application to use the GPU.

       ad->glview = elm_glview_add(ad->main_box);
      -

      There are 2 different methods to call GL functions.

      - -
      • First is to use Elementary GL Helper functions. You have to include Elementary_GL_Helpers.h and define a global variable by using ELEMENTARY_GLVIEW_GLOBAL_DEFINE(). Before calling gl functions, write ELEMENTARY_GLVIEW_GLOBAL_USE(). This tutorial uses this method. The usage is as follows. +

        There are 2 different methods to call the GL functions:

        +
        • Use the Elementary GL Helper functions. You have to include the Elementary_GL_Helpers.h header file and define a global variable using the ELEMENTARY_GLVIEW_GLOBAL_DEFINE() function. Before calling the gl functions, write the ELEMENTARY_GLVIEW_GLOBAL_USE() function. This tutorial uses this method.
           #include <Elementary_GL_Helpers.h>
           ELEMENTARY_GLVIEW_GLOBAL_DEFINE();
           
          -static void create_gl_canvas(appdata_s *ad) 
          +static void 
          +create_gl_canvas(appdata_s *ad) 
           {
              ad->glview = elm_glview_add(ad->main_box);
              ELEMENTARY_GLVIEW_GLOBAL_USE(ad->glview);
           }
           
          -static void draw_gl(Evas_Object *obj) 
          +static void 
          +draw_gl(Evas_Object *obj) 
           { 
              glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
           }
        • -
        • Second, you can get the Evas_GL instance from elm_glview_gl_api_get function, then you can call the OpenGL ES functions with the instance.

          +
        • Get the Evas_GL instance from the elm_glview_gl_api_get() function, and call the OpenGL ES functions with the instance.

           ad->glview = elm_glview_add(ad->main_box);
           Evas_GL_API *glapi = elm_glview_gl_api_get(ad->glview);
           glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        - -

        The next thing to do is to set the GLView mode. elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode) supports alpha, depth, stencil, MSAA, and client_side_rotation.

        +
      • +
      • +

        Set the GLView mode. The elm_glview_mode_set() function supports alpha, depth, stencil, MSAA, and client_side_rotation.

         elm_glview_mode_set(ad->glview, ELM_GLVIEW_DEPTH);
        - -

        To set up callbacks:

        - -
        -elm_glview_init_func_set(ad->glview, init_gl);
        -elm_glview_resize_func_set(ad->glview, resize_gl);
        -elm_glview_render_func_set(ad->glview, draw_gl);
        -elm_glview_del_func_set(ad->glview, del_gl);
        -ani = ecore_animator_add(animate_cb, ad->glview);
        - +
      • +
      • +

        Set up callbacks:

        • Callback for initialization

          The initialization callback is called when the GLView is first created, after a valid OpenGL ES context and surface have been created. This is called from the main loop, just as the 3 other callbacks.

          +
          +elm_glview_init_func_set(ad->glview, init_gl);
          +
        • Callback for resizing

          The resize callback is called whenever the GLView component is resized. A common action to take here is to reset the viewport.

          +
          +elm_glview_resize_func_set(ad->glview, resize_gl);
          +
        • Callback for drawing -

          The drawing callback is called whenever a new frame has to be drawn. The exact moment when this function is called depends on the policy set when calling.

          +

          The drawing callback is called whenever a new frame has to be drawn.

          +
          +elm_glview_render_func_set(ad->glview, draw_gl);
          +
          +

          The exact moment when this function is called depends on the policy set when calling.

           elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
          -

          Another policy is ELM_GLVIEW_POLICY_ALWAYS, which requests render always even when it is not visible. So on demand policy is probably what you are looking for. The application can now draw anything using GL primitives when this callback is triggered. All draw operations are restricted to the surface of the GLView object previously created. Here it covers the whole window.

          +

          Another policy is ELM_GLVIEW_POLICY_ALWAYS, which requests render always even when it is not visible. So on demand policy is probably what you are looking for. The application can now draw anything using GL primitives when this callback is triggered. All draw operations are restricted to the surface of the GLView object previously created. Here it covers the whole window.

        • Callback for deleting

          The delete callback is triggered when the GLView is being destroyed, from the main loop, and no other callback can be called on the same object afterwards.

          +
          +elm_glview_del_func_set(ad->glview, del_gl);
          +
        • Add an animator. -

          The application above is technically working but the scene does not get updated unless the object is marked as such. Games might want to use an animator to have a regular update of the scene.

          +

          The application above is technically working but the scene does not get updated unless the object is marked as such. Games want to use an animator to have a regular update of the scene.

          +
          +ani = ecore_animator_add(animate_cb, ad->glview);

          Any other event can be used to refresh the view, for example user input if the view needs to be updated.

        - +
      • +
    +
  • +

    Creating the Cube

    -

    Creating and the coloring the cube can be separated into two distinct tasks: define the vertices and then add the colors to the faces.

    - +

    Creating and the coloring the cube can be separated into 2 distinct tasks: define the vertices and then add the colors to the faces.

    +

    To create and color the cube:

    Figure: Cube

    Cube

    - -

    Declare an array that stores the vertices of the cube in order to make it look like the drawing above.

    -
    static const float vertices[] =
    +
      +
    1. Declare an array that stores the vertices of the cube to make it look like the drawing above.

      +
      +static const float vertices[] =
       {
          // Front
          -0.5f, 0.5f, 0.5f,
      @@ -252,8 +273,10 @@ elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);

      Figure: Cube matrix

      Cube matrix

      -

      Each triangle is defined with three point coordinates, three vertices for each triangle, two triangles per face and six faces, so there are 36 vertices is total.

      -

      The next step is to specify a color for each face of the cube. Each color is represented in the RGBA format for the corresponding vertex, where each component is ranged from 0 to 1 where 1 is the maximum value. For example, in 32-byte color space, the RGB color of (16, 147, 237) is translated as (0.0625, 0.57421875, 0.92578125). The A of RGBA stands for the alpha channel, which represents the transparency of the color. All colors defined in this tutorial are opaque to make it simpler, so each alpha value is set to 1.0. In this example, different variants of blue are used for the faces of the cube.

      +

      Each triangle is defined with 3 point coordinates, 3 vertices for each triangle, 2 triangles per face and 6 faces. There are 36 vertices is total.

      +
    2. +
    3. +

      Specify a color for each face of the cube. Each color is represented in the RGBA format for the corresponding vertex, where each component is ranged from 0 to 1 where 1 is the maximum value. For example, in 32-byte color space, the RGB color of (16, 147, 237) is translated as (0.0625, 0.57421875, 0.92578125). The A of RGBA stands for the alpha channel, which represents the transparency of the color. All colors defined in this tutorial are opaque to make it simpler, so each alpha value is set to 1.0. In this example, different variants of blue are used for the faces of the cube.

      Specify the colors of the cube into an array dedicated to this vertex:

      static const float colors[] =
       {
      @@ -301,12 +324,17 @@ elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
         0.52734375f, 0.76171875f, 0.92578125f, 1.0f };
    + +

    Drawing the Cube with GLView

    -

    Mathematical Functions for Matrices

    -

    After the model is initialized, create functionality to manipulate the scene. OpenGL ES 2.0 provided by GLView requires more preliminary work that the previous version of the library, but gives more power and flexibility, although our example does not take much benefit.

    -

    First, declare additional global variables for tasks specific to OpenGL ES 2.0. A program object is needed, an identifier for the vertices buffer and another for the colors. Three variables are also required to ensure the connection with the shader language:

    +

    After the model is initialized, create functionality to manipulate the scene. OpenGL ES 2.0 provided by GLView requires more preliminary work that the previous version of the library, but it gives you more power and flexibility, although this example does not take much benefit.

    +

    To draw the cube with GLView and use mathematical functions for matrices:

    + +
      +
    1. +

      Declare additional global variables for tasks specific to OpenGL ES 2.0. A program object is needed, an identifier for the vertices buffer, and another for the colors. Three variables are also required to ensure the connection with the shader language:

      • mvpLoc is an identifier for model-view-projection matrix.
      • positionLoc is an identifier for the vertex position.
      • @@ -315,21 +343,23 @@ elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);

    Declare all these variables in the appdata object as static variables so that each function can use variables and that they exist for the whole duration of the program.

    typedef struct appdata 
     {
    -   unsigned int     program;
    -   unsigned int     vtx_shader;
    -   unsigned int     fgmt_shader;
    -   unsigned int     vertexID;
    -   unsigned int     colorID;
    -   unsigned int     mvpLoc;
    -   unsigned int     positionLoc;
    -   unsigned int     colorLoc;
    +   unsigned int program;
    +   unsigned int vtx_shader;
    +   unsigned int fgmt_shader;
    +   unsigned int vertexID;
    +   unsigned int colorID;
    +   unsigned int mvpLoc;
    +   unsigned int positionLoc;
    +   unsigned int colorLoc;
     }
     
    -

    Since OpenGL ES 2.0, some functions for matrix transformations have been removed. Define three matrices to use: projection matrix, model-view matrix, and a combination of these allows you to perform any transformations on the initial vertices matrix.

    - -

    Matrix Multiplication Function (glMultMatrix)

    -

    First, define a function that is able to return the inner product of two matrices. This function reproduces the behavior of glMultMatrix() available in OpenGL ES 1.1. This function is very useful since almost every matrix transformation can be translated as multiplications of matrices.

    -

    The function takes three arguments, one is for the result and the other 2 matrices are operands:

    + +
  • +

    Since OpenGL ES 2.0, some functions for matrix transformations have been removed. Define 3 matrices to use: projection matrix, model-view matrix, and a combination of these allows you to perform any transformations on the initial vertices matrix.

    +
      +
    • Create the matrix multiplication function. +

      Define a function that is able to return the inner product of 2 matrices. This function reproduces the behavior of the glMultMatrix() function available in OpenGL ES 1.1. This function is very useful since almost every matrix transformation can be translated as multiplications of matrices.

      +

      The function takes 3 parameters, 1 is for the result and the other 2 matrices are operands.

      static void
       customMutlMatrix(float matrix[16], const float matrix0[16], const float matrix1[16])
       {
      @@ -348,9 +378,9 @@ customMutlMatrix(float matrix[16], const float matrix0[16], const float matrix1[
             matrix[i] = temp[i];
       }
       
      -

      Matrix Identity Function (glLoadIdentity)

      - -

      Implement a function equivalent to glLoadIdentity() that replaces the current matrix with the identity matrix:

      +
    • +
    • Create the matrix identity function. +

      Implement a function equivalent to the glLoadIdentity() function that replaces the current matrix with the identity matrix.

      const float unit_matrix[] = 
       {
          1.0f, 0.0f, 0.0f, 0.0f,
      @@ -366,14 +396,14 @@ customLoadIdentity(float matrix[16])
             matrix[i] = unit_matrix[i];
       }
       
      - -

      Matrix Projection Function (glFrustum)

      -

      Since glFrustum has been depreciated, implement a function that produces perspective projection matrices that are used to transform from eye coordinate space to clip coordinate space. This matrix projects a portion of the space (the "fustum") to your screen. Many caveats apply (normalized device coordinates, perspective divide, etc), but that is the idea:

      +
    • +
    • Create the matrix projection function. +

      Since the glFrustum() function has been deprecated, implement a function that produces perspective projection matrices that are used to transform from eye coordinate space to clip coordinate space. This matrix projects a portion of the space (the "frustum") to your screen. Many caveats apply (such as normalized device coordinates and perspective divide), but that is the idea.

      static int
       customFrustum(float result[16], 
      -              const float left,   const float right, 
      +              const float left, const float right, 
                     const float bottom, const float top, 
      -              const float near,   const float far)
      +              const float near, const float far)
       {
          if ((right - left) == 0.0f || (top - bottom) == 0.0f || (far - near) == 0.0f) 
             return 0;
      @@ -401,9 +431,9 @@ customFrustum(float result[16],
          return 1;
       }
       
      - -

      Matrix Scaling Function (glScale)

      -

      Depreciated glScale() function represents a non-uniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of the three axes:

      +
    • +
    • Create the matrix scaling function. +

      The deprecated glScale() function represents a non-uniform scaling along the x, y, and z axes. The 3 parameters indicate the desired scale factor along each of the 3 axes.

      const float scale_matrix[] = 
       {
          x,    0.0f, 0.0f, 0.0f,
      @@ -412,7 +442,7 @@ customFrustum(float result[16],
          0.0f, 0.0f, 0.0f, 1.0f
       }
       
      -

      Here is the implementation of the matrix scaling function:

      +

      The following example shows the implementation of the matrix scaling function:

      static void
       customScale(float matrix[16], const float sx, const float sy, const float sz)
       { 
      @@ -432,9 +462,10 @@ customScale(float matrix[16], const float sx, const float sy, const float sz)
          matrix[11] *= sz; 
       }
       
      +
    • -

      Matrix Rotation Function (glRotate)

      -

      Define a function to represent a rotation by the vector (x y z). The current matrix is multiplied by a rotation matrix:

      +
    • Create the matrix rotation function. +

      Define a function to represent a rotation by the vector (x y z). The current matrix is multiplied by a rotation matrix.

      static void
       customRotate(float matrix[16], const float anglex, const float angley, const floatanglez)
       {
      @@ -467,10 +498,15 @@ customRotate(float matrix[16], const float anglex, const float angley, const flo
          customMultMatrix(matrix, matrix, temp);
       }
       
      - -

      Create the Shader

      -

      Define the source for the shader using a string array. First comes out vertex shader, which is used to a medium precision for float values. Then build a uniform matrix with dimensions 4x4 intended to hold the model-view-projection matrix. Also create two vector attributes which have 4 components for the vertex position and the color. This varying variable v_color can be accessed from the fragment shader. In the main function of the shader, initialize the position of the current vertex, gl_Position, with the product of the vertex position and the model-view-projection matrix, in order to normalize the position for the target screen. The pixel color is calculated by the varying variable from the vertex shader.

      -

      In the fragment shader, declare a varying variable, then set the color of the pixel with this interpolated color.

      +
    • +
    +
  • +
  • Create the shader: +
      +
    1. +

      Define the source for the shader using a string array. First comes out vertex shader, which is used to a medium precision for float values. Then build a uniform matrix with dimensions 4x4 intended to hold the model-view-projection matrix. Also create 2 vector attributes which have 4 components for the vertex position and the color. This varying variable v_color can be accessed from the fragment shader.

      +

      In the main function of the shader, initialize the position of the current vertex, gl_Position, with the product of the vertex position and the model-view-projection matrix, to normalize the position for the target screen. The pixel color is calculated by the varying variable from the vertex shader.

      +

      In the fragment shader, declare a varying variable, and set the color of the pixel with this interpolated color.

      static const char vertex_shader[] =
          "precision mediump float;"
          "uniform mat4 u_mvpMat;"
      @@ -490,7 +526,9 @@ static const char fragment_shader[] =
             "gl_FragColor = v_color;"
          "}";
       
      -

      Create the shaders, attach the source code that is just defined and compile the program object:

      +
    2. +
    3. +

      Create the shaders, attach the source code that is just defined, and compile the program object:

      static void
       initShaders(void* data)
       {
      @@ -507,7 +545,9 @@ initShaders(void* data)
          glShaderSource(ad->fgmt_shader, 1, &p, NULL);
          glCompileShader(ad->fgmt_shader);
       
      -

      Once the shaders are ready, instantiate the program object and link the shaders. If the linking succeeds, you can destroy the shaders afterwards (using glDeleteShader). Since they are inside the program object, so it is pointless to keep them in memory.

      +
    4. +
    5. +

      Once the shaders are ready, instantiate the program object and link the shaders. If the linking succeeds, you can destroy the shaders afterwards (using the glDeleteShader() function). Since they are inside the program object, it is pointless to keep them in memory.

         ad->program = glCreateProgram();
       
          glAttachShader(ad->program, ad->vtx_shader);
      @@ -518,14 +558,16 @@ initShaders(void* data)
       
          glLinkProgram(ad->program);
       
      - -

      For shader process, create identifiers for the attribute variables used in the shader program. First create an identifier for the model-view-projection matrix, another one for the current vertex position, and a last one for the vertex color.

      +
    6. +
    7. +

      For shader process, create identifiers for the attribute variables used in the shader program. Create an identifier for the model-view-projection matrix, another one for the current vertex position, and a last one for the vertex color.

         ad->mvpLoc      = glGetUniformLocation(ad->program, "u_mvpMat");
          ad->positionLoc = glGetAttribLocation(ad->program, "a_position");
          ad->colorLoc    = glGetAttribLocation(ad->program, "a_color");
       
      - -

      Finally, generate the buffers for the vertex positions and colors.

      +
    8. +
    9. +

      Generate the buffers for the vertex positions and colors:

          glGenBuffers(1, &ad->vertexID);
          glBindBuffer(GL_ARRAY_BUFFER, ad->vertexID);
      @@ -536,8 +578,9 @@ initShaders(void* data)
          glBufferData(GL_ARRAY_BUFFER, sizeof(colors), colors, GL_STATIC_DRAW);
       }
       
      - -

      Allocate memory for the matrix and load a unit matrix into it. Then define the value that is used in order to build the perspective projection matrix. The customFrustum() function is used for it. Multiply this resulting matrix with a resizing matrix, so the model is correctly adjusted to the screen.

      +
    10. +
    11. +

      Allocate memory for the matrix and load a unit matrix into it. Define the value that is used to build the perspective projection matrix with the customFrustum() function. Multiply this resulting matrix with a resizing matrix, so the model is correctly adjusted to the screen.

       float aspect;
       customLoadIdentity(view);
      @@ -553,17 +596,25 @@ else
          customFrustum(view, -1.0, 1.0, -1.0 * aspect, 1.0 * aspect, -1.0, 1.0);
       }
       
      +
    12. +
    +
  • +

    Rendering the Cube

    -

    We set the viewport at 0,0 corresponding to the bottom left edge of the window, and the height and width of the GL surface. Clear the depth and the color buffers to the values that were selected during initialization. Then call the glUseProgram() function in order to trigger the shader program.

    +

    To render the cube:

    +
      +
    1. +

      Set the viewport at 0,0 corresponding to the bottom left edge of the window, and the height and width of the GL surface. Clear the depth and the color buffers to the values that were selected during initialization. Call the glUseProgram() function to trigger the shader program.

      glViewport(0, 0, w, h);
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       
       glUseProgram(ad->program);
       
      - -

      Also bind the position and color identifiers to the buffers defined above.

      +
    2. +
    3. +

      Bind the position and color identifiers to the buffers defined above:

      glEnableVertexAttribArray(ad->positionLoc);
       glBindBuffer(GL_ARRAY_BUFFER, ad->vertexID);
       glVertexAttribPointer(ad->positionLoc, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), 0);
      @@ -572,27 +623,32 @@ glEnableVertexAttribArray(ad->colorLoc);
       glBindBuffer(GL_ARRAY_BUFFER, ad->colorID);
       glVertexAttribPointer(ad->colorLoc, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
       
      - -

      After this, initialize and calculate the transformation matrix of the model-view matrix by calling the customRotate() function. This makes the cube view rotate a little for a better perspective. Once the model-view matrix is ready to display, multiply the projection matrix with the model-view matrix.

      +
    4. +
    5. +

      Initialize and calculate the transformation matrix of the model-view matrix by calling the customRotate() function. This makes the cube view rotate a little for a better perspective. Once the model-view matrix is ready to display, multiply the projection matrix with the model-view matrix.

      customLoadIdentity(model);
       customRotate(ad->model, 45.0f, 45.0f, 0.0f);
       customMutlMatrix(ad->mvp, ad->view, ad->model);
       
      - -

      Then load the model-view-projection matrix into the shader and call glDrawArrays() to draw the model.

      +
    6. +
    7. +

      Load the model-view-projection matrix into the shader and call the glDrawArrays() function to draw the model:

      glUniformMatrix4fv(ad->mvpLoc, 1, GL_FALSE, mvp);
       glDrawArrays(GL_TRIANGLES, 0, 36);
       glFlush();
       
      - -

      You now are the proud owner of a nice cube!

      +
    8. +

    Figure: Static cube

    Static cube

    Animating the Cube

    -

    Ecore_Animator is used to create an animation.

    +

    To animate the cube:

    +
      +
    1. +

      Use the Ecore_Animator to create an animation:

      static Eina_Bool
       animate_cb(void *data)
       {
      @@ -607,8 +663,9 @@ create_gl_canvas(appdata_s *ad)
          ani = ecore_animator_add(animate_cb, ad->glview);
       }
       
      - -

      Next define the global variables which are used as parameters of the rendering process. Add parameters to the application data object that are used to control the scaling and the rotation of the cube. To make the cube rotate on one axis, take z, and allow the user to interact with the mouse to make the cube rotate on the two other axes x and y. In order to figure out whether the user is holding the mouse down, add a Boolean variable to have this information. Operations such as shader initialization or program compilation are not required at each tick of the animation loop. For better performance, isolate such task from the repetitive rendering loop. For such purpose, add a Boolean variable which tells whether the initialization is already done.

      +
    2. +
    3. +

      Define the global variables which are used as parameters of the rendering process. Add parameters to the application data object that are used to control the scaling and the rotation of the cube. To make the cube rotate on 1 axis, take z, and allow the user to interact with the mouse to make the cube rotate on the other axes x and y. To figure out whether the user is holding the mouse down, add a Boolean variable to have this information. Operations such as shader initialization or program compilation are not required at each tick of the animation loop. For better performance, isolate such task from the repetitive rendering loop. For such purpose, add a Boolean variable which tells whether the initialization is already done.

      typedef struct appdata 
       {
          float xangle;
      @@ -618,23 +675,29 @@ create_gl_canvas(appdata_s *ad)
          Eina_Bool initialized : 1;
       }  appdata_s;
       
      - -

      Here are the modifications that must be done to the rendering loop for animation.

      -

      First, lighten the recurrent rendering process by adding an initialization step:

      +
    4. +
    5. Modify the rendering loop for animation.

      +
        +
      • +

        Lighten the recurrent rendering process by adding an initialization step:

        if (ad->initialized) 
         {
            initShaders(ad);
            ad->initialized = EINA_TRUE;
         }
         
        - -

        Before drawing the vertices, the rotation angle for the model-view matrix must be incremented for every tick.

        +
      • +
      • +

        Before drawing the vertices, the rotation angle for the model-view matrix must be incremented for every tick. This makes the cube rotate automatically.

        customLoadIdentity(ad->model);
         customRotate(ad->model, ad->xangle, ad->yangle, ad->zangle++);
         customMutlMatrix(ad->mvp, ad->view, ad->model);
         
        - -

        This makes the cube rotate automatically. The next thing is to use the mouse to drag the cube around. To do so, add callbacks for mouse events. The first callback defines whether the user is holding the mouse down while moving the cursor around:

        +
      • +
      +
    6. +
    7. +

      Use the mouse to drag the cube around. To do so, add callbacks for mouse events. The first callback defines whether the user is holding the mouse down while moving the cursor around.

      static void
       mouse_down_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
       {
      @@ -668,16 +731,22 @@ mouse_move_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
          }
       }
       
      - +
    8. +
    9. Define the mouse events callbacks when creating the image canvas:

      evas_object_event_callback_add(ad->glview, EVAS_CALLBACK_MOUSE_DOWN, mouse_down_cb, ad);
       evas_object_event_callback_add(ad->glview, EVAS_CALLBACK_MOUSE_UP, mouse_up_cb, ad);
       evas_object_event_callback_add(ad->glview, EVAS_CALLBACK_MOUSE_MOVE, mouse_move_cb, ad);
       
      +
    10. +

    Implementing UI Component Interaction

    -

    Consider using UI component to control some aspects of the rendering. For example, use some sliders to control the shape of the cube. Declare 3 sliders to play with the scaling coordinates of the cube.

    +

    To implement UI component interaction:

    +
      +
    1. +

      Use the UI component to control some aspects of the rendering, such as some sliders to control the shape of the cube. Declare 3 sliders to play with the scaling coordinates of the cube.

      typedef struct appdata 
       {
          Evas_Object *slx;
      @@ -685,9 +754,10 @@ evas_object_event_callback_add(ad->glview, EVAS_CALLBACK_MOUSE_MOVE, mouse_mo
          Evas_Object *slz;
       }
       
      - -

      When rendering the GUI, build and show the sliders. Those accept values in a range from 0.0 to 1.5 and control the scaling of each axis of the cube.

      -
      // Slider for X-axis scale
      +
    2. +
    3. +

      Build and show the sliders when rendering the GUI. The sliders accept values in a range from 0.0 to 1.5. They control the scaling of each axis of the cube.

      +
      // Slider for X axis scale
       ad->slx = elm_slider_add(ad->inner_box);
       evas_object_size_hint_align_set(ad->slx, EVAS_HINT_FILL, 0);
       elm_slider_horizontal_set(ad->slx, EINA_TRUE);
      @@ -700,7 +770,7 @@ evas_object_color_set(ad->slx, 0.0, 0.0, 120, 255);
       elm_box_pack_end(ad->inner_box, ad->slx);
       evas_object_show(ad->slx);
       
      -// Slider for Y-axis scale
      +// Slider for Y axis scale
       ad->sly = elm_slider_add(ad->inner_box);
       evas_object_size_hint_align_set(ad->sly, EVAS_HINT_FILL, 0);
       elm_slider_horizontal_set(ad->sly, EINA_TRUE);
      @@ -713,7 +783,7 @@ evas_object_color_set(ad->sly, 0.0, 0.0, 120, 255);
       elm_box_pack_end(ad->inner_box, ad->sly);
       evas_object_show(ad->sly);
       
      -// Slider for Z-axis scale
      +// Slider for Z axis scale
       ad->slz = elm_slider_add(ad->inner_box);
       evas_object_size_hint_align_set(ad->slz, EVAS_HINT_FILL, 0);
       elm_slider_horizontal_set(ad->slz, EINA_TRUE);
      @@ -726,8 +796,9 @@ evas_object_color_set(ad->slz, 0.0, 0.0, 120, 255);
       elm_box_pack_end(ad->inner_box, ad->slz);
       evas_object_show(ad->slz);
       
      - -

      Then use the actual sliders's values and pass them to the scaling function in the rendering loop:

      +
    4. +
    5. +

      Use the actual sliders's values and pass them to the scaling function in the rendering loop:

      double scalex = elm_slider_value_get(ad->slx);
       double scaley = elm_slider_value_get(ad->sly);
       double scalez = elm_slider_value_get(ad->slz);
      @@ -737,14 +808,16 @@ customRotate(ad->model, ad->xangle, ad->yangle, ad->zangle++);
       customScale(ad->model, scalex, scaley, scalez);
       customMutlMatrix(ad->mvp, ad->view, ad->model);
       
      - -

      Consider also using a colorpicker to change the background. To achieve this, add a colorselector component:

      +
    6. +
    7. +

      Use a colorpicker to change the background by adding a colorselector component:

      typedef struct appdata 
       {
          Evas_Object *cs;
       }
       
      - +
    8. +
    9. Build the UI component with a default palette and add it to the GUI:

      ad->cs = elm_colorselector_add(ad->inner_box);
       elm_colorselector_mode_set(ad->cs, ELM_COLORSELECTOR_BOTH);
      @@ -752,34 +825,40 @@ elm_colorselector_palette_name_set(ad->cs, "default");
       elm_box_pack_end(ad->inner_box, ad->cs);
       evas_object_show(ad->cs);
       
      - -

      When rendering the cube, retrieve the currently selected color to define the color buffer. The colors from the colorselector vary from 0 to 255, which needs to be converted to the color format of OpenGL ES.

      -

      Build the UI component with a default palette and add it to the GUI:

      +
    10. +
    11. +

      When rendering the cube, retrieve the currently selected color to define the color buffer. The colors from the colorselector vary from 0 to 255, which needs to be converted to the color format of OpenGL ES.

      int r, g, b, a;
       elm_colorselector_color_get(ad->cs, &r, &g, &b, &a);
       glClearColor(r/255.0, g/255.0, b/255.0, a/255.0);
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       
      +
    12. +

    Implementing Effects

    - -

    Create a button that resets the scene by putting the background color to black and makes the cube bounce back to its original scale. First add the button to the application data object:

    +

    To implement effects:

    +
      +
    1. +

      Create a button that resets the scene by putting the background color to black and makes the cube bounce back to its original scale. Add the button to the application data object.

      typedef struct appdata 
       {
          Evas_Object *button;
       }
       
      - -

      Then add the button to the GUI:

      +
    2. +
    3. +

      Add the button to the GUI:

      elm_object_text_set(ad->button, "Reset");
       elm_box_pack_start(ad->reset_vbox, ad->button);
       evas_object_smart_callback_add(ad->button, "clicked", btn_reset_cb, ad);
       elm_box_pack_end(ad->inner_box, ad->button);
       evas_object_show(ad->button);
       
      - -

      Declare a callback that resets the variables that have influence on the drawing of the cube. In addition, animate the sliders when they get back to their original position using Ecore_Animator.

      +
    4. +
    5. +

      Declare a callback that resets the variables that have influence on the drawing of the cube. In addition, animate the sliders when they get back to their original position using the Ecore_Animator.

       typedef struct appdata 
       {
      @@ -817,6 +896,8 @@ btn_reset_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
          ecore_animator_timeline_add(1, animate_reset_cb, ad);
       }
       
      +
    6. +

    Viewing the Entire Cube Source

    @@ -849,25 +930,25 @@ typedef struct appdata    Evas_Object *cs;    Evas_Object *button; -   unsigned int program; -   unsigned int vtx_shader; -   unsigned int fgmt_shader; -   unsigned int vertexID; -   unsigned int colorID; -   unsigned int    mvpLoc; -   unsigned int    positionLoc; -   unsigned int    colorLoc; -   float model[16], mvp[16]; -   float view[16]; -   float xangle; -   float yangle; -   float zangle; -   Eina_Bool mouse_down : 1; -   Eina_Bool initialized : 1; - -   float slx_value; -   float sly_value; -   float slz_value; +   unsigned int program; +   unsigned int vtx_shader; +   unsigned int fgmt_shader; +   unsigned int vertexID; +   unsigned int colorID; +   unsigned int mvpLoc; +   unsigned int positionLoc; +   unsigned int colorLoc; +   float model[16], mvp[16]; +   float view[16]; +   float xangle; +   float yangle; +   float zangle; +   Eina_Bool mouse_down : 1; +   Eina_Bool initialized : 1; + +   float slx_value; +   float sly_value; +   float slz_value; } appdata_s; @@ -1136,7 +1217,8 @@ initShaders(void* data)    ad->colorLoc   = glGetAttribLocation(ad->program, "a_color"); } -static void init_gl(Evas_Object *obj) +static void +init_gl(Evas_Object *obj) {    int w, h;    appdata_s *ad = evas_object_data_get(obj, "ad"); @@ -1159,7 +1241,8 @@ static void init_gl(Evas_Object *obj)    } } -void resize_gl(Evas_Object *obj) +void +resize_gl(Evas_Object *obj) {    int w, h;    float aspect; @@ -1180,7 +1263,8 @@ void resize_gl(Evas_Object *obj)    } } -static void draw_gl(Evas_Object *obj) +static void +draw_gl(Evas_Object *obj) {    int w, h;    int r, g, b, a; @@ -1221,7 +1305,8 @@ static void draw_gl(Evas_Object *obj)    glFlush(); } -static void del_gl(Evas_Object *obj) +static void +del_gl(Evas_Object *obj) {    appdata_s *ad = evas_object_data_get(obj, "ad"); @@ -1232,25 +1317,30 @@ static void del_gl(Evas_Object *obj)    evas_object_data_del((Evas_Object*) obj, "ad"); } -static Eina_Bool animate_cb(void *data) +static Eina_Bool +animate_cb(void *data) {    elm_glview_changed_set(data); +    return EINA_TRUE; } -static void del_animate_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) +static void +del_animate_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) {    Ecore_Animator *ani = evas_object_data_get(obj, "ani");    ecore_animator_del(ani); } -static void mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void +mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) {    appdata_s *ad = data;    ad->mouse_down = EINA_TRUE; } -static void mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void +mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) {    Evas_Event_Mouse_Move *ev;    ev = (Evas_Event_Mouse_Move *) event_info; @@ -1266,13 +1356,15 @@ static void mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_inf    } } -static void mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void +mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) {    appdata_s *ad = data;    ad->mouse_down = EINA_FALSE; } -static Eina_Bool animate_reset_cb(void *data, double pos) +static Eina_Bool +animate_reset_cb(void *data, double pos) {    appdata_s *ad = data;    double frame = pos; @@ -1290,7 +1382,8 @@ static Eina_Bool animate_reset_cb(void *data, double pos)    return EINA_TRUE; } -static void btn_reset_cb(void *data, Evas_Object *obj, void *event_info) +static void +btn_reset_cb(void *data, Evas_Object *obj, void *event_info) {    appdata_s *ad = data;    ad->slx_value = elm_slider_value_get(ad->slx); @@ -1299,7 +1392,8 @@ static void btn_reset_cb(void *data, Evas_Object *obj, void *event_info)    ecore_animator_timeline_add(1, animate_reset_cb, ad); } -static void win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void +win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) {    Evas_Coord w, h;    appdata_s *ad = data; @@ -1316,10 +1410,11 @@ static void win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_inf    } } -static void win_back_cb(void *data, Evas_Object *obj, void *event_info) +static void +win_back_cb(void *data, Evas_Object *obj, void *event_info) {    appdata_s *ad = data; -   // Let window go to hidden state +   // Let the window go to the hidden state    elm_win_lower(ad->win); } @@ -1329,7 +1424,8 @@ win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)    ui_app_exit(); } -static void create_base_gui(appdata_s *ad) +static void +create_base_gui(appdata_s *ad) {    // Window    elm_config_accel_preference_set("opengl"); @@ -1365,7 +1461,8 @@ static void create_base_gui(appdata_s *ad)    evas_object_show(ad->win); } -static void create_gl_canvas(appdata_s *ad) +static void +create_gl_canvas(appdata_s *ad) {    Ecore_Animator *ani; @@ -1379,15 +1476,15 @@ static void create_gl_canvas(appdata_s *ad)    elm_glview_mode_set(ad->glview, ELM_GLVIEW_DEPTH);    // The resize policy tells GLView what to do with the surface when it -   // resizes. ELM_GLVIEW_RESIZE_POLICY_RECREATE will tell it to +   // resizes. ELM_GLVIEW_RESIZE_POLICY_RECREATE tells it to    // destroy the current surface and recreate it to the new size    elm_glview_resize_policy_set(ad->glview, ELM_GLVIEW_RESIZE_POLICY_RECREATE); -   // The render policy sets how GLView should render GL code. -   // ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the GL callback +   // The render policy sets how GLView must render GL code. +   // ELM_GLVIEW_RENDER_POLICY_ON_DEMAND has the GL callback    // called only when the object is visible. -   // ELM_GLVIEW_RENDER_POLICY_ALWAYS would cause the callback to be -   // called even if the object were hidden. +   // ELM_GLVIEW_RENDER_POLICY_ALWAYS causes the callback to be +   // called even if the object were hidden    elm_glview_render_policy_set(ad->glview, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);    // The initialize callback function gets registered here @@ -1406,10 +1503,10 @@ static void create_gl_canvas(appdata_s *ad)    elm_box_pack_end(ad->main_box, ad->glview);    evas_object_show(ad->glview); -   // This adds an animator so that the app will regularly -   // trigger updates of the GLView using elm_glview_changed_set() +   // This adds an animator so that the app regularly +   // triggers updates of the GLView using elm_glview_changed_set()    // -   // NOTE: If you delete GL, this animator will keep running trying to access +   // NOTE: If you delete GL, this animator keeps running trying to access    // GL so this animator needs to be deleted with ecore_animator_del()    ani = ecore_animator_add(animate_cb, ad->glview);    evas_object_data_set(ad->glview, "ani", ani); @@ -1427,7 +1524,8 @@ static void create_gl_canvas(appdata_s *ad)    ad->initialized = EINA_FALSE; } -static void create_toolbox(appdata_s *ad) +static void +create_toolbox(appdata_s *ad) {    ad->inner_box = elm_box_add(ad->main_box);    elm_box_horizontal_set(ad->inner_box, EINA_FALSE); @@ -1442,7 +1540,7 @@ static void create_toolbox(appdata_s *ad)    elm_box_pack_end(ad->inner_box, ad->cs);    evas_object_show(ad->cs); -   // Slider for X-axis scale +   // Slider for X axis scale    ad->slx = elm_slider_add(ad->inner_box);    evas_object_size_hint_align_set(ad->slx, EVAS_HINT_FILL, 0);    elm_slider_horizontal_set(ad->slx, EINA_TRUE); @@ -1455,7 +1553,7 @@ static void create_toolbox(appdata_s *ad)    elm_box_pack_end(ad->inner_box, ad->slx);    evas_object_show(ad->slx); -   // Slider for Y-axis scale +   // Slider for Y axis scale    ad->sly = elm_slider_add(ad->inner_box);    evas_object_size_hint_align_set(ad->sly, EVAS_HINT_FILL, 0);    elm_slider_horizontal_set(ad->sly, EINA_TRUE); @@ -1468,7 +1566,7 @@ static void create_toolbox(appdata_s *ad)    elm_box_pack_end(ad->inner_box, ad->sly);    evas_object_show(ad->sly); -   // Slider for Z-axis scale +   // Slider for Z axis scale    ad->slz = elm_slider_add(ad->inner_box);    evas_object_size_hint_align_set(ad->slz, EVAS_HINT_FILL, 0);    elm_slider_horizontal_set(ad->slz, EINA_TRUE); @@ -1490,10 +1588,11 @@ static void create_toolbox(appdata_s *ad)    evas_object_show(ad->button); } -static bool app_create(void *data) +static bool +app_create(void *data) {    // Hook to take necessary actions before main event loop starts -   // Initialize UI resources and application's data +   // Initialize UI resources and application's data    // If this function returns true, the main loop of application starts    // If this function returns false, the application is terminated    appdata_s *ad = data; @@ -1505,27 +1604,32 @@ static bool app_create(void *data)    return true; } -static void app_control(app_control_h app_control, void *data) +static void +app_control(app_control_h app_control, void *data) {    // Handle the launch request } -static void app_pause(void *data) +static void +app_pause(void *data) {    // Take necessary actions when application becomes invisible } -static void app_resume(void *data) +static void +app_resume(void *data) {    // Take necessary actions when application becomes visible } -static void app_terminate(void *data) +static void +app_terminate(void *data) {    // Release all resources } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) {    appdata_s ad = { 0, };    int ret = 0; @@ -1542,7 +1646,6 @@ int main(int argc, char *argv[])    {       dlog_print(DLOG_ERROR, PACKAGE, "The application failed to start, and returned %d", ret);    } -    return ret; }
    @@ -1594,7 +1697,8 @@ typedef struct    Target_Buffer *last_buffer; } App_Data; -static bool app_create(void *data) +static bool +app_create(void *data) {    Evas_Object *win, *glview;    App_Data *ad = data; @@ -1698,7 +1802,7 @@ init(Evas_Object *obj) -
  • Create Ecore threads: +
  • Create Ecore threads.

    To easily create threads with EFL, use the ecore_thread() infrastructure, which provides a high level abstraction over system threads, along with callbacks in the main loop to signal that a thread has finished running or has been canceled.

    When the main OpenGL ES context is properly set up, spawn the render thread and start setting up its OpenGL ES context:

    @@ -1719,7 +1823,7 @@ init(Evas_Object *obj)
     

    To establish safe communication channels between threads:

    1. Since most of EFL is not thread-safe, certain operations cannot be executed from another thread and you must use the main loop instead. -

      Establish a communication channel from the render thread to the main loop:

      +

      Establish a communication channel from the render thread to the main loop.

      1. Create an ecore_pipe channel.

        EFL provides a simple tool to send messages to the main thread using pipes. Ecore Pipe is the abstraction layer around pipe objects, and is the easiest way to send a message from any thread back to the main thread.

        @@ -1775,7 +1879,7 @@ pipe_handler(void *data, void *buf, unsigned int len EINA_UNUSED)    } }
    -

    You need not use the free() function to free data since the data belongs to the ecore_pipe.

    +

    You do not need to use the free() function to free data since the data belongs to the ecore_pipe.

  • @@ -1786,7 +1890,7 @@ pipe_handler(void *data, void *buf, unsigned int len EINA_UNUSED)
    1. Create a pipe. -

      The easiest way to send a simple message in EFL in Tizen is to rely on a POSIX pipe file handle:

      +

      The easiest way to send a simple message in EFL in Tizen is to rely on a POSIX pipe file handle.

       // Create a pipe for messaging  
       int fds[2];
      @@ -1796,7 +1900,7 @@ ad.rt_wpipefd = fds[1];
       
    2. -
    3. Send messages to a thread. Write data to the pipe created above, from the main loop: +
    4. Send messages to a thread. Write data to the pipe created above, from the main loop.
       // Main loop to render thread  
       static void
      @@ -1818,8 +1922,8 @@ event_send(App_Data *ad, Event_Type type, ...)
       
    5. -
    6. Receive messages in a thread: -

      In the render thread, use the event handling code:

      +
    7. Receive messages in a thread. +

      In the render thread, use the event handling code.

       while (!ecore_thread_check(ad->th.thread))
       {
      @@ -1836,7 +1940,7 @@ while (!ecore_thread_check(ad->th.thread))
       }
       
    8. -
    9. Use a simple pipe file descriptor to use the poll() or select() function, in order to wait for events for a pre-determined period of time, or to wait for events on more than a single file descriptor. In this example, the main loop is responsible for the render thread life-cycle: +
    10. Use a simple pipe file descriptor to use the poll() or select() function to wait for events for a pre-determined period of time, or to wait for events on more than a single file descriptor. In this example, the main loop is responsible for the render thread life-cycle.
       thread_run(void *data, Ecore_Thread *th EINA_UNUSED)
       {
      @@ -1875,7 +1979,7 @@ evas_object_event_callback_add(glview, EVAS_CALLBACK_MOUSE_UP, mouse_up_cb, &
       
    11. -

      Add a handle to the callbacks:

      +

      Add a handle to the callbacks.

      The mouse down callback sends a mouse down event to render thread.

       static void
      @@ -1892,7 +1996,7 @@ mouse_down_cb(void *data, Evas *e EINA_UNUSED,
       
    12. -

      The mouse up callback sends a mouse up event to render thread.

      +

      The mouse up callback sends a mouse up event to render thread:

       static void
       mouse_up_cb(void *data, Evas *e EINA_UNUSED,
      @@ -2016,7 +2120,6 @@ target_create(App_Data *ad EINA_UNUSED)
       
             return NULL;
          }
      -
          return target;
       }
       
      @@ -2054,7 +2157,7 @@ thread_run(void *data, Ecore_Thread *th EINA_UNUSED)
    13. -

      To render in a thread, use the thread_draw() function. The following example draws with a color:

      +

      To render in a thread, use the thread_draw() function. The following example draws with a color.

       static void
       thread_draw(App_Data *ad, Evas_GL_API *gl)
      @@ -2066,14 +2169,14 @@ thread_draw(App_Data *ad, Evas_GL_API *gl)
       
    14. -
    15. Render the FBO to the screen. The following example uses the ecore_pipe: +
    16. Render the FBO to the screen. The following example uses the ecore_pipe.
       // Signal the main thread that a new frame is now available  
       message_send(ad, MSG_NEWFRAME, target);
       
    17. -

      The pipe handler receives this message in pipe_handler. The following example adds the target buffer to a queue:

      +

      The pipe handler receives this message in pipe_handler. The following example adds the target buffer to a queue.

       case MSG_NEWFRAME:
          // Queue a new frame description  
      @@ -2184,7 +2287,7 @@ if (evasglCreateImageForContext)
       {
          // Create an image
          evasglCreateImageForContext(evgl, ctx, EVAS_GL_TEXTURE_2D,
      -                               (void*)(intptr_t)texid, NULL);
      +                              (void*)(intptr_t)texid, NULL);
       }
       

      Tizen also provides specific buffers created with TBM that can be passed to this function. Unfortunately the image extension is more device-dependent, and may not even work in the Tizen emulator.

      @@ -2235,15 +2338,14 @@ if (gl->glGetProgramBinaryOES)

      Image and sync support are the most commonly used EvasGL extensions. Both can be used for multi-thread rendering, but EvasGL images can also be used to share images between contexts.

      -

      EvasGLImage

      - -

      There are 2 versions of the evasglCreateImage function, out of which extra Evas_GL_Context is taken as an argument. It is recommended to call evasglCreateImageForContext if you are dealing with multiple contexts, otherwise calling the evasglCreateImage function is sufficient.

      +
        +
      • To use the image extension: -

        The code below is just an example.

        +

        There are 2 versions of the evasglCreateImage() function, out of which extra Evas_GL_Context is taken as a parameter. It is recommended to call the evasglCreateImageForContext() function if you are dealing with multiple contexts, otherwise calling the evasglCreateImage() function is sufficient.

        1. Check for support. -

          Before using this extension, check whether it is supported:

          +

          Before using this extension, check whether it is supported.

           if (gl->evasglCreateImageForContext && gl->evasglDestroyImage)
          @@ -2253,7 +2355,7 @@ if (gl->evasglCreateImageForContext && gl->evasglDestroyImage)
           
        2. Create an image. -

          Create a render buffer and bind it to an EvasGL image:

          +

          Create a render buffer and bind it to an EvasGL image.

           const int width = 64, height = 64;
          @@ -2275,13 +2377,13 @@ gl->glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
           evgl = elm_glview_evas_gl_get(glview);
           ctx = evas_gl_current_context_get(evgl);
           image = gl->evasglCreateImageForContext(evgl, ctx, EVAS_GL_TEXTURE_2D,
          -                                        (void *)(intptr_t) color_rb, NULL);
          +                                       (void *)(intptr_t) color_rb, NULL);
           

          The EvasGL image is now created and available for use from another context.

        3. Use an image. -

          To draw something in the texture and render that texture to the screen. To skip the draw function:

          +

          To draw something in the texture and render that texture to the screen. The following example shows how to skip the draw function.

           gl->glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo);
          @@ -2296,7 +2398,7 @@ gl->glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
           gl->glGenTextures(1, &tex);
           gl->glBindTexture(GL_TEXTURE_2D, tex);
           gl->glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
          -And do the actual draw operation (draw the contents of the texture on screen):
          +// Draw the contents of the texture on the screen
           static const GLint verts[12] = { -5, -6, -10,  5, -6, -10,  -5, 4, 10,  5, 4, 10 };
           static const GLint tex_coords[8] = { 0, 0,  1, 0,  0, 1,  1, 1 };
           
          @@ -2323,37 +2425,41 @@ gl->glDisable(GL_TEXTURE_2D);
           	

          The image content can be shared between different contexts.

        4. Destroy an image. -

          After releasing all the associated resources, such as FBO and textures, release the image object itself:

          +

          After releasing all the associated resources, such as FBO and textures, release the image object itself.

           gl->evasglDestroyImage(image);
        - -

        Sync

        +
      • +
      • To use the sync extension:

        Another commonly used extension is the fence sync extension along with the reusable sync and wait sync. This allows creating a semaphore-style object that is released as soon as all the previous render operations have been completed.

        -

        This guide does not explain the details of these extensions, as they should behave in a similar way to their EGL implementations.

        +

        This guide does not explain the details of these extensions, as they must behave in a similar way to their EGL implementations.

        As usual with extensions, check the support:

         if (gl->evasglCreateSync)
        -  // fence_sync must be supported
        +   // fence_sync must be supported
         
        +
      • +

      Using Direct Rendering

      To enhance rendering performance, the Direct Rendering option is supported.

      +
        +
      • +

        To use direct rendering in GLView:

        -

        GLView

        - +

        In GLView, the ELM_GLVIEW_DIRECT option is one of GLView mode's enums and the option can be enabled using the elm_glview_mode_set() function.

         // Tizen 2.3
         // elm_config_accel_preference_set("opengl");
         
        -// since Tizen 2.3.1
        +// Since Tizen 2.3.1
         elm_config_accel_preference_set("opengl:depth24:stencil8:msaa_high");
         Evas_Object *win = elm_win_util_standard_add("sample", "sample");
         
        @@ -2361,17 +2467,17 @@ Evas_Object *glview = elm_glview_add(win);
         elm_glview_mode_set(glview, ELM_GLVIEW_DEPTH_24 | ELM_GLVIEW_STENCIL_8 | ELM_GLVIEW_MULTISAMPLE_HIGH);
         
        -

        In GLView, the ELM_GLVIEW_DIRECT option is one of GLView mode's enums and the option can be enabled using the elm_glview_mode_set() function.

        -

        To use the Direct Rendering mode since Tizen 2.3.1, set the same option values (depth, stencil, and MSAA) to a rendering engine and a GLView object. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function and to a GLView object using the elm_glview_mode_set() function. If the GLView object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled.

        +
      • +
      • +

        To use direct rendering in EvasGL:

        -

        EvasGL

        - +

        In EvasGL, the EVAS_GL_OPTIONS_DIRECT is one of EvasGL's config options and the option can be enabled by setting the Evas_GL_Config option.

         // Tizen 2.3
         // elm_config_accel_preference_set("opengl");
         
        -// since Tizen 2.3.1
        +// Since Tizen 2.3.1
         elm_config_accel_preference_set("opengl:depth24:stencil8:msaa_high");
         Evas_Object *win = elm_win_util_standard_add("sample", "sample");
         
        @@ -2385,7 +2491,7 @@ cfg->options_bits = EVAS_GL_OPTIONS_DIRECT;
         cfg->multisample_bits = EVAS_GL_MULTISAMPLE_HIGH;
         
        -

        In EvasGL, the EVAS_GL_OPTIONS_DIRECT is one of EvasGL's config options and the option can be enabled by setting the Evas_GL_Config option. To use the Direct Rendering mode since Tizen 2.3.1, set the same option values (depth, stencil, and MSAA) to a rendering engine and an Evas_GL_Config object. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function. If the Evas_GL_Config object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled.

        +

        To use the Direct Rendering mode since Tizen 2.3.1, set the same option values (depth, stencil, and MSAA) to a rendering engine and an Evas_GL_Config object. You can set the option values to a rendering engine using the elm_config_accel_preference_set() function. If the Evas_GL_Config object option values are bigger or higher than the rendering engine's, the Direct Rendering mode is disabled.

        @@ -2393,17 +2499,17 @@ cfg->multisample_bits = EVAS_GL_MULTISAMPLE_HIGH; - +
        Note
        If direct rendering is enabled, EvasGL will render directly to the back buffer of the window. Otherwise, EvasGL will render to the off screen buffer, then composited to the back buffer of the window. + If direct rendering is enabled, EvasGL rendersdirectly to the back buffer of the window. Otherwise, EvasGL renders to the off screen buffer, then composited to the back buffer of the window. -

        Although direct rendering is enabled, EvasGL will not always render directly to the back buffer. Here are some conditions that will disable direct rendering and force a fallback to indirect rendering in a frame buffer.

        +

        Although direct rendering is enabled, EvasGL not always renders directly to the back buffer. The following conditions disable direct rendering and force a fallback to indirect rendering in a frame buffer:

        -
          +
          • If the object's color is not 255,255,255,255.
          • If the object has an Evas map.
          • If the object size is different from the viewport, (RESIZE_POLICY_SCALE).
          • If the window is rotated and CLIENT_SIDE_ROTATION is not set.
          • If the GLView policy is set to ALWAYS render or the EvasGL does not use pixel getter callback.
          • -
        @@ -2417,40 +2523,40 @@ cfg->multisample_bits = EVAS_GL_MULTISAMPLE_HIGH; In the render callback function, call only GL functions.

        In case the GL functions are called outside the render callback function, you must call the evas_gl_make_current() function before the GL function calls. However, this results in a performance degradation due to context switching, and only works if the target surface is not an Evas_GL_Surface with Direct Rendering enabled.

        -

        If the target buffer is an Evas_GL_Surface with Direct Rendering enabled, all GL functions must be called from the render callback function only. All other operations can break the rendering order and the unexpected rendering will occur.

        +

        If the target buffer is an Evas_GL_Surface with Direct Rendering enabled, all GL functions must be called from the render callback function only. All other operations can break the rendering order and the unexpected rendering occurs.

        +
      • +

      Using Client-side Rotation

      - -

      The Client Side Rotation is a special value that indicates to EFL that the application will handle the view rotation when the device is rotated. This is needed only when the application requests Direct Rendering.

      +

      The Client Side Rotation is a special value that indicates to EFL that the application handles the view rotation when the device is rotated. This is needed only when the application requests Direct Rendering.

      If the window is rotated and the Direct Rendering flag is set, Client Side Rotation can be used to avoid falling back to a frame buffer.

      -

      GLView

      +
        +
      • To use GLView rotation: +

        In GLView, the ELM_GLVIEW_CLIENT_SIDE_ROTATION option is one of GLView mode's enums and the option can be enabled by using the elm_glview_mode_set() function. This option is needed only when Direct Rendering is enabled.

         Evas_Object *gl;
         gl = elm_glview_add(win);
          
         elm_glview_mode_set(gl, ELM_GLVIEW_DEPTH | ELM_GLVIEW_DIRECT | ELM_GLVIEW_CLIENT_SIDE_ROTATION);
        +
      • -

        In GLView, the ELM_GLVIEW_CLIENT_SIDE_ROTATION option is one of GLView mode's enums and the option can be enabled by using the elm_glview_mode_set() function. This option is needed only when Direct Rendering is enabled.

        - -

        EvasGL

        +
      • To use EvasGL rotation: +

        In EvasGL, the EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION is one of EvasGL's config options and this option can be enabled by setting the Evas_GL_Config option.

         Evas_GL_Config *cfg;
         cfg = evas_gl_config_new();
          
         cfg->options_bits = EVAS_GL_OPTIONS_DIRECT | EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION;
        -

        In EvasGL, the EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION is one of EvasGL's config options and this option can be enabled by setting the Evas_GL_Config option.

        -

        Get the current rotation value:

        -
         static void _draw_gl(Evas_Object *obj) 
         {
        @@ -2464,7 +2570,9 @@ static void _draw_gl(Evas_Object *obj)
            } 
         }
        -

        To get the current rotation of the view, in degrees, call the evas_gl_rotation_get() in order to properly handle the current rotation of the view. It will always return 0 unless the option EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION has been set. Indeed, in case of Direct Rendering to the back buffer, the client application is responsible for properly rotating its view. This can generally be done by applying a rotation to a view matrix.

        +

        To get the current rotation of the view, in degrees, call the evas_gl_rotation_get() function to properly handle the current rotation of the view. It always returns 0 unless the option EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION has been set. Indeed, in case of Direct Rendering to the back buffer, the client application is responsible for properly rotating its view. This can generally be done by applying a rotation to a view matrix.

        +
      • +
      diff --git a/org.tizen.tutorials/html/native/graphics/tbm_tutorial_n.htm b/org.tizen.tutorials/html/native/graphics/tbm_tutorial_n.htm index d982d88..e30173c 100644 --- a/org.tizen.tutorials/html/native/graphics/tbm_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/graphics/tbm_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      @@ -72,7 +72,7 @@ if (tbm_surface_query_formats (&formats, &format_num) != TBM_SURFACE_ERR
    18. -

      Create the TBM surface (tbm_surface), defining its format, height, and width:

      +

      Create the TBM surface (tbm_surface) and define its format, height, and width:

       int i;
       tbm_surface_h surface = NULL;
      @@ -107,7 +107,7 @@ if (tbm_surface_map (surface, TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, &s
       
    19. -

      Store data at the tbm_surface by using pointer of each plane:

      +

      Store data at the tbm_surface by using a pointer of each plane:

       for (i = 0; i<surface_info.num_planes; i++)
       {
      @@ -116,7 +116,7 @@ for (i = 0; i<surface_info.num_planes; i++)
       
    20. -
    21. Unmap and destroy tbm_surface. +
    22. Unmap and destroy tbm_surface:
       if (tbm_surface_unmap (surface) != TBM_SURFACE_ERROR_NONE)
       {
      diff --git a/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm b/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm
      index fe04c46..31c4592 100644
      --- a/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm
      +++ b/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm
      @@ -16,7 +16,7 @@
       
       
      -

      Mobile native

      +

      Mobile native

      Content

      @@ -40,16 +40,7 @@

      This tutorial demonstrates how you can implement the geofence-related information and services.

      - - - - - - - - - -
      Note
      This feature is supported in mobile applications only.
      +

      This feature is supported in mobile applications only.

      Warm-up

      Become familiar with Geofence API basics by learning about:

      @@ -136,7 +127,7 @@ geofence_manager_stop(manager); geofence_manager_destroy(manager); manager = NULL;
      -

      If you destroy the handle, there is no need to call geofence_manager_stop() function to stop the service as the service is automatically stopped. Also, you do not have to unset the previously set callbacks.

    +

    If you destroy the handle, there is no need to call the geofence_manager_stop() function to stop the service as the service is automatically stopped. Also, you do not have to unset the previously set callbacks.

    Getting the Geofence Event State

    @@ -152,8 +143,9 @@ geofence_manager_set_geofence_event_cb(manager, geofence_event, NULL);
     geofence_manage_e user_action;
     geofence_error_e user_error;
    -void geofence_event(int place_id, int geofence_id, geofence_manager_error_e error, 
    -                    geofence_manage_e manage, void *user_data)
    +void 
    +geofence_event(int place_id, int geofence_id, geofence_manager_error_e error, 
    +               geofence_manage_e manage, void *user_data)
     {
        user_action = manage;
        user_error = error;
    @@ -187,7 +179,8 @@ geofence_manager_set_geofence_state_changed_cb(manager, geofence_state_changed,
     
  • When the alert is received, you can use the callback to, for example, update the variables that store the current state:

     geofence_state_e received_state;
    -void geofence_state_changed(int geofence_id, geofence_state_e state, void *user_data)
    +void 
    +geofence_state_changed(int geofence_id, geofence_state_e state, void *user_data)
     {
        received_state = state;
     }
    diff --git a/org.tizen.tutorials/html/native/location/location_tutorial_n.htm b/org.tizen.tutorials/html/native/location/location_tutorial_n.htm
    index 3006795..42305e1 100644
    --- a/org.tizen.tutorials/html/native/location/location_tutorial_n.htm
    +++ b/org.tizen.tutorials/html/native/location/location_tutorial_n.htm
    @@ -16,7 +16,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -75,7 +75,7 @@
     #include <locations.h>
     
  • -
  • Create a location manager handle using the location_manager_create() function before you use it. For this example, the GPS is used as the source of the position data, so the first argument is LOCATIONS_METHOD_GPS. You can use other values of the location_method_e enumeration (in mobile and wearable applications), such as LOCATIONS_METHOD_HYBRID or LOCATIONS_METHOD_CPS, but they are less accurate.

    +
  • Create a location manager handle using the location_manager_create() function before you use it. For this example, the GPS is used as the source of the position data, so the first parameter is LOCATIONS_METHOD_GPS. You can use other values of the location_method_e enumeration (in mobile and wearable applications), such as LOCATIONS_METHOD_HYBRID or LOCATIONS_METHOD_CPS, but they are less accurate.

     location_manager_h manager;
     location_manager_create(LOCATIONS_METHOD_GPS, &manager);
    @@ -112,7 +112,8 @@ ret = location_manager_start(manager);

    The __state_changed_cb function is a callback, which is called when the status of the location service state changes.

     static location_service_state_e service_state;
    -static void __state_changed_cb(location_service_state_e state, void *user_data)
    +static void 
    +__state_changed_cb(location_service_state_e state, void *user_data)
     {
        service_state = state;
     }
    @@ -133,7 +134,8 @@ ret = location_manager_get_last_location(manager, &altitude, &latitude,
     
     
  • When getting the current location information, call the location_manager_get_location() function after the service is enabled:
    -static void __state_changed_cb(location_service_state_e state, void *user_data)
    +static void 
    +__state_changed_cb(location_service_state_e state, void *user_data)
     {
        double altitude, latitude, longitude, climb, direction, speed;
        double horizontal, vertical;
    @@ -150,7 +152,7 @@ static void __state_changed_cb(location_service_state_e state, void *user_data)
     
  • -
  • When you no longer need the Location Manager, destroy it. You must also unset all connected callback functions and stop the Location Manager: +
  • When you no longer need the Location Manager, destroy it, unset all connected callback functions, and stop the Location Manager:
     location_manager_unset_service_state_changed_cb(manager);
     location_manager_stop(manager);
    @@ -165,8 +167,9 @@ location_manager_destroy(manager);
  • When the update is received, you can, for example, update the variables that store the current position:

     static double user_latitude, user_longitude;
    -static void position_updated(double latitude, double longitude, double altitude, 
    -                             time_t timestamp, void *user_data)
    +static void 
    +position_updated(double latitude, double longitude, double altitude, 
    +                 time_t timestamp, void *user_data)
     {
        user_latitude = latitude;
        user_longitude = longitude;
    @@ -205,13 +208,14 @@ ret = location_bounds_create_polygon(coord_list, poly_size, &bounds_poly);
     

    When a circular bound is needed, use the location_bounds_create_circle() function.

  • -
  • Get the coordinates of the generated polygon bounds. Register a callback function to notify you of the polygon coordinates: +
  • Get the coordinates of the generated polygon bounds. Register a callback function to notify you of the polygon coordinates.
     ret = location_bounds_foreach_polygon_coords(bounds_poly, capi_poly_coords_cb, NULL);

    Implement the callback function (the second parameter in the function above) separately:

     static double latitude, longitude;
    -static bool capi_poly_coords_cb(location_coords_s coords, void *user_data)
    +static bool 
    +capi_poly_coords_cb(location_coords_s coords, void *user_data)
     {
        latitude = coords.latitude;
        longitude = coords.longitude;
    @@ -225,7 +229,8 @@ static bool capi_poly_coords_cb(location_coords_s coords, void *user_data)
     

    Implement the bounds_state_changed_cb callback separately:

     static location_boundary_state_e bound_state;
    -static void bounds_state_changed_cb(location_boundary_state_e state, void *user_data)
    +static void 
    +bounds_state_changed_cb(location_boundary_state_e state, void *user_data)
     {
        bound_state = state;
     }
    @@ -248,7 +253,7 @@ location_bounds_destroy(bounds_poly);
  • gps_status_set_satellite_updated_cb(manager, capi_gps_status_satellite_updated_cb, 10, NULL);

    The third parameter determines the frequency of callback calls. In this example, the callback is called every 10 seconds.

  • -
  • When the update is received, the callback having brief satellite information is called. To get the detailed satellite information in the sky, call the gps_status_foreach_satellites_in_view() function in the callback. Variables that store the current satellite information are updated: +
  • When the update is received, the callback having brief satellite information is called. To get the detailed satellite information in the sky, call the gps_status_foreach_satellites_in_view() function in the callback. Variables that store the current satellite information are updated.
     int cur_azimuth, cur_elevation, cur_prn, cur_snr;
    @@ -372,7 +377,7 @@ location_manager_get_location(manager, &altitude, &latitude, &longit
     
     
  • Get the distance.

    To get a distance (in meters) between 2 points, use the location_manager_get_distance() function. The obtained value is a great-circle distance; the shortest distance between 2 points on the sphere.

    -

    Provide the latitude and longitude of the starting point, the latitude and longitude of the end point, and the variable to store the obtained distance:

    +

    Provide the latitude and longitude of the starting point, the latitude and longitude of the end point, and the variable to store the obtained distance.

     double distance;
    diff --git a/org.tizen.tutorials/html/native/location/location_tutorials_n.htm b/org.tizen.tutorials/html/native/location/location_tutorials_n.htm
    index 9eb76f3..f5b59d7 100644
    --- a/org.tizen.tutorials/html/native/location/location_tutorials_n.htm
    +++ b/org.tizen.tutorials/html/native/location/location_tutorials_n.htm
    @@ -16,7 +16,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Related Info

    @@ -35,14 +35,13 @@

    The following tutorials apply in mobile applications only:

    diff --git a/org.tizen.tutorials/html/native/location/maps_tutorial_n.htm b/org.tizen.tutorials/html/native/location/maps_tutorial_n.htm index 6f4a890..022b4ed 100644 --- a/org.tizen.tutorials/html/native/location/maps_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/location/maps_tutorial_n.htm @@ -19,7 +19,7 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    @@ -52,18 +53,6 @@

    This tutorial demonstrates how you can use the map service to query geocodes and routes, and search for places.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    - -

    Warm-up

    Become familiar with the Maps Service API basics by learning about:

      @@ -105,22 +94,24 @@

      To start using the map service:

        -
      1. To use the functions and data types of the Maps Service API, include the <maps_service.h> header file in your application:

        +
      2. To use the functions and data types of the Maps Service API (in mobile and wearable applications), include the <maps_service.h> header file in your application:

         #include <maps_service.h>
         
      3. -
      4. The Maps Service instance relies on a particular map provider. To get a list of available map providers, use the maps_service_foreach_provider() function: +
      5. The Maps Service instance relies on a particular map provider. To get a list of available map providers, use the maps_service_foreach_provider() function.
        -static bool _maps_service_provider_info_cb(char* maps_provider, void* user_data)
        +static bool 
        +_maps_service_provider_info_cb(char* maps_provider, void* user_data)
         {
            // Handle the map provider name, passed as maps_provider
         
            return bool;
         }
         
        -void get_available_providers()
        +void 
        +get_available_providers()
         {
            void *user_data = NULL;
            const int error = maps_service_foreach_provider(_maps_service_provider_info_cb, user_data);
        @@ -162,7 +153,7 @@ const bool is_routing_supported = (error == MAPS_ERROR_NONE) ? supported : false
         error = maps_service_provider_is_service_supported(maps, MAPS_SERVICE_SEARCH_ROUTE_WAYPOINTS, &supported);
         const bool is_routing_waypoints_supported = (error == MAPS_ERROR_NONE) ? supported : false;
         
        -

        To check for the availability of other services, follow the same approach using the keys from the maps_service_e enumerator.

        +

        To check for the availability of other services, follow the same approach using the keys from the maps_service_e enumerator (in mobile and wearable applications).

      6. Optionally, check which data features are available for the desired services using the maps_service_provider_is_data_supported() function: @@ -191,7 +182,7 @@ if (is_route_segment_maneuvers_supported)    // Use segment maneuvers }
    -

    To check the availability of other data features, follow the same approach using the keys from the maps_service_data_e enumerator.

    +

    To check the availability of other data features, follow the same approach using the keys from the maps_service_data_e enumerator (in mobile and wearable applications).

  • Set general preferences, such as language and distance units, using the maps_service_set_preference() function:

    @@ -305,8 +296,9 @@ if (error != MAPS_ERROR_NONE)
  • Implement the __maps_service_geocode_cb() callback to receive the service response:
    -static bool __maps_service_geocode_cb(maps_error_e result, int request_id, int index, int total, 
    -                                      maps_coordinates_h coordinates, void* user_data)
    +static bool 
    +__maps_service_geocode_cb(maps_error_e result, int request_id, int index, int total, 
    +                          maps_coordinates_h coordinates, void* user_data)
     {
        // Handle the obtained coordinate data
     
    @@ -337,8 +329,9 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_service_reverse_geocode_cb() callback to receive the service response:
    -static void __maps_service_reverse_geocode_cb(maps_error_e result, int request_id, int index, int total, 
    -                                              maps_address_h address, void* user_data)
    +static void 
    +__maps_service_reverse_geocode_cb(maps_error_e result, int request_id, int index, int total, 
    +                                  maps_address_h address, void* user_data)
     {
        // Handle the obtained address
     
    @@ -407,8 +400,9 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_service_search_place_cb() callback to receive the service response:
    -static bool __maps_service_search_place_cb(maps_error_e error, int request_id, int index, int total, 
    -                                           maps_place_h place, void* user_data)
    +static bool 
    +__maps_service_search_place_cb(maps_error_e error, int request_id, int index, int total, 
    +                               maps_place_h place, void* user_data)
     {
        // Handle the obtained place data
     
    @@ -468,8 +462,9 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_service_search_route_cb() callback to receive the service response:
    -static bool __maps_service_search_route_cb(maps_error_e error, int request_id, int index, int total, 
    -                                           maps_route_h route, void* user_data)
    +static bool 
    +__maps_service_search_route_cb(maps_error_e error, int request_id, int index, int total, 
    +                               maps_route_h route, void* user_data)
     {
        // Handle the obtained route data
     
    @@ -637,7 +632,8 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_place_categories_cb() callback:
    -static bool __maps_place_categories_cb(int index, int total, maps_place_category_h category, void* user_data)
    +static bool 
    +__maps_place_categories_cb(int index, int total, maps_place_category_h category, void* user_data)
     {
        // Handle the obtained place category data
     
    @@ -673,7 +669,8 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_place_properties_cb() callback:
    -static bool __maps_place_properties_cb(int index, int total, char* key, void* value, void* user_data)
    +static bool 
    +__maps_place_properties_cb(int index, int total, char* key, void* value, void* user_data)
     {
        // Handle the obtained property:
        // property_name: key
    @@ -788,7 +785,8 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_route_path_cb() callback:
    -static bool __maps_route_path_cb(int index, int total, maps_coordinates_h coordinates, void* user_data)
    +static bool 
    +__maps_route_path_cb(int index, int total, maps_coordinates_h coordinates, void* user_data)
     {
        // Handle the obtained route path coordinates
     
    @@ -812,8 +810,8 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_route_segment_cb() callback:

    -static bool __maps_route_segment_cb(int index, int total,
    -maps_route_segment_h segment, void* user_data)
    +static bool 
    +__maps_route_segment_cb(int index, int total, maps_route_segment_h segment, void* user_data)
     {
        // Handle the obtained route segment
     
    @@ -842,7 +840,8 @@ if (error != MAPS_ERROR_NONE)
     
     
  • Implement the __maps_route_properties_cb() callback:
    -static bool __maps_route_properties_cb(int index, int total, char* key, void* value, void* user_data)
    +static bool 
    +__maps_route_properties_cb(int index, int total, char* key, void* value, void* user_data)
     {
        // Handle the obtained property:
        // property_name: key
    diff --git a/org.tizen.tutorials/html/native/messaging/email_tutorial_n.htm b/org.tizen.tutorials/html/native/messaging/email_tutorial_n.htm
    index 80a561f..e4ca1b9 100644
    --- a/org.tizen.tutorials/html/native/messaging/email_tutorial_n.htm
    +++ b/org.tizen.tutorials/html/native/messaging/email_tutorial_n.htm
    @@ -18,7 +18,7 @@
     
     
    -

    Mobile native

    +

    Mobile native

    Content

    @@ -40,16 +40,7 @@

    This tutorial demonstrates how you can send email messages with attachments.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    +

    This feature is supported in mobile applications only.

    Warm-up

    Become familiar with the Email API basics by learning about:

    @@ -78,7 +69,7 @@

    To create and send email messages:

    1. Create an email message. -

      To create an email message and receive its handle, use the email_create_message() function. The function return code informs about success or failure:

      +

      To create an email message and receive its handle, use the email_create_message() function. The function return code informs about success or failure.

      email_h msg;
       int error_code = EMAILS_ERROR_NONE;
       error_code = email_create_message(&msg);
      @@ -89,7 +80,7 @@ if (error_code != EMAILS_ERROR_NONE)
       

      One of the possible error codes that is not related to the Email module itself is EMAIL_ERROR_ACCOUNT_NOT_FOUND. This error occurs if no email account has been configured on a device.

    2. Add recipients and attachments. -

      Email recipients can be added to the email message one by one. There is no possibility to add lists of recipients in one function call. Each address has to be given as a character string and the address type (TO, CC, BCC) has to be declared:

      +

      Email recipients can be added to the email message one by one. There is no possibility to add lists of recipients in one function call. Each address has to be given as a character string and the address type (TO, CC, BCC) has to be declared.

      error_code = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO, "example@mail.com");
       if (error_code != EMAILS_ERROR_NONE) 
       {
      @@ -103,7 +94,7 @@ if (error_code != EMAILS_ERROR_NONE)
       }
    3. Remove recipients or attachments. -

      You can remove added recipients and attachments. In both cases, all recipients or attachments are removed at once. It is not possible to remove one selected item. As all functions from the Email API, the email_remove_all_attachments() and email_remove_all_recipients() functions inform about success or failure by the returned error code:

      +

      You can remove added recipients and attachments. In both cases, all recipients or attachments are removed at once. It is not possible to remove one selected item. As all functions from the Email API, the email_remove_all_attachments() and email_remove_all_recipients() functions inform about success or failure by the returned error code.

      error_code = email_remove_all_recipients(msg);
       if (error_code != EMAILS_ERROR_NONE) 
       {
      @@ -115,7 +106,7 @@ if (error_code != EMAILS_ERROR_NONE)
          dlog_print(DLOG_INFO, LOG_TAG, "Failed to remove attachments\n");
       }
    4. -
    5. Save the email before sending it. +
    6. Save the email before sending it:
      error_code = email_save_message(msg);
       if (error_code != EMAILS_ERROR_NONE) 
       {
      @@ -124,8 +115,9 @@ if (error_code != EMAILS_ERROR_NONE)
       
    7. Define the email sending status callback. -

      Email sending is an asynchronous operation, and thus the sending status cannot be checked directly in the return code from the email_send_message() function. To receive notifications about sending success or failure, a callback function must be defined:

      -
      static void email_send_status(email_h email, email_sending_e result, void *user_data) 
      +

      Email sending is an asynchronous operation, and thus the sending status cannot be checked directly in the return code from the email_send_message() function. To receive notifications about sending success or failure, a callback function must be defined.

      +
      static void 
      +email_send_status(email_h email, email_sending_e result, void *user_data) 
       {
          if (result == EMAIL_SENDING_FAILED) 
          {
      @@ -140,7 +132,7 @@ if (error_code != EMAILS_ERROR_NONE)
       }
    8. Send the email. -

      If the email message object is ready and the sending status callback is defined, the message can be sent:

      +

      If the email message object is ready and the sending status callback is defined, the message can be sent.

      error_code = email_set_message_sent_cb(msg, email_send_status, NULL);
       if (error_code != EMAILS_ERROR_NONE) 
       {
      @@ -152,7 +144,7 @@ if (error_code != EMAILS_ERROR_NONE)
       {
          dlog_print(DLOG_INFO, LOG_TAG, "");
       }
      -

      When the message is sent or if sending was canceled and the message is no longer needed, delete it using the email_destroy_message() function. The callback registered for the specified message must also be unset using the email_unset_message_sent_cb() callback function:

      +

      When the message is sent or if sending was canceled and the message is no longer needed, delete it using the email_destroy_message() function. The callback registered for the specified message must also be unset using the email_unset_message_sent_cb() callback function.

      error_code = email_unset_message_sent_cb(msg);
       if (error_code != EMAILS_ERROR_NONE) 
       {
      diff --git a/org.tizen.tutorials/html/native/messaging/messaging_tutorials_n.htm b/org.tizen.tutorials/html/native/messaging/messaging_tutorials_n.htm
      index af9fcc7..17c3aea 100644
      --- a/org.tizen.tutorials/html/native/messaging/messaging_tutorials_n.htm
      +++ b/org.tizen.tutorials/html/native/messaging/messaging_tutorials_n.htm
      @@ -18,7 +18,7 @@
       
       
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      diff --git a/org.tizen.tutorials/html/native/messaging/push_tutorial_n.htm b/org.tizen.tutorials/html/native/messaging/push_tutorial_n.htm index b4950bf..0d87da6 100644 --- a/org.tizen.tutorials/html/native/messaging/push_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/messaging/push_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      @@ -192,12 +192,13 @@ push_service_connection_h push_conn;

      To manage push service connections:

      1. Connect to the push service. -

        Once the connection handle is defined, use the push_service_connect() function to connect the push service:

        +

        Once the connection handle is defined, use the push_service_connect() function to connect the push service.

         #define PUSH_APP_ID "YOUR_PUSH_ID_HERE"
         
        -static bool app_create(void *data)
        +static bool 
        +app_create(void *data)
         {
            int ret;
         
        @@ -214,7 +215,7 @@ static bool app_create(void *data)
         }
         
        -

        In the above example, the application establishes a socket connection to the push service using the push_service_connect() function. The YOUR_PUSH_ID_HERE argument is the push app ID received from the Tizen push server team when the access to the server was requested. Keep this push app ID confidential, otherwise your push notifications can be hijacked by malicious applications.

        +

        In the above example, the application establishes a socket connection to the push service using the push_service_connect() function. The YOUR_PUSH_ID_HERE parameter is the push app ID received from the Tizen push server team when the access to the server was requested. Keep this push app ID confidential, otherwise your push notifications can be hijacked by malicious applications.

        The _state_cb() and _noti_cb() parameters are callback functions called when the state changes or a notification arrives from the server through the push service.

        The push_conn parameter is the output of the push_service_connect() function. If the connection between your application and the service is successful, the push_service_connect() function returns PUSH_SERVICE_ERROR_NONE and the push_conn connection handle is returned through the last parameter. If the push_service_connect() function returns other values, the connection to the service failed. This happens most likely when the push privilege is not added in the SDK.

        @@ -246,10 +247,11 @@ push_conn = NULL;
      2. If your application is not currently registered to the push server, the state transits from the INITIAL state to the UNREGISTERED state. In this case, your application can request registration to the push server through the push service using the push_service_register() function. If this request is approved by the push server, the state transits to REGISTERED.
      3. When an error occurs, the state transits to ERROR.
      4. -

        When the current state transits, the _state_cb() function is called and the new state is obtained from the first argument. The application then needs to determine its actions based on the new state:

        +

        When the current state transits, the _state_cb() function is called and the new state is obtained from the first parameter. The application then needs to determine its actions based on the new state:

        -static void _state_cb(push_service_state_e state, const char *err, void *user_data)	
        +static void 
        +_state_cb(push_service_state_e state, const char *err, void *user_data)	
         {
            switch (state)	
            {
        @@ -275,21 +277,22 @@ static void _state_cb(push_service_state_e state, const char *err, void *user_da
         }
         
        -

        In the above example, the _on_state_registered(), _on_state_unregistered(), and _on_state_error() functions contain the actions for the REGISTERED, UNREGISTERED, and ERROR states, respectively. Your application does not need to handle the INITIAL state because it is maintained internally, and this callback function is never invoked in this state. The second argument, err, is the error message from the push service when the state becomes ERROR. Consequently, only the _on_state_error() function takes this argument while others ignore it.

        +

        In the above example, the _on_state_registered(), _on_state_unregistered(), and _on_state_error() functions contain the actions for the REGISTERED, UNREGISTERED, and ERROR states, respectively. Your application does not need to handle the INITIAL state because it is maintained internally, and this callback function is never invoked in this state. The second parameter, err, is the error message from the push service when the state becomes ERROR. Consequently, only the _on_state_error() function takes this parameter while others ignore it.

      Registering with the Push Server

      To receive push notifications, your application must send a registration request to the Tizen push server. When the server receives this request, it assigns a registration ID that is unique to your application on the particular device. When sending a notification from your application server, this registration ID is used as a destination address of your application. If your application no longer needs to receive push notifications, it needs to send a deregistration request to the server.

      - +

      To register with the push server:

      1. Request registration.

        After connecting to the push service, request registration using the push_service_register() function.

        -

        The function takes 3 arguments. The first argument is the connection handle that was returned from the push_service_connect() function. The second argument is the callback function that returns the result of this registration request. The last argument is the user data to be handed over to the result callback function.

        +

        The function takes 3 parameters. The first parameter is the connection handle that was returned from the push_service_connect() function. The second parameter is the callback function that returns the result of this registration request. The last parameter is the user data to be handed over to the result callback function.

        -static void _on_state_unregistered(void *user_data) 
        +static void 
        +_on_state_unregistered(void *user_data) 
         {
            int ret;
         
        @@ -300,10 +303,11 @@ static void _on_state_unregistered(void *user_data)
         
         

        The _on_state_unregistered() function containing the push_service_register() function is called when the state transits to UNREGISTERED. This sample application is designed to send the registration request as soon as it is connected to the push service. If your application requires users to login to your service, this registration request must be sent after the login process is complete.

        -

        Note that the registration request is non-blocking. If PUSH_SERVICE_ERROR_NONE returns from the push_service_register() function, your request is successfully delivered to the push service. However, it does not necessarily mean that your request is approved by the server. If the push service successfully sends your request to the server and receives an approval, the _result_cb() callback is called with PUSH_SERVICE_RESULT_SUCCESS from the first parameter:

        +

        Note that the registration request is non-blocking. If PUSH_SERVICE_ERROR_NONE returns from the push_service_register() function, your request is successfully delivered to the push service. However, it does not necessarily mean that your request is approved by the server. If the push service successfully sends your request to the server and receives an approval, the _result_cb() callback is called with PUSH_SERVICE_RESULT_SUCCESS from the first parameter.

        -static void _result_cb(push_service_result_e result, const char *msg, void *user_data) 
        +static void 
        +_result_cb(push_service_result_e result, const char *msg, void *user_data) 
         {
            if (result == PUSH_SERVICE_RESULT_SUCCESS)
               dlog_print(DLOG_INFO, LOG_TAG, "Registration request is approved.");
        @@ -314,7 +318,7 @@ static void _result_cb(push_service_result_e result, const char *msg, void *user
         }
         
        -

        When an error occurs in the middle of the registration process, the reason is returned from the first parameter of the callback. For example, if the push server is not responding, the push_service_register() function returns PUSH_SERVICE_ERROR_NONE (because delivery to the service is successful), but the _result_cb() function is called later with PUSH_RESULT_TIMEOUT. In this case, your application does not need to request registration again because the push service keeps the previous request and sends it when the network becomes online. The msg argument is the error message from the push service if the request fails.

        +

        When an error occurs in the middle of the registration process, the reason is returned from the first parameter of the callback. For example, if the push server is not responding, the push_service_register() function returns PUSH_SERVICE_ERROR_NONE (because delivery to the service is successful), but the _result_cb() function is called later with PUSH_RESULT_TIMEOUT. In this case, your application does not need to request registration again because the push service keeps the previous request and sends it when the network becomes online. The msg parameter is the error message from the push service if the request fails.

      2. @@ -331,7 +335,8 @@ static void _result_cb(push_service_result_e result, const char *msg, void *user
        -static void _on_state_registered(void *user_data) 
        +static void 
        +_on_state_registered(void *user_data) 
         {
            int ret;
            char *reg_id = NULL;
        @@ -346,6 +351,7 @@ static void _on_state_registered(void *user_data)
            if (ret != PUSH_SERVICE_ERROR_NONE)	
            {
               dlog_print(DLOG_ERROR, LOG_TAG, "ERROR [%d]: push_service_get_registration_id()", ret);
        +
               return;
            }
         
        @@ -369,7 +375,8 @@ static void _on_state_registered(void *user_data)
         #include <openssl/sha.h>
         #define PUSH_HASH_KEY "existing_push_reg_id"
         
        -static void _send_reg_id_if_necessary(const char *reg_id)
        +static void 
        +_send_reg_id_if_necessary(const char *reg_id)
         {
            unsigned char md[SHA_DIGEST_LENGTH];
            char hash_string[2*SHA_DIGEST_LENGTH+1];
        @@ -413,13 +420,13 @@ static void _send_reg_id_if_necessary(const char *reg_id)
         
      3. Request deregistration. -

        When your application no longer wants to receive push notifications, use the following function to request deregistration:

        +

        When your application no longer wants to receive push notifications, use the following function to request deregistration.

         push_service_deregister(push_conn, _dereg_result_cb, NULL);
         
        -

        This function is non-blocking. If PUSH_SERVICE_ERROR_NONE returns from this function, the request is successfully received by the push service. The result of this request is returned in the _dereg_result_cb() callback function. The third argument is the pointer to the user data which is handed over to the result function.

        +

        This function is non-blocking. If PUSH_SERVICE_ERROR_NONE returns from this function, the request is successfully received by the push service. The result of this request is returned in the _dereg_result_cb() callback function. The third parameter is the pointer to the user data which is handed over to the result function.

        Note that the push_service_deregister() function is not used, if the application is intended to receive push notifications while being installed. If the application is uninstalled, the push service detects the event and deregisters the application automatically. In contrast, if the application wants to receive push notifications only when a user logs in, the push_service_deregister() function must be called whenever a user logs out.

      4. @@ -446,42 +453,42 @@ push_service_deregister(push_conn, _dereg_result_cb, NULL); 00 US East - https://useast.push.samsungosp.com:8088/spp/pns/api/push + https://useast.push.samsungosp.com:8088/spp/pns/api/push 01 US West - https://uswest.push.samsungosp.com:8088/spp/pns/api/push + https://uswest.push.samsungosp.com:8088/spp/pns/api/push 02 Asia Pacific Southeast - https://apsoutheast.push.samsungosp.com:8088/spp/pns/api/push + https://apsoutheast.push.samsungosp.com:8088/spp/pns/api/push 03 EU West - https://euwest.push.samsungosp.com:8088/spp/pns/api/push + https://euwest.push.samsungosp.com:8088/spp/pns/api/push 04 Asia Pacific Northeast - https://apnortheast.push.samsungosp.com:8088/spp/pns/api/push + https://apnortheast.push.samsungosp.com:8088/spp/pns/api/push 05 Korea - https://apkorea.push.samsungosp.com:8088/spp/pns/api/push + https://apkorea.push.samsungosp.com:8088/spp/pns/api/push> 06 China - https://apchina.push.samsungosp.com.cn:8088/spp/pns/api/push + https://apchina.push.samsungosp.com.cn:8088/spp/pns/api/push 7C Staging (AP Northeast) - https://175.41.248.50:8088/spp/pns/api/push + https://175.41.248.50:8088/spp/pns/api/push @@ -502,33 +509,33 @@ push_service_deregister(push_conn, _dereg_result_cb, NULL); action - ALERT: Store the message and alert the user. -

        SILENT: Store the message without alerting the user.

        -

        DISCARD: Discard the message.

        -

        LAUNCH: Forcibly launch the app and deliver the notification.

        + ALERT: Store the message and alert the user. +

        SILENT: Store the message without alerting the user.

        +

        DISCARD: Discard the message.

        +

        LAUNCH: Forcibly launch the app and deliver the notification.

        Action to be performed if the application is not running. If action is not included, the default behavior is SILENT. alertMessage Up to 127 bytes - Alert message shown to the user in the quick panel. If the action is not set as ALERT, this value is meaningless. + Alert message shown to the user in the quick panel. If the action is not set as ALERT, this value is meaningless. badgeOption - INCREASE: Increase the badge number by the given value. -

        DECREASE: Decrease the badge number by the given value.

        -

        SET: Set badge number to the given value.

        - Option for updating the icon badge number. If the action is set as DISCARD, the badgeOption is ignored. If it is not included, the icon badge number remains unchanged. + INCREASE: Increase the badge number by the given value. +

        DECREASE: Decrease the badge number by the given value.

        +

        SET: Set badge number to the given value.

        + Option for updating the icon badge number. If the action is set as DISCARD, the badgeOption is ignored. If it is not included, the icon badge number remains unchanged. - badgeNumber + badgeNumber 0-999 - -

        For example, to show a "Hi" message in the quick panel and increase the badge count by 1 when the notification arrives at the device, the message field of the notification must be as follows:

        +

        For example, to show a "Hi" message in the quick panel and increase the badge count by 1 when the notification arrives at the device, the message field of the notification must be the following:

        "badgeOption=INCREASE&badgeNumber=1&action=ALERT&alertMessage=Hi"
        @@ -677,7 +684,8 @@ appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
      5. Example response

        If the push server receives a notification request, the server returns a JSON string that contains the regID, requestID, status code, and status message. If the request contains a malformed JSON format, requests are not processed and are returned without the regID and requestID values. If the request is of the JSON format but has invalid data, no requests are processed and are considered as an error. This return message only shows whether receiving notification request was successful. This return message does not deal with whether the push client receives the notification. The order of the return message is the same as the request message order.

        - +
          +
        • The following example is shown if the request is successful:

           {
          @@ -690,6 +698,8 @@ appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
              }]
           }
           
          +
        • +
        • The following example is shown if the request fails due to malformation:

           {
          @@ -701,7 +711,10 @@ appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
                 "statusMsg":"error of json mapping exception"
              }]
           }
          -

          The following example is shown if the request fails due to abnormal data:

          +
      +
    9. +
    10. +

      The following example is shown if the request fails due to abnormal data:

       {
          "results":
      @@ -717,6 +730,8 @@ appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
       
       
    11. + +

      Handling Push Notifications

      @@ -726,10 +741,11 @@ appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
      • Receive notifications when the application is running. -

        When a notification arrives to your application while it is running (precisely, your application is connected to the service), the _noti_cb() function is called as defined in the push_service_connect() function. In this callback function, you can handle the received notification. The following example shows how your application can retrieve the app data (payload), message, and timestamp from the received notification:

        +

        When a notification arrives to your application while it is running (precisely, your application is connected to the service), the _noti_cb() function is called as defined in the push_service_connect() function. In this callback function, you can handle the received notification. The following example shows how your application can retrieve the app data (payload), message, and timestamp from the received notification.

        -static void _noti_cb(push_service_notification_h noti, void *user_data)
        +static void 
        +_noti_cb(push_service_notification_h noti, void *user_data)
         {
            int ret;
         
        @@ -792,7 +808,8 @@ static void _noti_cb(push_service_notification_h noti, void *user_data)
         

        -static void app_control(app_control_h app_control, void *data)
        +static void 
        +app_control(app_control_h app_control, void *data)
         {
            char *op = NULL;
            push_service_notification_h noti = NULL;
        @@ -823,7 +840,7 @@ static void app_control(app_control_h app_control, void *data)
         }
         
        -

        When you create your project in the SDK, the app_control() function is created automatically. When your application is launched by the push service, all related information regarding this launch request is delivered through the app_control argument. From this handle, retrieve the op operation using the app_control_get_operation() function. With app_control and op, retrieve the notification data using the push_service_app_control_to_noti_data() function. If your application is not launched by the push service, this function returns as NULL.

        +

        When you create your project in the SDK, the app_control() function is created automatically. When your application is launched by the push service, all related information regarding this launch request is delivered through the app_control parameter. From this handle, retrieve the op operation using the app_control_get_operation() function. With app_control and op, retrieve the notification data using the push_service_app_control_to_noti_data() function. If your application is not launched by the push service, this function returns as NULL.

        For the second option, you need to set the action to ALERT or SILENT in the message field when sending the notification from the application server. When such a notification arrives at the device, the push service keeps the notification in the database and waits for the request from the application. The difference of the 2 options is that the former shows the alert message in the quick panel and changes the badge count while the latter does not. If the user clicks the message in the quick panel, the push service forcibly launches the application and delivers the notification through the app control callback function as in the first option.

        @@ -832,7 +849,7 @@ static void app_control(app_control_h app_control, void *data)
      • Request unread notifications. -

        If the user does not launch the application from the quick panel, the application requests the unread notifications after start-up using the push_service_request_unread_notification() function as already introduced. The synchronous request using the push_service_get_unread_notification() function is shown below: +

        If the user does not launch the application from the quick panel, the application requests the unread notifications after start-up using the push_service_request_unread_notification() function as already introduced. The synchronous request using the push_service_get_unread_notification() function is shown in the following example.

        @@ -888,4 +905,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
         
         
          
        -
        +
        \ No newline at end of file
        diff --git a/org.tizen.tutorials/html/native/messaging/sms_mms_tutorial_n.htm b/org.tizen.tutorials/html/native/messaging/sms_mms_tutorial_n.htm
        index b8c3350..6da67e9 100644
        --- a/org.tizen.tutorials/html/native/messaging/sms_mms_tutorial_n.htm
        +++ b/org.tizen.tutorials/html/native/messaging/sms_mms_tutorial_n.htm
        @@ -18,7 +18,7 @@
         
         
        -

        Mobile native Wearable native

        +

        Mobile native Wearable native

        Content

        @@ -62,7 +62,7 @@ #include <messages.h>
      • The Messages service works like a client-service architecture. In this architecture, a Tizen application is the client side and has to connect to the service before using the Messages API.

        -

        Establish a connection using the messages_open_service(messages_service_h *service) function:

        +

        Establish a connection using the messages_open_service(messages_service_h *service) function.

        static messages_service_h service_handle = NULL;
         int error_code;
        @@ -83,11 +83,11 @@ service_handle = NULL;

    To fetch messages from a message box, use the messages_foreach_message() function with the appropriate parameters. One of these parameters is the callback function called for each message matching the search criteria.

    +

    To fetch messages:

    +
    1. Define the message searching callback function. -
      1. -

        The callback function signature has to match the following typedef:

        -
        typedef bool(* messages_search_cb)(messages_message_h msg, int index, int result_count, int total_count, void *user_data)
      2. -
      3. Within the callback, to print the message content (or to show it to the user in any other way), extract its text, address, and type as below:

        +
          +
        1. Within the callback, to print the message content (or to show it to the user in any other way), extract its text, address, and type as in the following example:

          char *message = NULL, *address = NULL;
           messages_recipient_type_e rtype;
           int error_code = MESSAGES_ERROR_NONE;
          @@ -133,7 +133,7 @@ free(address);
      4. Keyword (for searching based on text and subject)
      5. Address (message recipient address)
      6. -

        The following example shows a simple search for all SMS messages in all message boxes with a callback function named message_search_callback:

        +

        The following example shows a simple search for all SMS messages in all message boxes with a callback function named message_search_callback.

        int error_code;
         error_code = messages_open_service(&service_handle);
         if (error_code != MESSAGES_ERROR_NONE) 
        @@ -154,10 +154,11 @@ messages_close_service(service_handle);

      Sending SMS or MMS Messages

      -

      The Messaging API provides functions to send SMS (Short Message Service) messages and MMS (Multimedia Message Service) messages with attachments (image or video files):

      +

      The Messaging API supports SMS (Short Message Service) messages and MMS (Multimedia Message Service) messages with attachments (image or video files).

      +

      To send a message:

      1. Create a message.

        Before sending a message, open a connection to the messaging service.

        -

        To create an SMS or an MMS message, use the messages_create_message() function. Specify the message type (MESSAGES_TYPE_SMS or MESSAGES_TYPE_MMS) when creating the message. The following example creates an SMS message:

        +

        To create an SMS or an MMS message, use the messages_create_message() function. Specify the message type (MESSAGES_TYPE_SMS or MESSAGES_TYPE_MMS) when creating the message. The following example creates an SMS message.

        int error_code;
         messages_message_h msg_hndl = NULL;
         
        @@ -168,7 +169,7 @@ if (error_code != MESSAGES_ERROR_NONE)
            dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to create message");
         }
      2. Define the recipients and message body. -

        Functions for setting the recipient address and the message body (the message text) are the same for SMS and MMS, but in this case the message type specification is not needed:

        +

        Functions for setting the recipient address and the message body (the message text) are the same for SMS and MMS, but in this case the message type specification is not needed.

        error_code = messages_add_address(msg_hndl, "123456789", MESSAGES_RECIPIENT_TO);
         if (error_code != MESSAGES_ERROR_NONE) 
         {
        @@ -182,13 +183,13 @@ if (error_code != MESSAGES_ERROR_NONE)
         }
      3. Set a subject and add an attachment (note that sending MMS is not supported on the Emulator). -
        • You can set a message subject and add attachments to MMS messages. Set the subject:

          +
          • Set a message subject to a MMS message:

            error_code = messages_mms_set_subject(msg_hndl, "MMS test");
             if (error_code != MESSAGES_ERROR_NONE) 
             {
                dlog_print(DLOG_DEBUG, LOG_TAG, "Failed to set MMS subject");
             }
          • -
          • Add attachments to the MMS message with their absolute path in the device file system. When adding the attachment, give the attachment type. Possible attachment types are image, audio, and video:

            +
          • Add attachments to the MMS message with their absolute path in the device file system. When adding the attachment, give the attachment type. Possible attachment types are image, audio, and video.

            error_code = messages_mms_add_attachment(g_message, MESSAGES_MEDIA_IMAGE, "/path/to/image/file");
             if (error_code != MESSAGES_ERROR_NONE) 
             {
            @@ -196,10 +197,10 @@ if (error_code != MESSAGES_ERROR_NONE)
             }
        • Send the message. -
          1. SMS and MMS sending is an asynchronous operation, and a callback function is needed to receive the sending operation status. This function has to match the following typedef:

            -
            typedef void(* messages_sent_cb)(messages_sending_result_e result, void *user_data)
          2. +
            1. Using the first parameter in the callback (result), the messaging service informs you about the sending status. It can be used to determine whether the sending succeeded:

              -
              static void sent_msg_cb(messages_sending_result_e result, void *user_data)
              +
              static void 
              +sent_msg_cb(messages_sending_result_e result, void *user_data)
               {
                  if (MESSAGES_SENDING_SUCCEEDED == result) 
                  {
              diff --git a/org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm
              index 958cc76..1c9bbd0 100644
              --- a/org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm
              +++ b/org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm
              @@ -18,7 +18,7 @@
               
               
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              Content

              diff --git a/org.tizen.tutorials/html/native/multimedia/camera_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/camera_tutorial_n.htm index 063ec8f..979b4b5 100644 --- a/org.tizen.tutorials/html/native/multimedia/camera_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/camera_tutorial_n.htm @@ -18,13 +18,13 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              Content

            2. +
            -
          3. -

            Setting the Display for Camera Preview

            -

            In order to display camera preview to the screen, need to check settings for camera display.

            -

            Camera Framework already provided proper display with default setting. Applications don't have to invoke display setting. However, if some applications want to use own display setting, you refer this page for intended display setting.

            -
              -
            1. Camera Device Location -

              To display camera preview to the screen, you need to check device location.

              -

              This location of camera device depends on the hardware device.

              -
              +

              Setting the Display for the Camera Preview

              + +

              To display the camera preview on the screen, you must check the camera display settings.

              +

              The Camera framework provides a proper display with the default settings, so the applications have no need usually to invoke the display settings. However, if you want to use your own display settings, use the following information:

              + +
                +
              • To set the camera device location: + +

                To display the camera preview on the screen, you need to check the device location. The camera device location depends on the hardware device.

                + +
                 typedef enum
                 {
                -    CAMERA_DEVICE_CAMERA0 = 0, /**< Primary camera*/
                -    CAMERA_DEVICE_CAMERA1      /**< Secondary camera*/
                +   CAMERA_DEVICE_CAMERA0 = 0, // Primary camera
                +   CAMERA_DEVICE_CAMERA1 // Secondary camera
                 } camera_device_e;
                -				
                -
              • -
              • Camera Device Orientation
              • -

                To consider proper display, you must think the physical lens orientation and location.

                -

                If the facing direction of camera is opposite to the display, camear device orientation is calculated clockwise. If the facing direction of camera is same direction to the display, camera device orientation is calculated counterclockwise.

                -
                +
                + + + +
              • To set the camera device orientation: +

                For a proper display, you must think about the physical lens orientation and location.

                +

                If the facing direction of the camera is opposite to the display, the camera device orientation is calculated clockwise. If the facing direction of the camera is the same direction as the display, the camera device orientation is calculated counter-clockwise.

                + +
                 int angle = 0;
                 int error_code = 0;
                -error_code = camera_attr_get_lens_orientation(cam_data.g_camera, &angle);
                -		 		
                -

                If your camera device is opposite to the display, the right side is 90 degrees and If it is same as the display direction, right side is 270 degrees

                -

                The returned value of "angle" is degress

                -
              • Default display settings
              • -

                Camera display settings are already set internally. For example, the Sencondary camera is already set flip for supporting mirror mode.

                -

                If application sets any other values with camera_set_display_rotation, camera_get_display_flip, these default values will be changed.

                -

                Therefore, remind that these valuses should be get the default display right after initializing the camera

                -
                +
                +error_code = camera_attr_get_lens_orientation(cam_data.g_camera, &angle);
                +
                + +

                If your camera device is opposite to the display, the right side is 90 degrees, and if it is on the display direction, the right side is 270 degrees.

                +

                The returned value of the angle variable is degrees.

                + + +
              • To set the default display settings: + +

                The camera display settings are already set internally. For example, the secondary camera is already set flipped for supporting the mirror mode.

                +

                If you set any other values with the camera_set_display_rotation() or camera_get_display_flip() functions, the default values are changed. Therefore, remember that these values are retrieved for the default display right after initializing the camera.

                + +
                 camera_rotation_e rotation = 0;
                 camera_flip_e flip = 0
                 int error_code = 0;
                -//To get default display rotation value
                -error_code = camera_get_display_rotation(cam_data.g_camera, &rotation);
                -//To get default display flip value
                -error_code = camera_get_display_flip(cam_data.g_camera, &flip);
                -		 		
                -
              • Display Rotation
              • -

                The recommended display rotation can be calculated like below

                -
                +
                +// To get the default display rotation value
                +error_code = camera_get_display_rotation(cam_data.g_camera, &rotation);
                +
                +// To get the default display flip value
                +error_code = camera_get_display_flip(cam_data.g_camera, &flip);
                +
                + +
              • To set the display rotation: +

                The recommended display rotation can be calculated as follows:

                + +
                 int lens_orientation = 0;
                 int error_code = 0;
                 camera_rotation_e display_rotation = CAMERA_ROTATION_NONE;
                 int display_rotation_angle = 0;
                 
                -// To get recommanded display rotation value
                -error_code = camera_attr_get_lens_orientation (cam_data.g_camera, &lens_orientation);
                +// To get the recommended display rotation value
                +error_code = camera_attr_get_lens_orientation (cam_data.g_camera, &lens_orientation);
                 display_rotation_angle = (360 - lens_orientation) % 360;
                 
                -// To convert to enum type and set display rotation
                -switch(display_rotation_angle) {
                -    case   0: display_rotation = CAMERA_ROTATION_NONE; break;
                -    case  90: display_rotation = CAMERA_ROTATION_90; break;
                -    case 180: display_rotation = CAMERA_ROTATION_180; break;
                -    case 270: display_rotation = CAMERA_ROTATION_270; break;
                -    default : display_rotation = CAMERA_ROTATION_NONE; break;
                +// To convert to enum type and set the display rotation
                +switch (display_rotation_angle) 
                +{
                +   case   0: display_rotation = CAMERA_ROTATION_NONE; break;
                +   case  90: display_rotation = CAMERA_ROTATION_90; break;
                +   case 180: display_rotation = CAMERA_ROTATION_180; break;
                +   case 270: display_rotation = CAMERA_ROTATION_270; break;
                +   default : display_rotation = CAMERA_ROTATION_NONE; break;
                 }
                +
                 error_code = camera_set_display_rotation(cam_data.g_camera, display_rotation);
                -		 	 	
                -
              • Display Flip
              • -

                According to the camera facing direction, you need to select flip api.

                -

                Because the display flip api runs after display rotation api, you need to remind calculation carefully with camera facing direction.

                -
                -//If the facing direction of camera is same as display module, it is needed to apply flip for front camera, because of mirror effect
                +
                + +
              • To set the display flip: +

                According to the camera facing direction, you need to select the flip API. Because the display flip API runs after the display rotation API, you need to define the calculation carefully taking account of the camera facing direction.

                + +
                +// If the facing direction of camera is the same as display, apply flip for the front camera because of the mirror effect
                 int lens_orientation = 0;
                 int error_code = 0;
                 camera_flip_e camera_default_flip = MM_FLIP_NONE;
                 
                -// To get recommanded display rotation value
                -error_code = camera_attr_get_lens_orientation (cam_data.g_camera, &lens_orientation);
                +// To get the recommended display rotation value
                +error_code = camera_attr_get_lens_orientation (cam_data.g_camera, &lens_orientation);
                 display_rotation_angle = (360 - lens_orientation) % 360;
                 
                -// To set mirror display
                -if (display_rotation_angle == 90 || display_rotation_angle == 270) {
                -    camera_default_flip = MM_FLIP_VERTICAL;
                -} else {
                -    camera_default_flip = MM_FLIP_HORIZONTAL;
                +// To set the mirror display
                +if (display_rotation_angle == 90 || display_rotation_angle == 270) 
                +{
                +   camera_default_flip = MM_FLIP_VERTICAL;
                +} 
                +else 
                +{
                +   camera_default_flip = MM_FLIP_HORIZONTAL;
                 }
                 
                -// To set display flip
                +// To set the display flip
                 error_code = camera_set_display_flip(cam_data.g_camera, camera_default_flip);
                -  
                -
            - - - - - - - - - -
            Note
            In case of an overlay surface, when the device orientation changes, the displayed camera preview does not rotate automatically. If you want to change the display orientation according to the device orientation, use the camera_set_display_rotation() function within the app_device_orientation_cb() callback function used by the application. - In case of an Evas surface, the Evas object for camera display is rotated by the window manager used by the application, not by the camera_set_display_rotation() function. function.
            -
          4. +
    +
  • + + + + + + + + + + + +
    Note
    In case of an overlay surface, when the device orientation changes, the displayed camera preview does not rotate automatically. If you want to change the display orientation according to the device orientation, use the camera_set_display_rotation() function within the app_device_orientation_cb() callback function used by the application. +

    In case of an Evas surface, the Evas object for the camera display is rotated by the window manager used by the application, not by the camera_set_display_rotation() function.

    Taking a Photo

    diff --git a/org.tizen.tutorials/html/native/multimedia/image_util_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/image_util_tutorial_n.htm index 13e5a49..ffcdd1f 100644 --- a/org.tizen.tutorials/html/native/multimedia/image_util_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/image_util_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/multimedia/media_codec_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/media_codec_tutorial_n.htm index 2a63f76..3daf961 100644 --- a/org.tizen.tutorials/html/native/multimedia/media_codec_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/media_codec_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/multimedia/media_controller_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/media_controller_tutorial_n.htm index 99580e3..cdcbcd3 100644 --- a/org.tizen.tutorials/html/native/multimedia/media_controller_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/media_controller_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/multimedia/media_tools_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/media_tools_tutorial_n.htm index a56d1df..e4c1731 100644 --- a/org.tizen.tutorials/html/native/multimedia/media_tools_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/media_tools_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm index c2e109f..362879c 100644 --- a/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/media_vision_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -65,8 +65,10 @@
  • For barcode generation:
    1. Create a structure to store the global data with the bargendata_s structure: +
      -typedef struct _bargendata_s
      +typedef struct 
      +_bargendata_s
       {
          // Generate the variables to store barcode information
          mv_barcode_type_e type;
      @@ -86,22 +88,20 @@ typedef struct _bargendata_s
       static bargendata_s bargendata;
       
    2. -
    3. Configure the barcode generation engine with the mv_create_engine_config() function. The function configures an engine attribute with default values: - -
      • The MV_BARCODE_GENERATE_ATTR_TEXT attribute defines the generation with text using the mv_barcode_generate_attr_text_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_GENERATE_ATTR_TEXT_INVISIBLE.
      - +
    4. Configure the barcode generation engine with the mv_create_engine_config() function. The function configures an engine attribute with default values.
       int error_code = 0;
      -
      + 
       error_code = mv_create_engine_config(&bargendata.g_engine_cfg);
       if (error_code != MEDIA_VISION_ERROR_NONE)
       {
          dlog_print(DLOG_ERROR, LOG_TAG, "error code = %d", error_code);
       }
       
      +

      For example, use the MV_BARCODE_GENERATE_ATTR_TEXT attribute to define whether the barcode is generated with text. The possible values are listed in the mv_barcode_generate_attr_text_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_GENERATE_ATTR_TEXT_INVISIBLE.

    - +
  • For barcode detection:
    1. Include the <camera.h> header file to handle camera preview images: @@ -111,7 +111,8 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
    2. Create a structure to store the global data with the bardetdata_s structure:
      -typedef struct _bardetdata_s
      +typedef struct 
      +_bardetdata_s
       {
          // Generate the variables for the camera display
          Evas_Object *win;
      @@ -142,10 +143,7 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
       }
       
    3. -
    4. Configure the barcode detection engine with the mv_create_engine_config() function. The function configures an engine attribute with default values: - -
      • The MV_BARCODE_DETECT_ATTR_TARGET attribute defines the detection target using the mv_barcode_detect_attr_target_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_DETECT_ATTR_TARGET_ALL.
      - +
    5. Configure the barcode detection engine with the mv_create_engine_config() function. The function configures an engine attribute with default values.
       int error_code = 0;
       
      @@ -155,6 +153,7 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
          dlog_print(DLOG_ERROR, LOG_TAG, "error code = %d", error_code);
       }
       
      +

      For example, use the MV_BARCODE_DETECT_ATTR_TARGET attribute to define the detection target. The possible values are listed in the mv_barcode_detect_attr_target_e enumerator (in mobile and wearable applications). The default value is MV_BARCODE_DETECT_ATTR_TARGET_ALL.

    6. To provide camera preview images, create the camera handle, set the display and preview callback, and start the camera preview:
      @@ -312,6 +311,7 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
       
  • +
  • To release the g_engine_cfg handle, use the mv_destroy_engine_config() function:
     error_code = mv_destroy_engine_cfg(bargendata.g_engine_cfg);
    @@ -321,7 +321,6 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
     }
     
  • -
  • @@ -332,7 +331,8 @@ if (error_code != MEDIA_VISION_ERROR_NONE)
  • Fill the g_source source handle with the media packet using the mv_source_fill_by_media_packet() function.

    Use the media packet, because the camera preview images can be received through the _camera_media_packet_preview_cb() callback function as a media packet handle.

    -static void _camera_media_packet_preview_cb (media_packet_h pkt, void *user_data)
    +static void 
    +_camera_media_packet_preview_cb (media_packet_h pkt, void *user_data)
     {
        mv_rectangle_s mv_roi = { {0,0}, bardetdata.width, bardetdata.height};
     
    @@ -369,12 +369,10 @@ static void _camera_media_packet_preview_cb (media_packet_h pkt, void *user_data
     
  • Implement the _barcode_detected_cb() callback function, which is triggered when a barcode is detected.

    In the callback, when the number of detected barcodes is more than zero, print the number of detected barcodes and their messages. The used source must be cleared to use the next preview image.

    -static void _barcode_detected_cb (mv_source_h source,
    -mv_engine_config_h engine_cfg, const mv_quadrangle_s *barcode_locations, 
    -const char *message[],
    -const mv_barcode_type_e *types,
    -int number_of_barcodes,
    -void *user_data)
    +static void 
    +_barcode_detected_cb(mv_source_h source, mv_engine_config_h engine_cfg, 
    +                     const mv_quadrangle_s *barcode_locations, const char *message[], 
    +                     const mv_barcode_type_e *types, int number_of_barcodes, void *user_data)
     {
        int i = 0;
        char type[50] = {‘\0};
    diff --git a/org.tizen.tutorials/html/native/multimedia/metadata_editor_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/metadata_editor_tutorial_n.htm
    index 133ca3a..4b30616 100644
    --- a/org.tizen.tutorials/html/native/multimedia/metadata_editor_tutorial_n.htm
    +++ b/org.tizen.tutorials/html/native/multimedia/metadata_editor_tutorial_n.htm
    @@ -18,7 +18,7 @@
     
     
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -39,16 +39,6 @@

    Metadata Editor: Editing Metadata from an Input Audio File

    This tutorial demonstrates how you can edit metadata in audio files.

    - - - - - - - - - -
    Note
    The metadata editor can only be used with audio files. It is not supported in the image and video files.

    Warm-up

    @@ -60,6 +50,17 @@
  • Editing Metadata and Artwork

    Create a metadata editor handle, bind the handle with the file, edit metadata and artwork, and apply to the file.

  • + + + + + + + + + + +
    Note
    The metadata editor can only be used with audio files. It is not supported in the image and video files.

    Initializing the Metadata Editor

    diff --git a/org.tizen.tutorials/html/native/multimedia/metadata_extractor_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/metadata_extractor_tutorial_n.htm index 2702b75..dccd814 100644 --- a/org.tizen.tutorials/html/native/multimedia/metadata_extractor_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/metadata_extractor_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -52,9 +52,6 @@

    Create a metadata extractor handle, bind the handle with the file, and get metadata, artwork, lyrics, and frames.

  • - -

    Initializing the Metadata Extractor

    - @@ -65,6 +62,9 @@
    + +

    Initializing the Metadata Extractor

    +

    To initialize the metadata extractor:

      diff --git a/org.tizen.tutorials/html/native/multimedia/multimedia_tutorials_n.htm b/org.tizen.tutorials/html/native/multimedia/multimedia_tutorials_n.htm index cbbd90a..00a0a03 100644 --- a/org.tizen.tutorials/html/native/multimedia/multimedia_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/multimedia_tutorials_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -55,7 +55,7 @@

      The following tutorials apply in mobile applications only:

      diff --git a/org.tizen.tutorials/html/native/multimedia/player_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/player_tutorial_n.htm index 094ce06..d8e4ed4 100644 --- a/org.tizen.tutorials/html/native/multimedia/player_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/player_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      diff --git a/org.tizen.tutorials/html/native/multimedia/radio_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/radio_tutorial_n.htm index cdfd816..bf96c0e 100644 --- a/org.tizen.tutorials/html/native/multimedia/radio_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/radio_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      diff --git a/org.tizen.tutorials/html/native/multimedia/recorder_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/recorder_tutorial_n.htm index 69bcde1..e793672 100644 --- a/org.tizen.tutorials/html/native/multimedia/recorder_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/recorder_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      diff --git a/org.tizen.tutorials/html/native/multimedia/screen_mirroring_tutorial_n.htm b/org.tizen.tutorials/html/native/multimedia/screen_mirroring_tutorial_n.htm index 343bddb..4e3d9e9 100644 --- a/org.tizen.tutorials/html/native/multimedia/screen_mirroring_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/multimedia/screen_mirroring_tutorial_n.htm @@ -11,14 +11,14 @@ - Screen Mirroring Sink: Mirroring Screen and Sound + Screen Mirroring: Mirroring Screen and Sound
      -

      Screen Mirroring Sink: Mirroring Screen and Sound

      +

      Screen Mirroring: Mirroring Screen and Sound

      This tutorial demonstrates how you can mirror the device screen and sound to another device wirelessly as a sink.

      - - - - - - - - - -
      Note
      This feature is supported in mobile applications only.
      +

      This feature is supported in mobile applications only.

      Warm-up

      -

      Become familiar with Screen Mirroring Sink API basics by learning about:

      +

      Become familiar with Screen Mirroring API basics by learning about:

    @@ -202,7 +200,7 @@ int bt_onoff_operation(void)

    To communicate with other devices using Bluetooth, learn how to check the Bluetooth adapter state:

    -
    1. Check, whether the Bluetooth adapter is enabled on your device: +
      1. Check whether the Bluetooth adapter is enabled on your device:
        bt_adapter_state_e adapter_state;
          
         // Check whether the Bluetooth Service is enabled
        @@ -227,7 +225,8 @@ if (adapter_state == BT_ADAPTER_DISABLED)
         
         bt_error_e ret;
         
        -void adapter_state_changed_cb(int result, bt_adapter_state_e adapter_state, void* user_data) 
        +void 
        +adapter_state_changed_cb(int result, bt_adapter_state_e adapter_state, void* user_data) 
         {
            if (result != BT_ERROR_NONE) 
            {
        @@ -273,7 +272,7 @@ void adapter_state_changed_cb(int result, bt_adapter_state_e adapter_state, void
               dlog_print(DLOG_INFO, LOG_TAG, "[adapter_state_changed_cb] Bluetooth is disabled!");
               // When you try to get device information
               // by invoking bt_adapter_get_name(), bt_adapter_get_address(), or bt_adapter_get_visibility(), 
        -      // BT_ERROR_NOT_ENABLED will occur
        +      // BT_ERROR_NOT_ENABLED occurs
            }
         }
         ret = bt_adapter_set_state_changed_cb(adapter_state_changed_cb, NULL);
        @@ -287,22 +286,13 @@ if (ret != BT_ERROR_NONE)
          

        Finding Other Devices

        To find remote Bluetooth devices either through device discovery or querying bonded devices:

        - -

        Defining and Registering the Discovery State Callback Function

        +
          +
        • Define and register the discovery state callback function. +
            +
          1. Discovering available Bluetooth-enabled devices is the first step to communicating with remote devices. There are 2 types of Bluetooth devices: classic Bluetooth devices and Bluetooth LE devices. Both device types use their own APIs to discover devices of the same type.

            -

            Define a callback with the following function signature to get information about a specific device type:

            -
            typedef void(* bt_adapter_device_discovery_state_changed_cb)(int result, 
            -                                                             bt_adapter_device_discovery_state_e discovery_state, 
            -                                                             bt_adapter_device_discovery_info_s *discovery_info,
            -                                                             void *user_data);
            -typedef void (*bt_adapter_le_device_discovery_state_changed_cb)(int result, 
            -                                                                bt_adapter_le_device_discovery_state_e discovery_state,
            -                                                                bt_adapter_le_device_discovery_info_s *discovery_info,
            -                                                                void *user_data);
            -
            -

            The first parameter, result, specifies the result of the bt_adapter_start_device_discover() or bt_adapter_stop_device_discovery() function in classic Bluetooth, or the bt_adapter_le_start_discover_device() or bt_adapter_le_stop_device_discovery() function in Bluetooth LE.

            -

            This discovery start functions for the 2 types are declared as follows:

            +

            Declare the discovery start functions for the 2 types.

            // Classic Bluetooth
             int bt_adapter_start_device_discovery(void);
             int bt_adapter_stop_device_discovery(void);
            @@ -311,57 +301,20 @@ int bt_adapter_stop_device_discovery(void);
             int bt_adapter_le_start_device_discovery(void);
             int bt_adapter_le_stop_device_discovery(void);
             
            - -

            If discovering Bluetooth succeeds, you will receive the BT_ERROR_NONE result as the first parameter in your bt_adapter_device_discovery_state_changed_cb() (classic Bluetooth) or bt_adapter_le_device_discovery_state_changed_cb() (Bluetooth LE) callback function. If your device did not start to discover devices due to an error, then the result code will be BT_ERROR_TIMEOUT.

            -

            If stopping the discovery succeeds, you can also receive BT_ERROR_CANCELLED.

            - -

            The values in bt_adapter_device_discovery_state_e (classic Bluetooth) or bt_adapter_le_device_discovery_state_e (Bluetooth LE) are as follows:

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            - Table: Discovery states -
            Discovery stateDescription
            BT_ADAPTER_DEVICE_DISCOVERY_STARTEDWhen discovery is started
            BT_ADAPTER_DEVICE_DISCOVERY_FINISHEDWhen discovery is finished
            BT_ADAPTER_DEVICE_DISCOVERY_FOUNDWhen a device is found
            BT_ADAPTER_LE_DEVICE_DISCOVERY_STARTEDWhen LE discovery is started
            BT_ADAPTER_LE_DEVICE_DISCOVERY_FINISHEDWhen LE discovery is finished
            BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUNDWhen an LE device is found
            - - - +
          2. +
          3. +

            If discovering Bluetooth succeeds, you receive the BT_ERROR_NONE result as the first parameter in your bt_adapter_device_discovery_state_changed_cb() (classic Bluetooth) or bt_adapter_le_device_discovery_state_changed_cb() (Bluetooth LE) callback function. If your device did not start to discover devices due to an error, the result code is BT_ERROR_TIMEOUT. If stopping the discovery succeeds, you can also receive BT_ERROR_CANCELLED.

            +
          4. +
          5. When your implemented callback function is first called, the second parameter, discovery_state, is BT_ADAPTER_DEVICE_DISCOVERY_STARTED or BT_ADAPTER_LE_DEVICE_DISCOVERY_STARTED. This indicates that device discovery has begun.

            -

            Each time you find a remote Bluetooth device, discovery_state will be in the BT_ADAPTER_DEVICE_DISCOVERY_FOUND or BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND state.

            -

            At the BT_ADAPTER_DEVICE_DISCOVERY_FOUND or BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND state, you can get some information about a discovered device, such as the device MAC address, name, class, rssi (received signal strength indicator), and bonding state. Using this information, you can connect to the discovered device.

            +

            The discovery states are values of the enumerations bt_adapter_device_discovery_state_e (classic Bluetooth) (in mobile and wearable applications) or bt_adapter_le_device_discovery_state_e (Bluetooth LE) (in mobile and wearable applications).

            +

            Each time you find a remote Bluetooth device, discovery_state is in the BT_ADAPTER_DEVICE_DISCOVERY_FOUND or BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND state. At this state you can get some information about a discovered device, such as the device MAC address, name, class, rssi (received signal strength indicator), and bonding state. Using this information, you can connect to the discovered device.

            discovery_info is a NULL value in the BT_ADAPTER_DEVICE_DISCOVERY_STARTED, BT_ADAPTER_LE_DEVICE_DISCOVERY_STARTED, BT_ADAPTER_DEVICE_DISCOVERY_FINISHED, or BT_ADAPTER_LE_DEVICE_DISCOVERY_FINISHED state.

            -

            An example implementation for classic Bluetooth (Bluetooth LE usage is the same):

            +

            The following example shows the implementation for classic Bluetooth. Bluetooth LE usage is the same.

            #include <glib.h> // For GList
            -void adapter_device_discovery_state_changed_cb(int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void* user_data) 
            +void 
            +adapter_device_discovery_state_changed_cb(int result, bt_adapter_device_discovery_state_e discovery_state, 
            +                                          bt_adapter_device_discovery_info_s *discovery_info, void* user_data) 
             {
                if (result != BT_ERROR_NONE) 
                {
            @@ -396,8 +349,9 @@ void adapter_device_discovery_state_changed_cb(int result, bt_adapter_device_dis
                   break;
                }
             }
            - -

            Register the callback for classic Bluetooth (Bluetooth LE usage is the same):

            +
          6. +
          7. +

            Register the callback for classic Bluetooth. Bluetooth LE usage is the same.

            GList *devices_list = NULL;
             ret = bt_adapter_set_device_discovery_state_changed_cb(
             adapter_device_discovery_state_changed_cb, (void*)&devices_list);
            @@ -406,10 +360,12 @@ if (ret != BT_ERROR_NONE)
             {
                dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_set_device_discovery_state_changed_cb] Failed.");
             }
            - -

            Finding Other Bluetooth Devices

            -

            If you want to stop the device discovery, call bt_adapter_stop_device_discovery() (classic Bluetooth) or bt_adapter_le_stop_device_discovery() (Bluetooth LE).

            -

            A remote Bluetooth device will respond to the request if it is enabled and in a discovery mode. Classic Bluetooth and Bluetooth LE usages are the same.

            +
          8. +
          +
        • +
        • Find other Bluetooth devices. +

          If you want to stop the device discovery, call the bt_adapter_stop_device_discovery() (classic Bluetooth) or bt_adapter_le_stop_device_discovery() (Bluetooth LE) function.

          +

          A remote Bluetooth device responds to the request if it is enabled and in a discovery mode. Classic Bluetooth and Bluetooth LE usages are the same.

           // Classic Bluetooth
           ret = bt_adapter_start_device_discovery();
          @@ -418,9 +374,12 @@ if (ret != BT_ERROR_NONE)
              dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_start_device_discovery] Failed.");
           }
          -

          Enabling Discovery

          -

          For other devices to find your device, your device must be discoverable.

          -

          To check the current visibility of your device, do the following:

          +
        • + +
        • Enable discovery. +
            +
          1. +

            Check the current visibility of your device. For other devices to find your device, your device must be discoverable.

             // Visibility mode of the Bluetooth device
             bt_adapter_visibility_mode_e mode;
            @@ -439,7 +398,8 @@ else
             {
                dlog_print(DLOG_INFO, LOG_TAG, "The device is discoverable for a set period of time.");
             }
            - +
          2. +
          3. To change the visibility mode, use the Bluetooth visibility setting application (shown below with the initial screen on the left and the visibility setting screen on the right).

            Figure: Bluetooth visibility setting application

            Bluetooth visibility setting application

            @@ -448,7 +408,8 @@ else #include <app_control.h> #include <dlog.h> -int bt_set_visibility_operation(void) +int +bt_set_visibility_operation(void) {    int ret = 0;    app_control_h service = NULL; @@ -476,14 +437,14 @@ int bt_set_visibility_operation(void)       return -1;    } -    return 0; }
        - -

        If you want to get a notification when the visibility is changed after 90 seconds, you must implement the following callback and register it.

        -
        typedef void(* bt_adapter_visibility_mode_changed_cb)(int result, bt_adapter_visibility_mode_e visibility_mode, void *user_data)
        -

        An example implementation:

        -
        void adapter_visibility_mode_changed_cb(int result, bt_adapter_visibility_mode_e visibility_mode, void* user_data) 
        +
      2. +
      3. +

        To get a notification when the visibility is changed after 90 seconds, implement the following callback:

        +
        +void 
        +adapter_visibility_mode_changed_cb(int result, bt_adapter_visibility_mode_e visibility_mode, void* user_data) 
         {
            if (result != BT_ERROR_NONE) 
            {
        @@ -503,27 +464,32 @@ int bt_set_visibility_operation(void)
               dlog_print(DLOG_INFO, LOG_TAG, "[visibility_mode_changed_cb] Limited discoverable mode!");
            }
         }
        +
      4. +
      5. Register the callback:

        ret = bt_adapter_set_visibility_mode_changed_cb(adapter_visibility_mode_changed_cb, NULL);
         if (ret != BT_ERROR_NONE) 
         {
            dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_set_visibility_mode_changed_cb] Failed.");
         }
        - -

        Querying Bonded Devices

        -

        Before trying to find the remote devices nearby, you can query the list of bonded devices to get the basic information (such as device address and name) your device has stored for the bonded devices. In order to get all bonded devices, call bt_adapter_foreach_bonded_device(). You can get information about bonded devices in bt_adapter_bonded_device_cb(), which you need to call for each bonded device.

        -

        bt_adapter_foreach_bonded_device() is declared as follows:

        +
      6. +
      +
    2. +
    3. Query bonded devices. +
        +
      1. +

        Before trying to find the remote devices nearby, you can query the list of bonded devices to get the basic information (such as device address and name) your device has stored for the bonded devices. To get all bonded devices, call the bt_adapter_foreach_bonded_device() function. You can get information about bonded devices in the bt_adapter_bonded_device_cb() callback function, which you need to call for each bonded device.

        +

        Declare the bt_adapter_foreach_bonded_device() function.

        int bt_adapter_foreach_bonded_device(bt_adapter_bonded_device_cb foreach_cb, void *user_data)
        -

        The callback function is declared as follows:

        -
        typedef bool(* bt_adapter_bonded_device_cb)(bt_device_info_s *device_info, void *user_data)

        You can get information (such as the device name, service list, and Mac address) about the bonded device.

        To continue performing iterations, your implemented callback function must return true. Otherwise, it returns false and stops performing additional iterations.

        -

        The following code sample describes how to query bonded devices and how to discover a desired device.

        +

        The following example describes how to query bonded devices and how to discover a desired device.

        // Server address for connecting
         char *bt_server_address = NULL;
         const char *remote_server_name = "server device";
          
        -bool adapter_bonded_device_cb(bt_device_info_s *device_info, void *user_data) 
        +bool 
        +adapter_bonded_device_cb(bt_device_info_s *device_info, void *user_data) 
         {
            if (device_info == NULL) 
            {
        @@ -562,13 +528,19 @@ if (ret != BT_ERROR_NONE)
         if (bt_server_address != NULL)
            free(bt_server_address);
         
        +
      2. +
      +
    4. -

      Requesting Bonding with a Remote Bluetooth Device

      -

      You already got information about a remote device through device discovery or querying a bonded device. You can request to bond with that device using the bt_device_create_bond() function. If you want to cancel bonding, call bt_device_cancel_bonding().

      +
    5. Request bonding with a remote Bluetooth device. +
        +
      1. +

        You can request to bond with a remote device using the bt_device_create_bond() function. If you want to cancel bonding, call the bt_device_cancel_bonding() function.

        To get notified when the bonding has finished, register a bt_device_bond_created_cb() callback function using the bt_device_set_bond_created_cb() function. From this callback, you can get the service list that the remote Bluetooth device provides and the service UUID from that service list.

        -

        The example below shows how to implement a bt_device_bond_created_cb() callback function and bond with a remote Bluetooth device.

        - -
        void device_bond_created_cb(int result, bt_device_info_s *device_info, void *user_data) 
        +

        The following example shows how to implement the bt_device_bond_created_cb() callback function and bond with a remote Bluetooth device.

        +
        +void 
        +device_bond_created_cb(int result, bt_device_info_s *device_info, void *user_data) 
         {
            if (result != BT_ERROR_NONE) 
            {
        @@ -614,19 +586,23 @@ else
         {
            dlog_print(DLOG_INFO, LOG_TAG, "[bt_device_create_bond] succeeded. device_bond_created_cb callback will be called.");
         }
        -

        After that, the remote device is included in the bonded device list. So next time you do not need to find it again. Without finding, you can get information (such as address and name) by querying the bonded device.

        -

        You can verify the bonding by calling the bt_adapter_foreach_bonded_device() function.

        -

        If you want to remove the device from the bonded list, call the bt_device_destroy_bond() function.

        +
      2. +
      3. +

        After that, the remote device is included in the bonded device list. Next time you do not need to find it again. Without finding, you can get information (such as address and name) by querying the bonded device.

        +

        You can verify the bonding by calling the bt_adapter_foreach_bonded_device() function. To remove the device from the bonded list, call the bt_device_destroy_bond() function.

        +
      4. +
      +
    6. +

      Connecting to Other Devices Using SPP

      To connect to other devices:

      -

      Connecting as a Server

      -

      If you want your device to work as a server, establish a connection using an RFCOMM socket.

      -

      To establish a connection, create a RFCOMM Bluetooth socket using the bt_socket_create_rfcomm() function. It has the following signature:

      -
      int bt_socket_create_rfcomm(const char *port_uuid, int *socket_fd)
      -

      The first parameter, port_uuid, uniquely identifies which service to provide. It is the UUID of the service. This UUID must match for the connection to be accepted. The second parameter, socket_fd, is the RFCOMM socket ID as an output parameter.

      -

      The example below shows how to make an rfcomm socket with the Bluetooth API.

      +
        +
      • Connect as a server +
          +
        1. +

          To establish a connection with your device as a server, create a RFCOMM Bluetooth socket using the bt_socket_create_rfcomm() function. The first parameter is the UUID of the service, which uniquely identifies which service to provide. This UUID must match for the connection to be accepted. The second parameter is the RFCOMM socket ID as an output parameter.

          const char* my_uuid="00001101-0000-1000-8000-00805F9B34FB";
           int server_socket_fd = -1;
           bt_error_e ret;
          @@ -636,23 +612,19 @@ if (ret != BT_ERROR_NONE)
           {
              dlog_print(DLOG_ERROR, LOG_TAG, "bt_socket_create_rfcomm() failed.");
           }
          -

          To listen for an incoming connection, call the bt_socket_listen_and_accept_rfcomm() function.

          -

          This function is declared as follows:

          +
        2. +
        3. +

          To listen for an incoming connection, call the bt_socket_listen_and_accept_rfcomm() function. The first parameter is the socket fd passed from bt_socket_create_rfcomm(), which starts listening. The second parameter is the maximum number of pending connections that a Bluetooth server can store.

          int bt_socket_listen_and_accept_rfcomm(int socket_fd, int max_pending_connections)
          -
          • int socket_fd: socket fd passed from bt_socket_create_rfcomm(), which starts listening
          • -
          • int max_pending_connections: maximum number of pending connections that a Bluetooth server can store
          - - -

          You can be notified about which device connects to your device by using the bt_socket_connection_state_changed_cb() function.

          - -

          The callback function is declared as follows:

          -
          typedef void (* bt_socket_connection_state_changed_cb) (int result, bt_socket_connection_state_e connection_state, bt_socket_connection_s *connection, void *user_data)
          - -

          The first parameter, result, is the change in the connection state. The second parameter, connection_state, is the connection state, itself, either BT_SOCKET_CONNECTED or BT_SOCKET_DISCONNECTED. The third parameter is the pointer to the structure bt_socket_connection_s, which can specify an RFCOMM Bluetooth socket. The bt_socket_connection_s structure contains socket_fd, role (client or server), and the opposite Bluetooth device's MAC address. The fourth parameter, user_data, is user-defined data.

          +
        4. +
        5. +

          Get notified about which device connects to your device by using the bt_socket_connection_state_changed_cb() function. The first parameter, result, is the change in the connection state. The second parameter, connection_state, is the connection state, itself, either BT_SOCKET_CONNECTED or BT_SOCKET_DISCONNECTED. The third parameter is the pointer to the structure bt_socket_connection_s, which can specify an RFCOMM Bluetooth socket. The bt_socket_connection_s structure contains socket_fd, role (client or server), and the opposite Bluetooth device's MAC address. The fourth parameter, user_data, is user-defined data.

          -

          The example below shows how to implement a callback function and start listening for Bluetooth client devices.

          -
          void socket_connection_state_changed(int result, bt_socket_connection_state_e connection_state, bt_socket_connection_s *connection, void *user_data) 
          +
          +void 
          +socket_connection_state_changed(int result, bt_socket_connection_state_e connection_state,
          +                                bt_socket_connection_s *connection, void *user_data) 
           {
              if (result != BT_ERROR_NONE) 
              {
          @@ -713,9 +685,15 @@ else
              dlog_print(DLOG_INFO, LOG_TAG, "[bt_socket_listen_and_accept_rfcomm] Succeeded. bt_socket_connection_state_changed_cb will be called.");
              // Waiting for incoming connections
           }
          +

          If you do not want to accept any other connections or provide a service, call the bt_socket_destroy_rfcomm() function.

          +
        6. +
        +
      • -

        Connecting as a Client

        +
      • Connect as a client +
          +
        1. Set up the bt_socket_connection_state_changed_cb() function that is called when your device is connected to a Bluetooth server device.

          @@ -729,16 +707,10 @@ else - -

          Request a connection to the Bluetooth server. The server socket fd is used when you send data or disconnect.

          -
          bt_socket_connect_rfcomm (const char *remote_address, const char *remote_port_uuid)
          -

          The first parameter, remote_address, is the address of the remote device. You can get this from the bt_device_info_s structure.

          - -

          The second parameter, remote_port_uuid, is the UUID for the specific RFCOMM-based service on a remote device.

          -

          This remote_port_uuid must match the UUID used by the server device in the bt_socket_create_rfcomm() function.

          - -

          The example below shows how to connect to a specific RFCOMM-based service on a remote device.

          - +
        2. +
        3. +

          Request a connection to the Bluetooth server using the bt_socket_connect_rfcomm() function. The server socket fd is used when you send data or disconnect.

          +

          The first parameter is the address of the remote device. You can get this from the bt_device_info_s structure. The second parameter is the UUID for the specific RFCOMM-based service on a remote device. This remote_port_uuid must match the UUID used by the server device in the bt_socket_create_rfcomm() function.

          const char *service_uuid="00001101-0000-1000-8000-00805F9B34FB";
            
           ret = bt_socket_set_connection_state_changed_cb(socket_connection_state_changed, NULL);
          @@ -760,24 +732,24 @@ else
           {
              dlog_print(DLOG_INFO, LOG_TAG, "[bt_socket_connect_rfcomm] Succeeded. bt_socket_connection_state_changed_cb will be called.");
           }
          +
        4. +
        +
      • +

      Exchanging Data Using SPP

      To share data between devices after establishing a connection:

      -
      1. To write data, use the bt_socket_send_data() function.

        -

        This function is declared as follows:

        -
        int bt_socket_send_data(int socket_fd, const char *data, int length)
        -

        The first parameter, socket_fd, is the socket ID from the bt_socket_connection_state_changed_cb() function. The second parameter, data, is the data to write. The third parameter, length, is the data length.

      2. -
      3. To read data from other devices, you must set up the bt_socket_data_received_cb() callback that will be invoked when your device receives data from other Bluetooth devices.

        -

        To register a bt_socket_data_received_cb() callback function, call the bt_socket_set_data_received_cb() function. The callback function is declared as follows:

        -
        typedef void bt_socket_data_received_cb(bt_socket_received_data_s* data, void* user_data)
        -

        The first parameter, data, is the pointer to the structure bt_socket_received_data_s that can specify received data, data size, and socket fd. The second parameter, user_data, is user data. This callback will be called whenever your device receives data from other Bluetooth devices. You can read the data in the callback.

        +
        1. To write data, use the bt_socket_send_data() function. The first parameter is the socket ID from the bt_socket_connection_state_changed_cb() function. The second parameter is the data to write. The third parameter is the data length.

        2. +
        3. To read data from other devices, you must set up the bt_socket_data_received_cb() callback that is invoked when your device receives data from other Bluetooth devices.

          +

          To register a bt_socket_data_received_cb() callback function, call the bt_socket_set_data_received_cb() function. The first parameter is the pointer to the bt_socket_received_data_s structure that can specify received data, data size, and socket fd. The second parameter is user data. This callback is called whenever your device receives data from other Bluetooth devices. You can read the data in the callback.

          bt_error_e ret;
           char data[] = "Sending test";
           int client_socket_fd = 0;
           
          -void bt_socket_data_received_cb(bt_socket_received_data_s* data, void* user_data)
          +void 
          +bt_socket_data_received_cb(bt_socket_received_data_s* data, void* user_data)
           {
              if (data == NULL) 
              {
          @@ -806,7 +778,7 @@ if (ret != BT_ERROR_NONE)
           
           

          To disconnect from a device, call the bt_socket_destroy_rfcomm() or bt_socket_disconnect_rfcomm() function:

          -
          1. Disconnect the Bluetooth server: +
            • Disconnect the Bluetooth server:
              bt_error_e ret;
                
               // You can get "server_socket_fd" from output of bt_socket_create_rfcomm()
              @@ -832,19 +804,18 @@ if (ret != BT_ERROR_NONE)
               else 
               {
                  dlog_print(DLOG_INFO, LOG_TAG, "[bt_socket_destroy_rfcomm] Succeeded. server_socket_fd = %d.", server_socket_fd);
              -}
          +}
        4. -

          Performing GATT Client Operations

          -

          To perform GATT operations:

          +

          Managing the Client Operations

          +

          To perform GATT client operations:

          1. Register a callback for connection state changes:
             int ret = 0;
             // Register for GATT connection callback
            -void __bt_gatt_connection_state_changed_cb(int result, 
            -                                           bool connected, 
            -                                           const char *remote_address, 
            -                                           void *user_data) 
            +void
            +__bt_gatt_connection_state_changed_cb(int result, bool connected, 
            +                                      const char *remote_address, void *user_data) 
             {
                if (connected)
                   dlog_print(DLOG_INFO, LOG_TAG, "LE connected");
            @@ -863,7 +834,6 @@ if (ret == BT_ERROR_NONE)
                dlog_print(DLOG_INFO, LOG_TAG, "Success");
             break;
             
            -
          2. Unregister the callback registered for connection state changes: @@ -884,7 +854,7 @@ break;
  • -
  • Gets the address of remote device: +
  • Get the address of the remote device:
     int ret = 0;
     char *addr = NULL;
    @@ -901,9 +871,7 @@ break;
     
     int ret = 0;
     
    -ret = bt_gatt_client_foreach_services(client,
    -                                      __bt_gatt_client_foreach_svc_cb, 
    -                                      (void *)test_id);
    +ret = bt_gatt_client_foreach_services(client, __bt_gatt_client_foreach_svc_cb, (void *)test_id);
     if (ret != BT_ERROR_NONE) 
     {
        dlog_print(DLOG_INFO, LOG_TAG, "fail");
    @@ -913,7 +881,8 @@ break;
     
  • Use the bt_gatt_client_foreach_svc_cb() callback to initiate the service characteristics discovery:
    -bool __bt_gatt_client_foreach_svc_cb(int total, int index, bt_gatt_h svc_handle, void *data)
    +bool 
    +__bt_gatt_client_foreach_svc_cb(int total, int index, bt_gatt_h svc_handle, void *data)
     {
        int test_id = (int)data;
        int ret;
    @@ -933,7 +902,6 @@ bool __bt_gatt_client_foreach_svc_cb(int total, int index, bt_gatt_h svc_handle,
           {
              dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_service_foreach_characteristics is failed : %d", ret);
           }
    -
           return true;
        }
     }
    @@ -941,7 +909,8 @@ bool __bt_gatt_client_foreach_svc_cb(int total, int index, bt_gatt_h svc_handle,
     
  • Use the bt_gatt_client_foreach_chr_cb() callback to discover the characteristic descriptors:
    -bool __bt_gatt_client_foreach_chr_cb(int total, int index, bt_gatt_h chr_handle, void *data)
    +bool 
    +__bt_gatt_client_foreach_chr_cb(int total, int index, bt_gatt_h chr_handle, void *data)
     {
        int ret;
        char *uuid = NULL;
    @@ -964,7 +933,8 @@ bool __bt_gatt_client_foreach_chr_cb(int total, int index, bt_gatt_h chr_handle,
     
  • Use the bt_gatt_client_foreach_desc_cb() callback to get the descriptor data:
    -bool __bt_gatt_client_foreach_desc_cb(int total, int index, bt_gatt_h desc_handle, void *data)
    +bool 
    +__bt_gatt_client_foreach_desc_cb(int total, int index, bt_gatt_h desc_handle, void *data)
     {
        char *uuid = NULL;
     
    @@ -973,7 +943,6 @@ bool __bt_gatt_client_foreach_desc_cb(int total, int index, bt_gatt_h desc_handl
        dlog_print(DLOG_INFO, LOG_TAG, "\t\t[%d / %d] uuid : (%s)", index, total, uuid);
        __bt_gatt_client_print_value(desc_handle);
     
    -   g_free(str);
        g_free(uuid);
     
        return true;
    @@ -982,7 +951,6 @@ bool __bt_gatt_client_foreach_desc_cb(int total, int index, bt_gatt_h desc_handl
     
  • -
  • Read the value of the given attribute handle:
     {
    @@ -1041,22 +1009,21 @@ bool __bt_gatt_client_foreach_desc_cb(int total, int index, bt_gatt_h desc_handl
        {
           dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_read_value is failed : %d", ret);
        }
    -
        __bt_free_test_param(&g_test_param);
     }
     

    After the reading operation is complete, use the bt_gatt_client_read_complete_cb() callback to handle values:

    -void __bt_gatt_client_read_complete_cb(int result, bt_gatt_h gatt_handle, void *data)
    +void 
    +__bt_gatt_client_read_complete_cb(int result, bt_gatt_h gatt_handle, void *data)
     {
        char *uuid = NULL;
     
        bt_gatt_get_uuid(gatt_handle, &uuid);
     
    -   dlog_print(DLOG_INFO, LOG_TAG, "Read %s for uuid : (%s)",
    +   dlog_print(DLOG_INFO, LOG_TAG, "Read %s for uuid : (%s)", 
                   result == BT_ERROR_NONE ? "Success" : "Fail", uuid);
     
    -   g_free(str);
        g_free(uuid);
     
        if (result != BT_ERROR_NONE)
    @@ -1147,30 +1114,28 @@ void __bt_gatt_client_read_complete_cb(int result, bt_gatt_h gatt_handle, void *
        {
           dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_write_value is failed : %d", ret);
        }
    -
        __bt_free_test_param(&g_test_param);
     }
     

    After the writing operation is complete, use the bt_gatt_client_write_complete_cb() callback to finish the task:

    -void __bt_gatt_client_write_complete_cb(int result, bt_gatt_h gatt_handle, void *data)
    +void 
    +__bt_gatt_client_write_complete_cb(int result, bt_gatt_h gatt_handle, void *data)
     {
        char *uuid = NULL;
     
        bt_gatt_get_uuid(gatt_handle, &uuid);
     
    -   dlog_print(DLOG_INFO, LOG_TAG, "Write %s for uuid : (%s)",
    +   dlog_print(DLOG_INFO, LOG_TAG, "Write %s for uuid : (%s)", 
                   result == BT_ERROR_NONE ? "Success" : "Fail", uuid);
     
    -   g_free(str);
        g_free(uuid);
     
        return;
     }
     
  • - -
  • Registers a callback function to be invoked when the characteristic value is changed on the remote device: +
  • Register a callback function to be invoked when the characteristic value changes on the remote device:
     {
    @@ -1193,7 +1158,7 @@ void __bt_gatt_client_write_complete_cb(int result, bt_gatt_h gatt_handle, void
        {
           dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_get_service is failed : %d", ret);
           __bt_free_test_param(&g_test_param);
    -   break;
    +      break;
        }
     
        ret = bt_gatt_service_get_characteristic(svc, chr_uuid, &chr);
    @@ -1204,8 +1169,7 @@ void __bt_gatt_client_write_complete_cb(int result, bt_gatt_h gatt_handle, void
           break;
        }
     
    -   ret = bt_gatt_client_set_characteristic_value_changed_cb(chr,
    -     __bt_gatt_client_value_changed_cb, NULL);
    +   ret = bt_gatt_client_set_characteristic_value_changed_cb(chr, __bt_gatt_client_value_changed_cb, NULL);
        if (ret != BT_ERROR_NONE)
        {
           dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_set_characteristic_value_changed_cb is failed : %d", ret);
    @@ -1213,10 +1177,10 @@ void __bt_gatt_client_write_complete_cb(int result, bt_gatt_h gatt_handle, void
        }
     }
     
    -

    After registering callback operation, use the __bt_gatt_client_value_changed_cb() callback to display the changed value:

    +

    After registering the callback operation, use the __bt_gatt_client_value_changed_cb() callback to display the changed value:

    -void __bt_gatt_client_value_changed_cb(bt_gatt_h chr, char *value, int len,
    -  void *user_data)
    +void 
    +__bt_gatt_client_value_changed_cb(bt_gatt_h chr, char *value, int len, void *user_data)
     {
        char *uuid = NULL;
        int i;
    @@ -1227,9 +1191,8 @@ void __bt_gatt_client_value_changed_cb(bt_gatt_h chr, char *value, int len,
        dlog_print(DLOG_INFO, LOG_TAG, "len [%d]", len);
        for (i = 0; i < len; i++)
        {
    -    dlog_print(DLOG_INFO, LOG_TAG, "value %u", value[i]);
    +      dlog_print(DLOG_INFO, LOG_TAG, "value %u", value[i]);
        }
    -
        g_free(uuid);
     
        return;
    @@ -1237,7 +1200,7 @@ void __bt_gatt_client_value_changed_cb(bt_gatt_h chr, char *value, int len,
     
  • -
  • Unregisters the registered characteristic value changed callback. After Unregistration, the value change will not be informed: +
  • Unregister the callback for characteristic value changes. Afterwards, you are not notified of the value changes.
     {
    @@ -1260,7 +1223,7 @@ void __bt_gatt_client_value_changed_cb(bt_gatt_h chr, char *value, int len,
        {
           dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_get_service is failed : %d", ret);
           __bt_free_test_param(&g_test_param);
    -   break;
    +      break;
        }
     
        ret = bt_gatt_service_get_characteristic(svc, chr_uuid, &chr);
    @@ -1293,17 +1256,19 @@ break;
     
  • -

    Performing GATT Client Common Getter Operations

    -

    To perform Getter operations for both GATT Client related information:

    -
      -
    1. Gets the type of a service, characteristic or descriptor's GATT handle: + + +

      Managing Common Getter Operations

      +

      To perform getter operations for client-related information:

      +
        +
      • Get the type of a service, characteristic, or descriptor handle:
         {
            int ret = 0;
            bt_gatt_h gatt_handle = NULL;
            bt_gatt_type_e gatt_type;
         
        -   // Handle is already created either for Service/Characteristic/Descriptor using
        +   // Handle is already created for service/characteristic/descriptor
         
            ret = bt_gatt_get_type(gatt_handle, &gatt_type);
            if (ret != BT_ERROR_NONE)
        @@ -1313,14 +1278,14 @@ break;
         }
         
      • -
      • Gets the UUID of a service, characteristic or descriptor's GATT handle: +
      • Get the UUID of a service, characteristic, or descriptor handle:
         {
            int ret = 0;
            bt_gatt_h gatt_handle = NULL;
            char *uuid = NULL;
         
        -   // Handle is already created either for Service/Characteristic/Descriptor using
        +   // Handle is already created for service/characteristic/descriptor
         
            ret = bt_gatt_get_uuid(gatt_handle, &uuid);
            if (ret != BT_ERROR_NONE)
        @@ -1330,7 +1295,7 @@ break;
         }
         
      • -
      • Gets the value of a characteristic or descriptor's GATT handle: +
      • Get the value of a characteristic or descriptor handle:
         {
            int ret = 0;
        @@ -1338,7 +1303,7 @@ break;
            bt_gatt_h gatt_handle = NULL;
            char *value = NULL;
         
        -   // Handle is already created either for Characteristic/Descriptor using
        +   // Handle is already created for characteristic/descriptor
         
            ret = bt_gatt_get_value(gatt_handle, &value, &len);
            if (ret != BT_ERROR_NONE)
        @@ -1348,7 +1313,7 @@ break;
         }
         
      • -
      • Gets the value of a characteristic or descriptor's GATT handle as an integer type: +
      • Get the value of a characteristic or descriptor handle as an integer type:
         {
            int ret = 0;
        @@ -1357,7 +1322,7 @@ break;
            bt_gatt_h gatt_handle = NULL;
            int value;
         
        -   // Assuming All the input parameters[gatt_handle, type& offset] available.
        +   // Assuming all the input parameters (gatt_handle, type, and offset) are available
         
            ret = bt_gatt_get_int_value(gatt_handle, type, offset, &value);
            if (ret != BT_ERROR_NONE)
        @@ -1367,7 +1332,7 @@ break;
         }
         
      • -
      • Gets the value of a characteristic or descriptor's GATT handle as a float type: +
      • Get the value of a characteristic or descriptor handle as a float type:
         {
            int ret = 0;
        @@ -1376,7 +1341,7 @@ break;
            bt_gatt_h gatt_handle = NULL;
            float value;
         
        -   // Assuming All the input parameters[gatt_handle, type& offset] available.
        +   // Assuming all the input parameters (gatt_handle, type, and offset) are available
         
            ret = bt_gatt_get_float_value(gatt_handle, type, offset, &value);
            if (ret != BT_ERROR_NONE)
        @@ -1386,7 +1351,7 @@ break;
         }
         
      • -
      • Gets a service's GATT handle which has specific UUID: +
      • Get a service handle with a specific UUID:
         {
            char *svc_uuid = NULL;
        @@ -1409,7 +1374,7 @@ break;
         }
         
      • -
      • Gets a characteristic's GATT handle which has specific UUID: +
      • Get a characteristic handle with a specific UUID:
         {
            char *svc_uuid = NULL;
        @@ -1443,7 +1408,7 @@ break;
         }
         
      • -
      • Gets a descriptor's GATT handle which has specific UUID: +
      • Get a descriptor handle with a specific UUID:
         {
            char *svc_uuid = NULL;
        @@ -1490,13 +1455,13 @@ break;
         }
         
      • -
      • Gets the properties using characteristic's GATT handle: +
      • Get the properties using the characteristic handle:
         {
            bt_gatt_h chr = NULL;
            int properties;
         
        -   //get the characteristic handle using bt_gatt_service_get_characteristic()
        +   // Get the characteristic handle using bt_gatt_service_get_characteristic()
         
            ret = bt_gatt_characteristic_get_properties(chr, &properties);
            if (ret != BT_ERROR_NONE)
        @@ -1506,12 +1471,12 @@ break;
         }
         
      • -
      • Gets the service's GATT handle for which the specified characteristic belongs to: +
      • Get the service handle to which the specified characteristic belongs:
         {
            bt_gatt_h svc = NULL;
            bt_gatt_h chr = NULL;
        -   //chr = Assuming characteristic's handle is already available
        +   // chr = Assuming characteristic handle is already available
         
            ret = bt_gatt_characteristic_get_service(chr, &svc);
            if (ret != BT_ERROR_NONE)
        @@ -1521,12 +1486,12 @@ break;
         }
         
      • -
      • Gets the characteristic's GATT handle for which the specified descriptor belongs to: +
      • Get the characteristic handle to which the specified descriptor belongs:
         {
            bt_gatt_h chr = NULL;
            bt_gatt_h dsc = NULL;
        -   //dsc = Assuming descriptor's handle is already available.
        +   // dsc = Assuming descriptor handle is already available
         
            ret = bt_gatt_descriptor_get_characteristic(des, &chr);
            if (ret != BT_ERROR_NONE)
        @@ -1536,12 +1501,12 @@ break;
         }
         
      • -
      • Gets the GATT client handle for which the specified service belongs to: +
      • Get the client handle to which the specified service belongs:
         {
            bt_gatt_h svc = NULL;
            bt_gatt_client_h client = NULL;
        -   //svc = Assuming service's handle is already available.
        +   // svc = Assuming service handle is already available
         
            ret = bt_gatt_service_get_client(svc, &client);
            if (ret != BT_ERROR_NONE)
        @@ -1551,12 +1516,12 @@ break;
         }
         
      • -
      • Gets the write type of the specified characteristic: +
      • Get the write type of the specified characteristic:
         {
            bt_gatt_h chr = NULL;
            bt_gatt_write_type_e write_type = NULL;
        -   //svc = Assuming characteristic's handle is already available.
        +   // svc = Assuming characteristic handle is already available
         
            ret = bt_gatt_characteristic_get_write_type(chr, &write_type);
            if (ret != BT_ERROR_NONE)
        @@ -1566,14 +1531,14 @@ break;
         }
         
      • -
      • Gets an included service's GATT handle which has specific UUID: +
      • Get an included service's handle with a specific UUID:
         {
            bt_gatt_h svc = NULL;
            bt_gatt_h included_svc = NULL;
            char *uuid = NULL;
            bt_gatt_write_type_e write_type = NULL;
        -   //svc = Assuming service's handle and UUID are already available.
        +   // svc = Assuming service handle and UUID are already available
         
            ret = bt_gatt_service_get_included_service(svc, uuid, &included_svc);
            if (ret != BT_ERROR_NONE)
        @@ -1582,103 +1547,109 @@ break;
            }
         }
         
      • -
    -

    Gatt Client/Server Common setter operations

    + + +

    Managing Common Setter Operations

    + +

    The setter operations are common for the client role.

    -

    Set the properties and values of the attribute, These operations are common for Server and Client roles.

    +

    To set the properties and values of attributes:

      -
    1. Set/Update characteristic Value, value of the type unit8 or char: +
    2. Set or update the characteristic value (unit8 or char type value):
      -   int ret = 0;
      -   char char_value[1] = {1 + (rand()%100)};
      +int ret = 0;
      +char char_value[1] = {1 + (rand()%100)};
       
      -/* In case of Client, the characteristic handle shall be retrived from the client created using gatt_client_create(),
      - * using the  bt_gatt_service_get_characteristic()*/
      +// For client, the characteristic handle is retrieved from the client created using gatt_client_create()
      +// by using bt_gatt_service_get_characteristic()
       
      -   ret = bt_gatt_set_value(characteristic_handle, char_value, 1);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_set_value(characteristic_handle, char_value, 1);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
    3. -
    4. Set/Update characteristic Value, value of the type integer: +
    5. Set or update the characteristic value (integer type value):
      -   int ret = 0;
      -   int char_value = 60 + (rand()%60);
      +int ret = 0;
      +int char_value = 60 + (rand()%60);
       
      -/* In case of Client, the characteristic handle shall be retrived from the client created using gatt_client_create(),
      - * using the  bt_gatt_service_get_characteristic()*/
      +// For client, the characteristic handle is retrieved from the client created using gatt_client_create()
      +// by using bt_gatt_service_get_characteristic()
       
      -   ret = bt_gatt_set_int_value(characteristic_handle, BT_DATA_TYPE_UINT16, char_value, 1);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_set_int_value(characteristic_handle, BT_DATA_TYPE_UINT16, char_value, 1);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
    6. -
    7. Set/Update characteristic Value, value of the type float: +
    8. Set or update the characteristic value (float type value):
      -   int ret = 0;
      +int ret = 0;
       
      -/* In case of Client, the characteristic handle shall be retrived from the client created using gatt_client_create(),
      - * using the  bt_gatt_service_get_characteristic()*/
      +// For client, the characteristic handle is retrieved from the client created using gatt_client_create()
      +// by using bt_gatt_service_get_characteristic()
       
      -    /* Here the char value is, value: 123 exponent -2 */
      -   ret = bt_gatt_set_float_value(characteristic_handle, BT_DATA_TYPE_FLOAT, 123, -2, 1);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +// Here the char value is, value: 123 exponent -2
      +ret = bt_gatt_set_float_value(characteristic_handle, BT_DATA_TYPE_FLOAT, 123, -2, 1);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
    9. -
    10. Set characteristic write type: +
    11. Set the characteristic write type:
      -   int ret = 0;
      -   bt_gatt_h svc = NULL;
      -   bt_gatt_h control_point = NULL;
      -   char *svc_uuid = "000018f2-0000-1000-8000-00805f9b34fb";
      -   char *chr_uuid = "00002af6-0000-1000-8000-00805f9b34fb";
      +int ret = 0;
      +bt_gatt_h svc = NULL;
      +bt_gatt_h control_point = NULL;
      +char *svc_uuid = "000018f2-0000-1000-8000-00805f9b34fb";
      +char *chr_uuid = "00002af6-0000-1000-8000-00805f9b34fb";
       
      -   ret = bt_gatt_client_get_service(client, svc_uuid, &ancs_svc);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_client_get_service(client, svc_uuid, &ancs_svc);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
      -   ret = bt_gatt_service_get_characteristic(svc, chr_uuid, &control_point);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_service_get_characteristic(svc, chr_uuid, &control_point);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
      -   ret = bt_gatt_characteristic_set_write_type(control_point,
      -   			BT_GATT_WRITE_TYPE_WRITE);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_characteristic_set_write_type(control_point,
      +                                            BT_GATT_WRITE_TYPE_WRITE);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
      -   ret = bt_gatt_set_value(control_point, value, len);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_set_value(control_point, value, len);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
      -   ret = bt_gatt_client_write_value(control_point,
      -   			__write_completed_cb, NULL);
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +ret = bt_gatt_client_write_value(control_point, __write_completed_cb, NULL);
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
      -   return ret;
      +return ret;
       
      -   if (ret == BT_ERROR_NONE)
      -      dlog_print(DLOG_INFO, LOG_TAG, "Success");
      +if (ret == BT_ERROR_NONE)
      +   dlog_print(DLOG_INFO, LOG_TAG, "Success");
       
    -

    Exchanging Data Using OPP

    -

    To exchange data with Object Push Profile (OPP):

    +

    Exchanging Data Using OPP

    The OPP is a basic profile for sending objects, such as pictures, virtual business cards, or schedules. The sender, which is a client, always initiates the transactions (called "push"), not the receiver, which is a server.

    - -

    Server Role

    +

    To exchange data with Object Push Profile (OPP):

    +
      +
    • Exchange data in server role. +
        +
      1. The API has a server role to initialize the status of an OPP server device.

        +

        The following example initializes the OPP server device requested by the bt_opp_server_push_requested_cb(). The bt_opp_server_connection_requested_cb function is called when an OPP connection is requested.

         bt_error_e ret;
         char *directory = NULL;
         storage_get_directory(0, STORAGE_DIRECTORY_DOWNLOADS, &directory);
         
        -void connection_requested_cb_for_opp_server(const char *remote_address, void *user_data)
        +void 
        +connection_requested_cb_for_opp_server(const char *remote_address, void *user_data)
         {
            dlog_print(DLOG_INFO, LOG_TAG, "remote_address: %s", remote_address);
         }
        @@ -1689,21 +1660,23 @@ if (ret != BT_ERROR_NONE)
         }
         free(directory);
         
        -

        This function initializes the OPP server device requested by the bt_opp_server_push_requested_cb(). The bt_opp_server_connection_requested_cb function is called when an OPP connection is requested.

        - +
      2. +
      3. When a client requests a file push, the server can accept or reject it using the following functions:

         bt_error_e ret;
         const char file_name [18] = "tempfile";
         
        -void bt_opp_server_transfer_progress_cb_for_opp(const char *file, long long size, int percent, void *user_data)
        +void 
        +bt_opp_server_transfer_progress_cb_for_opp(const char *file, long long size, int percent, void *user_data)
         {
            dlog_print(DLOG_INFO, LOG_TAG, "file: %s", file);
            dlog_print(DLOG_INFO, LOG_TAG, "size: %ld", size);
            dlog_print(DLOG_INFO, LOG_TAG, "percent: %d", percent);
         }
         
        -void bt_opp_server_transfer_finished_cb_for_opp(int result, const char *file, long long size, void *user_data)
        +void 
        +bt_opp_server_transfer_finished_cb_for_opp(int result, const char *file, long long size, void *user_data)
         {
            dlog_print(DLOG_INFO, LOG_TAG, "result: %d", result);
            dlog_print(DLOG_INFO, LOG_TAG, "file: %s", file);
        @@ -1724,8 +1697,12 @@ if (ret != BT_ERROR_NONE)
            dlog_print(DLOG_ERROR, LOG_TAG, "[bt_opp_server_reject] Failed.");
         }
         
        - -

        Client Role

        +
      4. +
      +
    • +
    • Exchange data in client role. +
        +
      1. Initialize the client using the bt_opp_client_initialize() function:

         bt_error_e ret;
        @@ -1738,7 +1715,9 @@ if (ret != BLUETOOTH_ERROR_NONE)
            return -1;
         }
         
        -

        You can get the information of a file that can be sent to the server device using the bt_opp_client_add_file() function:

        +
      2. +
      3. +

        Get the information of a file that can be sent to the server device using the bt_opp_client_add_file() function:

         bt_error_e ret;
         char *resource_path = NULL;
        @@ -1757,31 +1736,37 @@ if (ret != BLUETOOTH_ERROR_NONE)
            return -1;
         }
         
        -

        You can send the files to the server using the bt_opp_client_push_files() function:

        +
      4. +
      5. +

        Send the files to the server using the bt_opp_client_push_files() function:

         bt_error_e ret;
         char remote_addr[18] = REMOTE_DEVICE_MAC_ADDRESS;
         
        -void __bt_opp_client_push_responded_cb(int result,
        -                                       const char *remote_address,
        -                                       void *user_data)
        +void 
        +__bt_opp_client_push_responded_cb(int result,
        +                                  const char *remote_address,
        +                                  void *user_data)
         {
            dlog_print(DLOG_INFO, LOG_TAG, "result: %d", result);
            dlog_print(DLOG_INFO, LOG_TAG, "remote_address: %s", remote_address);
         }
         
        -void __bt_opp_client_push_progress_cb(const char *file,
        -                                      long long size,
        -                                      int percent,
        -                                      void *user_data)
        +void 
        +__bt_opp_client_push_progress_cb(const char *file,
        +                                 long long size,
        +                                 int percent,
        +                                 void *user_data)
         {
            dlog_print(DLOG_INFO, LOG_TAG, "size: %ld", (long)size);
            dlog_print(DLOG_INFO, LOG_TAG, "percent: %d", percent);
            dlog_print(DLOG_INFO, LOG_TAG, "file: %s", file);
         }
        -void __bt_opp_client_push_finished_cb(int result,
        -                                      const char *remote_address,
        -                                      void *user_data)
        +
        +void 
        +__bt_opp_client_push_finished_cb(int result,
        +                                 const char *remote_address,
        +                                 void *user_data)
         {
            dlog_print(DLOG_INFO, LOG_TAG, "result: %d", result);
            dlog_print(DLOG_INFO, LOG_TAG, "remote_address: %s", remote_address);
        @@ -1798,7 +1783,8 @@ else
            dlog_print(DLOG_INFO, LOG_TAG, "[bt_opp_client_push_files] Succeeded.");
         }
         
        - +
      6. +
      7. After the push is finished by the client, call the bt_opp_client_clear_files() and bt_opp_client_deinitialize() to release the Bluetooth resources related to the OPP client:

         bt_error_e ret;
        @@ -1821,18 +1807,22 @@ if (ret != BLUETOOTH_ERROR_NONE)
            return -1;
         }
         
        +
      8. +
      +
    • +
    + - -

    Managing Bluetooth LE Scans

    -

    To discover nearby LE devices, perform a LE scan operation:

    +

    To discover nearby LE devices, perform an LE scan operation:

    1. To start the BLE scan:

      -int main()
      +int 
      +main()
       {
          int ret = BT_ERROR_NONE;
          ret = bt_adapter_le_start_scan(__bt_adapter_le_scan_result_cb, NULL);
      @@ -1841,7 +1831,6 @@ int main()
          {
             dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_le_start_scan] Failed.");
          }
      -
          return;
       }
       
      @@ -1853,9 +1842,10 @@ int main()
       int ret;
       
      -void __bt_adapter_le_scan_result_cb(int result,
      -                                    bt_adapter_le_device_scan_result_info_s *info, 
      -                                    void *user_data)
      +void 
      +__bt_adapter_le_scan_result_cb(int result,
      +                                bt_adapter_le_device_scan_result_info_s *info, 
      +                                void *user_data)
       {
          bt_adapter_le_packet_type_e pkt_type = BT_ADAPTER_LE_PACKET_ADVERTISING;
       
      @@ -1948,7 +1938,8 @@ void __bt_adapter_le_scan_result_cb(int result,
       
    2. To stop the BLE scan operation:

      -int main()
      +int 
      +main()
       {
          int ret = BT_ERROR_NONE;
          ret = bt_adapter_le_stop_scan();
      @@ -1957,7 +1948,6 @@ int main()
          {
             dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_le_stop_scan] Failed.");
          }
      -
          return;
       }
       
      @@ -1966,13 +1956,24 @@ int main()

      Discovering Bluetooth LE Devices

      -

      Perform LE discovery operation to discover nearby Bluetooth LE Devices. Callbacks can be registered and unregistered for the LE discovery operation through the use of set and unset callback functions

      -

      The registered device discovery call back provides details of the discovered devices and state of discovery (started, finished, found):

      -

      To start the BLE discovery operation. Please note, the below described BLE discovery apis are deprecated since tizen_2.3.1

      -

      Please refer to the section "Managing Bluetooth LE Scans" for scanning nearby BLE devices. +

      Perform the LE discovery operation to discover nearby Bluetooth LE devices. You can register and unregister callbacks for the LE discovery operation through the use of set and unset callback functions. The registered device discovery callback provides details of the discovered devices and the state of the discovery (started, finished, found).

      + + + + + + + + + + +
      Note
      The APIs used in this use case are deprecated since Tizen 2.3.1. For scanning nearby BLE devices in Tizen 2.3.1 and later, see Managing Bluetooth LE Scans.
      + +

      To start the BLE discovery operation:

      -int main()
      +int 
      +main()
       {
          int ret = BT_ERROR_NONE;
       
      @@ -1984,29 +1985,28 @@ int main()
          {
             dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_le_start_device_discovery] Failed.");
          }
      -
      -/* To unset the le device discovery state change call back*/
      +   // To unset the LE device discovery state change callback
          ret = bt_adapter_le_unset_device_discovery_state_changed_cb
      -   
       
          return;
       }
       
      -
    - -

    Add Advertising Data to the LE Advertisement

    + +

    Adding Advertising Data to the LE Advertisement

    LE advertising data can be added to the LE advertisement or the scan response data. You can add various information, such as the device name, service UUID, service solicitation UUID, advertising appearance, advertising transmission power level, device name, and manufacturer data.

    -
      -
    1. -

      To add the advertising data:

      +

      To add the advertising data:

      +
        +
      1. +

        Add the advertising data:

         static bt_advertiser_h advertiser = NULL;
         static bt_advertiser_h advertiser_list[3] = {NULL, };
         static int advertiser_index = 0;
         
        -int le_add_advertising_data()
        +int 
        +le_add_advertising_data()
         {
            int adv_data_type = 3; // Default all
            int manufacturer_id = 117;
        @@ -2162,19 +2162,18 @@ int le_add_advertising_data()
               dlog_print(DLOG_INFO, LOG_TAG, "add manufacturer data [0x%04x]", ret);
         }
         
        +
      2. - -

        To destroy the LE advertiser:

        +

        When you are done, destroy the LE advertiser:

         {
            int ret = BT_ERROR_NONE;
            ret = bt_adapter_le_destroy_advertiser(advertiser);
        -
        + 
            if (ret != BT_ERROR_NONE)
            {
               dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_le_destroy_advertiser] Failed.");
            }
        -
            return;
         }
         
        @@ -2245,7 +2244,8 @@ if (ret != BT_ERROR_NONE)    dlog_print(DLOG_INFO, LOG_TAG, "add scan response data [0x%04x]", ret);
    -

    Start and Stop Advertising

    +

    Starting and Stopping Advertising

    +

    To manage advertising:

    1. To start advertising with the given advertiser and advertising parameters information, use the bt_adapter_le_start_advertising_new() function:

      @@ -2272,18 +2272,20 @@ ret = bt_adapter_le_start_advertising_new(advertiser, cb, NULL); if (ret < BT_ERROR_NONE)    dlog_print(DLOG_INFO, LOG_TAG, "failed with [0x%04x]", ret);
  • +
  • To stop advertising with the given advertiser, use the bt_adapter_le_stop_advertising() function:

     if (advertiser != NULL)
     {
    -ret = bt_adapter_le_stop_advertising(advertiser);
    -if (ret < BT_ERROR_NONE)
    -   dlog_print(DLOG_INFO, LOG_TAG, "failed with [0x%04x]", ret);
    +   ret = bt_adapter_le_stop_advertising(advertiser);
    +   if (ret < BT_ERROR_NONE)
    +      dlog_print(DLOG_INFO, LOG_TAG, "failed with [0x%04x]", ret);
     }
    -
    +
  • +

    Releasing All Resources

    @@ -2328,4 +2330,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.tutorials/html/native/network/connection_tutorial_n.htm b/org.tizen.tutorials/html/native/network/connection_tutorial_n.htm index 276a948..6e329c5 100644 --- a/org.tizen.tutorials/html/native/network/connection_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/connection_tutorial_n.htm @@ -18,7 +18,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    @@ -335,7 +335,7 @@ if (error_code != CONNECTION_ERROR_NONE)

    To initialize a socket for use:

      -
    1. To use the functions and data types of the Socket API, include the following header files: +
    2. To use the functions and data types of the Socket API, include the following header files in your application:
       #include <sys/stat.h>
       #include <arpa/inet.h>
      diff --git a/org.tizen.tutorials/html/native/network/network_tutorials_n.htm b/org.tizen.tutorials/html/native/network/network_tutorials_n.htm
      index f1dae2b..d546470 100644
      --- a/org.tizen.tutorials/html/native/network/network_tutorials_n.htm
      +++ b/org.tizen.tutorials/html/native/network/network_tutorials_n.htm
      @@ -18,7 +18,7 @@
       
       
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      @@ -40,7 +40,7 @@
    3. Connection: Managing Modem Data Connections

      Demonstrates how you can get network connection information, such as default gateway and proxy configuration, IPv4/IPv6 address, cellular connection state, and data transfer statistics.

    4. Bluetooth: Managing Bluetooth Devices

      Demonstrates how you can enable Bluetooth, connect to other devices, and exchange data.

    5. NFC: Managing Near Field Radio Communication

      Demonstrates how you can activate NFC and get cached NFC messages and send and receive NDEF messages using the NFC P2P mode.

    6. -
    7. SmartCard: Accessing Secure Elements

      Demonstrates how you can access secure elements (SE) through smart card features.

    8. +
    9. Smartcard: Accessing Secure Elements

      Demonstrates how you can access secure elements (SE) through smart card features.

    10. Wi-Fi: Managing Wi-Fi and Monitoring Its State

      Demonstrates how you can manage Wi-Fi connections and monitor the Wi-Fi state.

    11. diff --git a/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm b/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm index e9a939d..57f97c4 100644 --- a/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm @@ -18,7 +18,7 @@
    12. NFC P2P bump @@ -68,10 +68,11 @@

      Initialize NFC asynchronously, set the NFC tag filter, and register all necessary NFC callbacks.

    13. Getting a Cached NFC Message

      Initialize NFC synchronously and get a cached NFC message.

    14. -
    15. Using the Card_Emulation Feature -

      Create a Card Emulation application.

    16. -
    17. NFC Application Control -

      Using NFC Application Control.

    18. +
    19. Using the Card Emulation Feature +

      Create a card emulation application.

    20. +
    21. Using the NFC Application Control +

      Use the NFC application control to manage events.

    22. +
    23. NFC P2P bump @@ -96,8 +97,8 @@

      In the NFC tutorial, the NFC API (in mobile and wearable applications) is used to write an application which initializes the NFC adapter and registers callbacks called in case of each connection scenario, so the user is able to work with NFC manually. By connecting your device to the other NFC point (tag, device, or sales terminal), you can invoke the specified callback registered earlier. The second scenario of this tutorial shows how to get the message cached by NFC.

      To initialize NFC:

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

        +
        1. +

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

           #include <nfc.h>
           
        2. @@ -108,7 +109,7 @@    gmainloop = g_main_loop_new(NULL, FALSE);    bool is_nfc_supported = nfc_manager_is_supported();    if (!is_nfc_supported) -      dlog_print(DLOG_INFO, LOG_TAG, "is_nfc_supported NOT SUPPORTED"); +      dlog_print(DLOG_INFO, LOG_TAG, "is_nfc_supported NOT SUPPORTED"); }

    The gmainloop, which is being created here, is used to wait for the results of calling asynchronous functions.

  • @@ -196,9 +197,9 @@ g_main_loop_run(gmainloop);
    static void on_nfc_activation_changed(bool activated, void *user_data)
     {
        if (activated)
    -      dlog_print(DLOG_INFO, LOG_TAG, "NFC activated");
    +      dlog_print(DLOG_INFO, LOG_TAG, "NFC activated");
        else
    -      dlog_print(DLOG_INFO, LOG_TAG, "NFC deactivated");
    +      dlog_print(DLOG_INFO, LOG_TAG, "NFC deactivated");
     }

    So in our example, this callback only informs the user that the activation state has changed.

  • @@ -259,7 +260,7 @@ if (NFC_ERROR_NONE != error_code) // Error occurred

    The on_nfc_tag_information_event() callback in this tutorial is really simple. It just prints out the found keys and their values.

    on_nfc_tag_information_event(const char *key, const unsigned char *value, int value_size, void *user_data)
     {
    -   dlog_print(DLOG_INFO, LOG_TAG, "Title: %s, Value: %s", key, (char*)value);
    +   dlog_print(DLOG_INFO, LOG_TAG, "Title: %s, Value: %s", key, (char*)value);
     
        return true;
     }
    @@ -393,13 +394,13 @@ if (NFC_ERROR_NONE != error_code) // Error occurred    nfc_ndef_record_h record;    nfc_ndef_message_get_record_count(message, &count); -   dlog_print(DLOG_INFO, LOG_TAG, "on_nfc_ndef_discovered %d", count); +   dlog_print(DLOG_INFO, LOG_TAG, "on_nfc_ndef_discovered %d", count);    for (i=0; i<count; i++)    {       nfc_ndef_message_get_record(message, i, &record); -      nfc_ndef_record_get_payload (record, &payload, &size); -      dlog_print(DLOG_INFO, LOG_TAG, "Record Number : %d, Payload : %s", i, payload); +      nfc_ndef_record_get_payload(record, &payload, &size); +      dlog_print(DLOG_INFO, LOG_TAG, "Record Number : %d, Payload : %s", i, payload);    } } @@ -429,7 +430,7 @@ if (NFC_ERROR_NONE != error_code) // Error occurred
    static void on_nfc_p2p_read_completed(nfc_p2p_target_h target, nfc_ndef_message_h message, void *user_data)
     {
        int count;
    -   dlog_print(DLOG_INFO, LOG_TAG, "on_nfc_p2p_read_completed");
    +   dlog_print(DLOG_INFO, LOG_TAG, "on_nfc_p2p_read_completed");
     
        nfc_ndef_message_get_record_count(message, &count);
        nfc_ndef_message_read_cb(clone_message(message));
    @@ -448,19 +449,19 @@ if (NFC_ERROR_NONE != error_code) // Error occurred
          // This event notifies the terminal host that it shall launch       // an application associated with an NFC application in a       // UICC (Universal Integrated Circuit Card) host -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Start Transaction"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Start Transaction");       break;    case NFC_SE_EVENT_END_TRANSACTION:       // This event notifies the terminal host that the current transaction       // in process was ended -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: End Transaction"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: End Transaction");       break;    case NFC_SE_EVENT_CONNECTIVITY:       // It is a ready signal to communicate UICC (Universal Integrated Circuit       // Card) with terminal host. \nUICC (Universal Integrated Circuit Card)       // creates a pipe and opens the pipe channel.\nThen it sends the signal       // to terminal host or host controller -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Connectivity"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Connectivity");       break;    case NFC_SE_EVENT_FIELD_ON:       // When the CLF (Contactless Front-end) detects 5ra RF field, the card @@ -469,7 +470,7 @@ if (NFC_ERROR_NONE != error_code) // Error occurred       // the CLF shall send the #NFC_SE_EVENT_FIELD_ON on all open pipes       // to these gates. Next the CLF starts the initialization       // and anti-collision process as defined in ISO/IEC 14443-3 [6] -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Field ON"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Field ON");       break;    case NFC_SE_EVENT_FIELD_OFF:       // When the CLF (Contactless Front-end) detects that the RF field @@ -477,15 +478,15 @@ if (NFC_ERROR_NONE != error_code) // Error occurred       // the card application gate.\nWhen there are multiple open card RF       // gates the CLF shall send the #NFC_SE_EVENT_FIELD_OFF to one gate       // only -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Field OFF"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Field OFF");       break;    case NFC_SE_EVENT_TRANSACTION:       // This event notifies that an external reader is trying to access a secure       // element -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Remote Start Transaction"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: Remote Start Transaction");       break;    default: -      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: DEFAULT:OTHER"); +      dlog_print(DLOG_INFO, LOG_TAG, "NFC EVENT: DEFAULT:OTHER");       break;    } } @@ -494,7 +495,7 @@ if (NFC_ERROR_NONE != error_code) // Error occurred

    The secure element transaction event gives you 4 information parameters and user data. You can get the application ID (specified in ISO/IEC 7816-4) from the first parameter, size of aid from the second parameter, the parameter list (specified in ISO/IEC 8825-1) from the third parameter, and the size of the parameter from the next function input parameter.

    static void on_nfc_se_transaction_event(nfc_se_type_e se_type, unsigned char *aid, int aid_size, unsigned char *param, int param_size, void *user_data)
     {
    -  dlog_print(DLOG_INFO, LOG_TAG, "Secure Element(SIM/UICC(Universal Integrated Circuit Card)) transaction event data");
    +  dlog_print(DLOG_INFO, LOG_TAG, "Secure Element(SIM/UICC(Universal Integrated Circuit Card)) transaction event data");
     }

    Getting a Cached NFC Message

    @@ -523,12 +524,12 @@ if (NFC_ERROR_NONE != error_code) // Error occurred }
  • Clean up at the application end.
  • -

    Using the Card Emulation Feature

    - -

    To create a Card Emulation application:

    +

    Using the Card Emulation Feature

    -
    1. Initialize the Card Emulation application: -
        +

        To create a card emulation application:

        +
          +
        1. Initialize the card emulation application: +
          1. To initialize NFC, use the nfc_manager_initialize() function:

            int ret = NFC_ERROR_NONE;
            @@ -566,55 +567,59 @@ else
                return false;
             }
             
          2. -
          3. Specify a "AID" value for the application. Next two step is required.

            -
            -

            1. To tell the platform which AIDs groups are requested by application, a metadata must be included in the manifest file.

            -
            <?xml version="1.0" encoding="utf-8"?>
            +
          4. Specify an AID value for the application:

            +
              +
            1. +

              To tell the platform which AID groups are requested by application, a metadata element must be included in the manifest file:

              +
              +<?xml version="1.0" encoding="utf-8"?>
               <manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.1" package="org.tizen.basicuiapplication" version="1.0.0">
              -   <profile name="wearable" />
              -   <ui-application appid="org.tizen.basicuiapplication" exec="basicuiapplication" type="capp" multiple="false" taskmanage="true" nodisplay="false">
              +   <profile name="wearable" />
              +   <ui-application appid="org.tizen.basicuiapplication" exec="basicuiapplication" type="capp" multiple="false" taskmanage="true" nodisplay="false">
                     <icon>basicuiapplication.png</icon>
                     <label>basicuiapplication</label>
              -      <metadata key="http://tizen.org/metadata/nfc_cardemulation" value="/shared/res/wallet.xml"/>
              +      <metadata key="http://tizen.org/metadata/nfc_cardemulation" value="/shared/res/wallet.xml"/>
                  </ui-application>
               </manifest>
               
              -
              • The <metadata> is required to contain a <key> and <value> attribute.
              • -
              • <key> attribute must be "http://tizen.org/metadata/nfc_cardemulation".
              • -
              • <value> attribute contain the AID xml file path.
              • -

                <value> attribute is a relative path starting from the app root path.

                +
                • The metadata element must contain the key and value attributes.
                • +
                • The key attribute must be http://tizen.org/metadata/nfc_cardemulation.
                • +
                • The value attribute must contain the AID XML file path. +

                  The value attribute is a relative path starting from the application root path.

                -
                -

                2. meta-data tag points to an AID xml file. An example of this file with AID declaration is shown below :

                -
                <?xml version="1.0" encoding="utf-8"?>
                -   <application name = "org.tizen.basicuiapplication">
                -      <wallet>
                -        <aid-group category = "payment">
                -                <aid aid = "325041592E5359532E4444463031" se_type = "hce" unlock = "false" power = "sleep"/>
                -        </aid-group>
                -      </wallet>
                -   </application>
                +
                +
              • The metadata element points to an AID XML file. The following is an example of this file with AID declaration.

                +
                +<?xml version="1.0" encoding="utf-8"?>
                +<application name="org.tizen.basicuiapplication">
                +   <wallet>
                +      <aid-group category="payment">
                +         <aid aid="325041592E5359532E4444463031" se_type="hce" unlock="false" power="sleep"/>
                +      </aid-group>
                +   </wallet>
                +</application>
                 
                -
                • The <application> is required to contain a <name> attribute that contains a application name.
                • -
                • The <application> must contain one or more <wallet> tags.
                • -
                • Each <wallet> must contain one or more <aid-group> tags.
                • -
                • The <aid-group> is required to contain a <category> attribute that contains <payment> or <other>.
                • -
                • Each <aid-group> must contain one or more <aid> tags, each of which contains a single AID.
                • -
                • The<aid-group> can have as much as you want aid
                • -
                • The <aid> is required to contain a <aid>, <se_type>, <unlock>, <power> attribute.
                • -
                • The <se_type> must contains "hce" or "ese" or "uicc". se_type value can be added later.
                • -
                • The <unlock> must contains "true" or "false".
                • -
                  • "true" mean "Card can't work, when device is locked."
                  • -
                  • "false" mean "Card can work, when device is locked."
                  -
                • The <power> must contains "on" or "off" or "sleep".
                • -
                  • "on" mean "Card can work, when device is on."
                  • -
                  • "off" mean "Card can work, when device is off."
                  • -
                  • "sleep" mean "Card can work, when device is sleep."
                  +
                  • The application element must contain a name attribute with an application name.
                  • +
                  • The application element must contain one or more wallet element, each of which must contain one or more aid-group element.
                  • +
                  • The aid-group element is required to contain a category attribute with the payment or other value.
                  • +
                  • Each aid-group element must contain one or more aid element, each of which contains a single AID. The aid-group can have as much as many aid elements as you want.
                  • +
                  • The aid element must contain the aid, se_type, unlock, and power attributes.
                  • +
                  • The se_type attribute must contain hce, ese, or uicc. The se_type value can be added later.
                  • +
                  • The unlock attribute must contain one of the following: +
                    • true: The card cannot work when the device is locked.
                    • +
                    • false: The card can work when the device is locked.
                  • +
                  • The power must contain one of the following: +
                    • on: The card can work when the device is on.
                    • +
                    • off: The card can work when the device is off.
                    • +
                    • sleep: The card can work when the device is in the sleep mode.
                  • +
                  -
                • The http://tizen.org/privilege/nfc.cardemulation privilege is required for the HCE API. Add the privilege to the tizen-manifest.xml file.
          5. -
          6. To create a Host based Card Emulation (HCE) application : +
          7. The http://tizen.org/privilege/nfc.cardemulation privilege is required for the HCE API. Add the privilege to the tizen-manifest.xml file.
        + +
      1. To create a host-based card emulation (HCE) application:
          +
        1. Define HCE event handling.

          The application must be able to handle an HCE event from the NFC reader. Define and register a callback that is triggered when data arrives from the NFC reader.

          Use the nfc_hce_send_apdu_response() function to send a response to the NFC reader. The actual data moving between the NFC reader and the application can be anything. The APDU protocol only defines as a promise between the application producer and NFC reader.

          @@ -747,7 +752,8 @@ if (ret != NFC_ERROR_NONE)    return false; } -

          When an application receives an app-control event, application can receive the aid value using the "data" appcontrol extra key.

        2. + +

          When an application receives an app control event, the application can receive the AID value using the data app control extra key.

        3. When HCE operations are no longer needed, deinitialize the resources:
          int ret = NFC_ERROR_NONE;
          @@ -759,7 +765,12 @@ if (ret != NFC_ERROR_NONE)
           {
              dlog_print(DLOG_ERROR, LOG_TAG, "nfc_manager_deinitialize failed : %d", ret);
           }
          -
        + +
      2. +
      +
    2. +
    +

    The following example shows the entire HCE application sample code:

    @@ -899,75 +910,41 @@ int main(int argc, char* argv[])    return service_app_main(argc, argv, &event_callback, ad); } - - -

    NFC Application Control

    -

    NFC application controls are kinds of event sent by the system to applications when NFC-based payment transaction occurs.

    -

    To receive these events, you are required to define the application control information in the Application Control tab of the manifest editor.

    - -

    The platform supports the following application controls for NFC applications:

    -

    http://tizen.org/appcontrol/operation/nfc/card_emulation/default_changed and http://tizen.org/appcontrol/operation/nfc/card_emulation/host_apdu_service and http://tizen.org/appcontrol/operation/nfc/card_emulation/off_host_apdu_service operations.

    - -

    default_changed operation

    -

    The application control with http://tizen.org/appcontrol/operation/nfc/card_emulation/default_changed is sent by the system when the default wallet is changed.

    For example, in Setting > NFC > Set Default Wallet App, if the default wallet is changed, an application control with this operation will be sent to the selected application (wallet).

    - -

    You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

    -
    - -

    host_apdu_service operation

    -

    The application control with http://tizen.org/appcontrol/operation/nfc/card_emulation/host_apdu_service operation is sent by the system when HCE event occurs.

    For example, when a mobile device receives Host based apdu (HCE) event from POS terminal, an application control with this operation will be sent to NFC applications.

    -

    You can get the target AID information using app_control_get_extra_data() with "data" key.

    - -

    You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

    - -

    The following table shows the information comes packaged when the http://tizen.org/appcontrol/operation/nfc/card_emulation/host_apdu_service operation is launching.

    - - - - - - - - - - - - - -
    - Table: host_apdu_service extra key -
    Extra keyDescription
    dataTarget AID key
    -
    -

    off_host_apdu_service operation

    -

    The application control with http://tizen.org/appcontrol/operation/nfc/card_emulation/off_host_apdu_service operation is sent by the system when SE transaction occurs.

    For example, when a mobile device receives Off-Host apdu event from POS terminal, an application control with this operation will be sent to NFC applications.

    -

    You can get the target AID information using app_control_get_extra_data() with "data" key.

    - -

    You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

    - -

    The following table shows the information comes packaged when the http://tizen.org/appcontrol/operation/nfc/card_emulation/off_host_apdu_service operation is launching.

    - - - - - - - - - - - - - -
    - Table: off_host_apdu_service extra key -
    Extra keyDescription
    dataTarget AID key
    -
    -

    Application control example

    -

    To tell the platform which application is register the opeartion, a operation must be included in the manifest file.

    -
    <?xml version="1.0" encoding="utf-8"?>
    +
    + + +

    Using the NFC Application Control

    + +

    NFC application controls are events sent by the system to applications when NFC-based payment transactions occur.

    +

    To receive these events, you must define the application control information in the Application Control tab of the manifest editor.

    + +

    The platform supports the following application controls for NFC applications:

    +
      +
    • default_changed operation + +

      The system sends the http://tizen.org/appcontrol/operation/nfc/card_emulation/default_changed application control when the default wallet is changed. For example, in Setting > NFC > Set Default Wallet App, if the default wallet is changed, an application control with this operation is sent to the selected application (wallet).

      + +

      You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

      +
    • +
    • host_apdu_service operation +

      The system sends the http://tizen.org/appcontrol/operation/nfc/card_emulation/host_apdu_service application control when HCE event occurs. For example, when a mobile device receives a host-based APDU (HCE) event from a POS terminal, an application control with this operation is sent to NFC applications.

      +

      You can get the target AID information using the app_control_get_extra_data() function with the data key. The target AID key comes packaged when the http://tizen.org/appcontrol/operation/nfc/card_emulation/host_apdu_service operation is launching.

      +

      You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

      +
    • +
    • off_host_apdu_service operation + +

      The system sends the http://tizen.org/appcontrol/operation/nfc/card_emulation/off_host_apdu_service application control when SE transaction occurs. For example, when a mobile device receives an off-host APDU event from a POS terminal, an application control with this operation is sent to NFC applications.

      +

      You can get the target AID information using the app_control_get_extra_data() function with the data key. The target AID key comes packaged when the http://tizen.org/appcontrol/operation/nfc/card_emulation/off_host_apdu_service operation is launching.

      +

      You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

      + +
    • +
    +

    The following example shows the use of the application control. To tell the platform which application is registered for the operation:

    +
    +<?xml version="1.0" encoding="utf-8"?>
     <manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.1" package="org.tizen.basicuiapplication" version="1.0.0">
    -   <profile name="wearable" />
    -   <ui-application appid="org.tizen.basicuiapplication" exec="basicuiapplication" type="capp" multiple="false" taskmanage="true" nodisplay="false">
    +   <profile name="wearable" />
    +   <ui-application appid="org.tizen.basicuiapplication" exec="basicuiapplication" type="capp" multiple="false" taskmanage="true" nodisplay="false">
           <icon>basicuiapplication.png</icon>
           <label>basicuiapplication</label>
           <app-control>
    @@ -978,29 +955,30 @@ int main(int argc, char* argv[])
        </ui-application>
     </manifest>
     
    -

    The code of the NFC application control is presented below:

    +

    The following example shows the NFC application control code:

    -...
    -bool service_app_control(app_control_h service, void *data)
    +bool 
    +service_app_control(app_control_h service, void *data)
     {
        struct _appdata *ad = user_data;
        char *operation, *aid;
        int ret = 0;
     
        app_control_get_operation(service, &operation);
    -   if ((strncmp(operation, NFC_APPCONTROL_STRING, strlen(NFC_APPCONTROL_STRING)) == 0)) {
    -      dlog_print(DLOG_INFO, "HCETESTAPP", "nfc appcontrol operation : [%s]", operation);
    -      app_control_get_extra_data(service, "data", &aid);
    -      dlog_print(DLOG_INFO, "HCETESTAPP", "nfc appcontrol uri : [%s]", aid);
    +   if ((strncmp(operation, NFC_APPCONTROL_STRING, strlen(NFC_APPCONTROL_STRING)) == 0)) 
    +   {
    +      dlog_print(DLOG_INFO, "HCETESTAPP", "nfc appcontrol operation : [%s]", operation);
    +      app_control_get_extra_data(service, "data", &aid);
    +      dlog_print(DLOG_INFO, "HCETESTAPP", "nfc appcontrol uri : [%s]", aid);
        }
     }
    -...
     
    -int main(int argc, char* argv[])
    +int 
    +main(int argc, char* argv[])
     {
        char ad[50] = {0,};
        service_app_event_callback_s event_callback;
    -
    + 
        event_callback.create = service_app_create;
        event_callback.terminate = service_app_terminate;
        event_callback.app_control = service_app_control;
    diff --git a/org.tizen.tutorials/html/native/network/smartcard_tutorial_n.htm b/org.tizen.tutorials/html/native/network/smartcard_tutorial_n.htm
    index 1855c3d..d046508 100644
    --- a/org.tizen.tutorials/html/native/network/smartcard_tutorial_n.htm
    +++ b/org.tizen.tutorials/html/native/network/smartcard_tutorial_n.htm
    @@ -11,14 +11,14 @@
         
         
     
    -    SmartCard: Accessing Secure Elements
    +    Smartcard: Accessing Secure Elements
     
     
     
     
     
     
     
    -

    SmartCard: Accessing Secure Elements

    +

    Smartcard: Accessing Secure Elements

    This tutorial demonstrates how you can manage smart card features and access secure elements (SE).

    Warm-up

    -

    Become familiar with the SmartCard API basics by learning about:

    +

    Become familiar with the Smartcard API basics by learning about:

    • Using the SE Service

      Initialize the SE service and retrieve available readers.

    • diff --git a/org.tizen.tutorials/html/native/network/wifi_direct_tutorial_n.htm b/org.tizen.tutorials/html/native/network/wifi_direct_tutorial_n.htm index 452d532..6cc6c2b 100644 --- a/org.tizen.tutorials/html/native/network/wifi_direct_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/wifi_direct_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native

      +

      Mobile native

      Content

      @@ -47,16 +47,7 @@

      This tutorial demonstrates how you can manage Wi-Fi Direct™ connections.

      - - - - - - - - - -
      Note
      This feature is supported in mobile applications only.
      +

      This feature is supported in mobile applications only.

      Warm-up

      Become familiar with the Wi-Fi Direct API basics by learning about:

      diff --git a/org.tizen.tutorials/html/native/network/wifi_tutorial_n.htm b/org.tizen.tutorials/html/native/network/wifi_tutorial_n.htm index 59d3fec..3974da9 100644 --- a/org.tizen.tutorials/html/native/network/wifi_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/wifi_tutorial_n.htm @@ -18,7 +18,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      diff --git a/org.tizen.tutorials/html/native/security/key_tutorial_n.htm b/org.tizen.tutorials/html/native/security/key_tutorial_n.htm index 99ad33b..722a897 100644 --- a/org.tizen.tutorials/html/native/security/key_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/security/key_tutorial_n.htm @@ -17,7 +17,7 @@
      -

      Mobile native Wearable native

      +

      Mobile native Wearable native

      Content

      @@ -193,17 +193,7 @@ if (CKMC_ERROR_NONE != ret)    // Error handling }
    - - - - - - - - - -
    Note
    Note that a few Key manager APIs have been deprecated since Tizen 2.4. - For example, several ckmc_remove_* () have been replaced by ckmc_remove_alias(). Although the deprecated APIs continue to be available, it is strongly recommended to use new APIs. For more information on the deprecated information, please refer to the Key-manager API References.
    + diff --git a/org.tizen.tutorials/html/native/security/privilege_tutorial_n.htm b/org.tizen.tutorials/html/native/security/privilege_tutorial_n.htm index 13ee06d..87be121 100644 --- a/org.tizen.tutorials/html/native/security/privilege_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/security/privilege_tutorial_n.htm @@ -17,7 +17,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    Content

    diff --git a/org.tizen.tutorials/html/native/security/security_tutorials_n.htm b/org.tizen.tutorials/html/native/security/security_tutorials_n.htm index ee8f1ea..f043761 100644 --- a/org.tizen.tutorials/html/native/security/security_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/security/security_tutorials_n.htm @@ -17,7 +17,7 @@
    -

    Mobile native Wearable native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.tutorials/html/native/social/calendar_tutorial_n.htm b/org.tizen.tutorials/html/native/social/calendar_tutorial_n.htm index 707fdf4..8a7f109 100644 --- a/org.tizen.tutorials/html/native/social/calendar_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/social/calendar_tutorial_n.htm @@ -16,7 +16,7 @@
    -

    Mobile native

    +

    Mobile native

    Content

    @@ -66,16 +66,7 @@

    This tutorial demonstrates how you can manage events and todo tasks, and convert calendar details to and from the vCalendar format.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.
    +

    This feature is supported in mobile applications only.

    Warm-up

    Become familiar with the Calendar API basics by learning about:

    diff --git a/org.tizen.tutorials/html/native/social/contact_tutorial_n.htm b/org.tizen.tutorials/html/native/social/contact_tutorial_n.htm index 4e30fdd..5bfa67b 100644 --- a/org.tizen.tutorials/html/native/social/contact_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/social/contact_tutorial_n.htm @@ -16,7 +16,7 @@ @@ -103,16 +104,6 @@

    This tutorial demonstrates how you can manage contacts and groups, and import them to or export them from the vCard format.

    - - - - - - - - - -
    Note
    This feature is supported in mobile applications only.

    Warm-up

    Become familiar with the Contacts API basics by learning about:

    @@ -230,7 +221,7 @@

    To start with the Contact Service:

    1. -

      To use the functions and data types of the Contacts API, include the <contacts.h> header file in your application:

      +

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

       #include <contacts.h>
       
    2. @@ -274,7 +265,7 @@ error_code = contacts_record_create(_contacts_name._uri, &name);
    3. Associate the name record with the contact record, by setting the name as the contact's child record. In this example, it is achieved using contacts_record_add_child_record().
      error_code = contacts_record_add_child_record(contact, _contacts_contact.name, name);
       
      -

      The second argument (_contacts_contact.name) is the parent property to which the child record is assigned. See _contacts_contact view description in the Contacts API. In the API, the name property is listed as one of the record type properties, which means that other records can be assigned to this property as child records ("single" means that only 1 _contacts_name type child record is allowed). The required type of the child record is specified in the API.

    +

    The second argument (_contacts_contact.name) is the parent property to which the child record is assigned. See _contacts_contact view description in the Contacts API (in mobile and wearable applications). In the API, the name property is listed as one of the record type properties, which means that other records can be assigned to this property as child records ("single" means that only 1 _contacts_name type child record is allowed). The required type of the child record is specified in the API.

  • Add an image.
    1. Create an image record:
      contacts_record_h image;
      @@ -307,10 +298,10 @@ int int_date = year * 10000 + month * 100 + day;
       
       error_code = contacts_record_set_int(event, _contacts_event.date, int_date);
       
    2. -
    3. Set the event type to birthday. For available types, see contacts_event_type_e enumeration. +
    4. Set the event type to birthday. For the available types, see the contacts_event_type_e enumeration (in mobile and wearable applications).
      error_code = contacts_record_set_int(event, _contacts_event.type, CONTACTS_EVENT_TYPE_BIRTH);
       
    5. -
    6. If the type is CONTACTS_EVENT_TYPE_CUSTOM, you can set a custom label (see _contacts_event view). +
    7. If the type is CONTACTS_EVENT_TYPE_CUSTOM, you can set a custom label (see the _contacts_event view, in mobile and wearable applications).
      error_code = contacts_record_set_int(event, _contacts_event.type, CONTACTS_EVENT_TYPE_CUSTOM);
       
       error_code = contacts_record_set_str(event, _contacts_event.label, "Event description");
      @@ -1389,17 +1380,6 @@ error_code = contacts_record_set_int(speeddial, _contacts_speeddial. number_id,
       
    - - - - - - - - - - -
    Note
    This tutorial does not describe how to insert a number. For more information, see the Contact Tutorial.

    Inserting a Speed Dial to the Database

    @@ -2358,7 +2338,7 @@ static contact_gl_data_t *_create_gl_data(contacts_record_h r_contact)
  • Retrieve record data into the structure. -

    Contacts are organized in a parent-child structure. To access specified data from a record, get the child responsible for the requested type using the contacts_record_get_child_record_at_p() function (for the property lists, see View/Property). Do not pass any data returned by a function with the _p suffix to the free() function.

    +

    Contacts are organized in a parent-child structure. To access specified data from a record, get the child responsible for the requested type using the contacts_record_get_child_record_at_p() function. For the property lists, see View/Property (in mobile and wearable applications). Do not pass any data returned by a function with the _p suffix to the free() function.

    • To get the name details, get the _contacts_contact.name (representing the child) from the r_contact parent. Both structures have the contacts_record_h type. After obtaining a child record, get the desired data from it using the contacts_record_get_str() function.

      @@ -2387,7 +2367,7 @@ static bool _get_contact_id(contacts_record_h r_contact, int *id) }
    • -
    • To get a contact number, check whether it exists using the contacts_record_get_bool() function. If it exists, use the various Query and Filter functions from the Contacts API to make a query to get a list. At the end, free any data returned by a function not containing the _p suffix.

      +
    • To get a contact number, check whether it exists using the contacts_record_get_bool() function. If it exists, use the various Query (in mobile and wearable applications) and Filter (in mobile and wearable applications) functions from the Contacts API to make a query to get a list. At the end, free any data returned by a function not containing the _p suffix.

      • Get a list of all numbers and filter the list to get the default:
         static bool _get_contact_number(contacts_record_h r_contact, char **number)
        @@ -2547,7 +2527,7 @@ contacts_filter_h filter = NULL;
         contacts_filter_create (_contacts_name._uri, &filter);
         
        -

        The first parameter defines in which view to place the filter. To filter by the first and last name, use the _contacts_name filter. The first parameter of the contacts_query_create() function must be the same parameter as in the filter to be appended. For more information on views, see the View/Property tables.

      • +

        The first parameter defines in which view to place the filter. To filter by the first and last name, use the _contacts_name filter. The first parameter of the contacts_query_create() function must be the same parameter as in the filter to be appended. For more information on views, see the View/Property tables (in mobile and wearable applications).

      • Add a condition, such as the following where only contacts beginning with "Za" are shown:

        @@ -2774,7 +2754,7 @@ contacts_person_link_person(first_person_id, second_person_id);
      • Set the default properties. -

        Set the default values from one of the linked contacts with the contacts_person_set_default_property() function. The first parameter determines the detail to be set using the contacts_person_property_e enum.

        +

        Set the default values from one of the linked contacts with the contacts_person_set_default_property() function. The first parameter determines the detail to be set using the contacts_person_property_e enum (in mobile and wearable applications).

        To set a default number from one of the persons, you have to know its ID. Get the detail ID using the contacts_record_get_child_record_at_p() function, because you need to get the value from the _contact_number view.

        diff --git a/org.tizen.tutorials/html/native/social/service_adaptor_tutorial_n.htm b/org.tizen.tutorials/html/native/social/service_adaptor_tutorial_n.htm index e629653..2282d69 100644 --- a/org.tizen.tutorials/html/native/social/service_adaptor_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/social/service_adaptor_tutorial_n.htm @@ -18,7 +18,7 @@ @@ -41,6 +40,9 @@

        Service Adaptor: Working with Plugins

        This tutorial demonstrates how you can use adaptors to work with plugins.

        + +

        This feature is supported in mobile applications only.

        +

        Warm-up

        Become familiar with the Service Adaptor API basics:

          diff --git a/org.tizen.tutorials/html/native/social/social_tutorials_n.htm b/org.tizen.tutorials/html/native/social/social_tutorials_n.htm index 90f94ee..f5a4a48 100644 --- a/org.tizen.tutorials/html/native/social/social_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/social/social_tutorials_n.htm @@ -16,7 +16,7 @@
          -

          Mobile native Wearable native

          +

          Mobile native Wearable native

          Related Info

          @@ -31,19 +31,19 @@

          Social: Managing Personal Data

          - -

          The social tutorials demonstrate how to use the following features in creating Tizen native applications:

          - -

          The following tutorials apply in mobile applications only:

          -
            -
          • Account Manager: Managing Account Information on the Device

            Demonstrates how you can connect to and disconnect from the Account Service, create, delete, and update accounts in the account database, and manage account information.

          • -
          • Calendar: Managing Calendar Events and Accessing the Calendar Database

            Demonstrates how you can manage calendars, events, and tasks.

          • -
          • Contacts: Managing Contacts and Groups, and Accessing the Contact Database

            Demonstrates how you can manage contact information, contact groups, vCards, and phone logs.

          • +

            The social tutorials demonstrate how to use the following features in creating Tizen native applications:

            + + +

            The following tutorials apply in mobile applications only:

            + + diff --git a/org.tizen.tutorials/html/native/system/device_tutorial_n.htm b/org.tizen.tutorials/html/native/system/device_tutorial_n.htm index 109484f..7114ee3 100644 --- a/org.tizen.tutorials/html/native/system/device_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/device_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/dlog_tutorial_n.htm b/org.tizen.tutorials/html/native/system/dlog_tutorial_n.htm index 493f4d8..d2c1346 100644 --- a/org.tizen.tutorials/html/native/system/dlog_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/dlog_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/media_key_tutorial_n.htm b/org.tizen.tutorials/html/native/system/media_key_tutorial_n.htm index 0155264..01b3b49 100644 --- a/org.tizen.tutorials/html/native/system/media_key_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/media_key_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm b/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm index dab5682..9bcb7ac 100644 --- a/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/sensor_tutorial_n.htm b/org.tizen.tutorials/html/native/system/sensor_tutorial_n.htm index fd9facc..000baa6 100644 --- a/org.tizen.tutorials/html/native/system/sensor_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/sensor_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/storage_tutorial_n.htm b/org.tizen.tutorials/html/native/system/storage_tutorial_n.htm index 4a5ad3b..04d51c4 100644 --- a/org.tizen.tutorials/html/native/system/storage_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/storage_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/sysinfo_tutorial_n.htm b/org.tizen.tutorials/html/native/system/sysinfo_tutorial_n.htm index 0c3aabb..ff001fa 100644 --- a/org.tizen.tutorials/html/native/system/sysinfo_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/sysinfo_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/system_setting_tutorial_n.htm b/org.tizen.tutorials/html/native/system/system_setting_tutorial_n.htm index 467415c..cc693ec 100644 --- a/org.tizen.tutorials/html/native/system/system_setting_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/system_setting_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            diff --git a/org.tizen.tutorials/html/native/system/system_tutorials_n.htm b/org.tizen.tutorials/html/native/system/system_tutorials_n.htm index 7147058..4ba7927 100644 --- a/org.tizen.tutorials/html/native/system/system_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/system/system_tutorials_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.tutorials/html/native/system/t-trace_tutorial_n.htm b/org.tizen.tutorials/html/native/system/t-trace_tutorial_n.htm index e2dd716..6abb0ea 100644 --- a/org.tizen.tutorials/html/native/system/t-trace_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/t-trace_tutorial_n.htm @@ -18,7 +18,7 @@
            -

            Mobile native Wearable native

            +

            Mobile native Wearable native

            Content

            @@ -57,7 +57,7 @@

            To initialize tracing:

              -
            1. To use the functions and data types of the T-trace API, include the <trace.h> header file in your application: +
            2. To use the functions and data types of the T-trace API (in mobile and wearable applications), include the <trace.h> header file in your application:
               #include <trace.h>
               
              diff --git a/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm b/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm index 3581422..7005b6d 100644 --- a/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/telephony/phonenumber_util_tutorial_n.htm @@ -18,7 +18,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              Content

              diff --git a/org.tizen.tutorials/html/native/telephony/telephony_info_tutorial_n.htm b/org.tizen.tutorials/html/native/telephony/telephony_info_tutorial_n.htm index 2891677..3f7fdec 100644 --- a/org.tizen.tutorials/html/native/telephony/telephony_info_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/telephony/telephony_info_tutorial_n.htm @@ -18,7 +18,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              Content

              @@ -535,4 +535,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - + \ No newline at end of file diff --git a/org.tizen.tutorials/html/native/telephony/telephony_tutorials_n.htm b/org.tizen.tutorials/html/native/telephony/telephony_tutorials_n.htm index d7f3c5c..4cf4c08 100644 --- a/org.tizen.tutorials/html/native/telephony/telephony_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/telephony/telephony_tutorials_n.htm @@ -18,7 +18,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              Related Info

              diff --git a/org.tizen.tutorials/html/native/tutorials_n.htm b/org.tizen.tutorials/html/native/tutorials_n.htm index 16a18a1..f4d06b3 100644 --- a/org.tizen.tutorials/html/native/tutorials_n.htm +++ b/org.tizen.tutorials/html/native/tutorials_n.htm @@ -18,7 +18,7 @@
              -

              Mobile native Wearable native

              +

              Mobile native Wearable native

              Related Info

              @@ -39,7 +39,7 @@
              • Account -

                Demonstrates how you can manage account information, such as receive sync operation notifications, and obtain an access token by using the oauth2 authorization.

              • +

                Demonstrates how you can manage account information, such as receive sync operation notifications, and obtain an access token by using the OAuth 2.0 authorization.

              • Application Framework: Controlling Your Application

                Demonstrates how you can configure application properties and manage application data.

              • Base: Using Fundamental Libraries diff --git a/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm b/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm index 264f3c7..25c1a6a 100644 --- a/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm @@ -18,7 +18,7 @@
                -

                Mobile native Wearable native

                +

                Mobile native Wearable native

                Content

                @@ -61,7 +61,7 @@

                Initializing the EOM

                To initialize EOM:

                  -
                1. To use the functions and data types of the External Output Manager API, include the <eom.h> header file in your application: +
                2. To use the functions and data types of the External Output Manager API (in mobile and wearable applications), include the <eom.h> header file in your application:
                  #include <eom.h>
                3. Initialize the application with the eom_init() function.
                4. diff --git a/org.tizen.tutorials/html/native/ui/minicontrol_tutorial_n.htm b/org.tizen.tutorials/html/native/ui/minicontrol_tutorial_n.htm new file mode 100644 index 0000000..54537d6 --- /dev/null +++ b/org.tizen.tutorials/html/native/ui/minicontrol_tutorial_n.htm @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + Minicontrol: Creating a Minicontrol + + + + + + +
                  +

                  Minicontrol: Creating a Minicontrol

                  + + +

                  This tutorial demonstrates how you can create minicontrols on the quick panel or the lock screen, and hide a minicontrol viewer.

                  + +

                  Warm-up

                  +

                  Become familiar with the Minicontrol API basics by learning about:

                  + + + +

                  Creating a Minicontrol on the Quick Panel

                  + +

                  To create a minicontrol of your application:

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

                    +
                    +#include <minicontrol_provider.h>
                    +
                    +
                  2. +
                  3. To create a minicontrol, use the minicontrol_create_window() function:

                    + +
                    +Evas_Object *win;
                    +
                    +win = minicontrol_create_window("mini-sample", MINICONTROL_TARGET_VIEWER_QUICK_PANEL, NULL);
                    +evas_object_resize(win, 480, 140);
                    +evas_object_show(win);
                    +
                    + +

                    To create a minicontrol on the quick panel, the target_viewer parameter must be set to MINICONTROL_TARGET_VIEWER_QUICK_PANEL.

                  4. + +
                  5. Add a text label on the minicontrol using the elm_label_add() function: + +
                    +label = elm_label_add(win);
                    +elm_object_text_set(label, "mini-sample");
                    +evas_object_resize(label, 480, 140);
                    +evas_object_show(label);
                    +
                  6. +
                  + +

                  Hiding the Quick Panel

                  +

                  To hide the quick panel:

                  +
                    +
                  1. +

                    Add a button on the minicontrol:

                    + +
                    +button = elm_button_add(win);
                    +elm_object_text_set(button, "Click to hide.");
                    +evas_object_move(button, 0, 50);
                    +evas_object_resize(button, 200, 50);
                    +evas_object_show(button);
                    +
                  2. +
                  3. +

                    Add an event handler callback function:

                    + +
                    +evas_object_smart_callback_add(button, "clicked", _button_clicked_cb, win);
                    +
                  4. +
                  5. +

                    Define the callback function for hiding the quick panel:

                    + +
                    +static void 
                    +_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                    +{
                    +   Evas_Object *win = data;
                    +   minicontrol_send_event(win, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL);
                    +}
                    +
                  6. +
                  + +

                  Figure: Minicontrol button for hiding the quick panel

                  +

                  Minicontrol button for hiding the quick panel

                  + + + + +
                  + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm b/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm index e427f65..4e789f5 100644 --- a/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm @@ -18,7 +18,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  @@ -35,10 +35,11 @@

                  UI Framework: Creating the Application UI

                  The UI framework tutorials demonstrate how to create a visual outlook for your application to ensure the best possible user experience:

                  -

                  For more information about implementing the UI for your application using the EFL features, see EFL.

                  +

                  For more information about implementing the UI for your application using the EFL features, see EFL.

                  diff --git a/org.tizen.tutorials/html/native/uix/ime_tutorial_n.htm b/org.tizen.tutorials/html/native/uix/ime_tutorial_n.htm index 482ce28..4ec2452 100644 --- a/org.tizen.tutorials/html/native/uix/ime_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/uix/ime_tutorial_n.htm @@ -18,7 +18,7 @@
                  -

                  Mobile native Wearable native

                  +

                  Mobile native Wearable native

                  Content

                  @@ -311,7 +311,7 @@ option_window_destroyed(Evas_Object *window, void *user_data)

                  To launch the IME list menu to show the installed IMEs:

                    -
                  1. To use the functions and data types of the Input Method Manager API, include the <inputmethod_manager.h> header file in your application: +
                  2. To use the functions and data types of the Input Method Manager API (in mobile and wearable applications), include the <inputmethod_manager.h> header file in your application:
                    #include <inputmethod_manager.h>
                  3. Add the http://tizen.org/privilege/imemanager privilege to the application manifest file.
                  4. @@ -336,7 +336,7 @@ void show_ime_list()

                    To launch the IME selector menu to allow the user to select the default keyboard:

                      -
                    1. To use the functions and data types of the Input Method Manager API, include the <inputmethod_manager.h> header file in your application: +
                    2. To use the functions and data types of the Input Method Manager API (in mobile and wearable applications), include the <inputmethod_manager.h> header file in your application:
                      #include <inputmethod_manager.h>
                    3. Add the http://tizen.org/privilege/imemanager privilege to the application manifest file.
                    4. diff --git a/org.tizen.tutorials/html/native/uix/stt_tutorial_n.htm b/org.tizen.tutorials/html/native/uix/stt_tutorial_n.htm index a95b3ea..3895696 100644 --- a/org.tizen.tutorials/html/native/uix/stt_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/uix/stt_tutorial_n.htm @@ -18,7 +18,7 @@
                      -

                      Mobile native Wearable native

                      +

                      Mobile native Wearable native

                      Content

                      diff --git a/org.tizen.tutorials/html/native/uix/tts_tutorial_n.htm b/org.tizen.tutorials/html/native/uix/tts_tutorial_n.htm index 5be326b..0a51b54 100644 --- a/org.tizen.tutorials/html/native/uix/tts_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/uix/tts_tutorial_n.htm @@ -18,7 +18,7 @@
                      -

                      Mobile native Wearable native

                      +

                      Mobile native Wearable native

                      Content

                      diff --git a/org.tizen.tutorials/html/native/uix/uix_tutorials_n.htm b/org.tizen.tutorials/html/native/uix/uix_tutorials_n.htm index 2c3b317..e7b9993 100644 --- a/org.tizen.tutorials/html/native/uix/uix_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/uix/uix_tutorials_n.htm @@ -18,7 +18,7 @@
                      -

                      Mobile native Wearable native

                      +

                      Mobile native Wearable native

                      Related Info

                      diff --git a/org.tizen.tutorials/html/native/uix/voicecontrol_elm_tutorial_n.htm b/org.tizen.tutorials/html/native/uix/voicecontrol_elm_tutorial_n.htm index c7c4c74..b858dac 100644 --- a/org.tizen.tutorials/html/native/uix/voicecontrol_elm_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/uix/voicecontrol_elm_tutorial_n.htm @@ -18,7 +18,7 @@
                      -

                      Mobile native Wearable native

                      +

                      Mobile native Wearable native

                      Content

                      @@ -58,7 +58,7 @@

                      Initializing the Voice Control

                      To initialize the Voice control elementary library and create a handle:

                        -
                      1. To use the functions and data types of the Voice control elementary API, include the <voice_control_elm.h> header file in your application: +
                      2. To use the functions and data types of the Voice control elementary API (in mobile and wearable applications), include the <voice_control_elm.h> header file in your application:
                        #include <voice_control_elm.h>
                      3. Initialize the Voice control elementary library with the vc_elm_initialize() function: diff --git a/org.tizen.tutorials/html/native/uix/voicecontrol_tutorial_n.htm b/org.tizen.tutorials/html/native/uix/voicecontrol_tutorial_n.htm index cb61c4a..630384a 100644 --- a/org.tizen.tutorials/html/native/uix/voicecontrol_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/uix/voicecontrol_tutorial_n.htm @@ -18,7 +18,7 @@
                        -

                        Mobile native Wearable native

                        +

                        Mobile native Wearable native

                        Content

                        @@ -58,7 +58,7 @@

                        Initializing the Voice Control

                        To initialize and prepare the voice control for use:

                          -
                        1. To use the functions and data types of the Voice control API, include the <voice_control.h> header file in your application: +
                        2. To use the functions and data types of the Voice control API (in mobile and wearable applications), include the <voice_control.h> header file in your application:
                          #include <voice_control.h>
                        3. Initialize the voice control with the vc_initialize() function: diff --git a/org.tizen.tutorials/html/native/uix/voicecontrol_tutorials_n.htm b/org.tizen.tutorials/html/native/uix/voicecontrol_tutorials_n.htm index 4b38bcb..ed1e4f9 100644 --- a/org.tizen.tutorials/html/native/uix/voicecontrol_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/uix/voicecontrol_tutorials_n.htm @@ -18,7 +18,7 @@
                          -

                          Mobile native Wearable native

                          +

                          Mobile native Wearable native

                          Related Info

                          diff --git a/org.tizen.tutorials/html/native/web/web_tutorials_n.htm b/org.tizen.tutorials/html/native/web/web_tutorials_n.htm index 9ee1f2c..8e1c00f 100644 --- a/org.tizen.tutorials/html/native/web/web_tutorials_n.htm +++ b/org.tizen.tutorials/html/native/web/web_tutorials_n.htm @@ -18,7 +18,7 @@
                          -

                          Mobile native Wearable native

                          +

                          Mobile native Wearable native

                          Content

                          @@ -195,10 +195,10 @@ static Browser_Window *window_create(Evas_Object *opener, int width, int height,       // "ERROR: could not create browser window."       return NULL;    } -    -   // If you want to use gpu acceleration, just use below function. -   // elm_config_accel_preference_set("opengl:depth24:stencil8"); -    + +   // If you want to use gpu acceleration, use the following function +   // elm_config_accel_preference_set("opengl:depth24:stencil8"); +    // Create window    window->elm_window = elm_win_add(NULL, "minibrowser-window", ELM_WIN_BASIC);    evas_object_smart_callback_add(window->elm_window, "delete,request", on_window_deletion, &window); @@ -395,7 +395,7 @@ window_create()

                          The void evas_object_show (Evas_Object *obj) function makes the given Evas object visible.

                          -

                          Finding a Window

                          +

                          Finding a Window

                          This example uses 2 helper functions for finding window structures. The first one, the window_find_with_elm_window() function, takes elm_window as an argument and returns a pointer to the Browser_Window object that the window is part of. The second one, the window_find_with_ewk_view() function, does the same for ewk_view. Both of them use the EINA_LIST_FOREACH macro to iterate over the windows list.

                          diff --git a/org.tizen.tutorials/html/web/tizen/application/alarm_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/application/alarm_tutorial_w.htm index 074458c..7d1c808 100644 --- a/org.tizen.tutorials/html/web/tizen/application/alarm_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/application/alarm_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          @@ -42,17 +42,7 @@

                          This tutorial demonstrates how you can manage alarms in the device to automatically launch applications when an alarm is triggered.

                          - - - - - - - - - -
                          Note
                          The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                          All mandatory APIs are supported on the Tizen Emulators.

                          +

                          The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                          Warm-up

                          Become familiar with the Alarm API basics by learning about:

                          @@ -106,7 +96,7 @@ console.log(alarms.length + " alarms present in the storage.");
                        4. To delete an alarm, use the remove() method with the alarm ID:

                           /* First add created alarm to the device */
                          -tizen.alarm.add(alarm1, "tizen.internet"); /*Tizen Alias ID is deprecated since Tizen 2.3.1.*/
                          +tizen.alarm.add(alarm1, "tizen.internet"); /* Tizen alias ID is deprecated since Tizen 2.3.1 */
                           /* Then remove it */
                           tizen.alarm.remove(alarm1.id);
                           

                          To delete all alarms at once, use the removeAll() method.

                        5. @@ -119,7 +109,7 @@ tizen.alarm.remove(alarm1.id);
                        6. To launch an application when an alarm is triggered, you must define the application as a parameter in the add() method used to add the created alarm to the system:

                           /* Run the browser */
                           var alarm = new tizen.AlarmAbsolute(new Date(2012, 10, 4, 8, 0));
                          -tizen.alarm.add(alarm, "tizen.internet"); /*Tizen Alias ID is deprecated since Tizen 2.3.1.*/
                          +tizen.alarm.add(alarm, "tizen.internet"); /* Tizen alias ID is deprecated since Tizen 2.3.1 */
                           
                        7. To launch an application with additional information when an alarm is triggered, you must use the application control and define the required arguments as a parameter in the add() method used to add the created alarm to the system:

                           /* Run the browser and open the defined browser page with the operation/view application control */
                          diff --git a/org.tizen.tutorials/html/web/tizen/application/app_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/application/app_tutorials_w.htm
                          index 62e4266..0bce714 100644
                          --- a/org.tizen.tutorials/html/web/tizen/application/app_tutorials_w.htm
                          +++ b/org.tizen.tutorials/html/web/tizen/application/app_tutorials_w.htm
                          @@ -18,7 +18,7 @@
                           
                           
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          @@ -38,8 +38,8 @@

                          The following tutorials apply in mobile applications only:

                          diff --git a/org.tizen.tutorials/html/web/tizen/application/appgroup_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/application/appgroup_tutorial_w.htm index df8ce2f..7025ca4 100644 --- a/org.tizen.tutorials/html/web/tizen/application/appgroup_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/application/appgroup_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          @@ -42,7 +42,7 @@ This tutorial demonstrates how you can define the application launch mode and ma

                          Warm-up

                          -

                          Become familiar with the Application Group API basics by learning about:

                          +

                          Become familiar with the Application API basics by learning about:

                          • Controlling the Launch Mode

                            Set the launch mode when calling an application through an app control.

                          • @@ -52,48 +52,40 @@ This tutorial demonstrates how you can define the application launch mode and ma

                            Controlling the Launch Mode

                            - - - - -

                            To launch an application in a GROUP mode you must learn how to define the application control object and next how to launch the application:

                            +

                            To launch an application in a GROUP mode, you must learn how to define the application control object and launch the application:

                              -
                            1. Define the application control object with the mode GROUP: +
                            2. Define the application control object with the GROUP mode:
                              -var appControl = new tizen.ApplicationControl(
                              -                        "http://tizen.org/appcontrol/operation/view",
                              -                        null,
                              -                        "image/jpeg",
                              -                        null,
                              -                        [],
                              -                        "GROUP");
                              +var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view",
                              +                                              null, "image/jpeg", null, [], "GROUP");
                               
                            3. -
                            4. Define an array with callback functions for tizen.application.launchAppControl() method: +
                            5. Define an array with callback functions for the tizen.application.launchAppControl() method:
                              -var appControlReplyCallback = {
                              -  // callee sent a reply 
                              -  onsuccess: function(data) {
                              -    console.log("onsuccess");
                              -  },
                              -  // callee returned failure
                              -  onfailure: function() {
                              -    console.log("onfailure");
                              -  }
                              +var appControlReplyCallback = 
                              +{
                              +   /* Callee sent a reply  */
                              +   onsuccess: function(data) 
                              +   {
                              +      console.log("onsuccess");
                              +   },
                              +   /* Callee returned failure */
                              +   onfailure: function() 
                              +   {
                              +      console.log("onfailure");
                              +   }
                               }
                               
                            6. Launch the application in the GROUP mode with the previously defined application control object:
                              -tizen.application.launchAppControl(
                              -                      appControl,
                              -                      null,
                              -                      function() { console.log("launch application control succeed"); },
                              -                      function(e) { console.log("launch application control failed. reason: " + e.message); },
                              -                      appControlReplyCallback);
                              +tizen.application.launchAppControl(appControl, null,
                              +                                   function() {console.log("launch application control succeed");},
                              +                                   function(e) {console.log("launch application control failed. reason: " + e.message);},
                              +                                   appControlReplyCallback);
                               
                            7. diff --git a/org.tizen.tutorials/html/web/tizen/application/application_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/application/application_tutorial_w.htm index 4539ab4..d88ca54 100644 --- a/org.tizen.tutorials/html/web/tizen/application/application_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/application/application_tutorial_w.htm @@ -18,8 +18,7 @@
                              -

                              Mobile Web - Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -50,17 +49,7 @@

                              This tutorial demonstrates how you can manage and launch applications.

                              - - - - - - - - - -
                              Note
                              The Application API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Application API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the Application API basics by learning about:

                              @@ -77,22 +66,35 @@

                              Learning how to retrieve information about installed and running applications allows you to manage all the device applications from your application:

                                -
                              1. To retrieve a list of installed applications, use the getAppsInfo() method of the ApplicationManager interface (in mobile and wearable applications):

                                function onListInstalledApplications(applications)
                                +   
                              2. To retrieve a list of installed applications, use the getAppsInfo() method of the ApplicationManager interface (in mobile and wearable applications):

                                +
                                +function onListInstalledApplications(applications)
                                 {
                                    console.log("The number of installed applications is " + applications.length);
                                 }
                                -tizen.application.getAppsInfo(onListInstalledApplications);

                                The list of applications is returned to the ApplicationInformationArraySuccessCallback event handler as an array of ApplicationInformation objects (in mobile and wearable applications).

                              3. -
                              4. To retrieve a list of running applications, use the getAppsContext() method of the ApplicationManager interface:

                                function onRunningApplicationContexts(contexts)
                                +tizen.application.getAppsInfo(onListInstalledApplications);
                                +
                                +

                                The list of applications is returned to the ApplicationInformationArraySuccessCallback event handler as an array of ApplicationInformation objects (in mobile and wearable applications).

                              5. +
                              6. To retrieve a list of running applications, use the getAppsContext() method of the ApplicationManager interface:

                                +
                                +function onRunningApplicationContexts(contexts)
                                 {
                                    console.log("The number of running applications is " + contexts.length);
                                 }
                                -tizen.application.getAppsContext(onRunningApplicationContexts);

                                The list of application contexts is returned to the given event handler as an array of the ApplicationContext objects.

                              7. -
                              8. To retrieve basic application information, use the getAppInfo() method of the ApplicationManager interface.

                                Provide the application ID of the application whose information you want as a parameter for the method. If no application ID is set, the method retrieves the information about the application calling the method.

                                var appinfo = tizen.application.getAppInfo("org.tizen.application");
                                +tizen.application.getAppsContext(onRunningApplicationContexts);
                                +
                                +

                                The list of application contexts is returned to the given event handler as an array of the ApplicationContext objects.

                              9. +
                              10. To retrieve basic application information, use the getAppInfo() method of the ApplicationManager interface.

                                Provide the application ID of the application whose information you want as a parameter for the method. If no application ID is set, the method retrieves the information about the application calling the method.

                                +
                                +var appinfo = tizen.application.getAppInfo("org.tizen.application");
                                 console.log("The application icon path :" + appinfo.iconPath);
                                 console.log("The application name :" + appinfo.name);
                                 
                              11. -
                              12. To retrieve application context information, use the getAppContext() method of the ApplicationManager interface.

                                Provide the context ID of the application whose context information you want as a parameter for the method. If no context ID is set, the method retrieves the information about the application calling the method.

                                var appContext = tizen.application.getAppContext();
                                -console.log("Application context retrieved for app " + appContext.id);
                              13. +
                              14. To retrieve application context information, use the getAppContext() method of the ApplicationManager interface.

                                Provide the context ID of the application whose context information you want as a parameter for the method. If no context ID is set, the method retrieves the information about the application calling the method.

                                +
                                +var appContext = tizen.application.getAppContext();
                                +console.log("Application context retrieved for app " + appContext.id);
                                +

                              Managing Applications

                              @@ -118,12 +120,18 @@ function onGetAppsContextSuccess(appcontexts) } tizen.application.getAppsContext(onGetAppsContextSuccess); -

                          You can also launch an application using the application control.

                        8. -
                        9. To retrieve the current application, use the getCurrentApplication() method:

                          var currApp = tizen.application.getCurrentApplication();
                        10. -
                        11. To hide the current application, use the hide() method:

                          +
                          +

                          You can also launch an application using the application control.

                        12. +
                        13. To retrieve the current application, use the getCurrentApplication() method:

                          +
                          +var currApp = tizen.application.getCurrentApplication();
                          +
                        14. +
                        15. To hide the current application, use the hide() method:

                          +
                           currApp.hide();
                           
                        16. -
                        17. To exit the current application, use the exit() method:

                          +   
                        18. To exit the current application, use the exit() method:

                          +
                           currApp.exit();
                           
                        @@ -134,7 +142,8 @@ currApp.exit();
                        1. Define the event handlers for different notifications by implementing the ApplicationInformationEventCallback listener interface (in mobile and wearable applications):

                          -
                          var appEventCB =
                          +
                          +var appEventCB =
                           {
                              /* When a new application is installed */
                              oninstalled: function(appInfo)
                          @@ -153,20 +162,34 @@ currApp.exit();
                              {
                                 console.log("Application " + appId + " uninstalled");
                              }
                          -} 
                        2. -
                        3. Register the listener to use the defined event handlers:

                          var listenerID = tizen.application.addAppInfoEventListener(appEventCB);
                        4. -
                        5. To stop receiving the notifications, use the removeAppInfoEventListener() method of the ApplicationManager interface (in mobile and wearable applications):

                          -tizen.application.removeAppInfoEventListener(listenerID);
                        6. +} + + +
                        7. Register the listener to use the defined event handlers:

                          +
                          +var listenerID = tizen.application.addAppInfoEventListener(appEventCB);
                          +
                          +
                        8. +
                        9. To stop receiving the notifications, use the removeAppInfoEventListener() method of the ApplicationManager interface (in mobile and wearable applications):

                          +
                          +tizen.application.removeAppInfoEventListener(listenerID);
                          +
                          +

                        Launching Applications with the Application Control

                        Learning to use the application controls to launch applications allows you to take advantage of all the device applications from your application:

                        -

                        An installed application can provide a service which is identified by the operation name. Other applications can request it and use the provided feature of the service application (an optionally passing some data to the service). The service application then responds with an ApplicationControlData instance (in mobile and wearable applications) (which can contain some data as well).

                        +

                        An installed application can provide a service which is identified by the operation name. Other applications can request it and use the provided feature of the service application (and optionally passing some data to the service). The service application then responds with an ApplicationControlData instance (in mobile and wearable applications) (which can contain some data as well).

                          -
                        1. To use the application control to pick image files from a list of images, create an ApplicationControl object (in mobile and wearable applications).

                          Define the desired functionality required from the application to be launched. The application needs to have an operation type suitable for selecting images, with URI as null, and the MIME type as image/*.

                          var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/pick", null, "image/*");
                        2. -
                        3. Define the format of the reply you want to receive from the application control:
                          var appControlReplyCB =
                          +   
                        4. To use the application control to pick image files from a list of images, create an ApplicationControl object (in mobile and wearable applications).

                          Define the desired functionality required from the application to be launched. The application needs to have an operation type suitable for selecting images, with URI as null, and the MIME type as image/*.

                          +
                          +var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/pick", null, "image/*");
                          +
                        5. +
                        6. Define the format of the reply you want to receive from the application control: +
                          +var appControlReplyCB =
                           {
                              /* Reply is sent if the requested operation is successfully delivered */
                              onsuccess: function(reply)
                          @@ -179,26 +202,26 @@ tizen.application.removeAppInfoEventListener(listenerID);
                        7.          }       }    } -}
                        8. -
                        9. Call the launchAppControl() method to find a suitable application to select the images:
                          tizen.application.launchAppControl(appControl, null,
                          +}
                          +
                        10. +
                        11. Call the launchAppControl() method to find a suitable application to select the images: +
                          +tizen.application.launchAppControl(appControl, null,
                                                              function(){console.log("launch appControl succeeded");},
                                                              function(e){/* Error handling */},
                          -                                   appControlReplyCB);
                        12. +                                   appControlReplyCB); +

                        Handling Application Control Requests

                        Learning how to handle requests from other applications allows you to create Web applications that can be called from other applications to perform specific actions.

                        -

                        Web applications can provide a service which is identified by the operation name. Other applications can request it and use the provided feature of the service application - (optionally passing some data to the service). The service application gets the request, performs some actions, and sends the result to caller application with - an ApplicationControlData array (in mobile and wearable applications).

                        +

                        Web applications can provide a service which is identified by the operation name. Other applications can request it and use the provided feature of the service application (optionally passing some data to the service). The service application gets the request, performs some actions, and sends the result to caller application with an ApplicationControlData array (in mobile and wearable applications).

                          -
                        1. To enable the application to receive Application Control requests, open the Web application configuration editor and - add an operation in the app-control section.

                          -

                          In this example, the name of the operation is http://example.tizen.org/operation/get_time. - The config.xml file contains a <tizen:app-control> element:

                          +
                        2. To enable the application to receive Application Control requests, open the Web application configuration editor and add an operation in the app-control section.

                          +

                          In this example, the name of the operation is http://example.tizen.org/operation/get_time. The config.xml file contains a <tizen:app-control> element:

                           <tizen:app-control>
                              <tizen:src name="index.html"/>
                          @@ -207,11 +230,7 @@ tizen.application.removeAppInfoEventListener(listenerID);
                        3. For more information, see Exporting Application Control Functionality.

                          -
                        4. To retrieve an object of the RequestedApplicationControl interface (in mobile and wearable applications), - use the getCurrentApplication() method of - the ApplicationManager interface (in mobile and wearable applications) and - the getRequestedAppControl() method of - the Application interface (in mobile and wearable applications):

                          +
                        5. To retrieve an object of the RequestedApplicationControl interface (in mobile and wearable applications), use the getCurrentApplication() method of the ApplicationManager interface (in mobile and wearable applications) and the getRequestedAppControl() method of the Application interface (in mobile and wearable applications):

                           var reqAppControl = tizen.application.getCurrentApplication().getRequestedAppControl();
                           
                          @@ -224,8 +243,7 @@ else
                              console.log("The application was not launched with Application Control.");
                           }
                           
                        6. -
                        7. To send a reply to the caller application, use the replyResult() method of - the RequestedApplicationControl interface:

                          +
                        8. To send a reply to the caller application, use the replyResult() method of the RequestedApplicationControl interface:

                           try
                           {
                          diff --git a/org.tizen.tutorials/html/web/tizen/application/data_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/application/data_tutorial_w.htm
                          index 3e06c1b..e0f4b94 100644
                          --- a/org.tizen.tutorials/html/web/tizen/application/data_tutorial_w.htm
                          +++ b/org.tizen.tutorials/html/web/tizen/application/data_tutorial_w.htm
                          @@ -18,7 +18,7 @@
                           
                           
                          -

                          Mobile Web

                          +

                          Mobile Web

                          Content

                          @@ -40,16 +40,7 @@

                          This tutorial demonstrates how you can share data between applications.

                          - - - - - - - - - -
                          Note
                          This feature is supported in mobile applications only.
                          +

                          This feature is supported in mobile applications only.

                          Warm-up

                          Become familiar with the Data Control API basics by learning about:

                          diff --git a/org.tizen.tutorials/html/web/tizen/application/package_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/application/package_tutorial_w.htm index 7be5286..400325d 100644 --- a/org.tizen.tutorials/html/web/tizen/application/package_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/application/package_tutorial_w.htm @@ -18,8 +18,8 @@
                          -

                          Mobile Web - Wearable Web

                          +

                          Mobile Web + Wearable Web

                          Content

                          @@ -49,17 +49,8 @@

                          This tutorial demonstrates how you can manage packages and retrieve information about them.

                          - - - - - - - - - -
                          Note
                          The Package API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                          All mandatory APIs are supported on the Tizen Emulators.

                          +

                          The Package API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                          +

                          Warm-up

                          Become familiar with the Package API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/bluetooth_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/communication/bluetooth_tutorial_w.htm index e7e86f8..1c129fe 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/bluetooth_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/bluetooth_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -56,18 +56,7 @@

                            This tutorial demonstrates how you can manage Bluetooth and exchange data with a peer device.

                            - - - - - - - - - -
                            Note
                            The Bluetooth API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                            The Bluetooth API is not supported on any Tizen Emulators.

                            -
                            +

                            The Bluetooth API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Bluetooth API is not supported on any Tizen Emulators.

                            Warm-up

                            Become familiar with the Bluetooth API basics by learning about:

                            @@ -351,12 +340,9 @@ healthChannel.close();
                          • Define a scan event handler by implementing the BluetoothLEScanCallback callback (in mobile and wearable applications).

                            The callback is invoked when a remote device has been detected.

                            -var callbacks = 
                            +function successcallback(device)
                             {
                            -   onsuccess: function(device)
                            -   {
                            -      console.log("Found device: "  device.name  " ["  device.address  "]");
                            -   }
                            +   console.log("Found device: " + device.name + " [" + device.address + "]");
                             };
                             
                            @@ -375,7 +361,7 @@ var callbacks =
                          • To search for remote devices, use the startScan() method of the BluetoothLEAdapter interface:

                            -
                            adapter.startScan(callbacks);
                            +
                            adapter.startScan(successcallback);
                          • When you find the right remote device or the user cancels the scanning, disable the scan using the stopScan() method of the BluetoothLEAdapter interface:

                            adapter.stopScan();
                            @@ -470,7 +456,7 @@ function onDeviceFound(device)
                          • When the callbacks are completed, initiate the Bluetooth Low Energy scan using the startScan() method of the BluetoothLEAdapter adapter:

                            -
                            adapter.startScan({onsuccess: onDeviceFound});
                          • +
                            adapter.startScan(onDeviceFound);
                          • When the connection to the remote device is no longer required, disconnect from the device by calling the disconnect() method of the BluetoothLEDevice interface:

                            remoteDevice.disconnect();
                          • @@ -525,7 +511,7 @@ function onDeviceFound(device)
                          • When the callbacks are completed, initiate the Bluetooth Low Energy scan:

                            -
                            adapter.startScan({onsuccess: onDeviceFound});
                          • +
                            adapter.startScan(onDeviceFound);
                          • When the notifications about the connection are no longer required, unregister the listener from the device by calling the removeConnectStateChangeListener() method of the BluetoothLEDevice interface:

                            remoteDevice.removeConnectStateChangeListener(watchId);
                          • diff --git a/org.tizen.tutorials/html/web/tizen/communication/comm_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/communication/comm_tutorials_w.htm index a82293d..e951a6e 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/comm_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/comm_tutorials_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Related Info

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/messaging_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/communication/messaging_tutorial_w.htm index 74d12bf..334ec40 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/messaging_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/messaging_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -46,16 +46,7 @@

                            This tutorial demonstrates how you can create, send, and read messages as well as manage messages in the message storage.

                            -
                            - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Messaging API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/nfc_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/communication/nfc_tutorial_w.htm index 846a35d..8aa79fa 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/nfc_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/nfc_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -48,17 +48,7 @@

                            This tutorial demonstrates how you can use NFC connectivity to detect NFC tags and exchange data with NFC-enabled devices.

                            - - - - - - - - - -
                            Note
                            The NFC API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                            The NFC API is supported on all Tizen Emulators.

                            +

                            The NFC API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The NFC API is supported on all Tizen Emulators.

                            Warm-up

                            Become familiar with the NFC API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/push_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/communication/push_tutorial_w.htm index 979d00c..18f0655 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/push_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/push_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -40,18 +40,7 @@

                            This tutorial demonstrates how you can register your application, connect to the push service, and start receiving push notifications.

                            - - - - - - - - - -
                            Note
                            The Push API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                            The Push API is supported on all Tizen Emulators.

                            -
                            +

                            The Push API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Push API is supported on all Tizen Emulators.

                            Warm-up

                            Become familiar with the Push API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/secure_element_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/communication/secure_element_tutorial_w.htm index e8e40b5..0ca00de 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/secure_element_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/secure_element_tutorial_w.htm @@ -18,8 +18,8 @@
                            -

                            Mobile Web - Wearable Web

                            +

                            Mobile Web + Wearable Web

                            Content

                            @@ -43,17 +43,7 @@

                            This tutorial demonstrates how you can access and manage secure elements in a device.

                            - - - - - - - - - -
                            Note
                            The Secure Element API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                            The Secure Element API is supported on all Tizen Emulators.

                            +

                            The Secure Element API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Secure Element API is supported on all Tizen Emulators.

                            Warm-up

                            Become familiar with the Secure Element API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/task_bluetoothchat_w.htm b/org.tizen.tutorials/html/web/tizen/communication/task_bluetoothchat_w.htm index 4e61ced..8c07cc3 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/task_bluetoothchat_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/task_bluetoothchat_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/task_chatter_w.htm b/org.tizen.tutorials/html/web/tizen/communication/task_chatter_w.htm index 34398f5..0d8bb72 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/task_chatter_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/task_chatter_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            diff --git a/org.tizen.tutorials/html/web/tizen/communication/task_contactsexchanger_w.htm b/org.tizen.tutorials/html/web/tizen/communication/task_contactsexchanger_w.htm index df10837..3b4eb95 100644 --- a/org.tizen.tutorials/html/web/tizen/communication/task_contactsexchanger_w.htm +++ b/org.tizen.tutorials/html/web/tizen/communication/task_contactsexchanger_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            diff --git a/org.tizen.tutorials/html/web/tizen/content/content_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/content/content_tutorial_w.htm index 113b828..ccabff5 100644 --- a/org.tizen.tutorials/html/web/tizen/content/content_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/content/content_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -51,17 +51,7 @@

                            This tutorial demonstrates how you can retrieve content and manage items in your device local storage.

                            - - - - - - - - - -
                            Note
                            The Content API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Content API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            Warm-up

                            Become familiar with the Content API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/content/content_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/content/content_tutorials_w.htm index 288e265..62b9454 100644 --- a/org.tizen.tutorials/html/web/tizen/content/content_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/content/content_tutorials_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Related Info

                            diff --git a/org.tizen.tutorials/html/web/tizen/content/download_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/content/download_tutorial_w.htm index aa5aa77..876ce6c 100644 --- a/org.tizen.tutorials/html/web/tizen/content/download_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/content/download_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -42,17 +42,7 @@

                            This tutorial demonstrates how you can manage and monitor downloads.

                            - - - - - - - - - -
                            Note
                            The Download API is mandatory for the Tizen mobile profile, but optional for the wearable profile. This means that it is supported in all mobile devices, but may not be supported in all wearable devices. -

                            The Download API is supported on all Tizen Emulators.

                            +

                            The Download API is mandatory for the Tizen mobile profile, but optional for the wearable profile. This means that it is supported in all mobile devices, but may not be supported in all wearable devices. The Download API is supported on all Tizen Emulators.

                            Warm-up

                            diff --git a/org.tizen.tutorials/html/web/tizen/content/exif_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/content/exif_tutorial_w.htm index b45e11d..6dc64ef 100644 --- a/org.tizen.tutorials/html/web/tizen/content/exif_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/content/exif_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -42,17 +42,7 @@

                            This tutorial demonstrates how you can use EXIF (exchangeable image format) information stored in JPEG files.

                            - - - - - - - - - -
                            Note
                            The Exif API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            The Exif API is supported on all Tizen Emulators.

                            +

                            The Exif API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The Exif API is supported on all Tizen Emulators.

                            Warm-up

                            Become familiar with the Exif API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/content/task_downloadmanager_w.htm b/org.tizen.tutorials/html/web/tizen/content/task_downloadmanager_w.htm index 97d938f..b9de649 100644 --- a/org.tizen.tutorials/html/web/tizen/content/task_downloadmanager_w.htm +++ b/org.tizen.tutorials/html/web/tizen/content/task_downloadmanager_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            diff --git a/org.tizen.tutorials/html/web/tizen/content/task_mediacontent_w.htm b/org.tizen.tutorials/html/web/tizen/content/task_mediacontent_w.htm index 5f7bfd0..3a5733a 100644 --- a/org.tizen.tutorials/html/web/tizen/content/task_mediacontent_w.htm +++ b/org.tizen.tutorials/html/web/tizen/content/task_mediacontent_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            diff --git a/org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm index 44b3fbd..144e452 100644 --- a/org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -41,17 +41,7 @@

                            This tutorial demonstrates how you can create, browse, and extract ZIP archives.

                            - - - - - - - - - -
                            Note
                            The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            The Archive API is supported on all Tizen Emulators.

                            +

                            The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The Archive API is supported on all Tizen Emulators.

                            Warm-up

                            Become familiar with the Archive API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/input_output/filesystem_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/input_output/filesystem_tutorial_w.htm index cca6685..a539a08 100644 --- a/org.tizen.tutorials/html/web/tizen/input_output/filesystem_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/input_output/filesystem_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -46,17 +46,7 @@

                            This tutorial demonstrates how you can control files and directories on the device.

                            - - - - - - - - - -
                            Note
                            The Filesystem API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Filesystem API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            Warm-up

                            Become familiar with the Filesystem API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/input_output/io_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/input_output/io_tutorials_w.htm index ddb317a..0c778e3 100644 --- a/org.tizen.tutorials/html/web/tizen/input_output/io_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/input_output/io_tutorials_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Related Info

                            diff --git a/org.tizen.tutorials/html/web/tizen/input_output/message_port_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/input_output/message_port_tutorial_w.htm index 3278803..f4e4173 100644 --- a/org.tizen.tutorials/html/web/tizen/input_output/message_port_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/input_output/message_port_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -40,17 +40,7 @@

                            This tutorial demonstrates how you can send and receive messages through message ports.

                            - - - - - - - - - -
                            Note
                            The Message Port API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Message Port API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            Warm-up

                            Become familiar with the Message Port API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/input_output/task_filemanager_w.htm b/org.tizen.tutorials/html/web/tizen/input_output/task_filemanager_w.htm index 8dfd641..595b4ae 100644 --- a/org.tizen.tutorials/html/web/tizen/input_output/task_filemanager_w.htm +++ b/org.tizen.tutorials/html/web/tizen/input_output/task_filemanager_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            @@ -148,7 +148,7 @@ passThruModifiers: function(tplHtml, tplParam, content)    if (content && (typeof content === 'string'))    { -         content = content.replace(specRegExp, '$$$$'); +      content = content.replace(specRegExp, '$$$$');    }    if (regModOn.test(tplHtml)) @@ -163,7 +163,7 @@ passThruModifiers: function(tplHtml, tplParam, content)    }    else    { -         tplHtml = tplHtml.replace(regModOff, content); +      tplHtml = tplHtml.replace(regModOff, content);    }    return tplHtml; diff --git a/org.tizen.tutorials/html/web/tizen/multimedia/media_controller_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/multimedia/media_controller_tutorial_w.htm index 791e957..8efa45f 100644 --- a/org.tizen.tutorials/html/web/tizen/multimedia/media_controller_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/multimedia/media_controller_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -43,17 +43,7 @@

                            This tutorial demonstrates how you can to develop server and client applications for controlling various media functions of the device.

                            - - - - - - - - - -
                            Note
                            The Media Controller API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Media Controller API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            Warm-up

                            Become familiar with the Media Controller API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/multimedia/media_key_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/multimedia/media_key_tutorial_w.htm index 8a6d68a..2a32b6c 100644 --- a/org.tizen.tutorials/html/web/tizen/multimedia/media_key_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/multimedia/media_key_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -40,17 +40,7 @@

                            This tutorial demonstrates how you can control multimedia playback.

                            - - - - - - - - - -
                            Note
                            The Media Key API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                            The Media Key API is not supported on any Tizen Emulators.

                            +

                            The Media Key API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Media Key API is not supported on any Tizen Emulators.

                            Warm-up

                            Become familiar with the Media Key API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/multimedia/multimedia_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/multimedia/multimedia_tutorials_w.htm index fdde298..a71069c 100644 --- a/org.tizen.tutorials/html/web/tizen/multimedia/multimedia_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/multimedia/multimedia_tutorials_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Related Info

                            diff --git a/org.tizen.tutorials/html/web/tizen/multimedia/sound_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/multimedia/sound_tutorial_w.htm index f5af960..f63c69c 100644 --- a/org.tizen.tutorials/html/web/tizen/multimedia/sound_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/multimedia/sound_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -43,17 +43,7 @@

                            This tutorial demonstrates how you can manage the device volume levels and sound devices.

                            - - - - - - - - - -
                            Note
                            The Sound API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                            All mandatory APIs are supported on the Tizen Emulators.

                            +

                            The Sound API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                            Warm-up

                            Become familiar with the Sound API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/service/service_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/service/service_tutorial_w.htm index 4ae21e1..0d85495 100644 --- a/org.tizen.tutorials/html/web/tizen/service/service_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/service/service_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Wearable Web

                            +

                            Wearable Web

                            Content

                            @@ -40,16 +40,7 @@

                            This tutorial demonstrates how you can create a service application and implement specific features within the service application.

                            - - - - - - - - - -
                            Note
                            This feature is supported in wearable applications only.
                            +

                            This feature is supported in wearable applications only.

                            Warm-up

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/account_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/social/account_tutorial_w.htm index 1cc4809..a3b1ddd 100644 --- a/org.tizen.tutorials/html/web/tizen/social/account_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/account_tutorial_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -41,16 +41,7 @@

                            This tutorial demonstrates how you can manage accounts and retrieve account information.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Account API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/bookmark_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/social/bookmark_tutorial_w.htm index 483c1e0..8111f82 100644 --- a/org.tizen.tutorials/html/web/tizen/social/bookmark_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/bookmark_tutorial_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -39,16 +39,7 @@

                            This tutorial demonstrates how you can manage Tizen Web browser bookmarks on the device.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Bookmark API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/calendar_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/social/calendar_tutorial_w.htm index 36ef391..e1357ae 100644 --- a/org.tizen.tutorials/html/web/tizen/social/calendar_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/calendar_tutorial_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -55,16 +55,7 @@

                            This tutorial demonstrates how you can manage calendars in the device to access, modify, add, and remove calendar items within a specified calendar on the device.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Calendar API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/call_history_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/social/call_history_tutorial_w.htm index aae5dc0..b179162 100644 --- a/org.tizen.tutorials/html/web/tizen/social/call_history_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/call_history_tutorial_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -39,16 +39,7 @@

                            This tutorial demonstrates how you can manage and monitor the call history.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Call History API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/contact_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/social/contact_tutorial_w.htm index c283388..20ea238 100644 --- a/org.tizen.tutorials/html/web/tizen/social/contact_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/contact_tutorial_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -63,16 +63,7 @@

                            This tutorial demonstrates how you can manage address books in the device to access, modify, add, and remove contacts within a specified address book on the device.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Contact API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/data_sync_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/social/data_sync_tutorial_w.htm index dd624a5..70db294 100644 --- a/org.tizen.tutorials/html/web/tizen/social/data_sync_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/data_sync_tutorial_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -38,16 +38,7 @@

                            This tutorial demonstrates how you can synchronize device data, such as contacts and calendar events, with the OMA DS server.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Data Synchronization API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/tizen/social/social_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/social/social_tutorials_w.htm index 01267bc..d794111 100644 --- a/org.tizen.tutorials/html/web/tizen/social/social_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/social_tutorials_w.htm @@ -16,7 +16,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Related Info

                            @@ -31,16 +31,7 @@

                            Social: Managing Personal Data

                            - - - - - - - - - -
                            Note
                            The Social API domain is supported in mobile applications only.
                            +

                            The Social API domain is supported in mobile applications only.

                            The social data tutorials demonstrate how to use the following features in creating Tizen Web applications:

                              diff --git a/org.tizen.tutorials/html/web/tizen/social/task_calllog_w.htm b/org.tizen.tutorials/html/web/tizen/social/task_calllog_w.htm index 9ad96c7..c0667fd 100644 --- a/org.tizen.tutorials/html/web/tizen/social/task_calllog_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/task_calllog_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              diff --git a/org.tizen.tutorials/html/web/tizen/social/task_eventmanager_w.htm b/org.tizen.tutorials/html/web/tizen/social/task_eventmanager_w.htm index d55c274..9d08f37 100644 --- a/org.tizen.tutorials/html/web/tizen/social/task_eventmanager_w.htm +++ b/org.tizen.tutorials/html/web/tizen/social/task_eventmanager_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/fm_radio_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/fm_radio_tutorial_w.htm index 1c000e0..7423ac8 100644 --- a/org.tizen.tutorials/html/web/tizen/system/fm_radio_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/fm_radio_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              Content

                              @@ -40,16 +40,7 @@

                              This tutorial demonstrates how you can manage a FM radio on the device.

                              - - - - - - - - - -
                              Note
                              This feature is supported in mobile applications only.
                              +

                              This feature is supported in mobile applications only.

                              Warm-up

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm index 3d50159..91402d2 100644 --- a/org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -41,17 +41,7 @@

                              This tutorial demonstrates how you can monitor user activity.

                              - - - - - - - - - -
                              Note
                              The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                              The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).

                              +

                              The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).

                              Warm-up

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/power_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/power_tutorial_w.htm index bf4d4cd..787ecc5 100644 --- a/org.tizen.tutorials/html/web/tizen/system/power_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/power_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -41,17 +41,7 @@

                              This tutorial demonstrates how you can access the device power state.

                              - - - - - - - - - -
                              Note
                              The Power API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Power API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the Power API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/sensor_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/sensor_tutorial_w.htm index a8264c4..872424f 100644 --- a/org.tizen.tutorials/html/web/tizen/system/sensor_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/sensor_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -40,17 +40,7 @@

                              This tutorial demonstrates how you can use device sensors.

                              - - - - - - - - - -
                              Note
                              The Sensor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. -

                              The Sensor API is supported on all Tizen Emulators.

                              +

                              The Sensor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Sensor API is supported on all Tizen Emulators.

                              Warm-up

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/system_info_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/system_info_tutorial_w.htm index 71f06d4..07c445f 100644 --- a/org.tizen.tutorials/html/web/tizen/system/system_info_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/system_info_tutorial_w.htm @@ -17,8 +17,8 @@
                              -

                              Mobile Web - Wearable Web

                              +

                              Mobile Web + Wearable Web

                              Content

                              @@ -44,17 +44,7 @@

                              This tutorial demonstrates how you can obtain information about the device properties.

                              - - - - - - - - - -
                              Note
                              The System Information API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The System Information API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the System Information API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/system_setting_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/system_setting_tutorial_w.htm index 38a4cd6..9146a12 100644 --- a/org.tizen.tutorials/html/web/tizen/system/system_setting_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/system_setting_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -41,17 +41,7 @@

                              This tutorial demonstrates how you can access the device's settings for the home screen and lock screen wallpaper, incoming call ringtone, and email notification tone.

                              - - - - - - - - - -
                              Note
                              The System Setting API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              The System Setting API is supported on the Tizen mobile Emulator and partly supported on the Tizen wearable Emulator (only the home screen and incoming call features).

                              +

                              The System Setting API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The System Setting API is supported on the Tizen mobile Emulator and partly supported on the Tizen wearable Emulator (only the home screen and incoming call features).

                              Warm-up

                              Become familiar with the System Setting API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/system_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/system/system_tutorials_w.htm index 5f885ac..ffc94bb 100644 --- a/org.tizen.tutorials/html/web/tizen/system/system_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/system_tutorials_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Related Info

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/task_sensorball_w.htm b/org.tizen.tutorials/html/web/tizen/system/task_sensorball_w.htm index 8d11437..bf10c00 100644 --- a/org.tizen.tutorials/html/web/tizen/system/task_sensorball_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/task_sensorball_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/task_systeminfo_w.htm b/org.tizen.tutorials/html/web/tizen/system/task_systeminfo_w.htm index 427f68c..5cbf375 100644 --- a/org.tizen.tutorials/html/web/tizen/system/task_systeminfo_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/task_systeminfo_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/time_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/time_tutorial_w.htm index 43350bc..6818bca 100644 --- a/org.tizen.tutorials/html/web/tizen/system/time_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/time_tutorial_w.htm @@ -17,8 +17,7 @@
                              -

                              Mobile Web - Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -43,17 +42,7 @@

                              This tutorial demonstrates how you can manage date and time information and perform different calculations and other tasks related to date and time.

                              - - - - - - - - - -
                              Note
                              The Time API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Time API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the Time API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/system/web_setting_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/system/web_setting_tutorial_w.htm index 098343f..e8d344c 100644 --- a/org.tizen.tutorials/html/web/tizen/system/web_setting_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/system/web_setting_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              Content

                              @@ -39,16 +39,7 @@

                              This tutorial demonstrates how you can manage Web view properties.

                              - - - - - - - - - -
                              Note
                              This feature is supported in mobile applications only.
                              +

                              This feature is supported in mobile applications only.

                              Warm-up

                              Become familiar with the Web Setting API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/tizen/tizen_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/tizen/tizen_tutorials_w.htm index 93f599e..ba0d96e 100644 --- a/org.tizen.tutorials/html/web/tizen/tizen/tizen_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/tizen/tizen_tutorials_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -51,17 +51,7 @@

                              This tutorial demonstrates how you can utilize generic Tizen Device API features, such as filters, sorting modes, and generic event handlers.

                              - - - - - - - - - -
                              Note
                              The Tizen API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Tizen API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the Tizen API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm b/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm index 32089c9..29cba39 100644 --- a/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm +++ b/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Related Info

                              @@ -34,20 +34,6 @@

                              Tizen tutorials teach you how to incorporate Tizen features into your application. The tutorials cover detailed code snippets to help you see how to write the required code in practice.

                              - - - - - - - - - -
                              Note
                              In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional. -

                              The mandatory APIs are always available on all Tizen devices. The optional APIs provide functionality that depends on the available device hardware or software capabilities, and they may not be available in all Tizen devices. For example, the Bluetooth and NFC API hardware features are optional, and not supported on all devices.

                              -

                              To determine the availability of optional APIs, use the tizen.systeminfo.getCapability() method of the System Information API (in mobile and wearable applications).

                              -

                              Note that all mandatory APIs are supported on the Tizen Emulators, while the optional APIs may or may not be supported. For the details of each API, see Tizen Web Device API Reference.

                              -

                              Select the feature you are interested in and see how you can implement its various functionalities into your application.

                              The following tutorials demonstrate features provided by the Tizen Web Device API:

                              @@ -72,8 +58,21 @@

                              Demonstrates how you can manage the user's personal data, such as contacts, calendars, location data, and call and browsing history, on the device.

                            + + + + + + + + + +
                            Note
                            In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional. +

                            The mandatory APIs are always available on all Tizen devices. The optional APIs provide functionality that depends on the available device hardware or software capabilities, and they may not be available in all Tizen devices. For example, the Bluetooth and NFC API hardware features are optional, and not supported on all devices.

                            +

                            To determine the availability of optional APIs, use the tizen.systeminfo.getCapability() method of the System Information API (in mobile and wearable applications).

                            +

                            Note that all mandatory APIs are supported on the Tizen Emulators, while the optional APIs may or may not be supported. For the details of each API, see Tizen Web Device API Reference.

                            -

                            For more information about implementing the UI for your application using the Advanced UI Framework (TAU) features, see TAU.

                            +

                            For more information about implementing the UI for your application using the Advanced UI Framework (TAU) features, see TAU.

                            In addition to the Tizen Web Device API tutorials above, you can implement the following features:

                              diff --git a/org.tizen.tutorials/html/web/tizen/ui/badge_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/ui/badge_tutorial_w.htm index 02226fc..0128da4 100644 --- a/org.tizen.tutorials/html/web/tizen/ui/badge_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/ui/badge_tutorial_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -40,17 +40,7 @@

                              This tutorial demonstrates how you can manage home screen badges.

                              - - - - - - - - - -
                              Note
                              The Badge API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Badge API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the Badge API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/ui/noti_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/ui/noti_tutorial_w.htm index b7a5f14..c1b05dd 100644 --- a/org.tizen.tutorials/html/web/tizen/ui/noti_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/tizen/ui/noti_tutorial_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              @@ -41,17 +41,7 @@

                              This tutorial demonstrates how you can manage notifications created based on application events.

                              - - - - - - - - - -
                              Note
                              The Notification API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. -

                              All mandatory APIs are supported on the Tizen Emulators.

                              +

                              The Notification API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.

                              Warm-up

                              Become familiar with the Notification API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/tizen/ui/ui_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/ui/ui_tutorials_w.htm index a4186dc..c36ff3a 100644 --- a/org.tizen.tutorials/html/web/tizen/ui/ui_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tizen/ui/ui_tutorials_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Related Info

                              diff --git a/org.tizen.tutorials/html/web/tutorials_w.htm b/org.tizen.tutorials/html/web/tutorials_w.htm index 6359524..40f70eb 100644 --- a/org.tizen.tutorials/html/web/tutorials_w.htm +++ b/org.tizen.tutorials/html/web/tutorials_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Related Info

                              @@ -35,6 +35,16 @@

                              Tizen Web tutorials teach you how to incorporate Tizen features into your application. The tutorials cover detailed code snippets to help you see how to write the required code in practice.

                              + +

                              Select the feature you are interested in and see how you can implement its various functionalities into your application:

                              + + + @@ -45,16 +55,7 @@
                              - -

                              Select the feature you are interested in and see how you can implement its various functionalities into your application:

                              - - - +
                              diff --git a/org.tizen.tutorials/html/web/w3c/communication/comm_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/communication/comm_tutorials_w.htm index aa7266a..62e5de2 100644 --- a/org.tizen.tutorials/html/web/w3c/communication/comm_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/communication/comm_tutorials_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Related Info

                              @@ -38,7 +38,7 @@
                            • HTML5 Web Messaging: Accessing Device-specific Information

                              Demonstrates how you can send messages between documents and through the message channel ports.

                            • WebSocket: Exchanging Data Using a Socket Server

                              Demonstrates how you can manage the client-server communication.

                            • -
                            • XMLHttpRequest Level 1 and 2: Communicating with the Server

                              Demonstrates how you can communicate with a Web server using HTTP requests.

                            • +
                            • XMLHttpRequest (Level 1 and 2): Communicating with the Server

                              Demonstrates how you can communicate with a Web server using HTTP requests.

                            The following tutorials apply in mobile applications only:

                            diff --git a/org.tizen.tutorials/html/web/w3c/communication/server_sent_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/communication/server_sent_tutorial_w.htm index d26ec30..c9414e6 100644 --- a/org.tizen.tutorials/html/web/w3c/communication/server_sent_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/communication/server_sent_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -39,16 +39,7 @@

                            This tutorial demonstrates how you can implement server push messaging.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            +

                            This feature is supported in mobile applications only.

                            Warm-up

                            Become familiar with the Server-Sent Events API basics by learning about:

                            diff --git a/org.tizen.tutorials/html/web/w3c/communication/web_messaging_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/communication/web_messaging_tutorial_w.htm index 78b599b..9d7cfba 100644 --- a/org.tizen.tutorials/html/web/w3c/communication/web_messaging_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/communication/web_messaging_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            diff --git a/org.tizen.tutorials/html/web/w3c/communication/websocket_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/communication/websocket_tutorial_w.htm index 503f642..59daf68 100644 --- a/org.tizen.tutorials/html/web/w3c/communication/websocket_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/communication/websocket_tutorial_w.htm @@ -18,7 +18,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            diff --git a/org.tizen.tutorials/html/web/w3c/communication/xmlhttprequest_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/communication/xmlhttprequest_tutorial_w.htm index 530df2e..71b1545 100644 --- a/org.tizen.tutorials/html/web/w3c/communication/xmlhttprequest_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/communication/xmlhttprequest_tutorial_w.htm @@ -11,14 +11,14 @@ - XMLHttpRequest Level 1 and 2: Communicating with the Server + XMLHttpRequest (Level 1 and 2): Communicating with the Server
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            @@ -42,7 +42,7 @@
                            -

                            XMLHttpRequest Level 1 and 2: Communicating with the Server

                            +

                            XMLHttpRequest (Level 1 and 2): Communicating with the Server

                            This tutorial demonstrates how you can communicate with a Web server using HTTP requests.

                            diff --git a/org.tizen.tutorials/html/web/w3c/device/battery_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/device/battery_tutorial_w.htm index ad90e97..0d15a6f 100644 --- a/org.tizen.tutorials/html/web/w3c/device/battery_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/battery_tutorial_w.htm @@ -17,7 +17,7 @@
                            -

                            Mobile Web Wearable Web

                            +

                            Mobile Web Wearable Web

                            Content

                            diff --git a/org.tizen.tutorials/html/web/w3c/device/browser_state_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/device/browser_state_tutorial_w.htm index 57a0414..4a8c118 100644 --- a/org.tizen.tutorials/html/web/w3c/device/browser_state_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/browser_state_tutorial_w.htm @@ -17,7 +17,7 @@
                            -

                            Mobile Web

                            +

                            Mobile Web

                            Content

                            @@ -39,17 +39,9 @@

                            This tutorial demonstrates how you can access the browser connection state.

                            - - - - - - - - - -
                            Note
                            This feature is supported in mobile applications only.
                            - + +

                            This feature is supported in mobile applications only.

                            +

                            Warm-up

                            Become familiar with the HTML5 Browser state API basics by learning about:

                              diff --git a/org.tizen.tutorials/html/web/w3c/device/device_orientation_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/device/device_orientation_tutorial_w.htm index 48d08ca..f224b44 100644 --- a/org.tizen.tutorials/html/web/w3c/device/device_orientation_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/device_orientation_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Content

                              diff --git a/org.tizen.tutorials/html/web/w3c/device/device_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/device/device_tutorials_w.htm index 211cdaf..0f77e1d 100644 --- a/org.tizen.tutorials/html/web/w3c/device/device_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/device_tutorials_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web Wearable Web

                              +

                              Mobile Web Wearable Web

                              Related Info

                              diff --git a/org.tizen.tutorials/html/web/w3c/device/screen_orientation_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/device/screen_orientation_tutorial_w.htm index d5f151e..d22052e 100644 --- a/org.tizen.tutorials/html/web/w3c/device/screen_orientation_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/screen_orientation_tutorial_w.htm @@ -17,7 +17,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              Content

                              @@ -38,16 +38,8 @@

                              This tutorial demonstrates how you can manage the screen orientation state.

                              - - - - - - - - - -
                              Note
                              This feature is supported in mobile applications only.
                              + +

                              This feature is supported in mobile applications only.

                              Warm-up

                              diff --git a/org.tizen.tutorials/html/web/w3c/device/task_compass_w.htm b/org.tizen.tutorials/html/web/w3c/device/task_compass_w.htm index 81e3254..1657542 100644 --- a/org.tizen.tutorials/html/web/w3c/device/task_compass_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/task_compass_w.htm @@ -18,7 +18,7 @@
                              -

                              Mobile Web

                              +

                              Mobile Web

                              @@ -154,7 +154,7 @@ else angleMemory = angle;
                        9. -
                        10. The needle position is updated by rotating the needle with the rotate() method of the transform function, based on the angle calculated above.

                          +
                        11. The needle position is updated by rotating the needle with the rotate() method of the transform function, based on the angle calculated above.

                          $('#direction').text(text);
                          diff --git a/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_mw.htm b/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_mw.htm
                          index e0db8ee..5288fdd 100644
                          --- a/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_mw.htm
                          +++ b/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_mw.htm
                          @@ -18,7 +18,7 @@
                           
                           
                          -

                          Mobile Web

                          +

                          Mobile Web

                          diff --git a/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_ww.htm b/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_ww.htm index 03d00bb..be8e699 100644 --- a/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_ww.htm +++ b/org.tizen.tutorials/html/web/w3c/device/task_touch_paint_ww.htm @@ -18,7 +18,7 @@
                          -

                          Wearable Web

                          +

                          Wearable Web

                          diff --git a/org.tizen.tutorials/html/web/w3c/device/touch_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/device/touch_tutorial_w.htm index 42ba4cf..5196fe7 100644 --- a/org.tizen.tutorials/html/web/w3c/device/touch_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/touch_tutorial_w.htm @@ -17,7 +17,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/device/vibration_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/device/vibration_tutorial_w.htm index 9b6c7ad..a691d13 100644 --- a/org.tizen.tutorials/html/web/w3c/device/vibration_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/device/vibration_tutorial_w.htm @@ -17,7 +17,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/graphics/canvas_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/graphics/canvas_tutorial_w.htm index 18f2d77..2df5db9 100644 --- a/org.tizen.tutorials/html/web/w3c/graphics/canvas_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/graphics/canvas_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/graphics/graphics_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/graphics/graphics_tutorials_w.htm index 73252fe..7ca29b8 100644 --- a/org.tizen.tutorials/html/web/w3c/graphics/graphics_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/graphics/graphics_tutorials_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/graphics/svg_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/graphics/svg_tutorial_w.htm index 92218d7..a41dd8c 100644 --- a/org.tizen.tutorials/html/web/w3c/graphics/svg_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/graphics/svg_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/graphics/task_basicwatch_w.htm b/org.tizen.tutorials/html/web/w3c/graphics/task_basicwatch_w.htm index 8610251..c5a1b76 100644 --- a/org.tizen.tutorials/html/web/w3c/graphics/task_basicwatch_w.htm +++ b/org.tizen.tutorials/html/web/w3c/graphics/task_basicwatch_w.htm @@ -18,7 +18,7 @@
                          -

                          Wearable Web

                          +

                          Wearable Web

                          diff --git a/org.tizen.tutorials/html/web/w3c/location/geolocation_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/location/geolocation_tutorial_w.htm index 410567a..6281811 100644 --- a/org.tizen.tutorials/html/web/w3c/location/geolocation_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/location/geolocation_tutorial_w.htm @@ -16,7 +16,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/location/location_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/location/location_tutorials_w.htm index 3ffd3fb..a6826e9 100644 --- a/org.tizen.tutorials/html/web/w3c/location/location_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/location/location_tutorials_w.htm @@ -16,7 +16,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/getusermedia_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/media/getusermedia_tutorial_w.htm index d5a7728..ddb899a 100644 --- a/org.tizen.tutorials/html/web/w3c/media/getusermedia_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/getusermedia_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/media_capture_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/media/media_capture_tutorial_w.htm index 7652634..0cd33de 100644 --- a/org.tizen.tutorials/html/web/w3c/media/media_capture_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/media_capture_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          Content

                          @@ -38,16 +38,7 @@

                          This tutorial demonstrates how you can use the HTML media capture feature.

                          - - - - - - - - - -
                          Note
                          This feature is supported in mobile applications only.
                          +

                          This feature is supported in mobile applications only.

                          Warm-up

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/media_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/media/media_tutorials_w.htm index def7baf..2ea94a4 100644 --- a/org.tizen.tutorials/html/web/w3c/media/media_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/media_tutorials_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/task_piano_w.htm b/org.tizen.tutorials/html/web/w3c/media/task_piano_w.htm index 49f38f8..5da486d 100644 --- a/org.tizen.tutorials/html/web/w3c/media/task_piano_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/task_piano_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/task_selfcamera_w.htm b/org.tizen.tutorials/html/web/w3c/media/task_selfcamera_w.htm index 4af1cc6..0b004fc 100644 --- a/org.tizen.tutorials/html/web/w3c/media/task_selfcamera_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/task_selfcamera_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/video_audio_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/media/video_audio_tutorial_w.htm index fd4627a..2f0cc35 100644 --- a/org.tizen.tutorials/html/web/w3c/media/video_audio_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/video_audio_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/media/webaudio_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/media/webaudio_tutorial_w.htm index c65629e..81054de 100644 --- a/org.tizen.tutorials/html/web/w3c/media/webaudio_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/media/webaudio_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          Content

                          @@ -40,16 +40,7 @@

                          This tutorial demonstrates how you can play audio content using the Web audio.

                          - - - - - - - - - -
                          Note
                          This feature is supported in mobile applications only.
                          +

                          This feature is supported in mobile applications only.

                          Warm-up

                          diff --git a/org.tizen.tutorials/html/web/w3c/perf_opt/page_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/perf_opt/page_tutorial_w.htm index 409c54c..6005a1a 100644 --- a/org.tizen.tutorials/html/web/w3c/perf_opt/page_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/perf_opt/page_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/perf_opt/performance_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/perf_opt/performance_tutorials_w.htm index 5562228..0d7f383 100644 --- a/org.tizen.tutorials/html/web/w3c/perf_opt/performance_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/perf_opt/performance_tutorials_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/perf_opt/timing_control_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/perf_opt/timing_control_tutorial_w.htm index 51431e9..f817308 100644 --- a/org.tizen.tutorials/html/web/w3c/perf_opt/timing_control_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/perf_opt/timing_control_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/perf_opt/web_workers_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/perf_opt/web_workers_tutorial_w.htm index bbccb9b..8f05a48 100644 --- a/org.tizen.tutorials/html/web/w3c/perf_opt/web_workers_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/perf_opt/web_workers_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/security/cors_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/security/cors_tutorial_w.htm index f1ad7cc..3df2a46 100644 --- a/org.tizen.tutorials/html/web/w3c/security/cors_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/security/cors_tutorial_w.htm @@ -17,7 +17,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/security/iframe_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/security/iframe_tutorial_w.htm index 09c61bc..fff4c0a 100644 --- a/org.tizen.tutorials/html/web/w3c/security/iframe_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/security/iframe_tutorial_w.htm @@ -17,7 +17,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/security/security_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/security/security_tutorials_w.htm index 86e7811..f93f96c 100644 --- a/org.tizen.tutorials/html/web/w3c/security/security_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/security/security_tutorials_w.htm @@ -17,7 +17,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/storage/appcache_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/storage/appcache_tutorial_w.htm index 2e1048c..e22f834 100644 --- a/org.tizen.tutorials/html/web/w3c/storage/appcache_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/storage/appcache_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          Content

                          @@ -41,16 +41,7 @@

                          This tutorial demonstrates how you can use HTML5 application caches.

                          - - - - - - - - - -
                          Note
                          This feature is supported in mobile applications only.
                          +

                          This feature is supported in mobile applications only.

                          Warm-up

                          Become familiar with the HTML5 Application caches API basics by learning about:

                          diff --git a/org.tizen.tutorials/html/web/w3c/storage/file_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/storage/file_tutorial_w.htm index b9b17ba..7d7da0e 100644 --- a/org.tizen.tutorials/html/web/w3c/storage/file_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/storage/file_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/storage/indexdb_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/storage/indexdb_tutorial_w.htm index c413cfd..e27b9b7 100644 --- a/org.tizen.tutorials/html/web/w3c/storage/indexdb_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/storage/indexdb_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/storage/storage_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/storage/storage_tutorials_w.htm index cb579f1..36d796f 100644 --- a/org.tizen.tutorials/html/web/w3c/storage/storage_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/storage/storage_tutorials_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/storage/websql_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/storage/websql_tutorial_w.htm index cae3fc4..b52ea15 100644 --- a/org.tizen.tutorials/html/web/w3c/storage/websql_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/storage/websql_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          Content

                          @@ -52,16 +52,8 @@

                          Web SQL Database: Creating and Querying Databases

                          This tutorial demonstrates how you can use SQL databases in Tizen applications.

                          - - - - - - - - - -
                          Note
                          This feature is supported in mobile applications only.
                          + +

                          This feature is supported in mobile applications only.

                          Warm-up

                          diff --git a/org.tizen.tutorials/html/web/w3c/storage/webstorage_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/storage/webstorage_tutorial_w.htm index 8b927f4..e2df93d 100644 --- a/org.tizen.tutorials/html/web/w3c/storage/webstorage_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/storage/webstorage_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/supplement/camera_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/supplement/camera_tutorial_w.htm index c918a0b..0050eaf 100644 --- a/org.tizen.tutorials/html/web/w3c/supplement/camera_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/supplement/camera_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Wearable Web

                          +

                          Wearable Web

                          Content

                          @@ -40,16 +40,7 @@

                          This tutorial demonstrates how you can control the camera on a wearable device.

                          - - - - - - - - - -
                          Note
                          This feature is supported in wearable applications only.
                          +

                          This feature is supported in wearable applications only.

                          Warm-up

                          Become familiar with the Camera API (Tizen Extension) API basics by learning about:

                          diff --git a/org.tizen.tutorials/html/web/w3c/supplement/fullscreen_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/supplement/fullscreen_tutorial_w.htm index 061924f..4828165 100644 --- a/org.tizen.tutorials/html/web/w3c/supplement/fullscreen_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/supplement/fullscreen_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web

                          +

                          Mobile Web

                          Content

                          @@ -39,16 +39,7 @@

                          This tutorial demonstrates how you can display an element in the fullscreen mode.

                          - - - - - - - - - -
                          Note
                          This feature is supported in mobile applications only.
                          +

                          This feature is supported in mobile applications only.

                          Warm-up

                          Become familiar with the FullScreen API - Mozilla API basics by learning about:

                          diff --git a/org.tizen.tutorials/html/web/w3c/supplement/supplement_tutorials_w.htm b/org.tizen.tutorials/html/web/w3c/supplement/supplement_tutorials_w.htm index cde38c7..3db8c42 100644 --- a/org.tizen.tutorials/html/web/w3c/supplement/supplement_tutorials_w.htm +++ b/org.tizen.tutorials/html/web/w3c/supplement/supplement_tutorials_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          diff --git a/org.tizen.tutorials/html/web/w3c/supplement/task_camera_w.htm b/org.tizen.tutorials/html/web/w3c/supplement/task_camera_w.htm index 7916992..d604c6f 100644 --- a/org.tizen.tutorials/html/web/w3c/supplement/task_camera_w.htm +++ b/org.tizen.tutorials/html/web/w3c/supplement/task_camera_w.htm @@ -18,7 +18,7 @@
                          -

                          Wearable Web

                          +

                          Wearable Web

                          diff --git a/org.tizen.tutorials/html/web/w3c/supplement/typedarray_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/supplement/typedarray_tutorial_w.htm index 458a11f..b18d312 100644 --- a/org.tizen.tutorials/html/web/w3c/supplement/typedarray_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/supplement/typedarray_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/supplement/webgl_tutorial_w.htm b/org.tizen.tutorials/html/web/w3c/supplement/webgl_tutorial_w.htm index acaaf7d..63e0034 100644 --- a/org.tizen.tutorials/html/web/w3c/supplement/webgl_tutorial_w.htm +++ b/org.tizen.tutorials/html/web/w3c/supplement/webgl_tutorial_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Content

                          diff --git a/org.tizen.tutorials/html/web/w3c/tutorials_w3c_w.htm b/org.tizen.tutorials/html/web/w3c/tutorials_w3c_w.htm index d89903d..0c5f2ce 100644 --- a/org.tizen.tutorials/html/web/w3c/tutorials_w3c_w.htm +++ b/org.tizen.tutorials/html/web/w3c/tutorials_w3c_w.htm @@ -18,7 +18,7 @@
                          -

                          Mobile Web Wearable Web

                          +

                          Mobile Web Wearable Web

                          Related Info

                          @@ -59,7 +59,7 @@

                          Demonstrates how you can create and run a wearable watch face application using the Tizen IDE.

              -

              For more information about implementing the UI for your application using the W3C features, see W3C.

              +

              For more information about implementing the UI for your application using the W3C features, see W3C.

              diff --git a/org.tizen.tutorials/html/web/w3c/watchface/developing_watch_app.htm b/org.tizen.tutorials/html/web/w3c/watchface/developing_watch_app.htm index 151595f..9097626 100644 --- a/org.tizen.tutorials/html/web/w3c/watchface/developing_watch_app.htm +++ b/org.tizen.tutorials/html/web/w3c/watchface/developing_watch_app.htm @@ -18,7 +18,7 @@
              -

              Wearable Web

              +

              Wearable Web

              @@ -39,16 +39,7 @@

              For more information on the sample functionality and the full source code, see Basic Watch task.

              - - - - - - - - - -
              Note
              This feature is supported in wearable applications only.
              +

              This feature is supported in wearable applications only.

              This article describes the main steps required to develop a watch face application using the Tizen IDE. For more detailed information about the application development process, see Web Application Development Process. To learn how to design a watch face, see the Gear UI guides on the Samsung Developers site.

              diff --git a/org.tizen.tutorials/index.xml b/org.tizen.tutorials/index.xml index 585f239..de5117f 100644 --- a/org.tizen.tutorials/index.xml +++ b/org.tizen.tutorials/index.xml @@ -9,6 +9,7 @@ + @@ -111,7 +112,7 @@ - + @@ -147,12 +148,17 @@ - + + - - + + + + + + @@ -161,8 +167,8 @@ - + @@ -188,8 +194,8 @@ - + @@ -213,14 +219,14 @@ - + - + @@ -229,10 +235,9 @@ - - - + + @@ -251,6 +256,7 @@ + diff --git a/org.tizen.ui.guides/.project b/org.tizen.ui.guides/.project deleted file mode 100755 index 2c22bce..0000000 --- a/org.tizen.ui.guides/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.tizen.ui.guides_2.4.0 - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/org.tizen.ui.guides/META-INF/MANIFEST.MF b/org.tizen.ui.guides/META-INF/MANIFEST.MF deleted file mode 100755 index 3ef5790..0000000 --- a/org.tizen.ui.guides/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 1 -Bundle-Name: Tizen UI Guides -Bundle-SymbolicName: org.tizen.ui.guides;singleton=true -Bundle-Version: 2.4.0 -Bundle-Vendor: The Linux Foundation - diff --git a/org.tizen.ui.guides/build.properties b/org.tizen.ui.guides/build.properties deleted file mode 100755 index 264c2a1..0000000 --- a/org.tizen.ui.guides/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -bin.includes = plugin.xml,\ - META-INF/,\ - html/,\ - build.properties,\ - .project,\ - about.html,\ - index.xml - diff --git a/org.tizen.ui.guides/html/cover_page.htm b/org.tizen.ui.guides/html/cover_page.htm deleted file mode 100755 index 1d59870..0000000 --- a/org.tizen.ui.guides/html/cover_page.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - Tizen UI Guides - - - - -

              Tizen
              -UI Guides

              - -

              Click the application type you want:

              -

              Web Application Native Application

              - - - - - - - - - - - - diff --git a/org.tizen.ui.guides/html/css/snippet.css b/org.tizen.ui.guides/html/css/snippet.css deleted file mode 100755 index 2be1b1f..0000000 --- a/org.tizen.ui.guides/html/css/snippet.css +++ /dev/null @@ -1,52 +0,0 @@ -/* Pretty printing styles. Used with prettify.js. */ - -/* SPAN elements with the classes below are added by prettyprint. */ -.pln { color: #000 } /* plain text */ - -@media screen { - .str { color: #793AFF } /* string content */ - .kwd { color: #7F0055 } /* a keyword */ - .com { color: green} /* a comment */ - .typ { color: #1C1C1C } /* a type name */ - .lit { color: black } /* a literal value */ - /* punctuation, lisp open bracket, lisp close bracket */ - .pun, .opn, .clo { color: #1C1C1C} - .tag { color: #008 } /* a markup tag name */ - .atn { color: #606 } /* a markup attribute name */ - .atv { color: #080 } /* a markup attribute value */ - .dec, .var { color: #606 } /* a declaration; a variable name */ - .fun { color: red } /* a function name */ -} - -/* Use higher contrast and text-weight for printable form. */ -@media print, projection { - .str { color: #060 } - .kwd { color: #006; font-weight: bold } - .com { color: #600; font-style: italic } - .typ { color: #404; font-weight: bold } - .lit { color: #044 } - .pun, .opn, .clo { color: #440 } - .tag { color: #006; font-weight: bold } - .atn { color: #404 } - .atv { color: #060 } -} - -/* Put a border around prettyprinted code snippets. */ -pre.prettyprint { overflow: auto; padding: 2px; border: 1px solid #888 } - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ -li.L0, -li.L1, -li.L2, -li.L3, -li.L5, -li.L6, -li.L7, -li.L8 { list-style-type: none } -/* Alternate shading for lines */ -li.L1, -li.L3, -li.L5, -li.L7, -li.L9 { background: #eee } diff --git a/org.tizen.ui.guides/html/css/styles.css b/org.tizen.ui.guides/html/css/styles.css deleted file mode 100755 index ad7ebcb..0000000 --- a/org.tizen.ui.guides/html/css/styles.css +++ /dev/null @@ -1,756 +0,0 @@ -@charset "utf-8"; - -body { - background: white; - color: #1C1C1C; - margin-right: 20px; - margin-left: 20px; - font-size: 9pt; - font-weight: normal; - font-family: Arial, Helvetica, sans-serif; -} - -h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ol, dl, dd, dt, footer { - font-family: Arial, Verdana, Helvetica, sans-serif - } - -/* Set default font to 9 pt */ -table, div, p, dl, td, caption, th, ul, ol, li, dd, dt, pre, code { - font-size: 9pt; -} - -pre, code { - font-family: "Courier New", Courier, monospace; - border: 1px solid #719cc7; - margin: 6px 1.5px; - padding: 1px 1px 1px 1px; - font-weight: normal; - font-style: normal; -} - -h1 {font-size: 24pt; color: #0E437D;} -h2 {font-size: 18pt; color: #0E437D;} -h3 {font-size: 14pt; color: #1C1C1C;} -h4 {font-size: 12pt; color: #1C1C1C;} -h5 {font-size: 10pt; color: #1C1C1C;} - -h1, h2, h3, h4, h5 { - font-weight: bold; - font-style: normal; - line-height: normal; - margin-top: 16pt; -} - -caption, p.caption { - font-size: 9pt; - color: #1C1C1C; - font-weight: bold; - text-align: left; - margin-top: 20px; - margin-bottom: 0px; -} - -ol { - margin-bottom: 20px; -} - -ul ul , ol ul, ul ol, ol ol{ - margin-top: 10px; -} - -ul li, ol li { - margin-bottom: 10px; -} - -ol.tutorstep li { - border-top: 2px solid #719cc7; - list-style-position: inside; - font-weight: bold; - margin-top: 30px; - margin-left: -20px; - padding-top: 3px; - font-size: 12pt; -} - -ol.tutorstep li p{ - font-size: 9pt; - font-weight: normal; - margin-top: 10px; -} - -ol.tutorstep ol li, ol.tutorstep li ol li, ol.tutorstep li ul li { - font-size: 9pt; - list-style-position: outside; - margin-left: 0px; - font-weight: normal; -} - -ol.tutorstep ol li p, ol.tutorstep ul li p { - font-size: 9pt; - font-weight: normal; - margin-top: 5px; -} - -ol li p, ul li p { - font-size: 9pt; - font-weight: normal; - margin-bottom: 2px; - margin-top: 2px; -} - -ol ol , ol.tutorstep ol{ - font-size: 9pt; - font-weight: normal; - list-style-type: lower-alpha; - color: #1C1C1C; - border-style: none; - margin-top: 10px; -} - -ol.tutorstep ul { - margin-top: 10px; - font-size: 9pt; -} - -ol ol li, ol ul li, ol.tutorstep ol li, ol.tutorstep ul li { - border-style: none; - margin-top: 5px; - font-size: 9pt; -} - -ul { - font-size: 9pt; - font-weight: normal; - color: #1C1C1C; -} - - -/* End of font face declarations */ - -/* Set table borders and heading row background */ -table { - border: 0px; - border-collapse: collapse; - width: 100%; - margin-top: 20px; - margin-bottom: 20px; - background: white; -} - -th { - border-top: 2px solid #719cc7; - border-right: 1px solid #c6d9f1; - border-left: 1px solid #c6d9f1; - background-color: #f3f7fb; - padding: 4px; - color: #719cc7; - font-size: 9pt; - font-weight: bold; -} - -td { - border: 1px solid #c6d9f1; - vertical-align:top; - padding: 3px 20px 5px 20px; - } - -td.middle { - border: 1px solid #c6d9f1; - vertical-align:middle; - padding: 3px 20px 5px 20px; - } - -/* Notes stand out using a light top & bottom borders with yellow background */ -table.note { - border-top: 2px solid #719cc7; - border-left: 0px; - border-right: 0px; - width: 100%; -} - -tr.note { - text-align: left; -} - -th.note { - text-align: left; - background-color: #ddd9c3; - background-image: note.gif; - border-top: 2px solid #719cc7; - border-bottom:1px solid #719cc7; - border-right: none; - -} - -td.note, p.note { - background-color: #eeece1; - color: #1C1C1C; - padding: 5px; - margin-top:12px; - margin-bottom:12px; - border: none; -} - -/* Figure titles are centered and bolded */ -p.figure , ol.tutorstep li p.figure, ol.tutorstep ol li p.figure, ol.tutorstep ul li p.figure { - text-align: center; - font-weight: bold; -} - -/* Red background and white text for things that need fixing before release */ -.fix { - background-color: red; - font-weight: bold; - color: white; - } - -/* Classes for creating collapsible content */ -#banner { - padding: 8px 4px 8px 4px; - /* top right bottom left */ - border: 1px solid #7f7f7f; - width: 100%; - background-image: url("banner.png"); - text-align: left; - font-weight: bold; - font-size: 9pt; - color: #ffffff; -} - -#toc-navigation {width: 20%; position: fixed; right: 17px; top: 0; bottom: 51px; /* overflow: auto; *//* min-width: 200px; *//* background: white; */z-index: 100;padding-top: 10px;/* padding-bottom: 88px; */margin-bottom: 89px;} -#toc {padding: 0px 20px 5px 20px; /* border: 2px solid #567a9c; */ border-radius: 15px;position: absolute;top: 78px;bottom: 9px;overflow: auto;/* margin-bottom: 5px; */padding-bottom: 5px;border-bottom: 3px transparent solid;margin-left: 5px;} -#main {width: 75%; height: 90%;} -#container {width:100%;} -#container #contents {padding:0px 0 20px; overflow: auto;position: fixed;top: 0;bottom: 0;margin-bottom: 64px;right: 200px;left: 20px;} -body.no-toc #container #contents {right: 0;padding-right:30px;} -body.no-toc #toc-navigation {width: auto;} -body.no-toc .top {right: 19px; /* float:none; */ width: 28px;} -body.no-toc #profile {float: right;right: -32px;} -body.no-toc #profile p {padding: 0; margin: 0;} -#container #contents:after {content: "."; display: block; height: 20px; clear: both; visibility: hidden;} - #container #contents>.content {/* width:75%; */min-width: 600px;/* right: 300px; *//* position: fixed; */padding-right: 5px;} - #container #contents>.content>.cont { margin-bottom:80px; padding-bottom:80px; } - -.devicespecs-util {float:right; margin-top:25px;} - .devicespecs-util ul.dutil {margin:0; padding-bottom:0; height: 11px; list-style-type:none;} - .devicespecs-util ul.dutil:after {content: "."; display: block; height: 0px; clear: both; visibility: hidden;} - .devicespecs-util ul.dutil li {float:left; margin-right:8px; padding-right:8px; background:url('../images/bg_util_bar.gif') no-repeat right center; color:#666;} - .devicespecs-util ul.dutil li.none {margin-right:0; padding-right:0; background-image:none;} - .devicespecs-util ul.dutil li a { font-size:11px; color:#666; line-height: 11px;} - .devicespecs-util ul.dutil li a:hover { color:#222; } - .devicespecs-util ul.dutil li a:active { color:#222; } - -ul.devicespecifications {clear:both; width:100%; margin:0; padding: 0;} -ul.devicespecifications > li { width:100%; margin-top:0; padding-left:0; list-style-type:none; border:1px solid #799cd3; padding: 5px 0px 5px 0px;} -ul.devicespecifications li div.devicespec-con {width:90%; margin:10px 0 20px 0; padding:0 14px; font-size: 13px;} -ul.devicespecifications li div.devicespec-tit {/*height:22px;*/ padding-right: 71px; background-color:#ffffff; position: relative;} - ul.devicespecifications li div.devicespec-tit .items-tit { /*float:left;*/ margin:0 0 0 14px; padding:0; color:#567a9c; line-height: 22px; font-size: 14px; font-style:normal; font-weight: bold;} - - ul.devicespecifications li div.devicespec-tit .items-tit-h2 { /*float:left;*/ margin: 0px 0px 0px 14px; padding:0; line-height: 22px; font-size: 18pt; color: #0E437D; font-style:normal; font-weight: bold;} - ul.devicespecifications li div.devicespec-tit .items-tit-h3 { /*float:left;*/ margin:0 0 0 14px; padding:0; line-height: 22px; font-size: 14pt; color: #1C1C1C; font-style:normal; font-weight: bold;} - ul.devicespecifications li div.devicespec-tit .items-tit-h4 { /*float:left;*/ margin:0 0 0 14px; padding:0; line-height: 22px; font-size: 12pt; color: #1C1C1C; font-style:normal; font-weight: bold;} - - ul.devicespecifications li div.devicespec-tit > span {position: absolute; top: 0; right:0;background:#416cbb; display:block; height:22px; margin-right:0; border-left: solid 1px #7a9bd4; } - ul.devicespecifications li div.devicespec-tit > span a.bt-arr {display:block; width: 55px; height:15px; margin-left:0; padding-top:5px; padding-left: 14px; text-align:left; background: url('../images/ico_arr_hidden.gif') 46px 9px no-repeat;} - ul.devicespecifications li div.devicespec-tit > span a.bt-arr em {display:inline-block; height: 14px; line-height:11px; font-size:11px; color:#fff; font-style:normal; margin-right: 8px;} - ul.devicespecifications li div.devicespec-tit > span * {vertical-align:middle;} - - ul.devicespecifications li div.devicespec-con ul.con-list { width:100%; } - ul.devicespecifications li div.devicespec-con ul.con-list li {line-height: 18px; margin:0; padding:0 0 0 7px; background: url("../images/ico_bullet_2_7.gif") 0 8px no-repeat; } - -.ul.ul, .ul.ul li {margin-bottom: 10px; list-style-type: disc; border: none;} -.ul.ul ul, .ul.ul ul li, .ol.ol ul, .ol.ol ul li {list-style-type: circle;} -.ol.ol, .ol.ol li {list-style-type: decimal; border: none;} -.ol.ol ol, .ol.ol ol li, .ul.ul ol, .ul.ul ol li {list-style-type: lower-alpha;} - -.static-cont {width:100%; margin-bottom:40px;} - -.top {text-align: right;} -.toc, ul.toc{ - margin: 10px 0px 0px 0px; - padding-left: 13px; - list-style: disc; - font-size: 9pt; - line-height: 115%; - } - -.toc-title { - font-size: 12pt; - color: #0E437D; - font-weight: bold; - font-style: normal; - line-height: normal; - margin-top: 16pt; -} - -a.top { - display:block; - float: right; - position:fixed; - width: 28px; - height:89px; - bottom:50px; - z-index: 101; - right: 19%; - } - -a img {border: 0;} - -/* Footer includes space and a gray line above */ -#footer { - position: fixed; - /* width: 100%; */ - bottom: 0px; - text-align: center; - border-top: 1px solid #CCCCCC; - background-color: #FFFFFF; - left: 21px; right: 21px; -} - -.footer {font-size: 8pt;} - -caption { - font-size: 9pt; - color: #1C1C1C; - font-weight: bold; - text-align: center; - margin-top: 20px; - margin-bottom: 0px; -} - -div.qindex, div.navpath, div.navtab{ - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; -} - -div.qindex, div.navpath { - width: 100%; - line-height: 140%; -} - -div.navtab { - margin-right: 15px; -} - -/* @group Link Styling */ - -a:link { - color: #719cc7; - text-decoration: underline; - font-weight: bold; -} - -a:hover { - color: #0e437d; -} - -a:visited { - text-decoration: underline; - color: #719cc7; - font-weight: bold; -} - -a.qindex { - font-weight: bold; - padding: 2px; -} - -a.qindex:hover { - text-decoration: underline; - color: #0e437d; - padding: 2px; -} - -a.qindex:visited { - text-decoration: underline; - font-weight: bold; - color: #719cc7; - padding: 2px; -} - -a.qindexHL { - text-decoration: underline; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - padding: 2px 6px; - border: 1px double #9295C2; -} - -a.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; - padding: 2px 6px; -} - -dl.el { - margin-left: -1cm -} - -.fragment { - font-family: monospace, fixed; - font-size: 105%; -} - -pre.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - padding: 4px 6px; - margin: 4px 8px 4px 2px; -} - -div.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - padding: 6px; -} - -div.ah { - background-color: black; - font-weight: bold; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px -} - -td.md { - background-color: #f5f5f5; - font-weight: bold; -} - -td.mdname1 { - background-color: #f5f5f5; - font-weight: bold; - color: #602020; -} - -td.mdname { - background-color: #f5f5f5; - font-weight: bold; - color: #602020; - width: 600px; -} - -div.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; -} - -div.groupText { - margin-left: 16px; - font-style: italic; -} - -td.indexkey { - background-color: #eeeeff; - font-weight: bold; - border: 1px solid #CCCCCC; - margin: 2px 0px 2px 0; - padding: 2px 10px; -} - -td.indexvalue { - background-color: #eeeeff; - border: 1px solid #CCCCCC; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #f0f0f0; -} - -p.formulaDsp { - text-align: center; -} - -img.formulaDsp { -} - -img.formulaInl { - vertical-align: middle; -} - -/* @group Code Colorization */ - -span.keyword { color: #008000 } -span.keywordtype { color: #604020 } -span.keywordflow { color: #e08000 } -span.comment { color: #800000 } -span.preprocessor { color: #806020 } -span.stringliteral { color: #002080 } -span.charliteral { color: #008080 } -span.vhdldigit { color: #ff00ff } -span.vhdlchar { color: #000000 } -span.vhdlkeyword { color: #700070 } -span.vhdllogic { color: #ff0000 } - -.mdTable { - border: 1px solid #868686; - background-color: #F4F4FB; -} - -.mdRow { - padding: 8px 10px; -} - -/* @group Member Descriptions */ - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F4F4F4A; - border: none; - margin: 4px; - padding: 3px 8px 4px 8px; -} - -.mdescLeft, .mdescRight { - padding: 0px 8px 4px 8px; - color: #555; -} - -.memItemLeft, .memItemRight, .memTemplParams { - border-top: 1px solid #DBDBDB; -} - -.memTemplParams { - color: #606060; -} - -/* @end */ - -/* @group Member Details */ - -/* Styles for detailed member documentation */ - -.memtemplate { - font-size: 80%; - color: #606060; - font-weight: normal; - margin-left: 3px; -} - -.memnav { - background-color: #eeeeff; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - -.memitem { - padding: 0; -} - -.memname { - white-space: nowrap; - font-weight: bold; -} - -.memproto, .memdoc { - border: 1px solid #9BBCDD; -} - -.memproto { - padding: 0; - background-color: #D5E2EF; - font-weight: bold; - -webkit-border-top-left-radius: 8px; - -webkit-border-top-right-radius: 8px; - -moz-border-radius-topleft: 8px; - -moz-border-radius-topright: 8px; -} - -.memdoc { - padding: 2px 5px; - background-color: #eef3f5; - border-top-width: 0; - -webkit-border-bottom-left-radius: 8px; - -webkit-border-bottom-right-radius: 8px; - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; -} - -.memdoc p, .memdoc dl, .memdoc ul { - margin: 6px 0; -} - -.paramkey { - text-align: right; -} - -.paramtype { - white-space: nowrap; -} - -.paramname { - color: #853E0E; - white-space: nowrap; -} -.paramname em { - font-style: normal; -} - -/* @end */ - -.search { color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #eeeeff; -} - -td.tiny { - font-size: 75%; -} - -.highlight { - background-color:#E2E2FF; -} - -/*---------- ide-eclipse Styles ---------*/ -.sh_ide-eclipse{font-family: "Courier New", Courier, monospace; - margin: 0px 0px; - padding: -30px -30px -30px -30px; - font-weight: normal; - font-style: normal;} -.sh_ide-eclipse .sh_sourceCode{background-color:#fff;color:#000;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_keyword{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_type{color:#7f0055;font-weight:bold;font-style:normal;} -/*.sh_ide-eclipse .sh_sourceCode .sh_string{color:#00f;font-weight:normal;font-style:normal;}*/ -.sh_ide-eclipse .sh_sourceCode .sh_string{color:#2A00FF;font-weight:normal;font-style:normal;} - -.sh_ide-eclipse .sh_sourceCode .sh_regexp{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_specialchar{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_comment{color:#238E23;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_number{color:#000;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_preproc{color:#3f5fbf;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_function{color:#000;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_url{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_date{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_time{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_file{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_ip{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_name{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_variable{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_oldfile{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_newfile{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_difflines{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_selector{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_property{color:#7f0055;font-weight:bold;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_value{color:#00f;font-weight:normal;font-style:normal;} -.sh_ide-eclipse .sh_sourceCode .sh_unknown{font-family: "Courier New", Courier, monospace;} - -/*------------- STYLE FOR NAMES FROM XML FILE -------------*/ -.sh_styleFromXML{color:#800000;font-weight:bold;} -/*-------------------------------------------------------*/ - -/*-------- Snippet Base Styles ----------*/ -.snippet-wrap {position:relative;} -*:first-child+html .snippet-wrap {display:inline-block;} -* html .snippet-wrap {display:inline-block;} -.snippet-reveal{text-decoration:underline;} -.snippet-wrap .snippet-menu, .snippet-wrap .snippet-hide {position:absolute; top:-99999px; right:15px; font-size:.9em;z-index:1;background-color:transparent;} -.snippet-wrap .snippet-hide {top:auto; bottom:1px;} -*:first-child+html .snippet-wrap .snippet-hide {bottom:1px;} -* html .snippet-wrap .snippet-hide {bottom:1px;} -.snippet-wrap .snippet-menu pre, .snippet-wrap .snippet-hide pre {background-color:transparent; margin:1; padding:0;} -.snippet-wrap .snippet-menu a, .snippet-wrap .snippet-hide a {padding:1px; text-decoration:underline;} -.snippet-wrap pre.sh_sourceCode{padding:1px;line-height:120%;overflow:auto;position:relative; --moz-border-radius:0px; --webkit-border-radius:0px; -border-radius:0px; -box-shadow: 1px 1px px #000; --moz-box-shadow: 2px 2px 1px #000; --webkit-box-shadow: 1px 1px 1px #000;} -.snippet-wrap pre.snippet-textonly {padding:1em;} -*:first-child+html .snippet-wrap pre.snippet-formatted {padding:0.5em 0.5em;} -* html .snippet-wrap pre.snippet-formatted {padding:0em 0.3em;} -.snippet-reveal pre.sh_sourceCode {padding:0em 0em; text-align:right;} -.snippet-wrap .snippet-num li{padding-left:2px;} -.snippet-wrap .snippet-no-num{list-style:none; padding:0em 0em; margin:0;} -.snippet-wrap .snippet-no-num li {list-style:none; padding-left:0;} -.snippet-wrap .snippet-num {margin:1em 0 1em 1em; padding-left:2px;} -.snippet-wrap .snippet-num li {list-style:decimal-leading-zero outside none;} -.snippet-wrap .snippet-no-num li.box {padding:0 6px; margin-left:-6px;} -.snippet-wrap .snippet-num li.box {border:1px solid; list-style-position:inside; margin-left:0px; padding-left:2px;} -*:first-child+html .snippet-wrap .snippet-num li.box {margin-left:-2px;} -* html .snippet-wrap .snippet-num li.box {margin-left:-2px;} -.snippet-wrap li.box-top {border-width:0px 0px 0 !important;} -.snippet-wrap li.box-bot {border-width:0 0px 0px !important;} -.snippet-wrap li.box-mid {border-width:0 0px !important;} -.snippet-wrap .snippet-num li .box-sp {width:10px; display:inline-block;} -*:first-child+html .snippet-wrap .snippet-num li .box-sp {width:20px;} -* html .snippet-wrap .snippet-num li .box-sp {width:2px;} -.snippet-wrap .snippet-no-num li.box {border:1px solid;} -.snippet-wrap .snippet-no-num li .box-sp {display:none;} - -/* Layout fixing */ -.clfix:after {content: "."; display: block; height: 0px; clear: both; visibility: hidden;} -.clfix {display: inline-block;} -.clfix {display: block;} -* html .clfix {height: 1%;} /* Hides from IE-mac */ -.clfix {zoom:1;} /*for IE 5.5-7*/ - -.fl {float:left !important;} -.fr {float:right !important;} -.cl {clear:both;} -.rel {position:relative;} -.abs {position:absolute;} -.ac {text-align:center !important;} -.ar {text-align:right !important;} -.al {text-align:left !important;} -.at {vertical-align:top !important;} -.am {vertical-align:middle !important;} -.ab {vertical-align:bottom;} -.hand {cursor:pointer;} -.bgnone {background:none !important;} -.brnone {border:none !important;} -.b {font-weight:bold !important;} -.n {font-weight:normal !important;} -.invisible{display:block; overflow:hidden; visibility:hidden; width:0; height:0; margin:0; font-size:0; line-height:0;} -.mt5 {margin-top:5px !important;} -/* //Layout fixing */ - -@media print { .hide, .show { display: none; }} - -div#profile { - position: relative; -} -#profile p { - text-align: right; -} - -div#toc_border { - border: 2px solid rgb(86, 122, 156); border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; height: 565px; -} - -#contents li { - padding-top: 3px; - margin-top: 5px; - /* overflow: auto; */ -} - -p { - /* overflow: auto; */ -} - -div.table { - /* overflow: auto; */ -} \ No newline at end of file diff --git a/org.tizen.ui.guides/html/images/after_resize.png b/org.tizen.ui.guides/html/images/after_resize.png deleted file mode 100755 index e045c5e..0000000 Binary files a/org.tizen.ui.guides/html/images/after_resize.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/before_resize.png b/org.tizen.ui.guides/html/images/before_resize.png deleted file mode 100755 index 476210f..0000000 Binary files a/org.tizen.ui.guides/html/images/before_resize.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/dali_threads.png b/org.tizen.ui.guides/html/images/dali_threads.png deleted file mode 100644 index 997d238..0000000 Binary files a/org.tizen.ui.guides/html/images/dali_threads.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/mn_division.png b/org.tizen.ui.guides/html/images/mn_division.png deleted file mode 100755 index 1f7e337..0000000 Binary files a/org.tizen.ui.guides/html/images/mn_division.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/mw_division.png b/org.tizen.ui.guides/html/images/mw_division.png deleted file mode 100755 index 8fc3efa..0000000 Binary files a/org.tizen.ui.guides/html/images/mw_division.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/n_division.png b/org.tizen.ui.guides/html/images/n_division.png deleted file mode 100755 index d687bc5..0000000 Binary files a/org.tizen.ui.guides/html/images/n_division.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/round_footer.png b/org.tizen.ui.guides/html/images/round_footer.png deleted file mode 100644 index 6b677ec..0000000 Binary files a/org.tizen.ui.guides/html/images/round_footer.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/round_moreoption.png b/org.tizen.ui.guides/html/images/round_moreoption.png deleted file mode 100644 index fe755d1..0000000 Binary files a/org.tizen.ui.guides/html/images/round_moreoption.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/round_multibtn.png b/org.tizen.ui.guides/html/images/round_multibtn.png deleted file mode 100644 index d8dcd9d..0000000 Binary files a/org.tizen.ui.guides/html/images/round_multibtn.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/round_processing.png b/org.tizen.ui.guides/html/images/round_processing.png deleted file mode 100644 index 030ef40..0000000 Binary files a/org.tizen.ui.guides/html/images/round_processing.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/tizen_project_dali.png b/org.tizen.ui.guides/html/images/tizen_project_dali.png deleted file mode 100644 index 3be4125..0000000 Binary files a/org.tizen.ui.guides/html/images/tizen_project_dali.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/w_division.png b/org.tizen.ui.guides/html/images/w_division.png deleted file mode 100755 index 88d9959..0000000 Binary files a/org.tizen.ui.guides/html/images/w_division.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/wn_division.png b/org.tizen.ui.guides/html/images/wn_division.png deleted file mode 100755 index 11a7876..0000000 Binary files a/org.tizen.ui.guides/html/images/wn_division.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/images/ww_division.png b/org.tizen.ui.guides/html/images/ww_division.png deleted file mode 100755 index 65e7ab7..0000000 Binary files a/org.tizen.ui.guides/html/images/ww_division.png and /dev/null differ diff --git a/org.tizen.ui.guides/html/index.htm b/org.tizen.ui.guides/html/index.htm deleted file mode 100755 index 99c8125..0000000 --- a/org.tizen.ui.guides/html/index.htm +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - UI Guides - - - - -
              -
              - -
              - -

              UI Guides

              - -

              Web Application

              - - -

              Native Application

              - - - - -
              - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/actors_n.htm b/org.tizen.ui.guides/html/native/dali/actors_n.htm deleted file mode 100755 index 72d24f1..0000000 --- a/org.tizen.ui.guides/html/native/dali/actors_n.htm +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - Actors: Working with Basic DALi Components - - - - - - -
              -

              Actors: Working with Basic DALi Components

              - - -

              Actor is the basic component that composes the entire scene. It can have visible (for example, UI components, image actor) or invisible (for example, camera actor or layer) forms.

              -

              Actor is also the primary object with which DALi applications interact. Multiple types of event signals provided by actors can be handled in a application through user-defined callback functions.

              - -

              Types of Actors

              - -

              Figure: Types of Actors

              -

              Types of Actors

              - -Actor has several concrete types as follows: - -
                -
              • UI Components are used to organize the appearance of applications. Please see UI Components: Creating the Application Layout for more details.
              • -
              • Camera Actor determines which view of the whole virtual 3D world is rendered in the screen. By default, it is best suited for 2D applications so you don't need to care about it in this case. Please see API reference for Dali::CameraActor (in mobile and wearable) for more details.
              • -
              • Layer provides a mechanism for overlaying groups of actors on top of each other. Please see API reference for Dali::Layer (in mobile and wearable) for more details.
              • -
              - -

              Actors and Stage

              - -

              Stage is a top-level object that represents the entire screen. It is used for displaying a hierarchy of actors managed by the scene graph structure, which means an actor inherits a position relative to its parent, and can be moved in relation to this point.

              - -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. - -

              To display the contents of an actor, it must be added to a stage. The following example shows how to connect a new actor to the stage:

              - -
              Actor actor = Actor::New();
              -Stage::GetCurrent().Add(actor);
              -
              - - -

              Positioning Actors

              -

              An actor inherits its parent's position. The relative position between the actor & parent is determined by the following properties:

              -
                -
              • Parent origin -

                This Vector3 property defines a point within the parent actor's area.

                - -

                Figure: Parent origin

                -

                Parent origin

                - -

                The default is top-left (Dali::ParentOrigin::TOP_LEFT), which can be visualized in 2D as (0, 0), but is actually Vector3 (0, 0, 0.5) in the 3D DALi world. The actor position is relative to this point.

                -

                Please see API reference for Dali::Actor::SetParentOrigin() (in mobile and wearable) for more details.

                -
              • - -
              • Anchor point -

                This Vector3 property defines a point within the child actor area.

                - -

                Figure: Anchor point

                -

                Anchor point

                - -

                The default is center (Dali::AnchorPoint::CENTER), which can be visualized in 2D as (0.5, 0.5), but is actually Vector3 (0.5, 0.5, 0.5) in the 3D DALi world. The actor position is also relative to this point.

                -

                Please see API reference for Dali::Actor::SetAnchorPoint() (in mobile and wearable) for more details.

                -
              • - -
              • Position -

                This is the position vector between the parent origin and anchor point.

                - -

                Figure: Position

                -

                Position

                - -

                Therefore by default, an actor's position indicates the vector to its center from the top-left corner of its parent.

                - -

                For example (with the default camera),

                -
                  -
                • An actor added directly to the stage with position (X = stageWidth*0.5, Y = stageHeight*0.5) appears in the center of the screen.
                • -
                • An actor with the position (X = actorWidth*0.5, Y = actorWidth*0.5) appears at the top-left corner of the screen.
                • -
                - -

                Please see API reference for Dali::Actor::SetPosition() (in mobile and wearable) for more details.

                - -
              • -
              - -

              Event Handling for Actors

              -

              The Dali::Actor class provides following event signals:

              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              - Table: Event signals -
              Event signalDescription
              TouchedSignal()This signal is emitted when a touch input is received.
              HoveredSignal()This signal is emitted when a hover input is received.
              WheelEventSignal()This signal is emitted when a wheel event is received.
              OnStageSignal()This signal is emitted after the actor has been connected to the stage.
              OffStageSignal()This signal is emitted after the actor has been disconnected from the stage.
              OnRelayoutSignal()This signal is emitted after the size has been set on the actor during relayout.
              - -

              For example, a touch event can be handled as follows:

              -
              -bool OnTouch(Actor actor, const TouchEvent& touch)
              -{
              -   bool handled = false;
              -
              -   switch(touch.GetPointCount())
              -   {
              -      case 1: // Single touch
              -         if (touch.GetPoint(0).GetState == TouchPoint::Down)
              -         {
              -            // Do action when first touches the touch screen.
              -            ...
              -            handled = true;
              -         }
              -
              -         break;
              -
              -      case 2: // Multi-touch event
              -
              -         break;
              -   }
              -
              -   return handled;   // true if the operation was successful
              -}
              -
              -// Elsewhere
              -Actor actor = Actor::New();
              -actor.TouchedSignal().Connect(&OnTouch);
              - -

              For more information, see Event Handling.

              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/animation_n.htm b/org.tizen.ui.guides/html/native/dali/animation_n.htm deleted file mode 100755 index b704de8..0000000 --- a/org.tizen.ui.guides/html/native/dali/animation_n.htm +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - Animations: Making Your Actors Alive - - - - - - -
              -

              Animations: Making Your Actors Alive

              - -

              Animation allows your objects to move around / change their properties for a specified duration.

              - -

              DALi provides a rich and easy to use animation framework which allows you to create visually rich applications. Dali::Animation can be used to animate the animatable properties of any number of objects (Please see Attributes of Properties for more details).

              - -

              Animation components are shown in the following figure:

              - -

              Figure: DALi animation components

              -

              DALi animation components

              - -

              DALi animations occur in a dedicated thread. This allows animations to run smoothly, regardless of the time taken to process inputs events and other factors in the application code. Please see Animations with Multi-Threading

              - -

              Creating a Basic Animation

              - -

              Create an animation object that takes place over 3 seconds:

              -
              -Dali::Animation animation = Animation::New(3.0f);
              -
              - -

              Animating Properties

              - -

              There are two distinct methods to animate the properties within DALi:

              -
                -
              • AnimateTo(): The property animates TO the value in the given time.
              • -
              • AnimateBy(): The property animates BY the value in the given time.
              • -
              - -

              In the following example, it is assumed that actor1 and actor2 are at position 10.0f, 10.0f, 0.0f at the start of the animation.

              -
              -// Animate the position of actor1 TO 10.0f, 50.0f, 0.0f
              -animation.AnimateTo(Property(actor1, Dali::Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f)); 
              -// End Position: 10.0f, 50.0f, 0.0f
              -
              -// Animate the position of actor2 BY 10.0f, 50.0f, 0.0f
              -animation.AnimateBy(Property(actor2, Dali::Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f)); 
              -// End Position: 20.0f, 60.0f, 0.0f
              -
              - -

              Playback Control

              - -

              When an animation is created, it can be played using the Play() method.

              -
              -animation.Play();
              -
              -

              This is not a synchronous method. The Play() method returns after sending a message. After the message is processed in a separate thread, the animation starts. Blocking the application thread does not stop the animation from playing.

              -

              Stop() and Pause() methods are also supported.

              -
              -animation.Stop();
              -animation.Pause();
              -
              - -

              Notifications

              -

              Using DALi's signal framework applications can be notified when the animation finishes. The Dali::Animation API supports "fire and forget" behavior, which means that an animation continues to play if the handle is discarded. In the following example, the Finished signal is emitted after 2 seconds:

              - -
              -  // ... Assuming this code is in the HelloWorldController class
              -  void Create( Application& application )
              -  {
              -    PushButton actor = PushButton::New();
              -    Stage::GetCurrent().Add( actor );
              -
              -    Animation animation = Animation::New(2.0f); // Duration 2 seconds
              -    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 100.0f, 100.0f, 0.0f ) );
              -    animation.FinishedSignal().Connect( this, &HelloWorldController::OnFinished );
              -    animation.Play();  // Fire the animation and forget about it
              -  }  // At this point the animation handle has gone out of scope
              -
              -  void OnFinished( Animation& animation )
              -  {
              -    // Do something when the animation is finished
              -  }
              -  // ...
              -
              - -

              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 class (in mobile and wearable applications).

              -
              -animation.SetDefaultAlphaFunction(Dali::AlphaFunction::EASE_IN);
              -
              -

              You can also create your own alpha function:

              -
              -float MyAlphaFunction(float progress)
              -{
              -   return progress;
              -}
              -
              -AlphaFunction alphaFunction(&MyAlphaFunction);
              -animation.SetDefaultAlphaFunction(alphaFunction);
              -
              -

              It is possible to specify a different alpha function for each animate call in an Animation object.

              -
              -animation.AnimateTo(Property(actor1, Dali::Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f), Dali::AlphaFunction::EASE_IN);
              -
              - -

              Other Actions

              - -

              An animation can be looped:

              -
              -animation.SetLooping(true);
              -
              -

              By default, when an animation ends, the properties that it was animating are baked (saved). Using the following function, the property changes can be discarded when the animation ends or is stopped:

              -
              -animation.SetEndAction(Animation::Discard);
              -
              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/animation_types_n.htm b/org.tizen.ui.guides/html/native/dali/animation_types_n.htm deleted file mode 100755 index 26c7f18..0000000 --- a/org.tizen.ui.guides/html/native/dali/animation_types_n.htm +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - Animations Types: Types of Animations Supported by DALi - - - - - - -
              -

              Animations Types: Types of Animations Supported by DALi

              - -

              DALi supports the key frame animation, path animation, and shader effect animation.

              - -

              Key Frame Animation

              - -

              DALi provides support for animating between several different values, or key frames. A key frame takes a progress value between 0.0f and 1.0f (0 and 100% respectively) and portrays the value of the property when the animation has progressed that much. You can create several key frames:

              -
              -Dali::KeyFrames keyFrames = Dali::KeyFrames::New();
              -keyFrames.Add(0.0f, Vector3(10.0f, 10.0f, 10.0f));
              -keyFrames.Add(0.7f, Vector3(200.0f, 200.0f, 200.0f));
              -keyFrames.Add(1.0f, Vector3(100.0f, 100.0f, 100.0f));
              -
              - -

              Next, you can add them to your animation.

              -
              -animation.AnimateBetween(Property(actor1, Dali::Actor::Property::POSITION), keyFrames);
              -
              -

              When you play the animation, DALi animates the position of actor1 between the key frames specified. The actor1 animates from (10.0f, 10.0f, 10.0f) to (200.0f, 200.f, 200.0f) by 70% of the animation time, and then spends the remaining time animating back to (100.0f, 100.0f, 100.0f).

              -

              The advantage of specifying a key frame at 0% is that regardless of where the actor1 is, it starts from position (10.0f, 10.0f, 10.0f). If AnimateTo() is used, the start position is the actor1's current position.

              - -

              Path Animation

              -

              The Dali::Path API can be used to animate the position and orientation of actors.

              - -

              The black points in the following figure are points where the DALi logo travels to. The red points are the control points which express the curvature of the path on the black points.

              - -

              Figure: Path animation

              -

              Path animation

              - -

              In the code, this is represented as follows:

              -
              -Path path = Path::New();
              -path.AddPoint(Vector3(50.0f, 10.0f, 0.0f));
              -path.AddPoint(Vector3(90.0f, 50.0f, 0.0f));
              -path.AddPoint(Vector3(10.0f, 90.0f, 0.0f));
              -
              -

              The control points can be added manually using Dali::Path::AddControlPoint. The Path API can also auto-generate the control points for you.

              -
              -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 (in mobile and wearable applications).

              -

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

              -
              -animation.Animate(actor1, path, Vector3::ZERO);
              -
              -

              The third parameter is the forward vector (in a local space coordinate system) that is oriented with the path's tangent direction.

              - - -

              Shader Effect Animation

              -

              Shader effects provide a visual effect for actors. In a shader, uniforms are set according to the purpose of applications. The uniforms of a shader can be animated using the Animation::AnimateTo() functions.

              -

              For example, to animate the center point of the Bendy shader effect:

              -
              -Dali::Animation animation = Dali::Animation::New(1.0f);
              -
              -Vector2 newPosition(0.0f, 0.0f);
              -animation.AnimateTo(Property(shaderEffect, shaderEffect.GetPositionPropertyName()), newPosition);
              -
              -

              To animate a uniform of a custom shader effect, you must use the name of the uniform:

              -
              -Dali::Animation animation = Dali::Animation::New(1.0f);
              -
              -// Set the initial value for the uniform
              -shaderEffect.SetUniform("myUniform", -0.5f);
              -
              -// Animate the uniform to a value
              -animation.AnimateTo(Property(shaderEffect, "myUniform"), 0.5f);
              -
              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/background_n.htm b/org.tizen.ui.guides/html/native/dali/background_n.htm deleted file mode 100755 index 7e16d5e..0000000 --- a/org.tizen.ui.guides/html/native/dali/background_n.htm +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - Background Knowledge: Using DALi More Effectively - - - - -
              -
              -

              Mobile native Wearable native

              -
              -
              -

              Content

              -
                -
              -

              Related Info

              -
                -
              -
              -
              - -
              -

              Background Knowledge: Using DALi More Effectively

              - -

              This section describes useful background knowledge that enables you to use DALi more effectively.

              -

              Topics covered are:

              - - - - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/buttons_n.htm b/org.tizen.ui.guides/html/native/dali/buttons_n.htm deleted file mode 100755 index 484aa88..0000000 --- a/org.tizen.ui.guides/html/native/dali/buttons_n.htm +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - Buttons: Push, Check, Select! - - - - - - -
              -

              Buttons: Push, Check, Select!

              - -

              Button is a small object on UI that you press in order to operate it. DALi provides button controls, such as PushButton , CheckBoxButton , and RadioButton . The base class for button controls is Toolkit::Button. The Toolkit::Button class provides the disabled property and the clicked signal. Basic signals provided by the Toolkit::Button class are listed in the following table.

              - - - - - - - - - - - - - - - - - - - - - - - - - -
              - Table: Toolkit::Button input signals -
              Input signalDescription
              PressedSignal()Emitted when the button is pressed. -
              ReleasedSignal()Emitted when the button is released. -
              ClickedSignal()Emitted when the button is clicked. -
              StateChangedSignal()Emitted when the button state is changed. -
              - -

              Push Button

              - -

              The PushButton class provides a button that can be pressed to operate it. A push button changes its appearance when is pressed and returns to its original when is released.

              - -

              Figure: Push button

              -

              Push button

              - -

              A push button emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when clicked, and a Button::ReleasedSignal() signal when released, or of the touch point leaves the boundary of the button. A basic push button example is as follows:

              - -
              -class ButtonController : public ConnectionTracker
              -{
              -public:
              -  ButtonController( Application& application ): mApplication( application )
              -  {
              -    mApplication.InitSignal().Connect( this, &ButtonController::Create );
              -  }
              -  void Create( Application& application )
              -  {
              -    PushButton button = PushButton::New();
              -    button.SetLabel( "Select" );
              -    button.SetParentOrigin( ParentOrigin::CENTER );
              -    button.ClickedSignal().Connect( this, &ButtonController::OnButtonClicked );
              -    Stage::GetCurrent().Add( button );
              -  }
              -  bool OnButtonClicked( Toolkit::Button button )
              -  {
              -    cout << "OnButtonClicked" << endl;
              -    return true;
              -  }
              -private:
              -  Application&  mApplication;
              -};
              -
              -int main( int argc, char **argv )
              -{
              -  Application application = Application::New( &argc, &argv );
              -  ButtonController test( application );
              -  application.MainLoop();
              -  return 0;
              -}
              -
              - -

              CheckBox Button

              - -

              The CheckBoxButton class provides check box button which can be checked or unchecked.

              - -

              Figure: Checkbox button

              -

              Checkbox button

              - -

              A checkbox button emits all of four button input sinals, but usually you can just use Button::StateChangedSignal() signal to check the button changes its state to selected or unselected. A basic checkbox button example is as follows:

              - -
              -// ... same as the push button example
              -  void Create( Application& application )
              -  {
              -    CheckBoxButton button = CheckBoxButton::New();
              -    button.SetLabel( "Select" );
              -    button.SetSize( 100,40 );
              -    button.SetBackgroundColor( Vector4( 1,0,0,1 ) );
              -    button.SetParentOrigin( ParentOrigin::CENTER );
              -    button.StateChangedSignal().Connect( this, &ButtonController::OnButtonStateChanged );
              -    Stage::GetCurrent().Add( button );
              -  }
              -  bool OnButtonStateChanged( Toolkit::Button button )
              -  {
              -    cout << "OnButtonStateChanged " << button.IsSelected() << endl;
              -    return true;
              -  }
              -// ... same as the push button example
              -
              - -

              Radio Button

              - -

              The RadioButton class provides a radio button with 2 states: selected and unselected.

              - -

              Figure: Radio button

              -

              Radio button

              - -

              Usually, radio buttons are grouped. Two or more radio buttons are in the same group when they have the same parent. In each group, only 1 radio button can be selected at a given time. You can use Button::StateChangedSignal() signal to check which radio button is selected. A basic radio button example is as follows:

              - -
              -// ... same as the push button example
              -  void Create( Application& application )
              -  {
              -    Actor radioGroup = Actor::New();
              -    radioGroup.SetParentOrigin( ParentOrigin::CENTER );
              -    Stage::GetCurrent().Add(radioGroup);
              -
              -    RadioButton button1 = RadioButton::New();
              -    button1.SetLabel( "button1" );
              -    button1.SetBackgroundColor( Vector4(1,0,0,1) );
              -    button1.SetPosition( 0, -40 );
              -    radioGroup.Add( button1 );
              -
              -    RadioButton button2 = RadioButton::New();
              -    button2.SetLabel( "button2" );
              -    button2.SetBackgroundColor( Vector4(0,0,1,1) );
              -    button2.SetPosition( 0, 40 );
              -    radioGroup.Add( button2 );
              -
              -    button1.StateChangedSignal().Connect( this, &ButtonController::OnButtonStateChanged );
              -    button2.StateChangedSignal().Connect( this, &ButtonController::OnButtonStateChanged );
              -  }
              -  bool OnButtonStateChanged( Toolkit::Button button )
              -  {
              -    cout << "OnButtonStateChanged " << button.GetLabel() << " " << button.IsSelected() << endl;
              -    return true;
              -  }
              -// ... same as the push button example
              -
              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/constraints_n.htm b/org.tizen.ui.guides/html/native/dali/constraints_n.htm deleted file mode 100755 index 15b9925..0000000 --- a/org.tizen.ui.guides/html/native/dali/constraints_n.htm +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - - - - - - - - Constraints: Imposing Your Own Constraints on Actors - - - - - - -
              -

              Constraints: Imposing Your Own Constraints on Actors

              - -

              Constraints are used to modify the property of an actor, based on other properties of the same actor; properties of the actor's parent; or properties of another actor altogether, when the modification needs to be at run-time. Custom functions or functors can be supplied, where the desired value of the property can be calculated. These functions (or functors) are called in every frame, therefore they must be fast and not too complex, otherwise they can affect performance.

              -

              Multiple constraints can be applied to the same actor at the same time. The order in which constraints are applied is important as this is the order in which they are processed in the update thread.

              -

              Constraints are applied after animations have been applied. This means that Constraints override the values set by Animations. Constraints are not applied to off-stage actors.

              -

              Not all properties can be used as a constraint input. For more details, see the IsPropertyAConstraintInput() function in the Dali::Handle class (in mobile and wearable applications).

              - -

              Using a Constraint

              - -

              Constraints are designed as a way of modifying properties that cannot be modified by any existing built-in functionality, such as animations, size negotiation, parent anchor, or origin settings. As they provide the ability for the application developer to execute their own code within the update thread, DALi can no longer guarantee the timeliness of this code, or how optimized it can be.

              -

              Generally, you must not use constraints with the size property as constraining the size and size negotiation are mutually exclusive. Consider the following use cases as an example of when and when not to use a constraint:

              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              - Table: Examples of constraint use -
              RequirementSolution
              Need a child to be 50% the size of it's parent.Use size negotiation.
              Need to zoom an actor in to the screen using its scale property.Use an animation.
              Need an actor to appear centered around the bottom-right corner of its parent.Use ParentOrigin and AnchorPoint.
              Need to lay out a series of controls with various alignment requirements.Use either Anchor and origin settings, or a TableView.
              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.Use a constraint.
              Need to position an actor relative to its parent actor in a NON-UNIFORM way, or a non-linear calculation needs to be performed that requires a functor.Use a constraint.
              Need to modify an actor's property in real time based on some calculations that require additional data to be stored in-between frames.Use a constraint. The constraint functor can hold any variables within it that need to be preserved frame-to-frame.
              - -

              For most general cases, the position and size requirements of a child or parent actor (from its child or parent) can be calculated with size negotiation.

              - -

              Constraint Sources

              -

              These properties are used as input sources to the constraint. The constraint takes these values, optionally performs a calculation on them (if using a custom functor) and writes the result to the specified property of the target actor. The source actor is specified as either the same actor, its parent, or another actor.

              -
                -
              • Local source -

                A local source is based on the local properties (such as size, position, scale, orientation, or color) of an actor. For example, the actor's orientation can be used as a constraint input source.

                -
                -Dali::ConstraintSource source(Dali::LocalSource(Dali::Actor::Property::ORIENTATION));
                -
                -
              • -
              • Parent Source -

                A parent source is based on properties of the actor's parent. For example, a parent's position can be used as a constraint input source.

                -
                -Dali::ConstraintSource source(Dali::ParentSource(Dali::Actor::Property::POSITION));
                -
                -
              • -
              • Other Handle Source -

                You can base your source on the properties of another handle altogether. For example, a sibling actor's color can be used as a constraint input source.

                -
                -Dali::ConstraintSource source(Dali::Source(anotherHandle, Dali::Actor::Property::COLOR));
                -
                -
              • -
              - -

              Constraint Function

              - -

              The signature of the constraint function is:

              - -
              -void Function(PropertyType &current, const Dali::PropertyInputContainer &inputs);
              -
              -

              In this function the current parameter is a reference to the target property type, such as float, Vector2, or Vector3. This is an in or out parameter. It represents the current value of the property and the expectation is that it is modified by the function to the desired value.

              -

              The inputs parameter holds all the constraint input sources. Each element is a pointer to the property-input and can be accessed using the indexing operator [ ]. The order in which the sources are added is the order in which the property-inputs are sorted in the container. For example:

              -
              -constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::POSITION));
              -constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::SIZE));
              -constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::POSITION));
              -constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::SIZE));
              -
              -

              In the constraint function this equals to:

              -
              -const Dali::Vector3& position(inputs[0]->GetVector3());
              -const Dali::Vector3& size(inputs[1]->GetVector3());
              -const Dali::Vector3& parentPosition(inputs[2]->GetVector3());
              -const Dali::Vector3& parentSize(inputs[3]->GetVector3());
              -
              - - -

              Creating a Constraint

              -

              Using C Functions

              -

              If you do not have any data that is changed at runtime, C functions must be used. For example, the color of an actor can be changed based on its position along the x-axis to a preset distance of 100, beyond which it is transparent.

              -
              -Dali::Actor actor = Actor::New();
              -
              -// Create a constraint that targets actor
              -Dali::Constraint constraint = Dali::Constraint::New< Vector4 >(actor, Dali::Actor::Property::COLOR, MyConstraintFunction); 
              -
              -// Add the POSITION property as a constraint input
              -constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::POSITION)); 
              -
              -// Apply the constraint
              -constraint.Apply(); 
              -
              - -

              The following example shows the actual C function:

              -
              -void MyConstraintFunction(Dali::Vector4& current, const Dali::PropertyInputContainer& inputs)
              -{
              -   const Dali::Vector3& position(inputs[0]->GetVector3());
              -
              -   float distance = fabs(position.x);
              -
              -   // More than 100.0f away, opacity is 0.0f
              -   if (distance > 100.0f)
              -   {
              -      current.a = 0.0f;
              -   }
              -   else
              -   {
              -      // Otherwise it blends between fully opaque and transparent
              -      current.a = (100.0f - distance) / 100.0f;
              -   }
              -}
              -
              - -

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

              - -

              Using Functors

              - -

              If you need to store some data in a struct or class, a functor can be used. Reusing the last example, the color of an actor is changed based on its position along the x-axis, but the distance when it is transparent is different for each applied constraint.

              -
              -Dali::Actor actor = Actor::New();
              -
              -// Create a constraint that targets actor, and uses MyFunctor with a distance of 200
              -Dali::Constraint constraint = Dali::Constraint::New< Vector4 >(actor, Dali::Actor::Property::COLOR, MyFunctor(200)); 
              -
              -// Add the POSITION property as a constraint input
              -constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::POSITION)); 
              -
              -// Apply the constraint
              -constraint.Apply(); 
              -
              -

              The following example shows the structure:

              -
              -struct MyFunctor
              -{
              -   // Constructor which takes the distance at which the actor is fully transparent
              -   MyFunctor(float distance)
              -   : mDistance(distance)
              -   {
              -   }
              -
              -   // Functor
              -   void operator()(Dali::Vector4 &current, const Dali::PropertyInputContainer &inputs)
              -   {
              -      const Dali::Vector3& position(inputs[0]->GetVector3());
              -
              -      float distance = fabs(position.x);
              -
              -      // More than mDistance away, opacity is 0.0f
              -      if (distance > mDistance)
              -      {
              -         current.a = 0.0f;
              -      }
              -      else
              -      {
              -         // Otherwise it blends between fully opaque and transparent
              -         current.a = (100.0f - mDistance) / 100.0f;
              -      }
              -   }
              -
              -   // Data
              -   const float mDistance;
              -};
              -
              -

              MyFunctor() can be used also with another constraint with a different distance.

              -

              Instead of using the default functor, another method can be declared in the class or struct and used as the constraint function.

              -

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

              - - -

              Removing Constraints

              - -

              The actor's constraints can later be removed in several ways:

              -
              -mConstraint.Remove(); // mConstraint is a base-handle to a constraint
              -actor.RemoveConstraints(); // Removes ALL constraints applied to an actor
              -actor.RemoveConstraint(tag); // All constraints with the tag are removed from the actor (tag can be set using SetTag)
              -
              - - -

              Equal To Constraint

              - -

              The built-in Dali::EqualToConstraint function can be used if only setting a property equal to another property is required:

              -
              -Dali::Constraint constraint = Dali::Constraint::New< Vector3 >(actor, Dali::Actor::Property::POSITION, Dali::EqualToConstraint());
              -constraint.AddSource(Dali::Source(anotherActor, Dali::Actor::Property::POSITION));
              -constraint.Apply();
              -
              -

              Here actor's position is set to equal the position of anotherActor.

              - - -

              Relative To Constraint

              - -

              The built in Dali::RelativeToConstraint and Dali::RelativeToConstraintFloat functions can be used if only setting a property relative to another property is required:

              - -
              -Dali::Constraint constraint = Dali::Constraint::New< Vector3 >(actor, Dali::Actor::Property::POSITION, Dali::RelativeToConstraint(2.0f));
              -constraint.AddSource(Dali::Source(anotherActor, Dali::Actor::Property::POSITION));
              -constraint.Apply();
              -
              -

              Here the actor's position is relative to the position of anotherActor. If anotherActor is at (10.0f, 20.0f, 30.0f), actor is at (20.0f, 40.0f, 60.0f).

              - - - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/control_base_n.htm b/org.tizen.ui.guides/html/native/dali/control_base_n.htm deleted file mode 100755 index cd7f49b..0000000 --- a/org.tizen.ui.guides/html/native/dali/control_base_n.htm +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - Control: Base Class of UI Components - - - - - - -
              -

              Control: Base Class of UI Components

              - -

              Dali::Toolkit::Control is the base class for all UI components in DALi. This section describes some useful tips for this class.

              - - -

              Background Color

              - -

              It is possible to set a background color for a UI component. If you want to set a component with a red background: - -

              -Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
              -control.SetSize( 200.0f, 200.0f );
              -control.SetBackgroundColor( Dali::Color::RED );
              -
              - -

              Figure: A Control object with a red background

              -

              A control with a red background

              - -

              This can be used for all existing controls like TextLabel as well:

              - -
              -Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( "Hello World" );
              -label.SetBackgroundColor( Dali::Color::RED );
              -
              - -

              Figure: A TextLabel object with a red background

              -

              A TextLabel object with a red background

              - - -

              Background Image

              - -

              You can also set a background image of a control:

              - -
              -Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
              -Dali::Image image = Dali::Image::New( "image.png" );
              -control.SetBackgroundImage( image );
              -
              - -

              Figure: A Control object with a background image

              -

              A Control object with a background image

              - -

              The background image is blended with the background color. If a red background color is set on the control:

              - -
              -control.SetBackgroundColor( Dali::Color::RED );
              -
              - -

              then the control object will look like:

              - -

              Figure: A Control object with a background image blended with a background color

              -

              A Control object with a background image blended with a background color

              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/dali_applications_n.htm b/org.tizen.ui.guides/html/native/dali/dali_applications_n.htm deleted file mode 100755 index 6f841e7..0000000 --- a/org.tizen.ui.guides/html/native/dali/dali_applications_n.htm +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - Application: Framework for DALi Application - - - - - - -
              -

              Application: Framework for DALi Application

              - -

              The Adaptor framework provides the Dali::Application class, which initializes and sets up DALi appropriately. The class provides many platform-related services.

              - -

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

              - -

              The following example shows how to create a Dali::Application instance and connect to its initialize signal, where the Dali::Actor hierarchy is created:

              - -
              void CreateProgram(Application& app)
              -{
              -   // Create DALi components...
              -   Dali::Actor actor = Actor::New();
              -   ...
              -}
              -int main (int argc, char **argv)
              -{
              -   Dali::Application app = Application::New(&argc, &argv);
              -   app.InitSignal().Connect(&CreateProgram);
              -   app.MainLoop();
              -}
              - -

              Window

              - -

              DALi provides the Window class to manage drawing to a default surface. The class is also responsible for drawing the Indicator bar if required. The Application class automatically creates a Window which the you can access after the SignalInit() function has fired.

              - -
              void CreateProgram(Application& app)
              -{
              -   app.GetWindow().ShowIndicator(Dali::Window::VISIBLE);
              -}
              -int main (int argc, char **argv)
              -{
              -   Dali::Application app = Application::New(argc, argv);
              -   app.SignalInit().Connect(&CreateProgram);
              -   app.MainLoop();
              -}
              - - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/dali_overview_n.htm b/org.tizen.ui.guides/html/native/dali/dali_overview_n.htm deleted file mode 100755 index 2e555c4..0000000 --- a/org.tizen.ui.guides/html/native/dali/dali_overview_n.htm +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - DALi Overview: Getting Started with DALi UI Programming - - - - - - -
              -

              DALi Overview: Getting Started with DALi UI Programming

              - -

              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.

              - -

              DALi Fundamentals

              - -

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

              - -

              Actor and Stage

              - -

              Actor is the primary object for interaction in DALi applications. Actors are effective nodes that receive input (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

              - -

              Signals and slots are used in the QT GUI library for communication between objects. Objects can send signals containing event information, which can be received by other objects using special functions known as slots. The DALi event system follows the signal and slot mechanism.

              - -

              Signal events are emitted when a certain action or event occurs. The application can connect using 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 method 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 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 default camera.

              - -

              Figure: DALi coordinate system

              -

              DALi coordinate system

              - -

              Camera

              - -

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

              - -
                -
              • For 2D applications, you don't need to care about the camera at all. The default camera is already best suited for 2D applications (configured to have the origin of 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 might want to change the view by mapulating the camera. You can translate / rotate the camera in this case. Please 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 Internal Structure

              - -

              DALi consists of the following modules:

              - -
                -
              • dali-core -

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

                -
              • -
              • dali-toolkit -

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

              • -
              • dali-adaptor -

                dali-adaptor is a platform adaptation layer. It initializes and sets up DALi appropriately. The module 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.

              • -
              -

              Figure: DALi internal structure

              -

              DALi internal structure

              - -

              Creating a DALi Application

              - -

              To create a 'Hello World' application with Dali:

              -
                -
              1. Create a DALi project
              2. -
              3. Initialize the DALi application
              4. -
              5. Create an actor and add it to a stage
              6. -
              7. Build your DALi application
              8. -
              9. Run your DALi application
              10. -
              - -

              Create a DALi project

              - -
                -
              1. Launch the Tizen IDE.
              2. -
              3. Choose File > New > Tizen Native Project. -

                Press Finish button, then your project is created at the default location. If you want to change the location, uncheck 'Use default location' and set the new location. -Please see Creating the Application Project for more information.

                -
              4. - -

                Figure: Create a DALi project

                -

                Create a DALi project

                - -
              5. The new project is shown in the Project Explorer view of the IDE. If you open src/basicdaliapplication.cpp, you can see the source code of basic DALi application as follows: -
                -#include <dali-toolkit/dali-toolkit.h>
                -
                -using namespace Dali;
                -using Dali::Toolkit::TextLabel;
                -
                -// This example shows how to create and display Hello World using a simple TextLabel
                -//
                -class HelloWorldController : public ConnectionTracker
                -{
                -public:
                -
                -  HelloWorldController( Application& application )
                -  : mApplication( application )
                -  {
                -    // Connect to the Application's Init signal
                -    mApplication.InitSignal().Connect( this, &HelloWorldController::Create );
                -  }
                -
                -  ~HelloWorldController()
                -  {
                -    // Nothing to do here
                -  }
                -
                -  // The 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.SetAnchorPoint( AnchorPoint::TOP_LEFT );
                -    textLabel.SetName( "hello-world-label" );
                -    stage.Add( textLabel );
                -
                -    // Respond to a click anywhere on the stage
                -    stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
                -  }
                -
                -  bool OnTouch( Actor actor, const TouchEvent& touch )
                -  {
                -    // quit the application
                -    mApplication.Quit();
                -    return true;
                -  }
                -
                -private:
                -  Application&  mApplication;
                -};
                -
                -// Entry point for Tizen applications
                -//
                -int main( int argc, char **argv )
                -{
                -  Application application = Application::New( &argc, &argv );
                -  HelloWorldController test( application );
                -  application.MainLoop();
                -  return 0;
                -}
                -
                -
              6. -
              - -

              Initialize the DALi Application

              - -

              To use DALi APIs, include the dali-toolkit.h header file. It includes the dali-core and dali-adaptor modules.

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

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

              -

              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 Dali::ConnectionTracker. A typical way for starting DALi application is creating a class derived from Dali::ConnectionTracker and using its member functions as callback functions for DALi signals (Please see Automatic Connection Management for more information). This HelloWorldController class will be used in other code samples in the remainder of this guide.

              - -

              Create a Dali::Application instance:

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

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

              - -
              -mApplication.InitSignal().Connect(this, &HelloWorldController::Create);
              - -

              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();
              - -

              Create an Actor and Add It to a Stage

              - -

              The 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:

              - -
              -Stage stage = Stage::GetCurrent();
              -stage.SetBackgroundColor( Color::WHITE );
              -
              -TextLabel textLabel = TextLabel::New( "Hello World" );
              -textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
              -textLabel.SetName( "hello-world-label" );
              -stage.Add( textLabel );
              -
              - -

              This 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 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.

              - - -

              Build your DALi application

              - -

              To build your application, choose Project > Build Project or press F10.

              -

              The Tizen IDE automatically packages the project after building. Please note that you need to register your certificate at the first time to build. Please see Certificate Registration and Building Applications for more information.

              - - -

              Run your DALi application

              - -

              To run your application, choose Run > Run or press Ctrl+F11.

              -

              Please see Running Applications for more information.

              - -

              Figure: The first DALi application running on Tizen emulator

              -

              The first DALi application

              - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/event_handling_n.htm b/org.tizen.ui.guides/html/native/dali/event_handling_n.htm deleted file mode 100755 index f720211..0000000 --- a/org.tizen.ui.guides/html/native/dali/event_handling_n.htm +++ /dev/null @@ -1,566 +0,0 @@ - - - - - - - - - - - - - - Event Handling: Managing the Event Flow - - - - - - -
              - -

              Event Handling: Managing the Event Flow

              - -

              DALi event handling system is composed of 2 major concepts:

              - -
                -
              • Signal -

                Notifications containing event information emitted by GUI components. Also known as events or notifications.

              • -
              • Slot -

                Special functions receiving signals. Also known as event handlers, observer, listener, or callbacks.

              • -
              -

              DALi emits various types of signals to an application to inform it of user actions and the application can handle them through slots.

              - -

              The concept of signal and slots were introduced by Qt for communication between objects. The event mechanism of DALi is inspired by Qt.

              - -

              Figure: A schematic example of signal-slot connections: Signal 1 is connected to slot 1, signal 2 is connected to slot 1 and slot 3, and signal 3 is connected to slot 2.

              -

              Signal and slot event handling

              - -

              The signal and slot system has following advantages:

              -
                -
              • Object-oriented: Support callbacks for C++ member functions
              • -
              • Type safe: Compiler is able to check for type safety
              • -
              • Non-coupling: No dependency between caller and callee
              • -
              • Non-type-intrusive: No modification to caller or callee types
              • -
              • Generic: Work for all types of callbacks
              • -
              • Many-to-many relationship: For example, 1 slot can connect to many signals and 1 signal can be connected to many slots
              • -
              - -

              Example: Handling 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:

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

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

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

              The return value true indicates that the touch event should be consumed. Otherwise, the signal is emitted on the next sensitive parent of the actor. This meaning is valid for the TouchedSignal(), and other types of signals may not have a return value.

              - -

              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.

              - -

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

              - -
              -  // ... Assuming this code is in the HelloWorldController class
              -  void Create( Application& application )
              -  {
              -    Control actor = Control::New(); // Control is one of the simplest types of Actor that has visible form
              -    actor.SetParentOrigin( ParentOrigin::CENTER );
              -    actor.SetSize( 100.0f, 100.0f );
              -    actor.SetBackgroundColor( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
              -    actor.TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
              -    Stage::GetCurrent().Add( actor );
              -  }
              -
              -  bool OnTouch( Actor actor, const TouchEvent&touch )
              -  {
              -    bool handled = false;
              -    unsigned int pointCount = touch.GetPointCount();
              -    if( pointCount == 1)
              -    {
              -      // Do action when first touch on screen
              -      handled = true;
              -    }
              -    else if( pointCount > 1)
              -    {
              -      // Do action when multi-touch on screen
              -      handled = true;
              -    }
              -    return handled;   // true if we have handled the touch, false otherwise
              -  }
              -  // ...
              -
              - -

              The touch event is first emitted to the hit actor by the primary touch point, which is the first point that the user touches. If this hit actor does not handle the event, then the event is offered to the hit actor's parent. Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.

              - -

              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, then is not informed to the parent.

              - -

              Example: Handling Key Events

              - -

              The following example show how to handle key events received by the stage:

              - -
              -  // ... Assuming this code is in the HelloWorldController class
              -  void Create( Application& application )
              -  {
              -    Stage::GetCurrent().SetBackgroundColor( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
              -    Stage::GetCurrent().KeyEventSignal().Connect( this, &HelloWorldController::OnKeyEvent );
              -
              -    PushButton button = PushButton::New();
              -    Stage::GetCurrent().Add( button );
              -  }
              -
              -  void OnKeyEvent(const KeyEvent& event)
              -  {
              -    if(event.state == KeyEvent::Down)
              -    {
              -      if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
              -      {
              -        mApplication.Quit();
              -      }
              -    }
              -  }
              -  // ...
              -
              - -

              The stage is the top-most root object, so can receive application-wide key events.

              - -

              DALi provides its own key codes for several special keys, such as DALI_KEY_ESCAPE or DALI_KEY_BACK, for your convinience. - -

              Available DALi key codes are listed as follows:

              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              - Table: DALi key codes -
              Key Codes
              DALI_KEY_INVALID
              DALI_KEY_ESCAPE
              DALI_KEY_BACKSPACE
              DALI_KEY_CURSOR_UP
              DALI_KEY_CURSOR_LEFT
              DALI_KEY_CURSOR_RIGHT
              DALI_KEY_CURSOR_DOWN
              DALI_KEY_BACK
              DALI_KEY_CAMERA
              DALI_KEY_CONFIG
              DALI_KEY_POWER
              DALI_KEY_PAUSE
              DALI_KEY_CANCEL
              DALI_KEY_PLAY_CD
              DALI_KEY_STOP_CD
              DALI_KEY_PAUSE_CD
              DALI_KEY_NEXT_SONG
              DALI_KEY_PREVIOUS_SONG
              DALI_KEY_REWIND
              DALI_KEY_FASTFORWARD
              DALI_KEY_MEDIA
              DALI_KEY_PLAY_PAUSE
              DALI_KEY_MUTE
              DALI_KEY_MENU
              DALI_KEY_HOME
              DALI_KEY_HOMEPAGE
              DALI_KEY_WEBPAGE
              DALI_KEY_MAIL
              DALI_KEY_SCREENSAVER
              DALI_KEY_BRIGHTNESS_UP
              DALI_KEY_BRIGHTNESS_DOWN
              DALI_KEY_SOFT_KBD
              DALI_KEY_QUICK_PANEL
              DALI_KEY_TASK_SWITCH
              DALI_KEY_APPS
              DALI_KEY_SEARCH
              DALI_KEY_VOICE
              DALI_KEY_LANGUAGE
              DALI_KEY_VOLUME_UP
              DALI_KEY_VOLUME_DOWN
              - -

              Input Signals

              - -

              Many DALi classes provide various signals to notify events to the application. Among them, the most basic type of signals would be input signals. This section briefly introduces these input signals in DALi.

              - -

              The basic DALi input signals are as follows:

              - -
                -
              • Touched signal notifies screen touch or mouse click
              • -
              • Hovered signal notifies mouse hovering
              • -
              • Wheel event signal notifies mouse wheel rolling
              • -
              • Key event signal notifies keyboard input
              • -
              • Key input focus signals notifies that a control is ready to receive key event signals
              • -
              • Keyboard focus signals notifies moved focus by navigation keys (such as left or right)
              • -
              -

              These signals are provided by the following classes:

              - -
                -
              • Dali::Actor - - - - - - - - - - - - - - - - - - - - - -
                - Table: Dali::Actor input signals -
                Input signalsDescription
                TouchedSignal()Emitted when touch input is received. -

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

                HoveredSignal()Emitted when hover input is received. -

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

                WheelEventSignal()Emitted when wheel event is received. -

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

                - -

                The actor receiving events is passed to the callbacks.

                -
              • - -
              • -Dali::Stage - - - - - - - - - - - - - - - - - - - - - -
                - Table: Dali::Stage input signals -
                Input signalsDescription
                TouchedSignal()Emitted when touch input is received. -

                Callback: void YourCallbackName(const TouchEvent& event)

                HoveredSignal()Emitted when hover input is received. -

                Callback: void YourCallbackName(const TouchEvent& event);

                KeyEventSignal()Emitted when a key event is received. -

                Callback: void YourCallbackName(const KeyEvent& event);

                - -

                Only events are passed to the callbacks since only a single stage instance can exist in DALi application. The callback return types are void because the stage has no parent to pass events to, even though it does not consume the events.

                -
              • - -
              • -Dali::Toolkit::Control - - - - - - - - - - - - - - - - - - - - - - - - - -
                - Table: Dali::Toolkit::Control input signals -
                Input signalsDescription
                KeyEventSignal()Emitted when a key event is received. -

                Callback: bool YourCallbackName(Control control, const KeyEvent& event);

                KeyInputFocusGainedSignal()Emitted when the control gets key input focus. -

                Callback: bool YourCallbackName(Control control);

                KeyInputFocusLostSignal()Emitted when the control loses key input focus which could be due to it being gained by another Control or Actor or just cleared from this control as no longer required. -

                Callback: bool YourCallbackName(Control control);

                TouchedSignal(), HoveredSignal(), KeyEventSignal()Same as the ones supported by Actor -
                - -

                The key event signal is provided by the Dali::Stage and Dali::Toolkit::Control classes, not by the Dali::Actor class. The Dali::Actor class is not designed to get key events. To receive key events, an actor must be an instance of the Dali::Toolkit::Control class or one of its subclasses.

                -

                The Dali::Toolkit::Control class also can receive touch, hover, and wheel events as it inherits from the Dali::Actor class.

                -
              • - -
              • -Dali::Toolkit::KeyboardFocusManager - - - - - - - - - - - - - - - - - - - - - - - - - - -
                - Table: Dali::Toolkit::KeyboardFocusManager input signals -
                Input signalsDescription
                PreFocusChangeSignal()Emitted before the focus is going to be changed. -

                Callback: Actor YourCallbackName(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocus::Direction direction);

                FocusChangedSignal()Emitted after the current focused actor has been changed. -

                Callback: void YourCallbackName(Actor originalFocusedActor, Actor currentFocusedActor);

                FocusGroupChangedSignal()Emitted when the focus group has been changed. -

                Callback: void YourCallbackName(Actor currentFocusedActor, bool forward);

                FocusedActorEnterKeySignal()Emitted when the current focused actor has the enter key pressed on it. -

                Callback: void YourCallbackName(Actor enterPressedActor);

                - -

                Dali::Toolkit::KeyboardFocusManager provides the functionality of handling keyboard navigation and maintaining the two dimensional keyboard focus chain. Disimilar to the key input focus, the keyboard focus is about the focus moving between actors, and that's why this signal is provided by the specific focus managing class.

                - -
              • -
              - - -The following DALi classes provide signals: -
                -
              • Dali::Window
              • -
              • Dali::Application
              • -
              • Dali::Timer
              • -
              • Dali::Actor
              • -
              • Dali::Image
              • -
              • Dali::ResourceImage
              • -
              • Dali::LongPressGestureDetector
              • -
              • Dali::TapGestureDetector
              • -
              • Dali::PanGestureDetector
              • -
              • Dali::PinchGestureDetector
              • -
              • Dali::RenderTask
              • -
              • Dali::Stage
              • -
              • Dali::ObjectRegistry
              • -
              • Dali::PropertyNotification
              • -
              • Dali::Animation
              • -
              • Dali::Toolkit::Button
              • -
              • Dali::Toolkit::Control
              • -
              • Dali::Toolkit::TextField
              • -
              • Dali::Toolkit::View
              • -
              • Dali::Toolkit::GaussianBlurViewSignal
              • -
              • Dali::ScrollBar
              • -
              • Dali::Toolkit::Scrollable
              • -
              • Dali::Toolkit::ScrollView
              • -
              • Dali::Toolkit::AccessibilityFocusManager
              • -
              • Dali::Toolkit::KeyboardFocusManager
              • -
              -

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

              - -

              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.

              -

              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.

              - -

              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 two fingers towards or away from each other.
              • -
              • Dali::PanGestureDetector detects when the user moves one or more fingers in the same direction.
              • -
              - -

              The example below shows how an application can be notified of a pinch gesture:

              - -
              -  // ... Assuming this code is in the HelloWorldController class
              -  void Create( Application& application )
              -  {
              -    PushButton actor = PushButton::New();  // Another type of Actor
              -    actor.SetParentOrigin( ParentOrigin::CENTER );
              -    actor.SetSize( 100.0f, 100.0f );
              -    Stage::GetCurrent().Add( actor );
              -
              -    PinchGestureDetector detector = PinchGestureDetector::New();
              -    detector.Attach( actor );
              -    detector.DetectedSignal().Connect( this, &HelloWorldController::OnPinch );
              -  }
              -
              -  void OnPinch( Actor actor, const PinchGesture& pinch )
              -  {
              -     // Scale your actor according to the pinch scale
              -     Vector3 newSize = actor.GetCurrentSize() * pinch.scale;
              -     actor.SetSize( newSize );
              -  }
              -  // ...
              -
              - -

              Automatic Connection Management

              - -

              Let's say we have a pair of connected signal (for example, a button clicked signal) and slot (for example, a toolbar object having the callback for the signal). -If one of them (the button or the toolbar) is deleted without any notification, then the application will crash 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 Dali::ConnectionTracker class. It tracks connections between signals and slots, performs automatic disconnection when either the singal or slot is deleted.

              - -

              That's why all the DALi sample codes start with a controller class derived from Dali::ConnectionTracker. This is a safe and typical way of DALi application. Of course you can think of another structure using Dali::ConnectionTracker. - - - -

              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm b/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm deleted file mode 100755 index 1295fda..0000000 --- a/org.tizen.ui.guides/html/native/dali/guides_dali_n.htm +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - DALi - - - - - - -
              -

              DALi

              - -

              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.

              - -

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

              - - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/handle_n.htm b/org.tizen.ui.guides/html/native/dali/handle_n.htm deleted file mode 100755 index 41da6eb..0000000 --- a/org.tizen.ui.guides/html/native/dali/handle_n.htm +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - - - Handle/Body Pattern: Basic Way of Using DALi Objects - - - - - - -
              -

              Handle/Body Pattern: Basic Way of Using DALi Objects

              - -

              DALi widely adopts the handle/body pattern (a.k.a. pimpl pattern) which seperates implementation details (the body classes) from their interfaces (the handle classes).

              -

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

              - -

              This structure is benificial for both users and developers of DALi:

              -
                -
              • Easier memory management -

                Each internal implementation class (the body class) contains a single reference count object which can be intitialized with the static "New" methods in the DALi public API. This means that C++ new/delete operators do not have to be used in the user code. -(For your information, these internal body class inherit from Dali::BaseObject, but you don't need to use this class directly). -

                -
              • -
              • Better encapsulation -

                The danger of API/ABI breaks is reduced since the implementation of a class can be changed without modifying the public API, thus without recompiling code using the public API. This also can reduce the build time.

                -
              • -
              - -

              Guide for Handles

              - -
                - -
              • No need to call destructors -
                -class HandleTest
                -{
                -  HandleTest()
                -  {
                -    mActor = Actor::New();
                -  }
                -
                -  ~HandleTest() {} // Actor object is destroyed automatically
                -
                -  Actor mActor;
                -};
                -
                -
              • - -
              • Can be stored in STL containers -
                -class HandleTest
                -{
                -  HandleTest()
                -  {
                -    mActors.push_back( Actor::New() );
                -    mActors.push_back( Actor::New() );
                -    ...
                -  }
                -
                -  ~HandleTest() {} // Actors are destroyed automatically
                -
                -  std::vector<Actor> mActors;
                -};
                -
                -
              • - -
              • Passing by value is encouraged -
                -void SomeFunction( Actor actor )
                -{
                -  if( actor )
                -  {
                -    actor.SomeMethod();
                -  }
                -}
                -
                -
              • - -
              • Validity check -
                -{
                -  ...
                -  Actor actor;  // Create a NULL object
                -
                -  // At this stage we cannot call any of the Actor methods
                -  if( !actor )  // This test is will pass, since the actor is NULL
                -  {
                -    actor = Actor::New();
                -    ...
                -  }
                -  ...
                -}
                -
                -
              • - -
              • Equality operators -
                -{
                -  Actor handle1;
                -  Actor handle2;
                -  cout << handle1 == handle2 << endl; // "true", both handles are empty
                -
                -  handle2 = Actor::New();
                -  cout << handle1 == handle2 << endl; // "false", one handle is empty
                -
                -  handle1 = Actor::New();
                -  cout << handle1 == handle2 << endl; // "false", handles to different objects
                -
                -  handle1 = handle2;
                -  cout << handle1 == handle2 << endl; // "true", handles to same object
                -}
                -
                -
              • - -
              • Reference counting examples -
                -class AnimationTest
                -{
                -...
                -private:
                -  Animation mAnimation; // animation handle
                -};
                -void AnimationTest::Initialize ()
                -{
                -  mAnimation = Animation::New( 10.0f ); // reference count will be 1, animation object stays alive when method returns
                -  ...
                -}
                -void AnimationTest::SetAnimation( Animation anim )
                -{
                -  mAnimation = anim; // reference count of original animation decreased, 'anim' is referenced instead
                -                     // if nobody else had a reference on the initial animation, the object is destroyed
                -}
                -
                - -
                -// At this point we own a Dali::Actor named "container"
                -// Enter a code block
                -{
                -  // Create an text label
                -  TextLabel actor = TextLabel::New("test");
                -  // Add the text label to a container
                -  container.Add(actor);
                -}
                -// Exit the code block
                -// At this stage the text label is still alive
                -// We don't keep the handle to the text label, but it can be retrieved from the container
                -
                - -
              - - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/imageview_n.htm b/org.tizen.ui.guides/html/native/dali/imageview_n.htm deleted file mode 100644 index a00a060..0000000 --- a/org.tizen.ui.guides/html/native/dali/imageview_n.htm +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - ImageView: Displaying Images - - - - - - -
              -

              ImageView: Displaying Images

              - -

              ImageView is a control displying an image.

              - -

              Creating an ImageView

              - -

              The following example shows how to create an ImageView object: - -

              -Image image = ResourceImage::New(myImageFilename);
              -ImageView imageView = ImageView::New(image);
              -
              - -

              The image view is constructed by passing a Dali::Image object. The Dali::Image is an abstract base class with multiple derived classes, and the Dali::ResourceImage class is used for loading an image from a file on an url. Please see Resources: Handling Images for more information.

              - - -

              Changing the Image

              - -

              The image view needs a reference to a Dali::Image object on creation. However, the image object can be later changed by calling ImageView::SetImage() function.

              - -
              -imageView.SetImage(newImage);
              -
              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/itemview_n.htm b/org.tizen.ui.guides/html/native/dali/itemview_n.htm deleted file mode 100755 index 9260eb4..0000000 --- a/org.tizen.ui.guides/html/native/dali/itemview_n.htm +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - ItemView: Item Container with Layouts - - - - - - -
              -

              ItemView: Item Container with Layouts

              - -

              The ItemView class is a scrollable container that can contain many items. It provides several scrollable layouts as illustranted in the following figure:

              - -

              Figure: ItemView layouts

              - - - - - - - - - - - - - - -
              GridSpiralDepth
              captured screen2captured screen2captured screen2
              -

              You can also create your own custom layout by inheriting from the Dali::Toolkit::ItemLayout class.

              - -

              Item Factory

              - -

              To create an ItemView instance, you should create your own ItemFactory class by deriving from Dali::Toolkit::ItemFactory and provide its instance to ItemView::New(). ItemFactory is an abstract class having two pure virtual member functions to create items and get the number of created items. The following is a basic example of implementing an ItemFactory:

              - -
              -class MyFactory : public Dali::Toolkit::ItemFactory
              -{
              -public:  
              -   virtual unsigned int GetNumberOfItems()  
              -   {   
              -      // Return the number of items   
              -      return MY_ITEM_COUNT;  
              -   }  
              -
              -   virtual Actor NewItem(unsigned int itemId)  
              -   {   
              -      // Create the actor representing the item based on the itemId 
              -      std::ostringstream imageName;   
              -      imageName << "my-image-folder/" << itemId << ".png"; 
              -
              -      // If item is 10, this results in my-image-folder/10.png
              -      Dali::ResourceImage image = Dali::ResourceImage::New(imageName.str());
              -
              -      // Create an ImageView from the image
              -      return Dali::ImageView::New(image);
              -   }
              -};
              -
              - -

              The overridden functions in the derived class are called by the ItemView object.

              - -

              Creating an ItemView

              - -

              An example of ItemView is as follows:

              - -
              // Store this as a member variable
              -MyFactory factory; 
              -
              -// Pass in the factory
              -Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::New(factory); 
              -
              -itemView.SetParentOrigin(ParentOrigin::CENTER);
              -itemView.SetAnchorPoint(AnchorPoint::CENTER);
              -
              -// Create a layout
              -Dali::Toolkit::ItemLayoutPtr spiralLayout = Dali::Toolkit::DefaultItemLayout::New(Dali::Toolkit::DefaultItemLayout::SPIRAL);
              -
              -// Add the layout to the ItemView
              -itemView.AddLayout(spiralLayout);
              -
              -// More layouts can be created and added to the ItemView
              -// Activate the layout
              -itemView.ActivateLayout(0, Dali::Stage::GetCurrent().GetSize(), 0);
              -
              -Dali::Stage::GetCurrent().Add(itemView);
              - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/layout_n.htm b/org.tizen.ui.guides/html/native/dali/layout_n.htm deleted file mode 100644 index c4c7d8e..0000000 --- a/org.tizen.ui.guides/html/native/dali/layout_n.htm +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - Actors: Working with Basic DALi Components - - - - - - -
              -

              Layout Management: Allocating the Sizes of the Actors

              - -

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

              - -

              Dimensions

              -

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

              -
                -
              • Dimension::WIDTH
              • -
              • Dimension::HEIGHT
              • -
              -

              If a method can process width and height at the same time, the Dimension::ALL_DIMENSIONS mask can be specified.

              - -

              Resize Policies

              - -

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

              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              - Table: Resizing rules -
              Resize policyDescriptionIllustration
              ResizePolicy::FIXEDUse this option to maintain a specific size as set by the SetSize() function. This is the default for all actors.captured screen2
              ResizePolicy::USE_NATURAL_SIZEUse this option for objects, such as images or text to get their natural size. This can mean the dimensions of an image or the size of text with no wrapping. You can also use this option with table views when the size of the table depends on its children.captured screen2
              ResizePolicy::FILL_TO_PARENTThe size of the actor is similar to its parent's size with proportionate filling considered.captured screen2
              ResizePolicy::SIZE_RELATIVE_TO_PARENTThe size of the actor is similar to its parent's size with a relative scale. Use the SetSizeModeFactor() function to specify the ratio.
              ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENTThe size of the actor is similar to its parent's size with a fixed offset using the SetSizeModeFactor function.
              ResizePolicy::FIT_TO_CHILDRENThe size of the actor is scaled around the size of the its children. For example, the height of a pop-up can be resized according to its contents.captured screen2
              ResizePolicy::DIMENSION_DEPENDENCYThis option covers rules, such as width-for-height and height-for-width. You can specify that one dimension depends on another.captured screen2
              - - -

              Example with Actors

              - -

              This section describes a layout example with a actor.

              - -

              Enabling Size Negotiation

              - -

              Text and image actors have relayout enabled by default, while plain actors are disabled unless the SetResizePolicy() function is called.

              - -

              Specifying Size Policies

              - -

              Actors have different size policies by default. For example, the image actor is set to USE_NATURAL_SIZE. This ensures that an image actor uses its natural size by default when it is placed on the stage. However, if the SetSize() function is used with sizes other than 0 on the image actor, the current resize policy is overridden by the FIXED policy and the actor takes the specified size.

              - -

              You can specify how an actor is size-negotiated:

              - -
              void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension) @endcode
              - -

              It is possible to specify different policies for the different dimensions of width and height to archive different layouts. Different actors have different resize policies specified. For example, image actors are set to USE_NATURAL_SIZE by default.

              - -

              The following example shows the rootActor with its width set to ResizePolicy::FILL_TO_PARENT and its height set to ResizePolicy::FIT_TO_CHILDREN. It has an image actor added to it with an explicit call to USE_NATURAL_SIZE in both dimensions called on it. This creates an actor that fills the space of its parent in the width dimension and fits its child in the height dimension. As the image actor child is using its natural size, the height of the root actor fits the height of the child image.

              - -
              Actor rootActor = Actor::New();
              -rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
              -rootActor.SetResizePolicy(ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT);
              -ImageActor image = ImageActor::New(Image::New(MY_IMAGE_PATH));
              -image.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
              -rootActor.Add(image);
              - -

              The following images show the before and after layouts for this code example.

              - -

              Figure: Before and after setting the resize policy

              -

              Before and after setting the resize policy

              -

              Before and after setting the resize policy

              - - -

              This example shows a root actor set to expand to its parent's width and adjust around its child's height. The child image actor is set to its natural size.

              - -

              To specify that a dimension has a dependency on another dimension, use the ResizePolicy::DIMENSION_DEPENDENCY policy. For example, if the dimension is Dimension::HEIGHT and the dependency is Dimension::WIDTH, there is a height-for-width dependency in effect. You can use the policy in a text view that wraps its text. The following example shows a text view that expands its width according to the size of its parent, wraps its contents and then determines its height based on the width.

              - -
              TextLabel text = TextLabel::New("Example");
              -text.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
              -text.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
              - -

              Specifying Sizes and Size Limits

              - -

              To specify a fixed size for an actor, use the FIXED resize policy and set the desired size using the SetSize function. If only 1 dimension is FIXED, the other value in the size parameter is ignored, so it is safe to set it to 0.

              -

              To constrain the final negotiated size of an actor, set the following minimum and maximum sizes, respectively:

              - -
              void SetMinimumSize(const Vector2& size)
              -void SetMaximumSize(const Vector2& size)
              - -

              Adjusting the Negotiated Size

              - -

              When an actor must to maintain the aspect ratio of its natural size, use the SizeScalePolicy() function. 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 -

                This is the default policy.

              • -
              • SizeScalePolicy::FIT_WITH_ASPECT_RATIO -

                Fits the actor within the bounds it has been allocated while maintaining the aspect ratio.

              • -
              • SizeScalePolicy::FILL_WITH_ASPECT_RATIO -

                Fills all available space, potentially overflowing its bounds, while maintaining aspect ratio.

              • -
              - -
              void SetSizeScalePolicy(SizeScalePolicy::Type policy)
              - -

              Using Actors in Containers

              - -

              When using actors in containers, such as a table view, you can specify the padding surrounding the actor. The padding specifies the left, right, bottom, and top padding value.

              - -
              void SetPadding(const Padding& padding)
              - - - - - - - - - - -
              Note

              Beware of infinite dependency loops!

              -

              The simplest form of this is shown when the resize policy of a parent actor is set to ResizePolicy::FIT_TO_CHILDREN with a child that has a resize policy of ResizePolicy::FILL_TO_PARENT.

              -

              A more complex loop occurs when a parent actor has a width policy of ResizePolicy::DIMENSION_DEPENDENCY with a height policy of ResizePolicy::FIT_TO_CHILDREN. The parent has a single child with a height policy ResizePolicy::DIMENSION_DEPENDENCY with width. If the child's width policy is ResizePolicy::FILL_TO_PARENT, a loop occurs.

              -

              Loops can occur over larger spreads of parent-child relationships. These loops are detected by the relayout algorithm, which allocates actors 0 sizes.

              - - - - -
              - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/multi_threaded_n.htm b/org.tizen.ui.guides/html/native/dali/multi_threaded_n.htm deleted file mode 100755 index 2972ebb..0000000 --- a/org.tizen.ui.guides/html/native/dali/multi_threaded_n.htm +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - Multi-Threaded Architecture: The Secret of High-Performance of DALi - - - - -
          -
          -
          - -
          -

          Multi-Threaded Architecture: The Secret of High-Performance of DALi

          - -

          DALi uses a multithreaded architecture in order to provide the best performance and scalability.

          -
            -
          • Event Thread: The main thread in which application code and event handling runs.
          • -
          • Update Thread: Updates the nodes on the scene as well as running animations and constraints.
          • -
          • Render Thread: OpenGL drawing, texture and geometry uploading etc.
          • -
          • Resource Thread: Loads images and decodes into bitmaps etc.
          • -
          - -

          Figure: DALi Thread Architecture

          -

          Thread Architecture

          - - - - - -

          Animations with Multi-Threading

          - -

          Multi-threaded Architecture

          - -

          DALi animations and rendering occur in a dedicated rendering thread. This allows animations to run smoothly, regardless of the time taken to process inputs events in the application code.

          - -

          Internally, DALi contains the scene graph that mirrors the actor hierarchy. The scene graph objects perform the actual animation and rendering, while the actors provide thread-safe access. Actors and scene graph objects communicate through messaging.

          - -

          The following figure shows an actor hierarchy, in which one of the actors is being animated. The green objects in are created by the application code, while the blue private objects are used in the dedicated rendering thread.

          - -

          Figure: Actor hierarchy with an animation

          -

          Actor hierarchy with an animation

          - -

          Reading an Animated Value

          - -

          When a property is animatable, it can only be modified in the rendering thread. The value returned from a getter method is the value used when the previous frame was rendered.

          - -

          For example, the GetCurrentPosition() function returns the position in which the actor was last rendered. Since the SetPosition() function is asynchronous, a call to GetCurrentPosition() function does not immediately return the same value.

          - -
          Actor actor = Actor::New();
          -Stage::GetCurrent().Add(actor); // Initial position is 0,0,0
          -
          -actor.SetPosition(Vector3(10,10,10));
          -
          -Vector3 current;
          -current = actor.GetCurrentPosition();
          -std::cout << "Current position: " << current.x << ", " << current.y << ", " << current.z << std::endl;
          -
          -std::cout << "..." << std::endl;
          -
          -// Handling another event
          -
          -current = actor.GetCurrentPosition();
          -std::cout << "Current position: " << current.x << ", " << current.y << ", " << current.z << std::endl;
          -
          - -

          The above code is likely to output:

          -
          Actor actor = Actor::New();
          -"Current position: 0,0,0"
          -// Other positions
          -"Current position: 10,10,10"
          - -

          Setting a Property during an Animation

          - -

          When a property is being animated, the animation overrides all values set with other functions, such as the SetPosition() function.

          - -

          Figure: Actor hierarchy with an animated property

          -

          Actor hierarchy with an animated property

          - -

          The order of execution in the render thread is:

          -
            -
          1. Process message and call the SetPosition() function
          2. -
          3. Apply animation and call the SetPosition() function
          4. -
          5. Render frame
          6. -
          - -

          Resource Loading with Multi-Threading

          - -

          DALi loads resources in seperate threads. Without using these resource threads, a large image file will cause block to process next operation in the main thread while reading data from file system or downloading from network.

          - -

          Currently, DALi creates one thread for loading local resources and another for loading remote resources if required.

          - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/properties_n.htm b/org.tizen.ui.guides/html/native/dali/properties_n.htm deleted file mode 100755 index 5bd20dd..0000000 --- a/org.tizen.ui.guides/html/native/dali/properties_n.htm +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - - - - - - - - - Properties: Accessing to Properties of DALi Objects - - - - - - -
          -

          Properties: Accessing to Properties of DALi Objects

          - -

          A property is a value used by an object that can be modified or read via Dali::Handle::GetProperty() / SetProperty() API.

          - -

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

          - -

          Dali::Handle (in mobile and wearable) provides methods to manage properties, thus the DALi classes that inherit from Dali::Handle (most of classes that users would use) have a number of predefined properties and can have any number of user-defined custom properties. -

          - -

          Accessing to Property Values

          - -

          Property values of an object usually can be accessed via two ways: by its class member functions or by property getters/setters (Dali::Handle::GetProperty() / SetProperty()).

          -

          For example, Dali::Actor has following predefined properties:

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Properties of Dali::Actor -
          Property Index (enumeration)Member Functions
          Dali::Actor::POSITIONDali::Actor::GetCurrentPosition() / SetPosition()
          Dali::Actor::ORIENTATIONDali::Actor::GetCurrentOrientation() / SetOrientation()
          Dali::Actor::SIZEDali::Actor::GetCurrentSize() / SetSize()
          Dali::Actor::COLORDali::Actor::GetCurrentColor() / SetColor()
          Dali::Actor::NAMEDali::Actor::GetName() / SetName()
          ......
          - - You can access them in both ways: - -
          -Actor actor = Actor::New();
          -actor.SetName("test actor");
          -std::cout << actor.GetName() << std::endl;  // "test actor"
          -
          - -
          -Actor actor = Actor::New();
          -actor.SetProperty( Actor::Property::NAME, "test actor" );
          -std::cout << actor.GetProperty( Actor::Property::NAME ) << std::endl;  // "test actor"
          -std::cout << actor.GetProperty<std::string>( Actor::Property::NAME ) << std::endl;  // "test actor"
          -std::cout << actor.GetProperty( Actor::Property::NAME ).Get<std::string>() << std::endl;  // "test actor"
          -
          - -

          Please see API reference for Dali::Handle (in mobile and wearable) for more information. - -

          Usages of Properties

          - -

          Registering User-Defined Custom Properties to Objects

          - -

          Properties can be registered / unregistered in runtime, which enables script-like programming of DALi application, for example, adding custom member data to an instance of a DALi class without subclassing the class or maintaining another pool of custom data.

          -

          For example, you can set your own custom data to PushButton objects and use them later when the buttons are clicked like:

          -
          -void Create( Application& application )
          -{
          -  for( int i=0; i<5; ++i )
          -  {
          -    Toolkit::PushButton button = Toolkit::PushButton::New();
          -    button.SetSize( 100, 100 );
          -    button.SetPosition( 100*i+50, 50 );
          -    button.ClickedSignal().Connect( this, OnButtonClicked );
          -
          -    // Register a custom property having button index.
          -    // Store the property index so you can look it up later.
          -    // Note: This is much faster than looking the property up by property name and should always be used if possible.
          -    // As all control types are the same (PushButtons) the indices to the unique custom property are all same.
          -    Property::Value data( i );
          -    mCustomDataIndex = button.RegisterProperty( "custom-data", data );
          -
          -    Stage::GetCurrent().Add(button);
          -  }
          -}
          -
          -bool OnButtonClicked(Toolkit::Button button)
          -{
          -  // Look up the custom property by the stored property index.
          -  // Note: If the property belongs to a control in another library, or we do not know the index, we can look the index up first with:
          -  // Property::Index index = button.GetPropertyIndex( "custom-data" );
          -  cout << button.GetProperty( mCustomDataIndex ) << endl;
          -  return true;
          -}
          -
          - -

          Please see API reference for Dali::Handle (in mobile and wearable) for more information. - -

          Animating Objects

          - -

          DALi animation API is used to animate the properties of any number of objects.

          - -

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

          - -
          -RadioButton actor = RadioButton::New();
          -Stage::GetCurrent().Add(actor);
          -Animation animation = Animation::New(2.0f); // duration 2 seconds
          -animation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(100.0f, 200.0f, 0.0f));
          -animation.Play();
          -
          - -

          Please see Animation Basics for more information.

          - -

          Imposing Constraints on Objects

          - -

          DALi constraint API is used to modify the property of an object based on other properties of other objects.

          - -

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

          - -
          -Constraint constraint = Constraint::New( actor,
          -                                                  Actor::Property::SIZE,
          -                                                  EqualToConstraint() );
          -constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
          -constraint.Apply();
          -
          - -

          Please see Constraints for more information.

          - -

          Attributes of Properties

          - -

          A property has following attributes: -

            -
          • Index: An enumeration number indicating the property. Property index is usually used to access properties.
          • -
          • Type: Type of the property. Retrieved by Dali::Handle::GetPropertyType().
          • -
          • Name: Name of the property. Retrieved by Dali::Handle::GetPropertyName().
          • -
          • Writable: If true, the property value can be written. Retrieved by Dali::Handle::IsPropertyWritable().
          • -
          • Animatable: If true, the property can be animated using Dali::Animation. Retrieved by Dali::Handle::IsPropertyAnimatable().
          • -
          • Constraint-Input: If true, the property can be used as input of constraints. Retrieved by Dali::Handle::IsPropertyAConstraintInput().
          • -
          - -

          For example, predefined properties of Dali::Actor has following attributes:

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Attributes of Properties of Dali::Actor -
          Property Index (enumeration)Property TypeProperty Name
          Dali::Actor::POSITIONVector3"position"
          Dali::Actor::ORIENTATIONQuaternion"orientation"
          Dali::Actor::SIZEVector3"size"
          Dali::Actor::COLORVector4"color"
          Dali::Actor::NAMEstd::string"name"
          .........
          - -

          You can see these information at API reference for property of each class. For example for Dali::Actor, please see Dali::Actor::Property (in mobile and wearable).

          - -

          To check all kinds of supported property types, please see Dali::Property::Type (in mobile and wearable) and Dali::PropertyTypes (in mobile and wearable).

          - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/rendering_effects_n.htm b/org.tizen.ui.guides/html/native/dali/rendering_effects_n.htm deleted file mode 100755 index ba741e0..0000000 --- a/org.tizen.ui.guides/html/native/dali/rendering_effects_n.htm +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - Rendering and Effects: Managing Viewing Modes and Shader Effects - - - - - - -
          -

          Rendering and Effects: Managing Viewing Modes and Shader Effects

          - -DALi provides stereoscopic viewing modes. It also provides a way to use user-defined custom shader effects. - -

          Viewing Modes

          - -

          DALi supports the following viewing modes:

          -
            -
          • MONO
          • -
          • STEREO_HORIZONTAL
          • -
          • STEREO_VERTICAL
          • -
          - -

          MONO is the default viewing mode. When using the MONO mode, only 1 image per scene is produced in every update. In this setup, DALi creates a default render task, which renders everything added to the stage root layer, and 1 default camera for that render task.

          - -

          The STEREO_HORIZONTAL and STEREO_VERTICAL modes allow the application to produce stereo images. Stereoscopy is a technique for creating or enhancing the illusion of depth in an image. Stereo rendering technique produces 2 images of the scene with an slight offset between them, which is presented to the left and the right eye independently. In this setup, DALi creates 2 additional render tasks, 1 for the right eye and 1 for the left, each with its own camera. Those cameras are parented to the default camera. The method to generate the projection transformation for each camera is known as "parallel axis asymmetric frustum perspective projection" and is illustrated in the following figure.

          - -

          Figure: Stereoscopic projection

          -

          Stereoscopic projection

          - -

          The separation between the 2 cameras is configurable but, typically, it ranges between 50 and 70 millimeters. Too large a separation can be hard to resolve and is known as hyperstereo. The convergence plane for both frustums is the 2D plane, so the projection of anything lying in the 2D plane is coincident for both left and right eye, resulting in no parallax. Objects that lie in front of the projection plane appear to be in front of the screen and objects behind the projection plane appear to be "into" the screen. Objects behind the projection plane (positive parallax) are easier to look at without straining the eyes.

          - -

          To view stereoscopic images correctly, each image must be presented to each eye independently. There are devices on the market for this, such as a head-mounted display, which is a display device worn in the head that has 2 small displays, one for each eye. A cheaper alternative to this often expensive device is the Google cardboard viewer.

          - -

          Figure: Google cardboard viewer

          -

          Google cardboard viewer

          - -

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

          - -

          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.

          - -

          To define the viewing mode to be used, use the SetViewMode() function of the Application class, passing the mode as a parameter. You can query the view mode being used by calling the GetViewMode() function. To define the separation between the left and right cameras, use the SetStereoBase() function, passing the distance in millimeters as a parameter. This distance can be queried using the GetStereoBase() function. You can also set the viewing mode and offset at initialization time using 2 command line arguments for this purpose: -view-mode (or -v) and 0 for MONO, 1 for STEREO_HORIZONTAL, 2 for STEREO_VERTICAL, and -stereo-base (or -s) and the separation in millimeters.

          - -

          Restrictions

          - -

          There are certain restrictions when writing stereoscopic applications using DALi:

          - -
            -
          • When a stereo mode is selected, the default render task source actor is set to an uninitialized actor so it does not render anything. Changing the default render task source actor later on produces undesired results, as the user does not want to see anything rendered by the default camera when stereo mode is on.
          • -
          • Stereo cameras are parented to the default camera, so if the application needs to change the camera position or orientation, it must change the default camera transformation. The handle to the default camera can be obtained from the default render task as follows: - -
            Dali::RenderTask defaultRenderTask = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0); Dali::CameraActor defaultCamera = defaultRenderTask.GetCameraActor();
            -
          • -
          • Stereo render tasks render everything added to the stage's root layer. If the application must render an object hierarchy to an off-screen buffer, it must set the exclusive flag on that render task so that the stereo tasks do not render that particular subtree. To set the exclusive flag in a render task, use the SetExclusive() function defined in the render task.
          • -
          - - - - - - - - - - -
          Note
          -

          DALi stereoscopic viewing mode is a developing feature rather than completed feature. Thus, it might not be enough for commercialized applications at this moment. For example, distortion correction is not supported yet. We are trying to improve this streoscopic mode to give our users chances to provide more exciting and immersive user experience to their clients.

          -
          - - - -

          Shader Effects

          -

          The shader effects allow the developer to apply visual deformations on the actors. They can affect the geometry, the colors and textures of the actor.

          -
            -
          • Each actor has its own default shaders.
          • -
          • Those default shaders can be overridden by modified shader effects.
          • -
          • In an application, each actor might possess its own shader effect.
          • -
          • In an application, multiple actors might apply the same effect.
          • -
          - -

          Custom Shader Effects

          -

          The ShaderEffect enables you to create custom shader effects by specifying the vertex and pixel shaders. For a custom shader, you can provide the vertex and fragment shader code as strings. These shader snippets get concatenated with the default attributes and uniforms.

          - -

          Create a custom shader effect:

          - -
          std::string myVertexShader; // This variable would contain the code for a vertex shader.
          -Dali::ShaderEffect myEffect = Dali::ShaderEffect::New(myVertexShader,
          -   "" // use default pixel shader
          -);
          - -

          Set the value of a uniform:

          - -
          // if the uniform was declared like this in the shader: uniform float myUniform;
          -myEffect.SetUniform("myUniform", 0.5f);
          - -

          You can apply the custom shader effect to an actor like any other shader:

          - -
          actor.SetShaderEffect(myEffect);
          - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/resources_n.htm b/org.tizen.ui.guides/html/native/dali/resources_n.htm deleted file mode 100755 index 12d0974..0000000 --- a/org.tizen.ui.guides/html/native/dali/resources_n.htm +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - Resources: Handling Images - - - - - - -
          -

          Resources: Handling Images

          - -

          DALi provides several ways to handle resource images.

          - -

          Loading Image Files

          - -

          You can load an image file with ResourceImage class by specifying its location as follows: - -

          -Dali::ResourceImage image = Dali::ResourceImage::New("/my-path/my-image.png");
          -
          - -

          The loaded image can be displayed using ImageView as follows:

          - -
          -ImageView imageView = ImageView::New(image);
          -Stage::GetCurrent().Add(imageView);
          -
          - -

          Please see ImageView: Displaying Images for more details. - -

          Supported Resource Types

          - -

          The resource location can be a file path or a URL.

          - -

          Currently supported image types are:

          -
            -
          • png
          • -
          • jpeg
          • -
          • gif
          • -
          • bmp
          • -
          • wbmp
          • -
          • ico
          • -
          • ktx
          • -
          - -

          Currently supported URL schemes are:

          -
            -
          • http
          • -
          • https
          • -
          - -

          Asynchronous Loading

          - -

          Resources are loaded in separate threads, which means when you call ResourceImage::New(), it returns immediately.

          - -

          The application can connect to the Dali::ResourceImage::LoadingFinishedSignal() signal to get notified when the image has loaded as follows:

          - - -
          -class ResourceImageController : public ConnectionTracker
          -{
          -public:
          -  ResourceImageController( Application& application ) : mApplication( application )
          -  {
          -    mApplication.InitSignal().Connect( this, &ResourceImageController::Create );
          -  }
          -
          -  void Create( Application& application )
          -  {
          -    ResourceImage image = ResourceImage::New("https://www.tizen.org/sites/default/files/admins/tizen-branding-lockup-on-light.png");
          -    image.LoadingFinishedSignal().Connect(this, &ResourceImageController::OnLoadFinished); 
          -
          -    ImageView imageView = ImageView::New(image);
          -    imageView.SetSize(400,200);
          -    imageView.SetParentOrigin(ParentOrigin::CENTER);
          -    Stage::GetCurrent().Add(imageView);
          -  }
          -
          -  void OnLoadFinished(ResourceImage image)
          -  {
          -    LoadingState state = image.GetLoadingState();
          -    if(state == ResourceLoadingSucceeded)
          -      cout << "Loading " << image.GetUrl() << " is succeeded" << endl;
          -    else if(state == ResourceLoadingFailed)
          -      cout << "Loading " << image.GetUrl() << " is failed" << endl;
          -  }
          -};
          -
          - -

          Please see Resource Loading with Multi-Threading for more information about the resource threads. - - -

          Load Policies & Release Policies

          - -

          By default, resource images start loading immediately and the data is released only when the ResourceImage handle is destroyed. To optimize the application's memory footprint, the application can ask resources to be loaded only when actually required and their data to be released automatically when they are no longer being used by actors.

          - -
          Dali::ResourceImage image = Dali::ResourceImage::New("/my-path/my-image.png", Dali::ResourceImage::ON_DEMAND, Dali::Image::UNUSED);
          - -

          If the Dali::Image::UNUSED property is used, when the image is used again, the resource data is reloaded automatically.

          - -

          Resizing at Load Time

          - -

          An application loading images from an external source will often want 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. There are four algorithms which can be used to fit an image to a desired rectangle, a desired width or a desired height (see Dali::FittingMode).

          - -

          Here is an example doing rescaling:

          - -
          -Dali::Image image = Dali::ResourceImage::New( filename, ImageDimensions( 240, 240 ), FittingMode::SCALE_TO_FILL );
          -
          - -

          This example sets the size and fitting mode appropriately for a large thumbnail during the Dali::ResourceImage object construction. In general, to enable scaling on load, pass a non-zero width or height and one of the four fitting modes to the Dali::ResourceImage creator function as shown above.

          - -

          The fitting modes and a suggested use-case for each are as follows:

          - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Fitting Modes -
          Fitting ModeSuggested Usecase
          Dali::FittingMode::SHRINK_TO_FITFull-screen image display: Limit loaded image resolution to device resolution but show all of image.
          Dali::FittingMode::SCALE_TO_FILLThumbnail gallery grid: Limit loaded image resolution to screen tile, filling whole tile but losing a few pixels to match the tile shape.
          Dali::FittingMode::FIT_WIDTHImage columns: Limit loaded image resolution to column.
          Dali::FittingMode::FIT_HEIGHTImage rows: Limit loaded image resolution to row height.
          - - -

          Image Size

          - -

          If the application requires the image dimensions immediately, they can be retrieved synchronously:

          - -
          Dali::ImageDimensions dimensions = Dali::ResourceImage::GetImageSize("/my-path/my-image.png");
          - -

          This is a disk read which can be slow and block the event thread (This is currently not suppored for remote resources such as http or https URLs).

          - -

          Nine-Patch Image

          - -

          DALi provides support for Nine-patch images which are stretchable images while maintaining their corners.

          - -

          Nine-Patch Image Format

          - -

          A nine-patch image has nine sections. In the following figure, section 2, 4, 5, 6, 8 are stretched and section 1, 3, 7, 9 keep their size unchanged when the size of the image is changed:

          - -

          Figure: A nine-patch image

          -

          A nine-patch image

          - -

          Figure: A nine-patch image explained

          -

          A nine-patch image

          - -

          The black lines top and left side of the image determines the stretchable region.

          - -

          This format is compatible with the one used in Android. Therefore, you can easily make nine-patch images using existing tools such as Simple Nine-patch Generator.

          - -

          Loading Nine-Patch Images

          - -

          A nine-patch image can be loaded by ResourceImage just like other images. If a image file has .9.png or .9.jpg extension and proper nine-patch image contents as forementioned, the image loaded by ResourceImage will be rendered in nine-patch way with ImageView class.

          - -

          The following is an example of using a *.9.png image:

          - -
          -  ResourceImage image = ResourceImage::New( "nine_patch_dali.9.png" );
          -  ImageActor imageView = ImageActor::New(image);
          -  imageView.SetSize(200,200);
          -
          - -

          The result is as follows:

          -

          Figure: 200 x 200 image

          -

          200 x 200 image

          - -

          Buffer Image

          - -

          A BufferImage represents an image resource in the form of a 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)
          -Dali::BufferImage image = Dali::BufferImage::New(200, 200);
          - -

          Please see API reference for Dali::BufferImage (in mobile and wearable) for more details. - - - - -

          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/scrollview_n.htm b/org.tizen.ui.guides/html/native/dali/scrollview_n.htm deleted file mode 100755 index 0121500..0000000 --- a/org.tizen.ui.guides/html/native/dali/scrollview_n.htm +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - ScrollView: Scrollable Container for Items - - - - - - -
          -

          ScrollView: Scrollable Container for Items

          - -

          The ScrollView class provides scrollable view which contains actors and can be scrolled automatically or manually by panning.

          - -

          The following figure shows example layouts using the ScrollView.

          - -

          Figure: ScrollView

          -

          ScrollView

          - - -

          A scroll view emits a SnapStartedSignal() when the ScrollView has started to snap or flick. The signal informs the target of the scroll position, scale, and rotation.

          - -

          Creating a ScrollView

          - -

          The following example shows how to create a ScrollView:

          - -
          Dali::Toolkit::ScrollView scrollView;
          -
          -// Create a ScrollView instance
          -myScrollView = ScrollView::New();
          -
          -// Add it to the stage
          -Stage::GetCurrent().Add(scrollView);
          -
          -// Set the size of stage; it covers the entire stage 
          -Stage stage = Dali::Stage::GetCurrent();
          -Size size = stage.GetSize();
          -scrollView.SetSize(size);
          -
          -// Add actors to the ScrollView 
          -Image image = Image::New(DALI_IMAGE_DIR "button-background.png");
          -ImageActor imageActor = ImageActor::New(image);
          -scrollView.Add(imageActor);
          -// The ScrollView contents are now draggable
          -
          -// To enforce horizontal-only scrolling, the Y-axis ruler can be disabled 
          -RulerPtr rulerY = new DefaultRuler();
          -rulerY->Disable();
          -scrollView.SetRulerY(rulerY);
          -
          -// To enable snapping, a FixedRuler can be applied to the X-axis, with snap points spaced to the width of the stage. 
          -Size size = stage.GetSize();
          -RulerPtr rulerX = new FixedRuler(size.width);
          -scrollView.SetRulerX(rulerX);
          -
          -// A domain can be applied to rulers to prevent scrolling beyond this boundary
          -// In this case, to 4 times the width of the stage, allowing for 4 pages to be scrolled
          -Size size = stage.GetSize();
          -RulerPtr rulerX = new FixedRuler(size.width);
          -rulerX->SetDomain(RulerDomain(0.0f, size.width*4.0f));
          -scrollView.SetRulerX(rulerX);
          - -

          Ruler, RulerDomain, and Wrap

          - -

          The Ruler abstract class defines the scroll axes. The RulerDomain class specifies the minimum and maximum values of a ruler. The ScrollView class provides a wrap mode for ScrollView contents. When enabled, the ScrollView contents are wrapped over the x/y domain. The ScrollView behavior depends on a combination of the Ruler, RulerDomain, and Wrap modes. The following table shows ScrollView behavior according to the combination.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Scrollview behavior in the Ruler, RulerDomain, and Wrap mode
          RulerDomainWrapBehavior
          DisabledDisabledWrapNo movement in axis
          DisabledEnabledNo wrapNo movement in axis
          DisabledEnabledWrapNo movement in axis
          EnabledDisabledNo wrapFree movement in axis
          EnabledDisabledWrapFree movement in axis, wrapped according to domain minimum and maximum
          EnabledEnabledNo wrapMovement limited to domain minimum and maximum
          EnabledEnabledWrapMovement limited to domain minimum and maximum
          - - - - - - - - - - -
          Note
          Actors within a ScrollView are controlled by constraints. If you apply constraints to these actors externally, undefined behavior can occur. Applying additional constraints can conflict with the ScrollView constraints, so place the actors within container actors. The container actors are affected by the constraints.
          - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/tableview_n.htm b/org.tizen.ui.guides/html/native/dali/tableview_n.htm deleted file mode 100755 index 6de3ce8..0000000 --- a/org.tizen.ui.guides/html/native/dali/tableview_n.htm +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - TableView: Container with Grid-like Layout - - - - - - -
          -

          TableView: Container with Grid-like Layout

          - -

          The TableView class is a layout container for aligning child actors in a grid like layout. TableView constraints the x and y position and width and height of the child actors.

          - -

          Figure: TableView

          -

          TableView

          - -

          Creating a TableView

          - -

          The following example shows how to create a TableView:

          - -
          class ButtonsController: public ConnectionTracker
          -{
          -   ButtonsController(Application& application)
          -      : mApplication(application)
          -   {
          -      mApplication.InitSignal().Connect(this, &ButtonsController::Create);
          -   }
          -
          -   void Create(Application& application)
          -   {
          -      Stage stage = Stage::GetCurrent();
          -
          -      TableView tableView = TableView::New(4,4);
          -      tableView.SetKeyboardFocusable(true);
          -      tableView.SetName("TableView");
          -
          -      for (int row = 0; row < 4; ++row)
          -      {
          -         for (int col = 0; col < 4; ++col)
          -         {
          -            Control control = Control::New();
          -            std::ostringstream str;
          -            str << row << "-" << col;
          -            control.SetName(str.str());
          -            control.SetKeyboardFocusable(true);
          -            tableView.AddChild(control, TableView::CellPosition(row, col));
          -         }
          -      }
          -      stage.Add(tableView);
          -   }
          -
          -   // Signal
          -
          -   Application& mApplication;
          -}
          - - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/textfield_n.htm b/org.tizen.ui.guides/html/native/dali/textfield_n.htm deleted file mode 100755 index d45daf5..0000000 --- a/org.tizen.ui.guides/html/native/dali/textfield_n.htm +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - TextField: Type Your Text! - - - - - - -
          -

          TextField: Type Your Text!

          - -

          The TextField class is a control providing a single-line editable text field.

          - -

          Figure: TextField

          -

          TextField

          - -

          Creating a TextField

          - -

          Before text has been entered, the TextField can display a placeholder text. An alternative placeholder can be displayed when the TextField has keyboard focus. For example, a TextField used to enter a username can initially show the text Unknown Name, and the text Enter Name.when the cursor is visible.

          - -
          TextField field = TextField::New();
          -field.SetProperty(TextField::Property::PLACEHOLDER_TEXT, "Unnamed Name");
          -field.SetProperty(TextField::Property::PLACEHOLDER_TEXT_FOCUSED, "Enter Name.");
          -Stage::GetCurrent().Add(field);
          -
          - -

          When the TextField is tapped, it automatically gets the keyboard focus. Key events enter text, and the placeholder text is removed. After text has been entered, it can be retrieved from the TEXT property.

          - -
          Property::Value fieldText = field.GetProperty(TextField::Property::TEXT);
          -std::cout << "Received text: " << fieldText.Get< std::string >() << std::endl;
          - -

          Text Alignment

          - -

          The TextField displays a single-line of text, which scrolls if there is not enough space for the text displayed. If there is enough space, the text can be aligned horizontally to the beginning, end, or center of the available area:

          - -
          field.SetProperty(TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); // "CENTER" or "END"
          - -

          Decorations

          - -

          For text decorations, the TextLabel class provides the properties listed in the following table.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: TextField properties -
          PropertyTypeWritableAnimatable
          RENDERING_BACKENDIntegerYesNo
          TEXTStringYesNo
          PLACEHOLDER_TEXTStringYesNo
          PLACEHOLDER_TEXT_FOCUSEDStringYesNo
          FONT_FAMILYStringYesNo
          FONT_STYLEStringYesNo
          POINT_SIZEFloatYesNo
          MAX_LENGTHIntegerYesNo
          EXCEED_POLICYIntegerYesNo
          HORIZONTAL_ALIGNMENTStringYesNo
          VERTICAL_ALIGNMENTStringYesNo
          COLORVector4YesNo
          SHADOW_OFFSETVector2YesNo
          SHADOW_COLORVector4YesNo
          PRIMARY_CURSOR_COLORVector4YesNo
          SECONDARY_CURSOR_COLORVector4YesNo
          ENABLE_CURSOR_BLINKBooleanYesNo
          CURSOR_BLINK_INTERVALFloatYesNo
          CURSOR_BLINK_DURATIONFloatYesNo
          GRAB_HANDLE_IMAGEStringYesNo
          GRAB_HANDLE_PRESSED_IMAGEStringYesNo
          SCROLL_THRESHOLDFloatYesNo
          SCROLL_SPEEDFloatYesNo
          SELECTION_HANDLE_IMAGE_RIGHTStringYesNo
          SELECTION_HANDLE_PRESSED_IMAGE_LEFTStringYesNo
          SELECTION_HANDLE_PRESSED_IMAGE_RIGHTStringYesNo
          SELECTION_HIGHLIGHT_COLORVector4YesNo
          DECORATION_BOUNDING_BOXRectangleYesNo
          INPUT_METHOD_SETTINGSMapYesNo
          - -

          To change the color of the text, use the TEXT_COLOR property. An alternative color can be used for placeholder text by setting the PLACEHOLDER_TEXT_COLOR property. Unlike the Actor::COLOR property, these properties do not affect child actors added to the TextField.

          - -
          field.SetProperty(TextField::Property::TEXT_COLOR, Color::CYAN);
          -field.SetProperty(TextField::Property::PLACEHOLDER_TEXT_COLOR, Color::BLACK);
          - - - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/textlabel_n.htm b/org.tizen.ui.guides/html/native/dali/textlabel_n.htm deleted file mode 100755 index 49e721c..0000000 --- a/org.tizen.ui.guides/html/native/dali/textlabel_n.htm +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - TextLabel: Displaying Text Labels - - - - - - -
          -

          TextLabel: Displaying Text Labels

          - -

          The TextLabel class provides a control that renders a short text string. The text labels are lightweight, non-editable, and do not respond to user input.

          - -

          Figure: TextLabel

          -

          TextLabel

          - -

          Creating a TextLabel

          - -

          The following example shows how to create a TextLabel instance:

          - -
          TextLabel label = TextLabel::New();
          -label.SetProperty(TextLabel::Property::TEXT, "Hello World");
          -Stage::GetCurrent().Add(label);
          - -

          Font Selection

          - -

          By default, the TextLabel automatically selects a suitable font from the platform. Please note that the selected font might not support all characters in your input text. For example, Latin fonts often do not provide Arabic glyphs.

          - -

          Alternatively, you can request a font using the FONT_FAMILY, FONT_STYLE, and POINT_SIZE properties:

          - -
          label.SetProperty(TextLabel::Property::FONT_FAMILY, "HelveticaNue");
          -label.SetProperty(TextLabel::Property::FONT_STYLE,  "Regular");
          -label.SetProperty(TextLabel::Property::POINT_SIZE,  12.0f);
          - -

          The TextLabel falls back to using the default font if the requested font does not support the required scripts.

          - -

          Text Alignment

          - -

          Wrapping can be enabled using the MULTI_LINE property:

          - -
          label.SetProperty(TextLabel::Property::MULTI_LINE, true);
          - -

          The text can be aligned horizontally to the beginning, end, or center of the available area:

          - -
          label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); // "CENTER" or "END"
          - -

          Layout

          - -

          There are several resize policies commonly used with TextLabels. -The following examples show the actual size by setting a colored background, whilst the black area represents the size of the parent control.

          - -

          Natural Size Policy

          - -

          In its natural size, the TextLabel is large enough to display the text without wrapping, and does not have extra space to align the text within. In the following example, the same result is displayed regardless of the alignment or multi-line properties:

          - -
          TextLabel label = TextLabel::New("Hello World");
          -label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          -label.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE,Dimension::ALL_DIMENSIONS);
          -label.SetBackgroundColor(Color::BLUE);Stage::GetCurrent().Add(label);
          - -

          Height-for-width Policy

          - -

          To lay out text labels vertically, a fixed (maximum) width must be provided by the parent control. Each TextLabel reports the desired height for the given width. The following example uses TableView as the parent:

          - -
          TableView parent = TableView::New(3, 1);
          -parent.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          -parent.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
          -parent.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          -
          -Stage::GetCurrent().Add(parent);
          -
          -TextLabel label = TextLabel::New("Hello World");
          -label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          -label.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          -label.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          -label.SetBackgroundColor(Color::BLUE);
          -
          -parent.AddChild(label, TableView::CellPosition(0, 0));
          -parent.SetFitHeight(0);
          -
          -label = TextLabel::New("A Quick Brown Fox Jumps Over The Lazy Dog");
          -label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          -label.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          -label.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          -label.SetBackgroundColor(Color::GREEN);
          -label.SetProperty(TextLabel::Property::MULTI_LINE, true);
          -
          -parent.AddChild(label, TableView::CellPosition(1, 0));
          -parent.SetFitHeight(1);
          -
          -label = TextLabel::New("لإعادة ترتيب الشاشات، يجب تغيير نوع العرض إلى شبكة قابلة للتخصيص");
          -label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          -label.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          -label.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          -label.SetBackgroundColor(Color::BLUE);
          -label.SetProperty(TextLabel::Property::MULTI_LINE, true);
          -
          -parent.AddChild(label, TableView::CellPosition(2, 0));
          -parent.SetFitHeight(2);
          - -

          In the example, the "Hello World" text label has been given the full width, not the natural width.

          - -

          Decorations

          - -

          For text decorations, TextLabel provides several properties.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: TextLabel properties -
          PropertyTypeWritableAnimatable
          RENDERING_BACKENDIntegerYesNo
          TEXTStringYesNo
          FONT_FAMILYStringYesNo
          FONT_STYLEStringYesNo
          POINT_SIZEFloatYesNo
          MULTI_LINEBooleanYesNo
          HORIZONTAL_ALIGNMENTStringYesNo
          VERTICAL_ALIGNMENTStringYesNo
          TEXT_COLORVector4YesNo
          SHADOW_OFFSETVector2YesNo
          SHADOW_COLORVector4YesNo
          UNDERLINE_ENABLEDBooleanYesNo
          UNDERLINE_COLORVector4YesNo
          UNDERLINE_HEIGHTFloatYesNo
          - -

          Color

          - -

          To change the color of the text, use the TEXT_COLOR property. Unlike the Actor::COLOR property, this does not affect child actors added to the TextLabel.

          - -
          label.SetProperty(TextLabel::Property::TEXT, "Red Text");
          -label.SetProperty(TextLabel::Property::TEXT_COLOR, Color::RED);
          - -

          Drop Shadow

          - -

          To add a drop shadow to the text, set the SHADOW_OFFSET property with a non-zero values. The color can also be selected using the SHADOW_COLOR property.

          - -
          stage.SetBackgroundColor(Color::BLUE);
          -label1.SetProperty(TextLabel::Property::TEXT, "Plain Text");
          -label2.SetProperty(TextLabel::Property::TEXT, "Text with Shadow");
          -label2.SetProperty(TextLabel::Property::SHADOW_OFFSET, Vector2(1.0f, 1.0f));
          -label2.SetProperty(TextLabel::Property::SHADOW_COLOR, Color::BLACK);
          -label3.SetProperty(TextLabel::Property::TEXT, "Text with Bigger Shadow");
          -label3.SetProperty(TextLabel::Property::SHADOW_OFFSET, Vector2(2.0f, 2.0f));
          -label3.SetProperty(TextLabel::Property::SHADOW_COLOR, Color::BLACK);
          -label4.SetProperty(TextLabel::Property::TEXT, "Text with Color Shadow");
          -label4.SetProperty(TextLabel::Property::SHADOW_OFFSET, Vector2(1.0f, 1.0f));
          -label4.SetProperty(TextLabel::Property::SHADOW_COLOR, Color::RED);
          - -

          Underlining

          - -

          The text can be underlined by setting UNDERLINE_ENABLED. The color can also be selected using the UNDERLINE_COLOR property.

          - -
          label1.SetProperty(TextLabel::Property::TEXT, "Text with Underline");
          -label1.SetProperty(TextLabel::Property::UNDERLINE_ENABLED, true);
          -label2.SetProperty(TextLabel::Property::TEXT, "Text with Color Underline");
          -label2.SetProperty(TextLabel::Property::UNDERLINE_ENABLED, true);
          -label2.SetProperty(TextLabel::Property::UNDERLINE_COLOR, Color::GREEN); 
          - -

          By default, the underline height is based on the font metrics. This can be overridden using the UNDERLINE_HEIGHT property:

          - -
          label1.SetProperty(TextLabel::Property::UNDERLINE_HEIGHT, 1.0f);
          - - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/dali/ui_components_n.htm b/org.tizen.ui.guides/html/native/dali/ui_components_n.htm deleted file mode 100755 index c7160c2..0000000 --- a/org.tizen.ui.guides/html/native/dali/ui_components_n.htm +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - UI Components: Creating the Application Layout - - - - - - -
          -

          UI Components: Creating the Application Layout

          - -

          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.

          - -

          Figure: DALi UI components

          -

          DALi UI components

          - -

          The following table lists the available UI components.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: DALi UI components -
          ControlDescriptionRelated classes
          ButtonsA push button that can be pressed, a checkbox button that can be checked/unchecked,and a radio button that only one option can be selected.Button, PushButton, CheckBoxButton, RadioButton
          ItemViewAn item view that renders item sets in a scrollable layout.ItemView, ItemFactory, ItemLayout, Scrollable
          ScrollViewA scroll view to provide scrollable view.ScrollView, Scrollable, ScrollViewEffect, ScrollViewPagePathEffect
          TableViewA table view that can align child actors in a grid like layout.TableView
          TextFieldA text field that provides a single-line editable text field.TextField
          TextLabelA text label that renders a short text string.TextLabel
          ImageViewAn image view that renders an image.ImageView
          - -

          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. Please find some tips for the base control class in Control: Base Class of UI Components. For remainder of this guide, the term "control" or "component" can be used to indicate UI component.

          - -

          The following figure illustrates the hierarchy of the UI components.

          - -

          Figure: DALi UI control hierarchy

          -

          DALi UI control hierarchy

          - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/animation_effects_n.htm b/org.tizen.ui.guides/html/native/efl/animation_effects_n.htm deleted file mode 100755 index c6ee375..0000000 --- a/org.tizen.ui.guides/html/native/efl/animation_effects_n.htm +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - Animations and Effects: Creating Transformations - - - - - -
          - -

          Animations and Effects: Creating Transformations

          - -

          EFL provides the following animation functionalities: Ecore animators, Elementary transitions, Edje animations, and Evas Map animations.

          - -

          The first option for creating animations with EFL is to use Ecore animators. To create an Ecore animation, you must first determine the duration of the animation, and then define a callback function that performs the animation with that duration.

          - -

          You can also create animations using Elementary transitions. Elementary transitions allow you to apply various transition effects, such as translation and rotation, to Evas objects. Elementary transitions are mostly based on Ecore animators, but provide some transition methods at a higher level of abstraction. Elementary transitions provide a simpler way of animating objects than Ecore animators or Edje animations.

          - -

          A third option for animating objects is to use Edje animations, which are based on a simple principle: transitioning from one state to another. To animate an object with Edje, you have to first define the start and end states of the animation, and then transition the object from the start state to the end state.

          - -

          Finally, Evas Map animations allow you to apply transformations to all types of objects by way of UV mapping. In UV mapping, you map points in the source object to 3D space positions in the target object. This allows for rotation, perspective, scale, and other transformation effects, depending on the map. In addition, each map point can carry a multiplier color, which, if properly calculated, can be used to apply 3D shading effects on the target object.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/basic_tutorial_mn.htm b/org.tizen.ui.guides/html/native/efl/basic_tutorial_mn.htm deleted file mode 100755 index 1e662b5..0000000 --- a/org.tizen.ui.guides/html/native/efl/basic_tutorial_mn.htm +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - - Creating Basic Mobile Interactions - - - - - - -
          -

          Creating Basic Mobile Interactions

          - - -

          This tutorial teaches the basics of UI components interactions. It builds upon the Hello World example.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          Using Buttons

          - -

          The basic application code is the same as in the Hello World example.

          - -

          Button Styles

          -

          Basic Text Button

          - -

          To create a text-only button, use the following code.

          -
          Evas_Object* button;
          -
          -button = elm_button_add(box);
          -elm_object_text_set(button, "Click me");
          -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
          -elm_box_pack_end(box, button);
          -evas_object_show(button);
          -
          - -

          Basic Icon Button

          -

          Instead of a button with text, create a button with an icon.

          -
          Evas_Object* button2;
          -Evas_Object* icon2;
          -
          -button2 = elm_button_add(box);
          -icon2 = elm_icon_add(box);
          -elm_image_file_set(icon2, "icon.png", NULL);
          -elm_object_part_content_set(button2, "icon", icon2);
          -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
          -elm_box_pack_end(box, button);
          -evas_object_show(button);
          -
          - -

          Icon and Text Button

          -

          Create buttons with both an icon and a text label.

          -
          Evas_Object* button3;
          -Evas_Object* icon3;
          -button3 = elm_button_add(box);
          -icon3 = elm_icon_add(box);
          -elm_image_file_set(icon, "icon.png", NULL);
          -elm_object_part_content_set(button3, "icon", icon3);
          -elm_object_text_set(button3, "Press me");
          -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
          -elm_box_pack_end(box, button);
          -evas_object_show(button);
          -
          - -

          Disabled Button

          -

          To disable a button so that it is not in use, only shown.

          -
          elm_object_disabled_set(button2, EINA_TRUE);
          -
          - -

          Callbacks

          -

          The Elementary buttons respond to user interactions with several events.

          - -

          Click Event

          -

          The "click" event is the most basic and well-known one. The following code snippet changes the text of a button upon a click event: a press followed by an unpress.

          -
          -static void _button_click_cb(void *data, Evas_Object *button, void *ev) 
          -{
          -   elm_object_text_set(button, "Clicked!");
          -}
          -evas_object_smart_callback_add(button, "clicked", _button_click_cb, NULL);
          -
          - -

          Press/Unpress Events

          -

          The button can respond to the press and unpress events instead of the entire click event.

          -
          static void _button_press_cb(void *data, Evas_Object *button, void *ev) 
          -{
          -   elm_object_text_set(button, "Pressed!");
          -}
          -static void _button_unpress_cb(void *data, Evas_Object *button, void *ev) 
          -{
          -   elm_object_text_set(button, "Unpressed!");
          -}
          -
          -evas_object_smart_callback_add(button3, "pressed", _button_press_cb, NULL);
          -evas_object_smart_callback_add(button3, "unpressed", _button_unpress_cb, NULL);
          -
          - -

          Repeated Events

          -

          The button can receive several events in case it is being held by the user. Timings, such as the initial timeout and the repeat interval, can be set. In this example, the initial timeout is set to 1 second, and the repeat interval to half a second.

          -
          static void _button_repeat_cb(void *data, Evas_Object *button, void *ev) 
          -{
          -   static int count = 0;
          -   char buf[16];
          -
          -   snprintf(buf, sizeof(buf), "Repeat %d", count++);
          -
          -   elm_object_text_set(button, buf);
          -}
          -
          -elm_button_autorepeat_set(button3, EINA_TRUE);
          -elm_button_autorepeat_initial_timeout_set(button3, 1.0);
          -elm_button_autorepeat_gap_timeout_set(button3, 0.5);
          -evas_object_smart_callback_add(button3, "repeated", _button_repeat_cb, NULL);
          -
          - -

          Using Simple Text

          - -

          Basic Text

          -

          To create a label object, use the following code.

          -
          label = elm_label_add(ad->win);
          -elm_object_text_set(label, "My label");
          -evas_object_show(label);
          -
          - -

          Sliding Text

          -

          If your text is too long, set it to slide. The duration of the slide is set to five seconds in the following example. There are several styles available:

          -
            -
          • slide_short: The text stops at an edge, reverts to its initial position and slides again.
          • -
          • slide_long: The text is originally empty. It slides in, all the way to the edge, continues sliding until the label is empty, and loops.
          • -
          • slide_bounce: The text moves backwards after stopping at the edge. In the example, it is set to bounce.
          • -
          - -
          Evas_Object* label;
          -label = elm_label_add(->win);
          -elm_object_text_set(label, "This text is supposed to be really long.");
          -elm_label_slide_set(label, EINA_TRUE);
          -elm_label_slide_duration_set(label, 5.);
          -elm_object_style_set(label, "slide_bounce");
          -evas_object_show(label);
          -
          - -

          If needed, you can use the slide,end event to respond to the moment when the sliding text reaches its end.

          - -

          Marker Text

          -

          A marker is a text that is centered and bold by default. As the default color is white, set the blue color in this example.

          -
          elm_object_style_set(label, "marker");
          -evas_object_color_set(label, 0, 0, 255, 255);
          -
          - -

          Styling the Text

          -

          You can apply basic styles to the text. For a bolded text, do as follows.

          -
          elm_object_text_set(label, "<b>This text is bold.</b>");
          -
          - -

          Using Simple Lists

          - -

          Basic List

          -

          A list is a scrollable container, whose children are selected.

          -
          Evas_Object* list;
          -Evas_Object* icon;
          -list = elm_list_add(ad->win);
          -elm_list_item_append(list, "Text item", NULL, NULL, NULL, NULL);
          -icon = elm_icon_add(ad->win);
          -elm_icon_standard_set(icon, "chat");
          -elm_list_item_append(list, "Second item", icon, NULL, NULL, NULL);
          -Evas_Object* button;
          -button = elm_button_add();
          -elm_object_text_set(button, "Button");
          -elm_list_item_append(list, "Fourth item", NULL, button, NULL, NULL);
          -elm_list_go(list);
          -
          - -

          Any Evas Object can be added as an icon, either at the beginning (third parameter) or the end (fourth parameter).

          - -

          List Orientation

          -

          By default, a list is set vertically. This is how to display it horizontally.

          -
          elm_list_horizontal_set(list, EINA_TRUE);
          -
          - -

          List Mode

          -

          There are several modes for the list item dimensions.

          -
            -
          • ELM_LIST_COMPRESS: The list does not set any size measures to inform the container how to resize it. If the list is not created as a "resize object", its dimensions are zeroed. The list respects the container's geometry and if any of the list items do not fit into the container transverse axis, the list does not scroll in that direction.
          • -
          • ELM_LIST_SCROLL: This is the default value. This list is the same as ELM_LIST_COMPRESS, with the exception that if any of the list items do not fit into the container transverse axis, the list still scrolls in that direction.
          • -
          • ELM_LIST_LIMIT: This list sets a minimum size measure on the list object, so that containers may respect it (and resize themselves to fit the child properly). More specifically, a minimum size measure is set for its transverse axis, so that the largest item in that direction fits well. This feature is bound by the list object's maximum size measures that are set externally.
          • -
          • ELM_LIST_EXPAND: Besides setting a minimum size on the transverse axis, as in ELM_LIST_LIMIT, this list sets a minimum size on the longitudinal axis to reserve space for all its children to be visible at the same time. This feature is bound by the list object's maximum size measures that are set externally.
          • -
          -
          elm_list_mode_set(list, ELM_LIST_COMPRESS);
          -
          - -

          Scroller Policy

          -

          Several effects are shown on a list.

          -

          For example, the scroller is set to bounce at the end on either direction.

          -
          elm_scroller_bounce_set(list, EINA_TRUE, EINA_TRUE);
          -
          - - -

          This is how to control displaying scrollbars. The second argument is for the horizontal axis, the third one for the vertical axis.

          -
          elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_ON);
          -
          - -

          As for the bounce preference, the second argument is for the horizontal axis, the third one for the vertical axis.

          -
            -
          • ELM_SCROLLER_POLICY_OFF hides the scrollbar
          • -
          • ELM_SCROLLER_POLICY_ON shows the scrollbar
          • -
          • ELM_SCROLLER_POLICY_AUTO the scrollbar is shown only when needed and stays hidden at other times
          • -
          - -

          Events

          -

          A list responds to several events:

          -
            -
          • activated: The user clicks or presses an item.
          • -
          • selected: The user selects an item.
          • -
          • unselected: The user unselects an item.
          • -
          • longpressed: The user long-presses an item.
          • -
          • edge,top: The user scrolls the list to the top edge.
          • -
          • edge,bottom: The user scrolls the list to the bottom edge.
          • -
          • edge,left: The user scrolls the list to the left edge.
          • -
          • edge,right: The user scrolls the list to the right edge.
          • -
          • highlighted: An item is pressed and highlighted.
          • -
          • unhighlighted: The press and highlight is removed on an item.
          • -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/button_tutorial_wn.htm b/org.tizen.ui.guides/html/native/efl/button_tutorial_wn.htm deleted file mode 100755 index 09fbae2..0000000 --- a/org.tizen.ui.guides/html/native/efl/button_tutorial_wn.htm +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - Creating Wearable Buttons - - - - - - -
          -

          Creating Wearable Buttons

          - - -

          This tutorial teaches the basics of the button component interactions.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - - -

          Initializing the Button Application

          - -

          This use case creates an application with a window entitled "Button Basic Tutorial". The window consists of a box component, and a button is placed inside the box.

          - -

          To create a typical elementary application:

          -
          -static void
          -create_base_gui(appdata_s *ad) 
          -{
          -   // Window
          -   Evas_Object *btn1, *btn2, *btn3;
          -
          -   ad->win = elm_win_util_standard_add("main", "Button Basic Tutorial");
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          -
          -   ad->box = elm_box_add(ad->win);
          -   evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_show(ad->box);
          -   elm_win_resize_object_add(ad->win, ad->box);
          -
          -   create_button(ad->box);
          -
          -   // Show the window after the base GUI is set up
          -   evas_object_show(ad->win);
          -}
          -
          -static bool
          -app_create(void *data)
          -{
          -   appdata_s *ad = data;
          -   create_base_gui(ad);
          -
          -   return true;
          -}
          -
          -int
          -main(int argc, char **argv)
          -{
          -   struct app_data ad = {0,};
          -   ui_app_lifecycle_callback_s event_callback = {0,};
          -
          -   event_callback.create = app_create;
          -
          -   return ui_app_main(&argc, &argv, &event_callback, &ad);
          -}
          - - -

          Using Button Styles

          - -

          The basic application code is the same as in the Hello World example.

          - -

          To use various button styles:

          - -
          1. To create buttons using various styles:

            - -
            • Create a basic text-only button: - -
              Evas_Object* button;
              -
              -button = elm_button_add(box);
              -elm_object_text_set(button, "Click me");
              -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
              -elm_box_pack_end(box, button);
              -evas_object_show(button);
              -
            • - -
            • Create a basic icon button (no text, just an icon): -
              Evas_Object* button2;
              -Evas_Object* icon2;
              -
              -button2 = elm_button_add(box);
              -icon2 = elm_icon_add(box);
              -elm_image_file_set(icon2, "icon.png", NULL);
              -elm_object_content_set(button2, icon2);
              -evas_object_size_hint_weight_set(button2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              -evas_object_size_hint_align_set(button2, EVAS_HINT_FILL, 0.5);
              -elm_box_pack_end(box, button2);
              -evas_object_show(button2);
              -
            • - -
            • Create a button with both an icon and a text label: -
              Evas_Object* button3;
              -Evas_Object* icon3;
              -button3 = elm_button_add(box);
              -icon3 = elm_icon_add(box);
              -elm_image_file_set(icon3, "icon.png", NULL);
              -elm_object_content_set(button3, icon3);
              -elm_object_text_set(button3, "Press me");
              -evas_object_size_hint_weight_set(button3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              -evas_object_size_hint_align_set(button3, EVAS_HINT_FILL, 0.5);
              -elm_box_pack_end(box, button3);
              -evas_object_show(button3);
              -
            • -
          2. -
          3. To disable a button so that it is not in use, only shown:

            -
            elm_object_disabled_set(button2, EINA_TRUE);
            -
          - -

          Managing Button Events

          -

          The Elementary buttons respond to user interactions with several events.

          -

          To manage button events:

          - -
            -
          • Handle click events: -

            The "click" event is the most basic and well-known one. The following code snippet changes the text of a button upon a click event: a press followed by an unpress.

            -
            -static void _button_click_cb(void *data, Evas_Object *button, void *ev) 
            -{
            -   elm_object_text_set(button, "Clicked!");
            -}
            -evas_object_smart_callback_add(button, "clicked", _button_click_cb, NULL);
            -
          • - -
          • Handle press and unpress events: -

            The button can respond to the separate press and unpress events instead of the entire click event.

            -
            static void _button_press_cb(void *data, Evas_Object *button, void *ev) 
            -{
            -   elm_object_text_set(button, "Pressed!");
            -}
            -static void _button_unpress_cb(void *data, Evas_Object *button, void *ev) 
            -{
            -   elm_object_text_set(button, "Unpressed!");
            -}
            -
            -evas_object_smart_callback_add(button3, "pressed", _button_press_cb, NULL);
            -evas_object_smart_callback_add(button3, "unpressed", _button_unpress_cb, NULL);
            -
          • - -
          • Handle repeated events: -

            The button can receive several events in case it is being held by the user. Timings, such as the initial timeout and the repeat interval, can be set. In this example, the initial timeout is set to 1 second, and the repeat interval to half a second.

            -
            static void _button_repeat_cb(void *data, Evas_Object *button, void *ev) 
            -{
            -   static int count = 0;
            -   char buf[16];
            -
            -   snprintf(buf, sizeof(buf), "Repeat %d", count++);
            -
            -   elm_object_text_set(button, buf);
            -}
            -
            -elm_button_autorepeat_set(button3, EINA_TRUE);
            -elm_button_autorepeat_initial_timeout_set(button3, 1.0);
            -elm_button_autorepeat_gap_timeout_set(button3, 0.5);
            -evas_object_smart_callback_add(button3, "repeated", _button_repeat_cb, NULL);
            -
          - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/component_custom_n.htm b/org.tizen.ui.guides/html/native/efl/component_custom_n.htm deleted file mode 100755 index d3f8043..0000000 --- a/org.tizen.ui.guides/html/native/efl/component_custom_n.htm +++ /dev/null @@ -1,557 +0,0 @@ - - - - - - - - - - - - - Customizing Components - - - - - -
          - -

          Customizing Components

          - - -

          Elementary UI components use the Edje library EDC themes to manage their look.

          - -

          Elementary Theme

          - -

          An Elementary theme is an Edje EDC file that contains groups composed of parts and programs. For more information about Edje, see Theme.

          - -

          Using Theme Styles

          - -

          Elementary UI components provide a way to modify only some parts of the styles using the default theme. A style is a part of the EDC theme (a group) that concerns only one UI component. For example, you can create a new style for a button component to change its appearance without modifying the default theme.

          - - - - - - - - - - -
          Note
          When creating a new style, knowledge of how each UI component is themed is required, because setting another style always replaces the entire group used by the UI component. Important signals and parts must be there for the object to behave properly.
          - -

          When several styles are loaded in the current theme, you can set a different style to a specific UI component using the elm_object_style_set() function. It is also possible to see the current style with the elm_object_style_get() function.

          - -

          The default theme specifies several styles for the button component. The code below shows how to set the "anchor" style of a newly created button component.

          - -
          -Evas_Object *parent, *button;
          -
          -// Create a button object 
          -button = elm_button_add(parent);
          -
          -// Set its style to "anchor""
          -elm_object_style_set(button, "anchor");
          -
          - -

          Loading Theme Styles

          - -

          Once written and compiled with Edje tools, the Elementary provides two methods to load the style in the application theme:

          -
            -
          • overlays
          • -
          • extensions
          • -
          - -

          When looking for a theme, the Elementary checks the list of overlays, if any are defined. Then it takes the default theme, and if it cannot find a theme for the UI component, it looks at the extensions list.

          - -

          Overlay

          - -

          An overlay can replace the look of all UI components by overriding the default style. If we create a new style called "default" for the button component and add it as an overlay, the Elementary uses the overlay for all button components overriding the default theme.

          - -

          Here is how to add an overlay to your application's theme.

          - -
          -elm_theme_overlay_add(NULL, "./theme_button.edj");
          -
          - - - - - - - - - - -
          Note
          Here we assume that the "theme_button.edj" file only contains a new theme for the button component.
          - - - - - - - - - - -
          Note
          Doing this is not recommended. Adding a file as an overlay makes the Elementary use the new theme for all the button components defined in the application. You must make sure that the "theme_button.edj" file reimplements everything that was previously defined in the default theme concerning the button component.
          - -

          This is how to remove the previously added overlay to return to the default theme.

          - -
          -elm_theme_overlay_del(NULL, "./theme_button.edj");
          -
          - -

          Extension

          - -

          With extensions, we can write styles that we can apply to some UI components (not all of them) by using the elm_object_style_set() function.

          - -

          The application adds a theme to the list of extensions with the following call.

          - -
          -elm_theme_extension_add(NULL, "./theme_button_style_custom.edj");
          -
          - - - - - - - - - - -
          Note
          Here we assume that the "theme_button_style_custom.edj" file contains a new button style called "custom".
          - -

          This is how to use the new "custom" style on a button component.

          - -
          -Evas_Object *parent, *button;
          -
          -// Create a button object 
          -button = elm_button_add(parent);
          -
          -// Set its style to "custom" 
          -elm_object_style_set(button, "custom");
          -
          - - - - - - - - - - -
          Note
          When using elm_theme_extension_add or elm_theme_overlay_add to add a new theme extension or overlay to a Theme object (here called the default theme), the Elementary calls the elm_theme_flush function to flush Elementary theme caches. Thus, the theme of all UI components that use the default theme is reloaded.
          - -

          Creating a New Theme

          - -

          This is how to create a new theme object.

          - -
          -Elm_Theme *new_theme = elm_theme_new();
          -
          - -

          This function creates an empty specific theme that only uses the default theme. It has its own private set of extensions and overlays (which are empty by default). Specific themes do not fall back to the themes of parent objects. They are not intended for this use.

          - -

          This is how to apply this theme to a UI component and its children (a button, for example).

          - -
          -// Create a button component 
          -Evas_Object *button = elm_button_add();
          -
          -// Set the new theme to the button component 
          -elm_object_theme_set(button, new_theme);
          -
          - -

          Customizing a UI Component Style

          - -

          UI component themes are written in Edje EDC source files (.edc). These files are compiled with Edje tools to make an .edj file that is used by the application. For more information on using the EDC language, see Theme.

          - -

          A new Edje style can be added for a UI component. The best way is to copy the existing "default" style, rename it, and update it to your needs.

          - -

          Creating a Customized Style for the Check Component

          - -

          As an example, we show how to create a new style for the check component. The aim is to update the background and the main pictures of this UI component with custom pictures.

          - -

          The EDC source file concerning the check component (check.edc file) is composed of several groups.

          - -
          -group 
          -{
          -   name: "elm/check/base/default";
          -}
          -
          -group 
          -{
          -   name: "elm/check/base/toggle";
          -}
          -
          - -

          Those two groups define two different styles for the check component (the "default" style and the "toggle" style).

          - -

          We copy the group corresponding to the "default" style in a new file to create a new style called "custom". This new style is saved in the "check_custom.edc" file.

          - -
          -group 
          -{
          -   name: "elm/check/base/custom";
          -   // Here is the copy of the content of "default" style 
          -}
          -
          - -

          In the new group ("elm/check/base/custom"), we have to find the parts we want to modify. Here, the appropriate parts are "bg" and "check" parts.

          - -
          -part 
          -{
          -   name: "bg";
          -   mouse_events: 0;
          -   scale: 1;
          -   description 
          -   {
          -      state: "default" 0.0;
          -      rel1.offset: 1 1;
          -      rel2.relative: 0.0 1.0;
          -      rel2.offset: 1 -2;
          -      align: 0.0 0.5;
          -      min: 16 16;
          -      max: 16 16;
          -      aspect: 1.0 1.0;
          -      aspect_preference: VERTICAL;
          -      image 
          -      {
          -         normal: "check_base.png";
          -         border: 5 5 5 5;
          -         middle: 0;
          -      }
          -      fill.smooth: 0;
          -   }
          -}
          -part 
          -{
          -   name: "check";
          -   mouse_events: 0;
          -   scale: 1;
          -   description 
          -   { 
          -      state: "default" 0.0;
          -      rel1 
          -      {
          -         to: "bg";
          -         offset: 1 1;
          -      }
          -      rel2 
          -      {
          -         to: "bg";
          -         offset: -2 -2;
          -      }
          -      visible: 0;
          -      color: 255 255 255 255;
          -      image.normal: "check.png";
          -   }
          -   description 
          -   {
          -      state: "visible" 0.0;
          -      inherit: "default" 0.0;
          -      visible: 1;
          -   }
          -   description 
          -   {
          -      state: "disabled" 0.0;
          -      inherit: "default" 0.0;
          -      visible: 0;
          -      color: 128 128 128 128;
          -   }
          -   description 
          -   {
          -      state: "disabled_visible" 0.0;
          -      inherit: "default" 0.0;
          -      color: 128 128 128 128;
          -      visible: 1;
          -   }
          -}
          -
          - -

          We do not detail all the options that can be modified here, but assume that the user is familiar with Edje and knows Edje basics.

          - -

          Our custom pictures filenames are:

          -
            -
          • check_base_custom.png for the bg part
          • -
          • check_custom.png for the check part
          - -

          We must update the image.normal attribute in both parts with our custom pictures filenames to modify the pictures of this style.

          - -
          -part 
          -{
          -   name: "bg";   
          -   description 
          -   {
          -      state: "default" 0.0;
          -
          -      image 
          -      {
          -         normal: "check_base_custom.png";
          -         border: 5 5 5 5;
          -         middle: 0;
          -      }
          -                
          -   }
          -}
          -part 
          -{
          -   name: "check";
          -        
          -   description 
          -   {
          -      state: "default" 0.0;
          -            
          -      image.normal: "check_custom.png";
          -   }
          -        
          -}
          -
          - - - - - - - - - - -
          Note
          Here, we assume that the custom images are the same size as the "default" images.
          - -

          Adding the Theme File to Your Project

          - -

          Once written, the check_custom.edc file is put in the /res/edje/. directory of the application project in the SDK.

          - -

          When building the application, the SDK calls the Edje tools automatically to build the final check_custom.edj file. This file can be loaded from our application.

          - -

          Using the New Style

          - -

          This is how to add the new theme file as an extension in the application.

          - -
          -char edj_path[PATH_MAX] = {0, };
          -
          -// Get the full path of the edj file 
          -app_get_resource("/edje/check_custom.edj", edj_path, (int)PATH_MAX);
          -
          -// Load check custom style as an extension 
          -elm_theme_extension_add(NULL, edj_path);
          -
          - -

          Use the "custom" style on a new check component.

          - -
          -Evas_Object *parent, *check;
          -
          -// Create a check object 
          -check = elm_check_add(parent);
          -
          -// Set its style to "custom" 
          -elm_object_style_set(check, "custom");
          -
          - -

          Special Theme Parts

          - -

          Some parts of the EDC file can be interacted with the Elementary. The content of parts of the type TEXT are modified using the elm_object_part_set_text() function. The content of SWALLOW parts is updated using the elm_object_part_content_set() function.

          - -

          Swallow Parts

          - -

          In the previous example (the check component "default" style), there is a part called "elm.swallow.content" that is of the type SWALLOW.

          - -
          -part 
          -{
          -   name: "elm.swallow.content";
          -   type: SWALLOW;
          -   scale: 1;
          -   description 
          -   {
          -      state: "default" 0.0;
          -      fixed: 1 0;
          -      visible: 0;
          -      align: 0.0 0.5;
          -      rel1.to_x: "bg";
          -      rel1.relative: 1.0 0.0;
          -      rel1.offset: 1 1;
          -      rel2.to_x: "bg";
          -      rel2.offset: 1 -2;
          -      rel2.relative: 1.0 1.0;
          -   }
          -   description
          -   {
          -      state: "visible" 0.0;
          -      inherit: "default" 0.0;
          -      fixed: 1 0;
          -      visible: 1;
          -      aspect: 1.0 1.0;
          -      min: 16 16;
          -   }
          -   description 
          -   {
          -      state: "disabled" 0.0;
          -      inherit: "default" 0.0;
          -      color: 255 255 255 128;
          -   }
          -   description 
          -   {
          -      state: "disabled_visible" 0.0;
          -      inherit: "default" 0.0;
          -      color: 255 255 255 128;
          -      fixed: 1 0;
          -      visible: 1;
          -      aspect: 1.0 1.0;
          -   }
          -}
          -
          - -

          We can push content (Evas_Object) to this part from the application anytime. The size and position of the content pushed is controlled by the EDC theme.

          - -
          -Evas_Object *parent, *check1, *content;
          -
          -// Create a check object 
          -check1 = elm_check_add(parent);
          -
          -// Set the content of the check object 
          -elm_object_part_content_set(check1, "elm.swallow.content", content);
          -
          - - - - - - - - - - -
          Note
          We can add new SWALLOW parts when customizing a UI component's style, if we want to be able to control more content from the application. Note that removing existing SWALLOW parts changes the UI component's behavior.
          - -

          Text Parts

          - -

          The same is done with parts of the type TEXT. The check "default" style contains a part named "elm.text".

          - -
          -part 
          -{
          -   name: "elm.text";
          -   type: TEXT;
          -   mouse_events: 0;
          -   scale: 1;
          -   description
          -   {
          -      state: "default" 0.0;
          -      visible: 0;
          -      rel1.to_x: "elm.swallow.content";
          -      rel1.relative: 1.0 0.0;
          -      rel1.offset: 1 1;
          -      rel2.relative: 1.0 1.0;
          -      rel2.offset: -2 -2;
          -      color: 0 0 0 255;
          -      text 
          -      {
          -         font: "Sans,Edje-Vera";
          -         size: 10;
          -         min: 0 1;
          -         align: -1.0 0.5;
          -      }
          -   }
          -   description
          -   {
          -      state: "visible" 0.0;
          -      inherit: "default" 0.0;
          -      visible: 1;
          -      text.min: 1 1;
          -   }
          -   description 
          -   {
          -      state: "disabled" 0.0;
          -      inherit: "default" 0.0;
          -      color: 0 0 0 128;
          -      color3: 0 0 0 0;
          -   }
          -   description
          -   {
          -      state: "disabled_visible" 0.0;
          -      inherit: "default" 0.0;
          -      color: 0 0 0 128;
          -      color3: 0 0 0 0;
          -      visible: 1;
          -      text.min: 1 1;
          -   }
          -}
          -
          - -

          This is how to modify the content of the "elm.text" part from the application. The position of the text, its size, color, look and feel are managed by the EDC theme.

          - -
          -Evas_Object *parent, *check2;
          -
          -// Create a check object 
          -check2 = elm_check_add(parent);
          -
          -// Set the text of the check object 
          -elm_object_part_text_set(check2, "elm.text", "Test text");
          -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/component_focus_n.htm b/org.tizen.ui.guides/html/native/efl/component_focus_n.htm deleted file mode 100755 index ee8ae76..0000000 --- a/org.tizen.ui.guides/html/native/efl/component_focus_n.htm +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - Managing Component Focus - - - - - -
          - -

          Managing Component Focus

          - - -

          Focus is a graphical user interface concept. A component, for example, a UI component, has a focus when it is selected to receive input from the user. The input can be an event, such as mouse button click or key press. A UI component application has, at all times, one (and only one) focused object. This is what determines where the input event goes to within the application window. Also, focused objects can be decorated differently, in order to signal to the user where the input is at any given moment.

          - -

          Focusing can be immediate (selected by the touchscreen or mouse) or relative (selected by a key press). There are mainly 2 ways to set focus on a graphical elements:

          - -
            -
          • Direct selection: this is done by clicking on the element. -

            Direct selection does not really need any kind of special treatment as the user explicitly selects the UI component to interact with.

          • -
          • Relative selection: this is done by moving the selection from a UI component to another, such as going to the previous or next one; this is done with a keyboard. -

            Relative selection' default order is the one in which the UI components have been added to the canvas. That may not be appropriate, if they are added programmatically in a different order than they appear on-screen.

          • -
          - - -

          Moving Focus

          - -

          Concept of Focus Chain

          -

          The order the focus goes from a UI component to another is called the focus chain. As said before, the default focus chain is set to the order the UI components have been added to the canvas.

          - -

          Focusable Objects

          -

          An object can be focused if the following conditions apply:

          - -
            -
          • object is visible
          • -
          • object is enabled
          • -
          • object accepts focus
          • -
          • object's subtree (if any) is focusable
          • -
          • all of object's parents have their subtrees focusable
          • -
          - -

          If any of these conditions do not apply, the object is unfocusable.

          - -

          Handling Key Input

          - -

          Handling of the keys is done automatically by Elementary. According to which key the user pressed, Elementary switches the focus in the selected direction. For example, using the Tab key the focus goes to the next object in the natural order, whereas using the direction keys the focus goes to the next object in the requested direction.

          - -

          Hiding, Deleting or Disabling a Focused Object

          - -

          When a UI component is hidden, deleted, or disabled, it becomes unfocusable.

          - -

          When a focused object is unfocusable, the focus is moved to another object.

          - -

          Selecting Next Object

          - -

          When the user wants to switch the focus to the next object (i.e. cycle focus), Elementary searches the first object which is focusable.

          - -

          If there is a disabled or read-only object in the focus chain, the focus goes to the following object in the requested direction.

          - -

          Customizing Focus

          - -

          There are several reasons why to customize the focus chain of an application, for example:

          - -
            -
          • If you have created a form with labels and text entries next to them, the focus moves to the entry field when the user clicks on the associated label.
          • -
          • If you have created an interface with several columns (table), set the focus chain as you wish, for example, going horizontally instead of going vertically, regardless whatever the order the UI components are added.
          • -
          - -

          Customizing Object's Focus Exit Chain

          - -

          Set the object to focus after other object in a specific direction using elm_object_focus_next_object_set(object, next, direction). Use the following directions:

          - -
            -
          • ELM_FOCUS_NEXT: next UI component in natural order
          • -
          • ELM_FOCUS_PREVIOUS: previous UI component in natural order
          • -
          • ELM_FOCUS_UP: UI component to focus when going up
          • -
          • ELM_FOCUS_DOWN: UI component to focus when going down
          • -
          • ELM_FOCUS_RIGHT: UI component to focus when going right
          • -
          • ELM_FOCUS_LEFT: UI component to focus when going left
          • -
          - -

          Set the object next to another in a specific direction using elm_object_focus_next_object_get(object, direction).

          - -

          Customizing Whole Application's Focus Chain

          - -

          To customize the application's custom chain:

          - -
          -Evas_Object *main, obj1, obj2, obj3, obj4, obj5;
          -
          -Eina_List *focus_chain = NULL;
          -focus_chain = eina_list_append(focus_chain, obj3);
          -focus_chain = eina_list_append(focus_chain, obj2);
          -// The chain is obj3, then obj2. Set the chain.
          -elm_object_focus_custom_chain_set(main, focus_chain);
          -// Prepend obj5 at the beginning of the chain
          -elm_object_focus_chain_prepend(main, NULL, obj5);
          -// Append obj1 after obj3
          -elm_object_focus_chain_append(main, obj3, obj1);
          -// Prepend obj4 before obj1
          -elm_object_focus_chain_prepend(main, obj1, obj4);
          -
          - -

          The focus chain is obj5, obj3, obj4, obj1, obj2.

          - -

          This actually applies to any container: it is possible to set the focus chain of, for example, a box.

          - -

          Customizing Collision of Both

          - -

          If an object is part of a focus chain and has the next focused object defined, the next object takes precedence over the focus chain.

          - -

          Following on the previous example, if obj4 has obj5 defined as its next object, the actual focus chain is obj5, obj3, obj4, and loop back to obj5.

          - -

          Focus on UI Component

          - -

          If your Evas object has several sub-objects, set its focus chain using the same functions as for the application. Elementary first follows the main focus chain, and then the focus chain of each UI component if applicable.

          - -

          Use elm_object_focus_get(object) to set whether a specific object has the focus. Set the focus to an object using elm_object_focus_set(object, set), where set is a Boolean value. If it is set to EINA_TRUE, the focus is set to that given object. If it is set to EINA_False, the focus is unset and passed back to the previous element in the focus chain. Set the focus only after the object is shown, that is, after evas_object_show(object) has been called. Call the function back when the object receives or loses focus by registering on smart event "focused" or "unfocused"

          - -

          Use elm_object_tree_focus_allow_set(object, focusable) to tell Elementary whether an object and its children are focusable, where focusable is a Boolean value. Get the current value using elm_object_tree_focus_allow_get(object).

          - -

          The similar functions for a specific object are elm_object_focus_allow_set(object, focusable) and elm_object_focus_allow_get(object).

          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/component_infra_n.htm b/org.tizen.ui.guides/html/native/efl/component_infra_n.htm deleted file mode 100755 index 0c9a0ff..0000000 --- a/org.tizen.ui.guides/html/native/efl/component_infra_n.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - UI Component Infrastructure Modules: Managing Component Properties - - - - - -
          - -

          UI Component Infrastructure Modules: Managing Component Properties

          - -

          The Elementary library is composed of many UI components to support Tizen native applications. While using UI components, you must manage their common properties. To meet this requirement, Elementary creates some infrastructure modules in order to support many UI components. Currently, Elementary provides following infrastructure modules:

          -
          • Component focus -

            A UI component application always has 1 focused object, which is selected to receive input from the user. The focus can change between objects, and the focused object can be decorated on the screen to make it easily visible.

          • -
          • Handling touch gestures for components -

            UI components generally handle basic touch inputs, such as press, release and moving. However, in some use cases (for example, when the accessibility Assistive Technology (AT) client is working), handling for a variety of touch gesture events (such as tap, double-tap, triple-tap, double-tap and hold, and left/right/up/down swipe) is needed. Elementary can also create new touch gesture patterns according to application use cases.

            -
          • -
          • Customizing components -

            Elementary provides basic UI components based on the Tizen UX styles which you can use. Usually, you can use the supported UI components themselves to make your application. However, if you need to use other styles than the basic ones, you must customize the UI component style.

          • -
          • UI mirroring -

            Elementary provides UI mirroring, which allows you to set UI mirroring on specific UI components or the whole interface. This facility is very useful to support applications which need both right-to-left and left-to-right languages.

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/containers_n.htm b/org.tizen.ui.guides/html/native/efl/containers_n.htm deleted file mode 100755 index f9ad56d..0000000 --- a/org.tizen.ui.guides/html/native/efl/containers_n.htm +++ /dev/null @@ -1,608 +0,0 @@ - - - - - - - - - - - - - - Using Container UI Components - - - - - - -
          -

          Using Container UI Components

          - -

          Box

          - - -

          Figure: Box container

          -

          Box container

          - - -

          Most of the time, you want to display UI components on the screen in a specific order. In a form container, for example, the user information is arranged vertically. This basic container is called a box. There is no theme for a box layout. It is just a linear method of arranging UI components horizontally or vertically.

          -

          Creating a Box

          -

          To create a new horizontal box:

          -
          Evas_Object *vbox;
          -
          -vbox = elm_box_add(parent);
          -
          -

          By default, the elm_box_add() function creates a vertical box. If you want to create a horizontal box, use the elm_box_horizontal_set() function:

          -
          Evas_Object *hbox;
          -
          -hbox = elm_box_add(parent);
          -elm_box_horizontal_set(hbox, EINA_TRUE);
          -
          - - - - - - - - - - -
          Note
          A box is a non-graphical object. It adds no graphics to or around the objects it holds.
          - -

          Adding Objects to the Box

          -

          You can add any Evas object to the box. Here, we create 5 button components and add them to a box:

          -
          int i;
          -Evas_Object *bt;
          -Evas_Object *vbox;
          -
          -vbox = elm_box_add(parent);
          -
          -for (i = 0; i < 5; i++)
          -{
          -   char tmp[16];
          -   snprintf(tmp, sizeof(tmp), "Button %d", i);
          -   bt = elm_button_add(vbox);
          -   elm_object_text_set(bt, tmp);
          -   elm_box_pack_end(vbox, bt);
          -   evas_object_show(bt);
          -}
          -evas_object_show(vbox);
          -
          -

          The most important function in the above code is elm_box_pack_end(), which is used to add the button component to the end of the box.

          - -

          Setting the Padding

          -

          You can set the padding between the objects in a box by using the elm_box_padding_set() function. The padding values are the number of pixels horizontally and vertically.

          -
          elm_box_padding_set(vbox, 16, 64);
          -
          - -

          Handling Element Size

          -

          You can add different-size elements to a container. For example, to add an image with a size of 128x128 pixels as the first element in a box, use the elm_box_pack_start() function:

          -
          ic = elm_icon_add(vbox);
          -elm_image_file_set(ic, "./c1.png", NULL);
          -evas_object_size_hint_min_set(ic, 128, 128);
          -evas_object_show(ic);
          -elm_box_pack_start(vbox, ic);
          -
          -

          We ask Evas to set the size hint for the icon object by using the elm_object_size_hint_min_set() function. Evas will try to set the minimum size of this object accordingly.

          -

          If you want to create a homogeneous box, where all objects have the same height or width, depending on the orientation of the box, use the elm_box_homogeneous_set() function:

          -
          elm_box_homogeneous_set(vbox, EINA_TRUE);
          -
          -

          Elementary will set the height of the tallest object as the height of all objects, or the width of the widest element as the width of all objects.

          -

          Setting the Alignment

          -

          You can set the alignment of UI components inside a box using the elm_box_align_set() function. The function takes two doubles values, a horizontal value and a vertical value, representing the percentage between 0 and 1.0 of the alignment in the horizontal and vertical axes. When you add a UI component with the elm_box_pack_end() or elm_box_pack_start() function, Elementary computes the global size of the box. If the global size is bigger than the size of the box's parent, the box will take up all the space occupied by the parent, and the size of the parent may be extended to hold the box. If the global size is smaller than the parent's size, the alignment values will set the position of the box inside the parent.

          - -

          Figure: Alignment

          -

          Alignment

          - -

          Here, we set an alignment of 0.8 vertically:

          -
          elm_box_align_set(vbox, 0.0, 0.8);
          -
          - - - - - - - - - - -
          Note
          The alignment only takes effect in the opposite direction than the one defined with the elm_box_horizontal_set() function.
          - - -

          The elm_box_layout_transition() function provides the ability to animate the motion of the objects in a box when switching from one layout to another.

          -

          Using Size Hints

          -

          Size hints are a set of functions that can be used on any Evas object. You request Evas to take care of various properties, and Evas will honor these requests if it can. This is why they are called "hints". The size hint functions are:

          -
            -
          • evas_object_size_hint_min_set()
          • -
          • evas_object_size_hint_max_set()
          • -
          • evas_object_size_hint_aspect_set()
          • -
          • evas_object_size_hint_align_set()
          • -
          • evas_object_size_hint_weight_set()
          • -
          -

          You can also use the respective get functions to get the current hint values.

          -

          In case of the evas_object_size_hint_min_set() function, you ask Evas to respect the minimum size you define for the object. For example, to set the minimum size of an icon to 64x46 pixels:

          -
          evas_object_size_hint_min_set(ic, 64, 64);
          -
          -

          You can also set a maximum size for the same icon:

          -
          evas_object_size_hint_max_set(ic, 128, 128);
          -
          -

          When you resize the parent of the icon, if there are no constraints to the parent, the minimum size of the parent will be the minimum hint size of the icon. If you increase the parent size, the icon will grow larger until its maximum hint size is reached. After this point, the icon will not grow any larger and there will be empty space around the icon within the parent.

          -

          When the aspect size hint is set, Evas tries to fix the dimensional proportions of the object. Here, the proportion of the icon is respected, and the width will be the same as the height:

          -
          evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
          -
          -

          Here, the width will be twice the height:

          -
          evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 2, 1);
          -
          -

          If we want to change the alignment of the icon relative to the parent, we can use the evas_object_size_hint_align() function. By default, the icon is centered, so it is aligned with a value of 0.5. You can change the alignment as follows:

          -
          evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          -

          In the above case, the icon is aligned to the bottom left corner of the parent.

          -

          We can also play with the size of the icon inside its container by using the weight size hint. By default, the weight is not set, so the size of the icon will be the minimum size. But if you set this value to 1, the icon will be expand as much as it can inside the container:

          -
          evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -
          -

          You can also use the alignment and weight hints together. Here, we want the icon to take up all the space in its parent:

          -
          evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -
          - - -

          Conformant

          - -

          Figure: Conformant container

          -

          Conformant container

          - -

          A conformant is a container UI component that accounts for the space taken by the indicator, virtual keyboard, and softkey windows. The content area of the conformant is resized and positioned based on the space available. When the virtual keyboard is displayed, the content area is not resized.

          - -

          Creating a Conformant

          -

          To create a conformant, use the elm_conformant_add() function:

          -
          -Evas_Object *conformant;
          -
          -conformant = elm_conformant_add(parent);
          -
          - -

          Adding Content to the Conformant

          -

          To add content to the conformant, use the elm_object_content_set() function:

          -
          elm_object_content_set(conformant, main_view);
          -
          - -

          Signals

          -

          To receive notifications about the state of the virtual keyboard and clipboard, listen to the following Evas signals:

          -
            -
          • "virtualkeypad,state,on": The virtual keyboard has been switched on.
          • -
          • "virtualkeypad,state,off": The virtual keyboard has been switched off.
          • -
          • "virtualkeypad,size,changed": The virtual keyboard size has changed.
          • -
          • "clipboard,state,on": The clipboard has been switched on.
          • -
          • "clipboard,state,off": The clipboard has been switched off.
          • -
          - - -

          Grid

          - -

          In a grid, objects are placed at specific positions along a fixed grid, where the position of each object is given as a percentage of the full width and height of the grid. By default, the size of the grid is 100 x 100 pixels.

          - -

          Creating a Grid

          -

          To create a grid, use the elm_grid_add() function:

          -
          Evas_Object *grid;
          -
          -grid = elm_grid_add(parent);
          -

          Adding Items to the Grid

          -

          To add an item to the grid, use the elm_grid_pack_set() function. Provide the X and Y coordinates, and the width and height in the grid as parameters. The following code adds 12 icons in a circle formation:

          -
          for (i = 0; i < 12; i++)
          -{
          -   ic = elm_icon_add(grid);
          -   elm_image_file_set(ic, "c1.png", NULL);
          -   evas_object_size_hint_min_set(ic, 128, 128);
          -   evas_object_show(ic);
          -   x = 40 * cos(2.0 * M_PI / 12 * i);
          -   y = 40 * sin(2.0 * M_PI / 12 * i);
          -   elm_grid_pack(grid, ic,  40 + x,  40 + y,  20 , 20);
          -}
          -evas_object_show(grid);
          -
          - -

          Changing Position and Size

          -

          To change the position of an item in the grid, use the elm_grid_pack_set() function. The first parameter is the item you want to move, and the following parameters are the same as for the elm_grid_pack() function.

          -

          To change the size of the grid, use the elm_grid_size_set() function. You can set the new width and height for the grid. The position and size of the items in the grid are changed accordingly.

          -

          Clearing the Grid

          -

          To clear the grid, use the elm_grid_clear() function. All items are removed from the grid. If you set the clear parameter, all the items are also deleted, with the evas_object_del() function called on each item.

          - - -

          Layout

          - -

          A layout is a container that takes a standard Edje design file and wraps it very thinly in a UI component. Layouts are the basis of a lot of graphics components used in Elementary.

          - -

          An Edje design file describes how the elements of the UI are positioned and how they behave when interacted with. For more information about Edje, see Themes.

          - -

          Creating a Layout

          - -

          To create a new layout, use the elm_layout_add() function:

          -
          Evas_Object *layout;
          -
          -layout = elm_layout_add(parent);
          -
          -

          In Tizen, the layout component is extended to support different kinds of layouts. Rather than define layouts yourself, you can use the following predefined default layouts:

          -
            -
          • application/default: This layout can be used to display content inside a window.
          • -
          • drawer/panel: This layout can be used to create a 2-panel view.
          • -
          • nocontents/default: This layout can be used when there is no content to display, such as in a contact or email.
          • -
          -

          To use the application/default layout:

          -
          Evas_Object *ly;
          -
          -ly = elm_layout_add(parent);
          -elm_layout_theme_set(ly, "layout", "application", "default");
          -
          - -

          Adding Objects to the Layout

          -

          To add an Evas object to the layout:

          -
          elm_object_part_content_set(ly, "elm.swallow.content" view);
          -
          -

          elm.swallow.content is the swallow part of the application layout, and with this call you integrate the view inside the swallow object of the layout.

          -

          The drawer/panel layout can display 2 different views, the background and the main content:

          -
          Evas_Object *ly;
          -
          -ly = elm_layout_add(parent);
          -elm_layout_theme_set(ly, "layout", "drawer", "panel");
          -
          -

          To swallow an object inside the main content and background views:

          -
          elm_object_part_content_set(ly, "elm.swallow.content", main_view);
          -elm_object_part_content_set(ly, "elm.swallow.background", background);
          -
          -

          The nocontents/default layout is a special layout in that it does not contain any swallows. You can only set the text part. There are two different texts zones: elm.text and elm.help.text. To change the text:

          -
          elm_object_part_text_set(ly, "elm.text", "Hi All :)");
          -elm_object_part_text_set(ly, "elm.help.text", "Hi All :)");
          -
          -

          Using Layout Themes

          -

          The layout component supports the following predefined default themes:

          -
            -
          • toolbar-content: For applications with a toolbar and main content area.
          • -
          • toolbar-content-back: For applications with a toolbar, main content area (with a back button), and title area.
          • -
          • toolbar-content-back-next: For applications with a toolbar, main content area (with back and next buttons), and title area.
          • -
          • content-back: For applications with main content (with a back button) and title areas.
          • -
          • content-back-next: For applications with main content (with back and next buttons) and title areas.
          • -
          • toolbar-vbox: For applications with a toolbar and main content area as a vertical box.
          • -
          • toolbar-table: For applications with a toolbar and main content area as a table.
          • -
          -

          To set a theme to the layout, use the elm_layout_theme_set() function.

          - - -

          Mapbuf

          - -

          Figure: Mapbuf hierarchy

          -

          Mapbuf hierarchy

          - -

          A mapbuf component is a container UI component that uses an Evas map to hold a content object. This component is used to improve the moving and resizing performance of complex UI components.

          - -

          The content object is treated as a single image by the Evas map. If you have a content object containing several child objects, frequently moving the mapbuf component will be faster than frequently moving the content object.

          - -

          The mapbuf component inherits all the functions of the container class.

          - -

          Creating a Mapbuf

          -

          To create a mapbuf component, use the elm_mapbuf_add() function:

          -
          Evas_Object *mapbuf, *parent, *content;
          -
          -// Creating a mapbuf
          -mapbuf = elm_mapbuf_add(parent);
          -
          -

          Adding Content to the Mapbuf

          -

          To add content to the mapbuf component, use the elm_object_content_set() function with the "default" part:

          -
          elm_object_content_set(mapbuf, content);
          - - - - - - - - - - -
          Note
          Calling elm_object_content_set(mapbuf, content) is equivalent to calling elm_object_part_content_set(mapbuf, "default", content).
          - - -

          To activate smooth map rendering and alpha rendering for the mapbuf component:

          -
          elm_mapbuf_smooth_set(mapbuf, EINA_TRUE);
          -elm_mapbuf_alpha_set(mapbuf, EINA_TRUE);
          -
          - -

          Activating the Mapbuf

          -

          Finally, to use the mapbuf component, you must activate it:

          -
          elm_mapbuf_enabled_set (mapbuf, EINA_TRUE);
          - -

          Signals

          -

          The mapbuf component does not emit any signals and therefore does not provide any callbacks that you can register.

          - - - - -

          A naviframe component consists of a stack of views. New views are pushed on top of previous ones, and only the top-most view on the stack is displayed. The previous views are not deleted. A previous view is displayed when the view on top of it is popped. Transitions can be animated on a push or a pop, depending on the theme applied to the UI component.

          - -

          Creating a Naviframe

          -

          To create a naviframe, use the elm_naviframe_add() function:

          -
          Evas_Object *nav;
          -
          -nav = elm_naviframe_add(parent);
          -
          -

          Adding and Deleting Views

          -

          The naviframe is a stack of views. A new view is always pushed to the top of the stack. The top-most view is deleted by popping it.

          -

          To add a new view to the naviframe:

          -
          Elm_Object_Item *nav_it;
          -
          -nav_it = elm_naviframe_item_push(nav, NULL, NULL, NULL, view, NULL);
          -// In Tizen 2.3, the back button is not supported in the naviframe 
          -
          -

          When you push a new view to the stack, you receive an Elm_Object_Item for the view. You can use this item to modify the view.

          -

          To pop and delete the top-most view:

          -
          elm_naviframe_item_pop(nav);
          -
          - -

          Adding Fixed Content

          -

          The naviframe can also display fixed content on top of the current (top-most) view. Use the elm_object_item_part_content_set() function to set this content. Use the following part names to specify the location of the content:

          -
            -
          • "default": The main content area of the current view.
          • -
          • "icon": An icon in the title area of the current view.
          • -
          • "title_left_btn": A button on the left side of the naviframe.
          • -
          • "title_right_btn": A button on the right side of the naviframe.
          • -
          -

          For example, to add a button to the naviframe:

          -
          btn = elm_button_add(nav);
          -elm_object_style_set(btn, "naviframe/title_cancel");
          -elm_object_item_part_content_set(nav_it, "title_left_btn", btn);
          -
          -

          To set the title labels of the naviframe, use the elm_object_item_part_text_set() function and specify one of the following label locations:

          -
            -
          • "default": Sets the title label in the title area of the current view.
          • -
          • "subtitle": Sets the subtitle label in the title area of the current view.
          • -
          -

          Signals

          -

          The naviframe emits the following signals:

          -
            -
          • "transition,finished": The transition has finished changing the view.
          • -
          • "title,transition,finished": The title area transition has finished changing the state of the title.
          • -
          • "title,clicked": The user has clicked the title area.
          • -
          - - - -

          Panes in Mobile Applications

          - -

          Figure: Panes component

          -

          Panes component

          - -

          A panes component adds a draggable bar between two sections of content. The sections are resized when the bar is dragged.

          - -

          Creating Panes

          -

          To create a panes component, use the elm_panes_add() function:

          -
          Evas_Object *panes;
          -
          -panes = elm_panes_add(parent);
          -
          - -

          Adding Content to the Panes

          -

          To add content to the panes, use the elm_object_part_content_set() function. The following code adds an object to the left pane:

          -
          elm_object_part_content_set(panes, "left", obj);
          -
          - -

          Setting Panes Options

          -

          To set the orientation of the panes, use the elm_panes_horizontal_set() function.

          - -

          To set the size of the panes, use the elm_panes_content_left_size_set() and elm_panes_content_right_size_set() functions.

          - -

          Signals

          -

          The panes component emits the following signals:

          -
            -
          • "press": The panes component has been pressed (but the press has not been released yet).
          • -
          • "unpress": The press has been released.
          • -
          • "clicked": The panes component has been clicked.
          • -
          • "clicked,double": The panes component has been double-clicked.
          • -
          - - -

          Scroller

          - -

          A scroller holds (and clips) a single object and allows you to scroll across it. This means that the user can use a scroll bar or their finger to drag the viewable region across the object, moving through a much larger area than is contained in the viewport. The scroller will always have a default minimum size that is not limited by its contents.

          -

          The scroller component inherits all the functions of the Layout.

          -

          Creating a Scroller

          -

          To create a scroller, use the elm_scroller_add() function:

          -
          -Evas_Object *scroller;
          -
          -scroller = elm_scroller_add(parent);
          -
          -

          Adding Objects to the Scroller

          -

          To add an object to the scroller, use the elm_object_content_set() function:

          -
          Evas_Object *image;
          -
          -image = elm_image_add(parent);
          -elm_image_file_set(image, "image.png", NULL);
          -evas_object_show(image);
          -evas_object_size_hint_min_set(image, 2560, 1600);
          -elm_object_content_set(scroller, image);
          -
          -

          In the above code, we set a minimum size of 2560 x 1600 pixels for the image. The scroller is smaller than the image, so you can scroll across the image.

          -

          If you want to be informed when the user begins scrolling the image, use the following code:

          -
          -evas_object_smart_callback_add(scroller, "scroll,drag,start", _scroll_start_cb, NULL);
          -
          -// Callback function for the "animate,begin" signal
          -// This callback is called when the user begins scrolling the image
          -void _scroll_start_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   printf("Scroll starts\n");
          -}
          - -

          Managing the Properties of the Scroller

          -

          When scrolling content, the scroller may "bounce" when reaching the edge of the content. This is a visual way of indicating that there is no more content to scroll in that direction. Bounce is enabled by default for both axes. To enable or disable the bounce for either or both axes, use the elm_scroller_bounce_set() function. The following code disables the bounce for the horizontal axis and enables it for the vertical axis:

          - -
          elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
          -
          -

          The scroller can limit the scrolling to "pages". In this case, the scrolling occurs in page-sized chunks of content rather than in a purely continuous fashion, with the scroller displaying a single "page" at a time. This feature sets the size of the page relative to the viewport of the scroller. A size of 1.0 equals 1 viewport (horizontally or vertically). A size of 0.0 disables paging for that axis. These settings are mutually exclusive with page size (see the elm_scroller_page_size_set() function). A size of 0.5 equals half a viewport. Usable size values are normally between 0.0 and 1.0, including 1.0. If you only want a single axis to scroll in pages, use 0.0 for the other axis.

          - -

          Signals

          - -

          The scroller emits the following signals, which you can catch in your application:

          - -
            -
          • "edge,left": The left edge of the content has been reached.
          • -
          • "edge,right": The right edge of the content has been reached.
          • -
          • "edge,top": The top edge of the content has been reached.
          • -
          • "edge,bottom": The bottom edge of the content has been reached.
          • -
          • "scroll": The content has been scrolled (moved).
          • -
          • "scroll,anim,start": The scrolling animation has started.
          • -
          • "scroll,anim,stop": The scrolling animation has stopped.
          • -
          • "scroll,drag,start": Dragging the contents has started.
          • -
          • "scroll,drag,stop": Dragging the contents has stopped.
          • -
          • "vbar,drag": The vertical scroll bar has been dragged.
          • -
          • "vbar,press": The vertical scroll bar has been pressed.
          • -
          • "vbar,unpress": The vertical scroll bar has been unpressed.
          • -
          • "hbar,drag": The horizontal scroll bar has been dragged.
          • -
          • "hbar,press": The horizontal scroll bar has been pressed.
          • -
          • "hbar,unpress": The horizontal scroll bar has been unpressed.
          • -
          • "scroll,page,changed": The visible page has changed.
          • -
          - -

          Example

          -

          A good example of the scroller is a picture slideshow: we add images to the scroller and limit the scrolling to pages (one picture at a time). In the following code, we disable the scroll bars for both axes, limit the scrolling to pages by using the elm_scroller_page_scroll_limit_set() function, and lock the scrolling on the Y axis by using the elm_object_scroll_lock_y_set() function:

          -
          elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
          -elm_scroller_page_scroll_limit_set(scroller, 1, 0);
          -elm_object_scroll_lock_y_set(scroller, EINA_TRUE);
          -
          -

          We create a horizontal box, which will contain all the images, and which itself will be contained by the scroller:

          -
          box = elm_box_add(scroller);
          -elm_box_horizontal_set(box, EINA_TRUE);
          -elm_object_content_set(scroller, box);
          -evas_object_show(box);
          -
          -

          We then create all the images and add them to the horizontal box:

          -
          img = elm_image_add(scroller);
          -snprintf(buf, sizeof(buf), IMAGE_DIR"/%d.jpg", i);
          -elm_image_file_set(img, buf, NULL);
          -evas_object_show(img);
          -pages = eina_list_append(pages, img);
          -elm_box_pack_end(box, img);
          -
          -

          We store references to the images in an eina_list for easy retrieval later.

          -

          Finally, we display the first page of the scroller:

          -
          elm_scroller_page_show(scroller, 0, 0);
          -
          -

          The size of the scroller depends on the size of the parent. When the parent changes, for example when the window is resized or rotated, the scroller is also resized. Since we need to be informed when the scroller is resized, we add a callback on the EVAS_CALLBACK_RESIZE event for the scroller:

          -
          evas_object_event_callback_add(scroller, EVAS_CALLBACK_RESIZE, _scroller_resize_cb, NULL);
          -

          The callback retrieves the new size of the scroller by using the evas_object_geometry_get() function on the object pointer. The pointer is relative to the object that has been resized, which in our case is the scroller itself. We can then iterate through the images of the scroller and set the minimum size to fit the scroller size:

          -
          EINA_LIST_FOREACH(images, l, page)
          -{
          -   evas_object_size_hint_min_set(page, w, h);
          -}
          -
          -

          Finally, we set the page size of the scroller to match the scroller size and display the first page:

          -
          elm_scroller_page_size_set(obj, w, h);
          -elm_scroller_page_show(obj, 0, 0);
          - -

          Table

          - -

          A table is like a box but with 2 dimensions. You have the same kind of APIs as with boxes. An item inside the table can span multiple columns and rows, and even overlap with other items (and it can then be raised or lowered accordingly to adjust stacking if there is overlap).

          - -

          Creating a Table

          - -

          To create a table, use the elm_table_add() function:

          -
          Evas_Object *table;
          -table = elm_table_add(parent);
          - -

          Adding Items to the Table

          - -

          Items are added to the table with the elm_table_pack() function. This function takes as parameters the table, the item to add to the table, and the position where to add the item: column, row, and the size of the item in number of rows and columns (colspan and rowspan). If we want to create an icon that takes 3 columns and rows and a button that only takes 1 row and column, the code will look like this:

          -
          ic = elm_icon_add(table);
          -elm_image_file_set(ic, "icon.png", NULL);
          -evas_object_show(ic);
          -elm_table_pack(table, ic, 0, 0, 3, 3);
          -
          -btn = elm_button_add(table);
          -elm_object_text_set(btn, "Click me i'm famous");
          -evas_object_show(btn);
          -elm_table_pack(table, btn, 3, 1, 1, 1);
          -evas_object_show(table);
          -
          - -

          Managing the Items

          - -

          If you want to change the position of the item after adding it, use the elm_table_pack_set() function. This function takes as parameters the item whose position to change, the new column, the new row, and the size of the item in number of rows and columns (colspan and rowspan).

          - -

          To add padding around the item, use the elm_table_padding_set() function. The second parameter is the padding between columns, and the third parameter is the padding between rows:

          -
          elm_table_padding_set(table, 10, 10);
          - -

          To change the alignment and size of an item, use the evas_object_size_hint parameters. They are used in the same way as with boxes. You can set the same size and weight to each item by using the homogeneous parameter:

          -
          elm_table_homogeneous_set(table, EINA_TRUE);
          -
          - -

          Clearing the Table

          - -

          To clear the table, use the elm_table_clear() function. If the clear parameter is EINA_TRUE, the table items are deleted. The evas_object_del() function will be called on each item.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/core_loop_n.htm b/org.tizen.ui.guides/html/native/efl/core_loop_n.htm deleted file mode 100755 index fcd6f6d..0000000 --- a/org.tizen.ui.guides/html/native/efl/core_loop_n.htm +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - Core Loop and OS Interfacing: Handling the Main Loop and Threads - - - - - -
          - -

          Core Loop and OS Interfacing: Handling the Main Loop and Threads

          -

          The Ecore library provides convenience functions, which allow you to manage the application main loop and threading.

          - -

          Tizen applications developed with EFL use the EDA (Event-driven Architecture) pattern. In EDA, applications reiterate the routine that checks input events, processes the events, and then displays the outputs. The main loop is the entity handling this sequence. It is the heart of any GUI based on EDA.

          - -

          Most applications start and end the main loop, which is used in special situations, such as propagation of events to UI components for handling and updating application appearance and state. That guarantees the delivery of all events received from low-level input devices and provides the accurate and speedy render event loop for synchronizing the application UI with events.

          - -

          The Ecore library provides main loop abstraction with a clean and tiny event loop library. Applications mainly deal with file descriptors handling, event handling, and timer handling from the beginning of the main loop.

          - -

          In addition, Ecore provides several modules related to, for example, Audio, Cocoa, Connection, Drm, FrameBuffer, Input, IPC, Wayland, Win32, and X11 with convenient methods to communicate with underlying operating systems, such as Linux, Windows®, or Mac OS® X.

          - -

          There are 2 types of threads in Tizen applications:

          -
            -
          • Main thread that contains the main loop
          • -
          • Worker threads that support concurrent processing. In parallel processing, applications must keep the GUI updating while processing the data related to the UI.
          • -
          - -

          The Ecore library provides these concurrent processing mechanisms through Ecore threads. An Ecore thread is not a simple wrapper for standard POSIX threads. It is not meant to be used to run parallel tasks throughout the entire duration of the application, especially when these tasks are performance-critical. Ecore manages these tasks using a pool of threads based on system configuration, such as the number of processors the system has, and the maximum amount of concurrent threads set for the application.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/data_types_n.htm b/org.tizen.ui.guides/html/native/efl/data_types_n.htm deleted file mode 100755 index 65bf805..0000000 --- a/org.tizen.ui.guides/html/native/efl/data_types_n.htm +++ /dev/null @@ -1,1696 +0,0 @@ - - - - - - - - - - - - - Data Types - - - - - -
          - -

          Data Types

          - -

          The Eina library is a central part of the EFL. It implements an API for data types, and allows you to create and manipulate several data types:

          - -
            -
          • Inline Array: standard array of inlined members
          • -
          • Array: standard array of void* data
          • -
          • Hash Table: standard hash of void* data
          • -
          • Inline List: list with nodes inlined into the user type
          • -
          • Compact List
          • -
          • List: standard list of void* data
          • -
          • Iterator Functions
          • -
          • Sparse Matrix: sparse matrix of void* data
          • -
          • Red-Black tree: red-black tree with nodes inlined into the user type
          • -
          • String Buffer: mutable string to prepend, insert, or append strings to a buffer
          • -
          • Stringshare: shares read-only string references
          • -
          • Tiler split: merges and navigates into 2D tiled regions
          • -
          • Trash: container of unused but allocated data
          • -
          • Generic Value Storage: container for generic value storage and access
          • -
          • Data Model API: container for data with a user-defined hierarchy or structure
          • -
          - - -

          Iterator Functions

          -

          Eina provides a set of iterator functions to manipulate data types, such as arrays.

          -

          These functions allow access to container elements in a generic way, without knowing which container is used (similar to iterators in the C++ STL). Iterators only allow sequential access (that is, from one element to the next one). For random access, Eina provides accessor functions.

          -

          Getting an iterator to access elements of a given container is done through the functions of that particular container. There is no function to create a generic iterator as iterators absolutely depend on the container. Note that all iterators, regardless of the container type, are always deleted with the same eina_iterator_free() function.

          -

          To get the data and iterate, use the eina_iterator_next() function. To call a function on every single element of a container, use the eina_iterator_foreach() function.

          -

          In addition to iterator functions, each data type also owns a set of macros that provide the iterators, such as FOREACH or REVERSE_FOREACH.

          - -

          Strings

          - -

          Stringshare

          - -

          The Eina_Stringshare data type functions allow you to store a single copy of a string and use it in multiple places throughout your program. This way you can save a lot of strings with less memory. It improves string creation and destruction speed, reduces memory use, and decreases memory fragmentation.

          -

          With this data type you can reduce the number of duplicated strings kept in memory. It is common for the same strings to be dynamically allocated repeatedly between applications and libraries, especially in circumstances where you can have multiple copies of a structure that allocates the string. Rather than duplicating and freeing these strings, request a read-only pointer to an existing string and only incur the overhead of a hash lookup. This can sound like micro-optimizing, but profiling has shown that this can have a significant impact as the number of copies grows.

          - -

          To manage stringshares:

          -
            -
          1. To create a stringshare, declare a string variable and call the eina_stringshare_add() function: -
            -const char *mystr;
            -const char *prologue = "Enlightenment is not just a window manager for Linux/X11 and others"
            -
            -mystr = eina_stringshare_add(prologue);
            -
          2. - -
          3. To retrieve or modify the string data: -
              -
            • Retrieve a string for use in a program from a format string using the eina_stringshare_printf() function. If you have a "format" string to pass to a function like printf, you can store it as a stringshare as well. -

              The following example produces "1 desktop manager to rule them all".

              -
              -const char *myfmtstr = "%d desktop manager to rule them all";
              -const char *str;
              -
              -str = eina_stringshare_printf(myfmtstr, 1);
              -
              -print(str)
              -
              -
            • - -
            • Replace the value of a stringshare with the eina_stringshare_replace() function. Pass the pointer address and the new value to the function. -
              -eina_stringshare_replace(&str,"One desktop manager to rule them all");
              -
              -
            • - -
            • Retrieve the length of the stringshare value with the eina_stringshare_strlen() function. -
              -printf("length: %d\n", eina_stringshare_strlen(str));
              -
              -
            • -
            -
          4. -
          5. When the string is no longer needed, delete it using the eina_stringshare_del() function: -
            -eina_stringshare_del(mystr);
            -
            -
          6. -
          - - - -

          String Buffer

          -

          The string buffer data type is designed to be a mutable string, allowing you to append, prepend or insert a string to a buffer. It allows easy handling of buffers in your applications.

          -

          To manage string buffers:

          -
            -
          1. Initialize the Eina_Strbuf instance and create the buffer: -
            -Eina_Strbuf *buf;
            -mybuffer = eina_strbuf_new();
            -
            -
          2. -
          3. Manage the buffer content: -
              -
            • To append characters to the buffer: -
                -
              • -

                For basic strings, use the eina_strbuf_append() function:

                -
                -eina_strbuf_append(mybuffer, "This is my string.");
                -
                -
              • -
              • To append 1 character to your buffer, use the eina_strbuf_append_char() function. You can also append a sized string to the buffer using the eina_strbuf_append_length() function. -
                -eina_strbuf_append_length(mybuffer, "Buffe", 5);
                -eina_strbuf_append_char(mybuffer, 'r');
                -
                -
              • -
              • To handle "printf" format strings, use the eina_strbuf_append_printf() function to add formatted strings to the buffer: -
                -eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
                -
                -
              • -
              -
            • - -
            • To remove characters from one position to another, use the eina_strbuf_remove() function. The first parameter is the buffer, the second is the start position of the characters you want to delete, and the last the end position. -

              This example removes the first 19 characters of the buffer:

              -
              -eina_strbuf_remove(buf, 0, 18);
              -
              -
            • - -
            • To replace characters: - -
              • -eina_strbuf_replace() replaces a specific occurrence of a given string in the buffer with another string.
              • -
              • -eina_strbuf_replace_all() replaces all occurrences of a given string in the buffer with another string. -
              • -
              -
              -eina_strbuf_append(mybuffer, "buffer buffer buffer");
              -
              -// Replacing one occurrence of "buffer" by "B-U-F-F-E-R"
              -eina_strbuf_replace(mybuffer, "buffer", "B-U-F-F-E-R", 1);
              -
              -// Replacing all the occurrences of "buffer" by "B-U-F-F-E-R"
              -eina_strbuf_replace_all(mybuffer, "buffer", "B-U-F-F-E-R");
              -
              -// Replacing all the occurrences of "B-U-F-F-E-R" by "Buffer"
              -eina_strbuf_replace_all(mybuffer, "B-U-F-F-E-R", "Buffer");
              -
              -
            • -
            • To insert a string at the specified position, use the eina_strbuf_insert() function. Use the eina_strbuf_insert_printf() function with formatted strings. -
              -eina_strbuf_insert(mybuffer, "More buffer", 10);
              -
              -// Using eina_strbuf_length_get to get the buffer length
              -eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf));
              -
              -
            • - -
            • To get the complete length of the string and the buffer, use the eina_strbuf_string_get() and eina_strbuf_length_get() functions: -
              -printf("%s : %d\n", eina_strbuf_string_get(mybuffer), eina_strbuf_length_get(buf));
              -
              -
            • -
            -
          4. - -
          5. When no longer needed, free the buffer with the eina_strbuf_free() function. You can also free the content of Eina_Strbuf without freeing the buffer itself using the eina_strbuf_string_free() function. -
            -eina_strbuf_free(mybuffer);
            -
            -
          6. -
          - -

          Arrays

          -

          An array is a data type which describes an ordered collection of values. The values are accessed by their index.

          -
          -INDEX | VALUE
          ---------------
          -0     | value0
          -1     | value1
          -2     | value2
          -3     | value3
          -4     | value4
          -5     | value5
          -6     | value6
          -7     | value7
          -
          -

          Eina provides 2 array types: the classic array and an inline array.

          - -

          Creating and Destroying a Classic Array

          - -

          The eina_array_new() function creates a new array. You can store strings or objects in the created array. The function returns a new array, or if memory allocation fails, NULL.

          -

          The first parameter of the eina_array_new() function defines the size of the array allocation step. For example, if you set it to 4, the function returns an array of 4 elements and the next time you grow the array it grows by 4 elements. Unless you have pushed 4 elements inside, it does not grow. But once you add the 5th element, it grows again and becomes an array of 8 elements. The allocation step feature is very useful for optimizing performance, and it also reduces memory fragmentation by having a size that fits the array usage. If you set the step to 0, the function sets a default safe value.

          - -

          To create an array to store strings:

          -
            -
          1. Create the array: -
            -// Strings to store in the array 
            -const char* strings[] = 
            -{
            -   "helo", "hera", "starbuck", "kat", "boomer",
            -   "hotdog", "longshot", "jammer", "crashdown", "hardball",
            -   "duck", "racetrack", "apolo", "husker", "freaker",
            -   "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
            -};
            -// Declaring the array (type Eina_Array)
            -Eina_Array *array;
            -unsigned int i;
            -
            -// Creating the array
            -array = eina_array_new(20);
            -
            -// Inserting elements in the array
            -for (i = 0; i < 20; i++)
            -   eina_array_push(array, strdup(strings[i]));
            -
            -
          2. -
          3. To change the allocation step, use the eina_array_step_set() function: -
            • The first parameter is the array you want to change.
            • -
            • The second parameter is the size of that specific array (retrieved with the sizeof() function).
            • -
            • The last parameter is the new step size.
            -

            In this example, the array step changes from 20 to 30.

            -
            -eina_array_step_set(array, sizeof(*array), 30);
            -
            -
          4. -
          5. When no longer used, use the eina_array_free() function to free the array. It first calls the eina_array_flush() function and frees the memory of the pointer. It does not free the memory allocated for the elements of the array. To free them, use a while statement with the eina_array_pop function. -
            -// Freeing the array elements
            -while (eina_array_count(array))
            -   free(eina_array_pop(array));
            -
            -// Freeing the array itself
            -eina_array_free(array);
            -
            -
          6. -
          - -

          Modifying Classic Array Content

          - -

          To modify classic array content:

          -
            -
          • To set the data of an element, use the eina_array_data_set() function. The first parameter is the array, the second is the index of the element you want to set, and the last one is the data. You must first get the related pointer if you need to free it, as this function replaces the previously held data. Be careful, as there is no array or index check. If the value is NULL or invalid, the application can crash. -
            -free(eina_array_data_get(array, 0));
            -eina_array_data_set(array, 0, strdup(strings[3]);
            -
            -
          • -
          • To add elements to the end of the array, use the eina_array_push() function. The function returns EINA_TRUE on success, and EINA_FALSE on failure. The first parameter is the array to store the element, the second one is the data you want to store. If you store strings, remember to allocate the memory first. The example uses the strdup function to duplicate the string contained in strings[]. This function allocates the memory of the returned string, so you do not have to do it yourself. -
            -for (i = 0; i < 20; i++)
            -   eina_array_push(array, strdup(strings[i]));
            -
            -
          • - -
          • To remove the last element of an array, use the eina_array_pop() function. It takes the array as a parameter, and if the operation is successful, returns a pointer to the data of the removed element. -
            -while (eina_array_count(array))
            -   free(eina_array_pop(array));
            -
            -
          • - -
          • To rebuild the array by specifying the data to be kept, use the eina_array_remove() function: -
            • The first parameter is the array to be changed.
            • -
            • The second parameter is the function which selects the data to keep in the rebuilt array.
            • -
            • The last parameter is the data to pass to the selector function defined as the second parameter.
            -

            The selector function has to return an Eina_Bool, EINA_TRUE if the element stays, and EINA_FALSE if it has to be removed.

            -

            The following example shows how to remove all the elements of the array that are longer than 5.

            -
            -// Selector function 
            -Eina_Bool keep(void *data, void *gdata)
            -{
            -   if (strlen((const char*)data) <= 5)
            -      return EINA_TRUE;
            -
            -   return EINA_FALSE;
            -}
            -
            -int remove_array()
            -{
            -   Eina_Array *array;
            -   Eina_Array_Iterator iterator;
            -   const char *item;
            -   unsigned int i;
            -
            -   // Creating and populating an array
            -
            -   // Removing the undesired elements 
            -   eina_array_remove(array, keep, NULL);
            -
            -   // Flushing and freeing the array
            -
            -   return 0;
            -}
            -
            -
          • -
          • To completely wipe an array out, use the eina_array_flush() function. This function sets the count and total members of an array to 0, and frees and sets its data members to NULL. For performance reasons, there is no array check. If the value is NULL or invalid, the program can crash. The only parameter of this function is a pointer to the Eina_Array array you want to flush. -
            -eina_array_flush(array);
            -
            -
          • -
          • To empty an array quickly, use the eina_array_clean() function. This function sets the counting of members in the array to 0. It does not free any space so you have to use it carefully. For performance reasons, there is no array check. If the value is NULL or invalid, the program can crash. -
            -eina_array_clean(array);
            -
            -
          • -
          - -

          Accessing Classic Array Data

          - -

          To access classic array data:

          -
            -
          • To access the data in the array, use the eina_array_data_get() function with the array and the index of the element you want to get. The function returns a pointer to the data. -
            -// Getting the data of the first element 
            -char *mydata;
            -mydata = eina_array_data_get(array, 0);
            -
            -
          • - - -
          • To get the number of elements in an array, use the eina_array_count() function. The first parameter is a pointer to the array variable returned by the eina_array_new() function. -

            The function returns the number of elements.

            -
            -unsigned int nb_elm;
            -nb_elm = eina_array_count(array);
            -
            -
          • - -
          • To iterate through an array, you can use various methods: -
              -
            • Use the Eina_Array iterator called ITER_NEXT. -

              You can use the iterator by calling the macro EINA_ARRAY_ITER_NEXT(). It takes the array to iterate as the first parameter, a counter for the current index during the iteration, and a variable of the same type as the item data and an Eina_Iterator. To use it, declare an Eina_Iterator, an int counter, and, for example, a char * item if your array contains any strings.

              -
              -Eina_Array_Iterator iterator;
              -const char *item;
              -unsigned int i;
              -
              -EINA_ARRAY_ITER_NEXT(array, i, item, iterator)
              -   printf("item #%d: %s\n", i, item);
              -
              -
            • -
            • Use the eina_array_foreach() function to iterate over the array. -

              The first parameter is the array to iterate, the second is a callback function which determines whether the iteration can continue,and the last is the data passed to the callback function.

              -

              To iterate over the array and to print the data of each array element:

              -
              -// Callback function 
              -static Eina_Bool
              -elm_print(const void *container, void *data, void *fdata)
              -{
              -   printf("%s\n", (char *)data);
              -
              -   return EINA_TRUE;
              -}
              -
              -int iterating_array()
              -{
              -   Eina_Array *array;
              -   unsigned int i;
              -
              -   // Creating and populating an array
              -
              -   // Iterating over the array and calling elm_print on each element
              -   eina_array_foreach(array, elm_print, NULL);
              -
              -   // Freeing the element data and array
              -
              -   return 0;
              -}
              -
              -
            • - -
            • Use the eina_array_iterator_new() function to create an iterator for the array.

              The function returns a newly allocated iterator associated with the array. If the array is NULL or the count of the array members is less than or equal to 0, the function returns NULL. If the memory cannot be allocated, NULL is returned and EINA_ERROR_OUT_OF_MEMORY is thrown. Otherwise, a valid iterator is returned.

              -

              Pass to this function the array for which you want to create a new iterator. The iterator is used to run a sequential walk through the array, just like the eina_array_foreach() function.

              -

              To create an iterator and use it to print the data of each array element:

              -
              -static Eina_Bool
              -print_one(const void *container, void *data, void *fdata)
              -{
              -   printf("%s\n", (char*)data);
              -
              -   return EINA_TRUE;
              -}
              -
              -int new_iterator()
              -{
              -   Eina_Array *arra;
              -   Eina_Iterator *it;
              -   unsigned short int i;
              -   void *uninteresting;
              -   Eina_Bool rt;
              -
              -   // Creating and populating an array
              -
              -   it = eina_array_iterator_new(array);
              -
              -   it = eina_iterator_next(it, &uninteresting);
              -   eina_iterator_foreach(it, print_one, NULL);
              -   eina_iterator_free(it);
              -
              -   return 0;
              -}
              -
              -
            • -
            • Use the eina_array_accessor_new() function to get random access to the array elements. -

              The function returns a newly allocated accessor associated with the array. If the array is NULL or the counting of array members is less than or equal to 0, this function returns NULL. If the memory cannot be allocated, NULL is returned and EINA_ERROR_OUT_OF_MEMORY is thrown. Otherwise, a valid accessor is returned.

              -

              To use the accessor to retrieve and print the data of every other array element:

              -
              -int random_access()
              -{
              -   // Declaration of the array 
              -   Eina_Array *array;
              -   // Declaration of the accessor
              -   Eina_Accessor *acc;
              -
              -   // Generic counter
              -   unsigned short int i;
              -
              -   // Variable to put the data retrieved from an array element
              -   void *data;
              -
              -   // Creating and populating an array
              -
              -   // Creating the array accessor
              -   acc = eina_array_accessor_new(array);
              -
              -   // Random access to the data of the array elements
              -   for(i = 1; i < 10; i += 2)
              -   {
              -      // Putting the data in the variable 'data'
              -      eina_accessor_data_get(acc, i, &data);
              -      printf("%s\n", (const char *)data);
              -   }
              -
              -   // Freeing the accessor
              -   eina_accessor_free(acc);
              -
              -   // Freeing the array
              -
              -   return 0;
              -}
              -
              -
            • -
            -
          • -
          - - -

          Creating and Destroying an Inline Array

          - -

          An inline array is a container that stores the data itself, not the pointers to the data. This means there is no memory fragmentation, and for small data types, such as char, short, and int, it is more memory-efficient. This is because the data is stored in the cache and is faster to access. The bigger the data gets, however, the less likely it is and the less interesting it becomes.

          -

          To create an inline array, use the eina_inarray_new() function:

          -
          • The first parameter is the size of the value. In this example, only the characters are stored, and because of that, only sizeof(char) is passed to the function.
          • -
          • The second parameter defines the size of the array allocation step. For example, if you set it to 4, the function returns an inline array of 4 elements, and the next time you grow the inline array, it grows by 4 elements and becomes an array of 8 elements. If you set the step to 0, the function sets a default safe value. -

            The step can be changed later on using the eina_inarray_step_set() function.

          - -

          The eina_inarray_new() function returns a pointer to the new Eina_Inarray variable.

          -
          -int inline_array() 
          -{
          -   // Declare an inline array variable of the type Eina_Inarray
          -   Eina_Inarray *iarr;
          -
          -   // Create an inline array of "char"
          -   iarr = eina_inarray_new(sizeof(char), 0);
          -
          -   // When no longer needed, free the array memory
          -   eina_inarray_free(iarr);
          -
          -   return 0;
          -}
          -
          - -

          Modifying Inline Array Content

          - -

          To modify inline array content:

          -
            -
          • -

            To add data as the last element of the inline array, use the eina_inarray_push() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The second parameter is the data you want to push to the inline array.

            -

            If everything runs fine, the function returns the index of the new element. If something goes wrong, it returns -1.

            -
            -ch = 'a';
            -eina_inarray_push(iarr, &ch);
            -
            -
          • -
          • -

            To insert data to a given position of the inline array, use the eina_inarray_insert_at() function:

            -
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • -
            • The second parameter is the index of the element you want to add to the inline array.
            • -
            • The last parameter is a pointer to the content to be added.
            -

            The content of the pointer is copied to the given position in the inline array. All the members from the position to the end of the array are shifted towards the end. If the position is equal to the end of the array, the member is appended. If the position is bigger than the array length, the function fails.

            -
            -ch = 'a';
            -eina_inarray_push(iarr, &ch);
            -ch = 'b';
            -eina_inarray_push(iarr, &ch);
            -ch = 'd';
            -eina_inarray_push(iarr, &ch);
            -
            -// Adding data on position 3
            -ch = 'c';
            -eina_inarray_insert_at(iarr, 2, &ch)
            -
            -
          • -
          • -

            To insert data with your own position criteria, use the eina_inarray_insert() or eina_inarray_insert_sorted() function. The only difference between these functions is that the eina_inarray_insert_sorted() function assumes that the array is already sorted and consequently optimizes the insertion position by doing a binary search.

            -

            In both functions:

            -
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • -
            • The second parameter is the data you want to push to the inline array.
            • -
            • The last parameter is the callback comparison function. -

              The Eina_Compare_Cb callback function compares data1 and data2. data1 is the value contained in the inline array and data2 is the data you pass to the eina_inarray_insert() or eina_inarray_insert_sorted() function as the second parameter. If data1 is less than data2, -1 must be returned, if it is greater, 1 must be returned, and if they are equal, 0 must be returned.

            -

            The following example shows how to insert a value before a greater value:

            -
            -// Defining the comparison function with the position criteria
            -Eina_Compare_Cb cmp(const void *a, const void *b)
            -{
            -   return *(int*)a > *(int*)b;
            -}
            -
            -int inline_insert()
            -{
            -   Eina_Inarray *iarr;
            -   char ch, *ch3;
            -   int a, *b;
            -
            -   // Creating an inline array
            -
            -   // Adding data to the inline array
            -   a = 97;
            -   eina_inarray_push(iarr, &a);
            -   a = 98;
            -   eina_inarray_push(iarr, &a);
            -   a = 100;
            -   eina_inarray_push(iarr, &a);
            -
            -   // Inserting data with the criteria
            -   a = 99;
            -   eina_inarray_insert_sorted(iarr, &a, cmp);
            -
            -   eina_inarray_free(iarr);
            -}
            -
            -
          • -
          • -

            To remove the last element of the inline array, use the eina_inarray_pop() function. The only parameter is a pointer to the array variable returned by the eina_inarray_new() function. This function returns the data removed from the inline array.

            -
            -eina_inarray_pop(iarr);
            -
            -
          • -
          • -

            To remove specific data from an inline array, use the eina_inarray_remove() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The second parameter is the data you want to remove from the inline array.

            - -

            The eina_inarray_remove() function finds the data and removes the matching members from the array. The data can be an existing member of an inline array for optimized usage. In other cases, the content is matched using the memcmp() function.

            - - -

            The eina_inarray_remove() function returns the index of the removed member, or -1 if failed.

            -
            -iarr = eina_inarray_new(sizeof(char), 0);
            -
            -ch = 'a';
            -eina_inarray_push(iarr, &ch);
            -
            -// Removing data from the array
            -eina_inarray_remove(iarr, &ch);
            -
            -
          • - -
          • -

            To remove data from a defined position in an inline array, use the eina_inarray_remove_at() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The second parameter is the index of the element you want to remove from the inline array.

            -

            The function returns EINA_TRUE on success and EINA_FALSE if something goes wrong. The member is removed from the inline array and any members after it are moved towards the array's head.

            -
            -// Removing data from position 2
            -eina_inarray_remove_at(iarr, 2);
            -
            -
          • -
          • To remove all the elements of the array, use the eina_inarray_flush() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The function removes every member from the array.

            -
            -eina_inarray_flush(iarr);
            -
            -
          • - -
          • -

            To replace values in the inline array, use the eina_inarray_replace_at() function, which copies the data over the given position:

            -
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • -
            • The second parameter is the index of the element you want to remove from the inline array.
            • -
            • The last parameter is the data you want to copy in place of the current data.
            -

            The function returns EINA_TRUE on success, and EINA_FALSE on failure. The given pointer content is copied to the given position in the array. The pointer is not referenced, instead its contents are copied to the member's array using the previously defined member_size. If the position does not exist, the function fails.

            -
            -// Replacing the member at position 3 
            -ch = 'd';
            -eina_inarray_replace_at(iarr, 3, &ch);
            -
            -
          • - -
          • -

            To sort an inline array, use the eina_inarray_sort() function, which applies a quick sorting algorithm to the inline array:

            -
            • The first parameter is a pointer to the array returned by the eina_inarray_new() function.
            • -
            • The last parameter is the Eina_Compare_Cb callback comparison function, which compares data1 and data2. -

              data1 and data2 are values contained in the inline array. If the data matches, the function must return 0, if data1 is less than data2, -1 must be returned and if it is greater, 1 must be returned.

            -
            -static int
            -short_cmp(const void *pa, const void *pb)
            -{
            -   const short *a = pa, *b = pb;
            -
            -   return *a - *b;
            -}
            -
            -int sorting_inline_array()
            -{
            -   Eina_Inarray *array;
            -   int i;
            -
            -   // Creating and populating the inline array
            -
            -   eina_inarray_sort(array, short_cmp);
            -   eina_inarray_free(array);
            -}
            -
            - -

            Be careful, the data given to the compare function is the pointer to the member memory itself. Do not change it.

            -
          • -
          - -

          Accessing Inline Array Data

          - -

          To access inline array data:

          -
            -
          • -

            To search a member in an inline array, use the eina_inarray_search() function that runs a linear walk looking for the given data:

            - -
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • -
            • The second parameter is the data used by the callback function to run the comparison.
            • -
            • The last parameter is the Eina_Compare_Cb callback comparison function, which compares data1 and data2. -

              data1 is the value contained in the inline array and data2 is the data you pass to the eina_inarray_search() function as the second parameter. If the data matches, the function must return 0, if data1 is less than data2, -1 must be returned and if it is greater, 1 must be returned.

            -

            The function returns the member index, or -1 if not found.

            -
            -Eina_Compare_Cb
            -compare(const void *pa, const void *pb)
            -{
            -   const short *a = pa, *b = pb;
            -   if (*a == *b)
            -   {
            -      return EINA_TRUE;
            -   }
            -
            -   return EINA_FALSE;
            -}
            -
            -int search_inline_array()
            -{
            -   Eina_Inarray *array;
            -   int i;
            -   int elm_index;
            -   int to_search = 3;
            -
            -   // Creating and populating the inline array
            -
            -   elm_index = eina_inarray_search(array, &to_search, compare);
            -   eina_inarray_free(array);
            -}
            -
            - -

            Be careful, the data given to the compare function is the pointer to the member memory itself. Do not change it.

            -

            The eina_inarray_search_sorted() function does exactly the same as eina_inarray_search(), but uses a binary search for the given data.

            -
          • - -
          • -

            To get the number of elements in an inline array, use the eina_inarray_count(). The first parameter is a pointer to the array returned by the eina_inarray_new() function. The function returns an unsigned int, the number of elements.

            -
            -printf("Inline array of integers with %d elements:\n", eina_inarray_count(iarr));
            -
            -
          • - -
          • To iterate through an inline array, you can use various methods: -
              -
            • You can use the iterator macros for the inline arrays: FOREACH and REVERSE_FOREACH.

            • -
            • -

              To run a linear walk over an array of elements, use the EINA_INARRAY_FOREACH() macro. The first parameter is a pointer to the array variable returned by eina_inarray_new(), and the second parameter is the variable into which the current value is put during the walk. The EINA_INARRAY_REVERSE_FOREACH() macro does the same thing but starts from the last element.

              - -

              The following example illustrates the printing of each element and its pointer:

              -
              -iarr = eina_inarray_new(sizeof(char), 0);
              -int a, *b;
              -
              -a = 97;
              -eina_inarray_push(iarr, &a);
              -a = 98;
              -eina_inarray_push(iarr, &a);
              -a = 99;
              -eina_inarray_push(iarr, &a);
              -
              -EINA_INARRAY_FOREACH(iarr, b)
              -  printf("int: %d(pointer: %p)\n", *b, b);
              -
              -
            • -
            • To process the array data, use the eina_inarray_foreach() function, which invokes the given function on each element of the array with the given data: -
              • The first parameter is a pointer to the array variable returned by eina_inarray_new().
              • -
              • The second parameter is the function to run on each element. -

                The function must return EINA_TRUE as long as you want to continue iterating. By returning EINA_FALSE, you stop the iteration and make the eina_inarray_foreach() function return EINA_FALSE.

                -

                The data given to the function is the pointer to the member itself.

              • -
              • The last parameter is the data passed to the function called on each element.
              -

              The eina_inarray_foreach() function returns EINA_TRUE if it successfully iterates through all items of the array. Call the function for every given data in the array. This is a safe way to iterate over an array.

              -
              -static Eina_Bool
              -array_foreach(const void *array __UNUSED__, void *p, void *user_data __UNUSED__)
              -{
              -   short *member = p;
              -   int *i = user_data;
              -   (*p)++;
              -   (*i)++;
              -
              -   return EINA_TRUE;
              -}
              -
              -int inline_array_foreach()
              -{
              -   Eina_Inarray *iarr;
              -   iarr = eina_inarray_new(sizeof(char), 1);
              -   int i;
              -
              -   for (i = 0; i < numbers_count; i++)
              -   {
              -      short val = i;
              -      eina_inarray_push(iarr, &val);
              -   }
              -
              -   i = 0;
              -   eina_inarray_foreach(iarr, array_foreach, &i);
              -
              -   eina_inarray_free(iarr);
              -
              -   return 0;
              -}
              -
              -
            • - -
            • To remove some elements based on your own criteria, use the eina_inarray_foreach_remove() function, which walks through the array and, if the value matches in the callback function, removes the element: -
              • The first parameter is a pointer to the array returned by eina_inarray_new() function.
              • -
              • The second parameter is the callback function to run on each element. -

                The callback function returns EINA_TRUE if the value matches, or EINA_FALSE if it does not match.

              • -
              • The last parameter is the data passed to the callback function.
              -

              The function returns the number of removed entries or -1 if something goes wrong.

              -
              -static Eina_Bool
              -array_foreach(const void *array __UNUSED__, void *p, void *user_data __UNUSED__)
              -{
              -   short *member = p;
              -   int *i = user_data;
              -   if (*i == *p) 
              -   { 
              -      return EINA_TRUE;
              -   }
              -
              -   return EINA_FALSE;
              -}
              -
              -int inline_array_foreach_remove()
              -{
              -   Eina_Inarray *iarr;
              -   iarr = eina_inarray_new(sizeof(char), 1);
              -   int i;
              -
              -   for (i = 0; i < numbers_count; i++)
              -   {
              -      short val = i;
              -      eina_inarray_push(iarr, &val);
              -   }
              -
              -   i = 6;
              -   eina_inarray_foreach_remove(iarr, array_foreach, &i);
              -
              -   eina_inarray_free(iarr);
              -
              -   return 0;
              -}
              -
              - -
            • -
            -
          • -
          - - -

          Hash Tables

          -

          The Eina_Hash provides a way to store values in association with a key. For example, if you want to store some tuples into a table, you can do it using the Eina_Hash.

          -

          The Eina_Hash is implemented using an array of "buckets" where each bucket is a pointer to a structure that is the head of a red-black tree. This implementation makes it very robust against week keys as in the worst case scenario, you can still depend on an efficient binary tree implementation.

          - -

          Creating a Hash Table

          - -

          To create the hash table, use the eina_hash_new() function:

          -
            -
          • The first parameter is the function called when getting the size of the key.
          • -
          • The second parameter is the function called when comparing the keys.
          • -
          • The third parameter is the function called when getting the values.
          • -
          • The fourth parameter is the function called on each value when the hash table is freed, or when an item is deleted from it. NULL can be passed as the callback.
          • -
          • The last parameter is the size of the buckets.
          • -
          -

          When you create an Eina_Hash instance, you have to create 4 potentially long callback functions. To make the functions shorter, Eina_Hash offers some predefined functions to create the following kinds of hash tables:

          -
            -
          • eina_hash_string_djb2_new() creates a new hash table using the djb2 algorithm for strings.
          • -
          • eina_hash_string_superfast_new() creates a new hash table for use with strings (better with long strings).
          • -
          • eina_hash_string_small_new() creates a new hash table for use with strings with a small bucket size.
          • -
          • eina_hash_int32_new() and eina_hash_int64_new() create a new hash table for use with 32-bit and 64-bit integers.
          • -
          • eina_hash_pointer_new() creates a new hash table for use with pointers.
          • -
          • eina_hash_stringshared_new() creates a new hash table for use with shared strings.
          • -
          -

          All these predefined functions require only one parameter, which is the function to free the data you store in the hash table.

          -

          The following example shows how to manage a small phone book using the eina_hash_string_superfast_new() function to create the hash table.

          -
            -
          1. Create the phone book structure and some static data:

            -
            -struct _Phone_Entry 
            -{
            -   const char *name; // Full name
            -   const char *number; // Phone number
            -};
            -
            -typedef struct _Phone_Entry Phone_Entry;
            -
            -static Phone_Entry _start_entries[] = 
            -{
            -   { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
            -   { "Ludwig van Beethoven", "+12 34 567-89101" },
            -   { "Richard Georg Strauss", "+23 45 678-91012" },
            -   { "Heitor Villa-Lobos", "+34 56 789-10123" },
            -   { NULL, NULL }
            -};
            -
            -
          2. - -
          3. Create the callback to free the data:

            -
            -static void
            -_phone_entry_free_cb(void *data)
            -{
            -   free(data);
            -}
            -
            -

            The free callback can be changed later using the eina_hash_free_cb_set() function. You need to pass the hash and the new callback function.

            -
          4. - -
          5. Create and destroy the hash table.

            -

            The eina_hash_free_buckets() function frees all hash table buckets. It empties the hash but does not destroy it, and you can still use it for another purpose. When eina_hash_free() is called, the space allocated for the hash is freed.

            -
            -int free_data()
            -{
            -   Eina_Hash *phone_book = NULL;
            -   phone_book = eina_hash_string_superfast_new(_phone_entry_free_cb);
            -
            -   // Empty the phone book without destroying it
            -   eina_hash_free_buckets(phone_book);
            -   eina_hash_free(phone_book);
            -}
            -
            -
          6. -
          - - - - -

          Modifying Hash Table Content

          - -

          To modify hash table content:

          -
            -
          • -

            To add some data to a hash, use the eina_hash_add() function. This function takes the hash, the key to access the data, and the data as its parameters.

            -

            The following example shows how to add the initial data declared earlier to the hash:

            -
            -for (i = 0; _start_entries[i].name != NULL; i++)
            -{
            -   eina_hash_add(phone_book, _start_entries[i].name, strdup(_start_entries[i].number));
            -}
            -
            - -

            The Eina_Hash offers various ways to add elements to a hash, such as the eina_hash_direct_add() function, which adds the entry without duplicating the string key. The key is stored in the struct, so this function can be used with eina_stringshare to avoid key data duplication.

            -
            -for (i = 0; _start_entries[i].name != NULL; i++)
            -{
            -   // Allocating memory for the phone entry
            -   Phone_Entry *e = malloc(sizeof(Phone_Entry));
            -
            -   // Creating an eina_stringshare for the name and the phone number
            -   e->name = eina_stringshare_add(_start_entries[i].name);
            -   e->number = eina_stringshare_add(_start_entries[i].number);
            -
            -   // Adding the entry to the hash 
            -   eina_hash_direct_add(phone_book, e->name, e);
            -}
            -
            -
          • -
          • -

            To modify an entry, use eina_hash_modify() function passing the hash, the key of the data to change, and the new data. The function returns the old data on success.

            -

            The eina_hash_set() function does the same work as eina_hash_modify(), but if the entry does not exist, the function creates a new one.

            -
            -char *old_phone = NULL;
            -char *phone = NULL;
            -// Replace the phone number of Richard Strauss
            -old_phone = eina_hash_modify(phone_book, "Richard Georg Strauss", strdup("+23 45 111-11111"));
            -phone = eina_hash_set(phone_book, "Philippe de Magalhães", strdup("+33 6 111-11111"));
            -eina_hash_set(phone_book, "Richard Georg Strauss", strdup("+23 45 111-117711"));
            -
            -
          • -
          • -

            To change the key associated with the data without freeing and creating a new entry, use the eina_hash_move() function. You only have to pass the hash, the old key, and the new key. If the operation succeeds, the function returns EINA_TRUE, if not, it returns EINA_FALSE.

            -
            -Eina_Bool res;
            -res = eina_hash_move(phone_book, "Philippe de Magalhães", "Filipe de Magalhães");
            -
            -
          • -
          • -

            To delete entries from a hash table:

            -
            • Use the eina_hash_del() function to remove the entry identified by a key or data from the given hash table: -
              -Eina_Bool r;
              -const char *entry_name = "Heitor Villa-Lobos";
              -r = eina_hash_del(phone_book, entry_name, NULL);
              -
            • -
            • Use the eina_hash_del_by_key() function to remove an entry based on the key: -
              -r = eina_hash_del_by_key(phone_book, "Richard Georg Strauss");
              -
              -
            • -
            • -

              Use the eina_hash_del_by_data() function to remove an entry based on the data:

              -
              -r = eina_hash_del_by_data(phone_book, "+12 34 567-89101");
              -
              -
            • -
          - -

          Accessing Hash Table Data

          -

          To find hash table elements and get data based on the key name:

          -
            -
          • -

            To retrieve an entry based on its key, use the eina_hash_find() function by passing the hash and the key you are looking for:

            -
            -char *phone = NULL;
            -const char *entry_name = "Heitor Villa-Lobos";
            -
            -// Look for a specific entry and get its phone number
            -phone = eina_hash_find(phone_book, entry_name);
            -
            -
          • -
          • -

            To get the number of entries in a hash, use the eina_hash_population() function. Pass the hash as the only argument.

            -
            -unsigned int nb_elm;
            -nb_elm = eina_hash_population(phone_book);
            -
            -
          • - -
          • To iterate through a hash table, you can use various methods: -
              - -
            • to iterate over the hash table, use the eina_hash_foreach() function: - -
              • The first parameter is the hash.
              • -
              • The second parameter is the callback function called on each iteration. -

                The callback function has to return an Eina_Bool, EINA_TRUE if the iteration has to continue and EINA_FALSE if the iteration has to stop.

              • -
              • The last parameter one is the data passed to the callback function.
              - -

              The following example prints the key and the data of the hash entry (the name and the phone number):

              - -
              -static Eina_Bool
              -pb_foreach_cb(const Eina_Hash *phone_book, const void *key, void *data, void *fdata)
              -{
              -   const char *name = key;
              -   const char *number = data;
              -   printf("%s: %s\n", name, number);
              -
              -   // Return EINA_FALSE to stop this callback from being called
              -   return EINA_TRUE;
              -}
              -
              -printf("List of phones:\n");
              -
              -// Running the callback on the hash called phone_book 
              -eina_hash_foreach(phone_book, pb_foreach_cb, NULL);
              -printf("\n");
              -
              -
            • -
            • To iterate over the keys, use the eina_hash_iterator_key_new() function: -
              -// Declaration of the Eina_Iterator
              -Eina_Iterator *it;
              -
              -// Variable to handle the current iteration "data"
              -void *data;
              -
              -// Iterate over the keys (names)
              -printf("List of names in the phone book:\n");
              -
              -it = eina_hash_iterator_key_new(phone_book);
              -
              -// Use the generic eina_iterator_next()
              -while (eina_iterator_next(it, &data))
              -{
              -   const char *name = data;
              -   printf("%s\n", name);
              -}
              -
              -// Free the iterator
              -eina_iterator_free(it);
              -
              -
            • - -
            • To iterate over the hash data, use the eina_hash_iterator_data_new() function the same way as eina_hash_iterator_key_new(): -
              -// Declaration of the Eina_Iterator
              -Eina_Iterator *it;
              -
              -// Variable to handle the current iteration "data"
              -void *data;
              -
              -// Iterate over hash data 
              -printf("List of numbers in the phone book:\n");
              -
              -it = eina_hash_iterator_data_new(phone_book);
              -while (eina_iterator_next(it, &data))
              -{
              -   const char *number = data;
              -   printf("%s\n", number);
              -}
              -
              -// Free the iterator
              -eina_iterator_free(it);
              -
              -
            • -
            • To iterate over a tuple composed of keys and data, use the eina_hash_iterator_tuple_new() function: -
              -// Declaration of the Eina_Iterator
              -Eina_Iterator *tit;
              -
              -// Variable to handle the current iteration "data"
              -void *tuple;
              -
              -printf("List of phones:\n");
              -tit = eina_hash_iterator_tuple_new(phone_book);
              -while (eina_iterator_next(tit, &tuple))
              -{
              -   Eina_Hash_Tuple *t = tuple;
              -   const char *name = t->key;
              -   const char *number = t->data;
              -   printf("%s: %s\n", name, number);
              -}
              -
              -// Always free the iterator after its use
              -eina_iterator_free(tit); 
              -
              -
            • -
            -
          • -
          - - -

          Lists

          - -

          The Eina_List is a double-linked list that can store data of any type as void pointers. It provides a set of functions to create and manipulate the list to avoid the access to the struct's fields, similar to a self-made double-link list.

          -

          In addition to the previous and next node and its data, the Eina_List nodes keep a reference to an accounting structure. The accounting structure is used to improve the performance of some functions. The structure is private and must not be modified.

          - -

          In an Eina_List, everything is a "list": the list itself is a list where each node is a list as well.

          - -

          Eina provides 2 list types: the classic list (Eina_List) and an inline list (Eina_Inlist).

          - -

          Creating and Destroying a List

          -

          To use an Eina_List:

          - -
          1. Declare the list with NULL as the default value: -
            -int list()
            -{
            -   // Declaration of the Eina_List with NULL as default value;
            -   Eina_List *list = NULL;
            -
          2. - -
          3. Call the eina_list_append() function with the list and the data you want to append as parameters. -

            The list must be a pointer to the first element of the list (or NULL). The function returns a pointer to the list.

            -
            -   // Creating the first element of the list 
            -   list = eina_list_append(list, "watch");
            -
            -   // Adding more elements
            -   list = eina_list_append(list, "phone");
            -   list = eina_list_append(list, "ivi");
            -   list = eina_list_append(list, "notebook");
            -
          4. - -
          5. When you no longer need the list, free it: -
            -   // Free the Eina_List
            -   eina_list_free(list);
            -
            -   return 0;
            -}
            -
          6. -
          - - -

          Modifying List Content

          - -

          To modify list content:

          -
            -
          • -

            To add data to a list:

            - -
              -
            • To add data at the end of the list, use the eina_list_append() function. To add data at the top of the list, use eina_list_prepend(). The functions work in the same way, only adding the data to different places. -
              -list = eina_list_prepend(list, "set-top box");
              -
              -
            • - -
            • To insert data into the list after a specified data, use the eina_list_append_relative() function. As the last parameter, define the element after which the data is added. -

              For example to append data after the "phone" element:

              -
              -list = eina_list_append_relative(list, "single-board computer", "phone");
              -
              -
            • - -
            • To add a new entry before a specified data, use the eina_list_prepend_relative() function. It is similar to the eina_list_append_relative() function. -
              -list = eina_list_prepend_relative(list, "ultrabook", "ivi");
              -
              -
            • - -
            • To append a list node to a linked list after a specified member, use the eina_list_append_relative_list() function. To prepend a list node to a linked list before a specified member, use the Eina_List * eina_list_prepend_relative_list() function. -
            • -
            -
          • - -
          • To set data in a list member, use the eina_list_data_set() function. Pass the "list" (node) as the first argument and the data to set as the second. - -

            The following example also shows the usage of the eina_list_last() function, which returns the last element of an Eina_List.

            - -
            -// Setting new data for the last element
            -eina_list_data_set(eina_list_last(list), eina_stringshare_add("Boris"));
            -
            -
          • - -
          • To remove a node from the list, use the eina_list_remove() function. This function removes the first instance of the specified data from the given list. -
            -list = eina_list_remove(list, "ultrabook");
            -
            -

            You can also remove a "list" (node) from a list using the eina_list_remove_list() function. Pass the list you want to delete an element from and a 'list' (node) you want to delete.

            -
            -Eina_List *app_list = NULL;
            -Eina_List *to_remove = NULL;
            -
            -// Adding some elements to the list (using stringshares)
            -app_list = eina_list_append(app_list, eina_stringshare_add("enna"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("ebird"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("calaos"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("rage"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("terminology"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("enlightenment"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("eyelight"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("ephoto"));
            -
            -// Finding the "list" to remove 
            -to_remove = eina_list_data_find_list(list, eina_string_share_add("enlightenment"));
            -
            -list = eina_list_remove_list(list, to_remove);
            -
            -
          • - -
          • To move elements in a list, you can use various function, such as eina_list_promote_list() that promotes an element to the top of the list or eina_list_demote_list() that puts the specified element at the end of the list. Remember that everything is a list so the second parameter represents the "list" (node) you want to move. Use the functions just like the eina_list_remove_list() function. -
            -list = eina_list_promote_list(list, eina_list_data_find_list(list, "ivi"));
            -
            -
          • -
          • To reverse all the elements of a list, use the eina_list_reverse() function. To obtain a reversed copy of the list while keeping the initial list unchanged, use the eina_list_reverse_clone() function. -
            -Eina_List *rev_copy;
            -
            -app_list = eina_list_reverse(app_list);
            -rev_copy = eina_list_reverse_clone(app_list);
            -
            -
          • -
          • To sort a list, use the eina_list_sort() function. This function takes a list which needs to be sorted, the maximum number of elements to be sorted, and a callback function that compares data. To sort all list elements, set the maximum number of elements to 0. -
            -int sort_cb(const void *d1, const void *d2)
            -{
            -   const char *txt = d1;
            -   const char *txt2 = d2;
            -   if(!txt) return(1);
            -   if(!txt2) return(-1);
            -
            -   return(strcmp(txt, txt2));
            -}
            -
            -extern Eina_List *list;
            -list = eina_list_sort(list, 0, sort_cb);
            -
            -
          • -
          • To merge 2 list into 1, use the eina_list_merge() function. The eina_list_sorted_merge() function merges 2 sorted lists according to the ordering function that you pass as the last argument. -
            -int sort_cb(void *d1, void *d2)
            -{
            -   const char *txt = NULL;
            -   const char *txt2 = NULL;
            -   if(!d1) return(1);
            -   if(!d2) return(-1);
            -
            -   return(strcmp((const char*)d1, (const char*)d2));
            -}
            -
            -Eina_List *sorted1;
            -Eina_List *sorted2;
            -Eina_List *newlist;
            -
            -// Insert some values and sort your lists
            -
            -// Simply merge 2 lists without any process
            -newlist = eina_list_merge(sorted1, sorted2);
            -
            -newlist = eina_list_sorted_merge(sorted1, sorted2, sort_cb);
            -
            -
          • -
          • To split a list, use the eina_list_split_list() function: -
            • The first parameter is the list to split.
            • -
            • The second parameter is the "list" (element) after which the list is split.
            • -
            • The last parameter is the head of the second list.
            -
            -// Original list (left list)
            -Eina_List *list = NULL;
            -
            -// New list (right list)
            -Eina_List *other_list = NULL;
            -
            -// Eina_List (element)
            -Eina_List *l;
            -
            -list = eina_list_append(list, "super tux");
            -list = eina_list_append(list, "frozen bubble");
            -list = eina_list_append(list, "lincity-ng");
            -
            -// Sorting the list (just for fun)
            -list = eina_list_sort(list, 0, cmp_func);
            -
            -// Looking for the 'split' element
            -l = eina_list_search_sorted_list(list, cmp_func, "frozen bubble");
            -
            -// Splitting the list
            -list = eina_list_split_list(list, l, &other_list);
            -
            -
          • -
          • To copy a list, use the eina_list_clone() function. The function copies all the elements in the list in the exact same order. -
            -Eina_List *app_list_copy;
            -
            -app_list_copy = eina_list_clone(app_list);
            -
            -
          • - -
          - - -

          Accessing List Data

          -

          To access list data:

          -
            -
          • To find some data on your list, use the eina_list_data_find() function. Pass the list containing your data as the first parameter and the data you are looking for as the last one. The function returns the found member data pointer if found, NULL otherwise. -

            The eina_list_data_find() function searches the list from the beginning to the end for the first member for which the data pointer is data. If it is found, the data is returned, otherwise NULL is returned. The function only compares pointers, which is why using Eina_Stringshare is very useful with lists, because it always returns the same pointer for the same string.

            -
            -Eina_List *app_list = NULL;
            -const char *res_str;
            -
            -// Adding some elements to the list (using stringshares)
            -app_list = eina_list_append(app_list, eina_stringshare_add("enna"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("ebird"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("calaos"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("rage"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("terminology"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("enlightenment"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("eyelight"));
            -app_list = eina_list_append(app_list, eina_stringshare_add("ephoto"));
            -
            -// Finding the data
            -res_str = eina_list_data_find(list, eina_string_share_add("enlightenment"));
            -if (res_str == eina_stringshare_add("enlightenment"))
            -   printf("Data is present");
            -else
            -   printf("Data not present");
            -
            - -

            The above example returns "Data is present".

            -

            The eina_list_data_find_list() function does the same thing as eina_list_data_find(), but returns an Eina_List. For an example, see the eina_list_remove_list() function.

            -

            You can access the data or a "list" (node) of an Eina_List using the eina_list_nth() and eina_list_nth_list() functions. The first one returns a pointer to the data of the "n" element and the second a pointer to the "list". To access the data of the 3rd element of an Eina_List:

            -
            -const char *res;
            -Eina_List *res_lst;
            -
            -res = eina_list_nth(app_list, 2);
            -res_lst = eina_list_nth_list(app_list, 2);
            -
            - -

            The res variable contains the pointer to the string "calaos". The res_lst variable is the list containing "calaos".

            -
          • - -
          • To search for data in a list, select your function based on whether the list is sorted or unsorted. -
              -
            • To search in an unsorted list, use the eina_list_search_unsorted() function: -
              • The first parameter is the list.
              • -
              • The second parameter is a callback function for comparison.
              • -
              • The last parameter is the data you are looking for.
              - -

              The eina_list_search_unsorted_list() function does the same but returns an "Eina_List".

              - - -

              The following example shows 2 searches using both the eina_list_search_unsorted() and eina_list_search_unsorted_list() functions:

              -
              -int search_list()
              -{
              -   // Declaring the list
              -   Eina_List *list = NULL; 
              -   Eina_List *l;
              -   // Little trick to use strcmp as Eina_Compare_Cb 
              -   Eina_Compare_Cb cmp_func = (Eina_Compare_Cb)strcmp;
              -
              -   void *data;
              -   int cmp_result;
              -
              -   list = eina_list_append(list, "debian");
              -   list = eina_list_append(list, "archlinux");
              -   list = eina_list_append(list, "centos");
              -
              -   data = eina_list_search_unsorted(list, cmp_func, "archlinux");
              -   l = eina_list_search_unsorted_list(list, cmp_func, "archlinux");
              -   if (l->data != data)
              -   {
              -      eina_list_free(list);
              -
              -      return 1;
              -   }
              -
              -   eina_list_free(list);
              -
              -   return 0;
              -}
              -
              - -
            • -
            • To search in sorted lists, use the eina_list_search_sorted_list() and eina_list_search_sorted() functions. They work similarly as the eina_list_search_unsorted() function. -
            • -
            -
          • - - -
          • To get data from a list element, use the eina_list_data_get() function. The function returns the data contained in the given list. - -

            The following example uses the eina_list_next() function to move through the list in a statement.

            -
            -int list_data_set()
            -{
            -   // Declaring the list
            -   Eina_List *list = NULL;
            -   // Eina_List in which to place the elements or lists
            -   Eina_List *l;
            -
            -   void *list_data;
            -
            -   list = eina_list_append(list, eina_stringshare_add("Bertrand"));
            -   list = eina_list_append(list, eina_stringshare_add("Cedric"));
            -   list = eina_list_append(list, eina_stringshare_add("Nicolas"));
            -   list = eina_list_append(list, eina_stringshare_add("Vincent"));
            -   list = eina_list_append(list, eina_stringshare_add("Raoul"));
            -   list = eina_list_append(list, eina_stringshare_add("Fabien"));
            -   list = eina_list_append(list, eina_stringshare_add("Philippe"));
            -   list = eina_list_append(list, eina_stringshare_add("billiob"));
            -
            -   for(l = list; l; l = eina_list_next(l))
            -      // Printing the data returned by eina_list_data_get
            -      printf("%s\n", (char*)eina_list_data_get(l));
            -
            -   EINA_LIST_FREE(list, list_data)
            -      eina_stringshare_del(list_data);
            -
            -   return 0;
            -}
            -
            -
          • - -
          • To move in a list, use the eina_list_last(), eina_list_next(), or eina_list_prev() functions to move to the last, next, or previous element in the list. -

            The following example scrolls backwards starting from the end of the list:

            -
            -for(l = eina_list_last(list); l; l = eina_list_prev(l))
            -   printf("%s\n", (char*)eina_list_data_get(l));
            -
            - -
          • - -
          • To count the list elements, use the eina_list_count() function. The function returns the number of items in a list. -
            -printf("List size: %d\n", eina_list_count(list));
            -
            -
          • -
          • To iterate through an array, you can use various iterators: -
              -
            • To iterate over a list from the beginning to the end, use the EINA_LIST_FOREACH macro: -
              • The first parameter is the list to iterate.
              • -
              • The second parameter is an Eina_List * to hold the current "List" (node).
              • -
              • The last parameter receives the current data during the run.
              - -

              The following example prints the data of each "List" (node) of the list:

              -
              -Eina_List *list = NULL;
              -Eina_List *l;
              -void *list_data;
              -
              -list = eina_list_append(list, "ls");
              -list = eina_list_append(list, "top");
              -list = eina_list_append(list, "rmdir");
              -list = eina_list_append(list, "uname");
              -
              -EINA_LIST_FOREACH(list, l, list_data)
              -   printf("%s\n", (char*)list_data);
              -
              -eina_list_free(list);
              -
              -
            • -
            • To iterate from the last element to the first, use the EINA_LIST_REVERSE_FOREACH macro. It works similarly as EINA_LIST_FOREACH(). -
            • -
            • To iterate over a list from the beginning to the end, you can also use the EINA_LIST_FOREACH_SAFE macro. It is called safe, because it stores the next "List" (node), so you can safely remove the current "List" (node) and continue the iteration. -
              -Eina_List *list;
              -Eina_List *l;
              -Eina_List *l_next;
              -char *data;
              -
              -list = eina_list_append(list, "tizen");
              -list = eina_list_append(list, "tizen");
              -list = eina_list_append(list, "tizen");
              -list = eina_list_append(list, "tizen");
              -
              -// Using EINA_LIST_FOREACH_SAFE to free the elements that match "tizen"
              -
              -EINA_LIST_FOREACH_SAFE(list, l, l_next, data)
              -   if (strcmp(data, "tizen") == 0) 
              -   {
              -      free(data);
              -      list = eina_list_remove_list(list, l);
              -   }
              -
              -
            • - - -
            • To remove each list element while having access to the node's data, use the EINA_LIST_FREE macro. Pass the list and a pointer to hold the current data. -
              -Eina_List *list;
              -char *data;
              -
              -// List is filled
              -
              -EINA_LIST_FREE(list, data)
              -   free(data);
              -
              -
            • -
            -
          • -
          - -

          Using an Inline List

          -

          The Eina_Inlist is a special data type drawn to store nodes pointers in the same memory as data. This way the memory is less fragmented, but operations, such as sort and count, are slower. The Eina_Inlist has its own purpose, but if you do not understand what the purpose is, use the regular Eina_List instead.

          - -

          The Eina_Inlist nodes can be part of a regular Eina_List, simply added with the eina_list_append() or eina_list_prepend() functions.

          - -

          To use the inline list:

          -
            -
          1. Define the structure of the data before creating the inline list: -
            -struct my_struct 
            -{
            -   EINA_INLIST;
            -   int a, b;
            -};
            -
            - -

            The structure is composed of 2 integers, the real data, and the EINA_INLIST type which is composed of 3 pointers defining the inline list structure:

            - -
              -
            • Eina_Inlist * next: next node
            • -
            • Eina_Inlist * prev: previous node
            • -
            • Eina_Inlist * last: last node
            • -
          2. - -
          3. -

            To create the inlist nodes, allocate the memory and use the eina_inlist_append() function:

            -
            • The first parameter is the existing list head or NULL to create a new list. -

              The following example passes NULL to create a new list.

            • -
            • The second parameter is the new list node, and it must not be NULL. -

              You must use the EINA_INLIST_GET() macro to get the inlist object of the datastruct.

            -
            -struct my_struct *d, *cur;
            -Eina_Inlist *list, *itr, *tmp;
            -
            -d = malloc(sizeof(*d));
            -d->a = 1;
            -d->b = 10;
            -
            -list = eina_inlist_append(NULL, EINA_INLIST_GET(d));
            -
            - -

            Repeat this operation for every new node:

            -
            -d = malloc(sizeof(*d));
            -d->a = 2;
            -d->b = 20;
            -list = eina_inlist_append(list, EINA_INLIST_GET(d));
            -
            -
          4. - -
          5. To add data to the inline list: -
            • Put data at the end of the inline list with the eina_inlist_prepend() function: -
              -d = malloc(sizeof(*d));
              -d->a = 3;
              -d->b = 30;
              -list = eina_inlist_prepend(list, EINA_INLIST_GET(d));
              -
              -
            • - -
            • Add a node before or after a given node with the eina_inlist_prepend_relative() and eina_inlist_append_relative() functions. -

              In both functions, the first parameter is the target list, the second is the element you want to add, and the last is the reference element to place data after (in this case). Similarly as in a regular Eina_List, everything is a list, so the last parameter is an Eina_Inlist typed variable.

              -
              d = malloc(sizeof(*d));
              -d->a = 4;
              -d->b = 40;
              -list = eina_inlist_append_relative(list, EINA_INLIST_GET(d), list);
              -
              -
          6. - -
          7. To sort and iterate an inline list, to find and move list elements, and to perform other inline list operations, see the Inline List API.
          8. - -
          9. When the inline list is no longer needed, destroy it by looping over the list to free each EINA_INLIST structure and the data using allocated memory. Use the eina_inlist_remove() function on each node. - -

            In the following example, the EINA_INLIST_CONTAINER_GET() macro returns the container object of an inlist (the EINA_INLIST of my_struct), and the list element is removed and the allocated memory of the container "object" is freed.

            - -
            while (list)
            -{
            -   struct my_struct *aux = EINA_INLIST_CONTAINER_GET(list, struct my_struct);
            -
            -   // Remove the current list element 
            -   list = eina_inlist_remove(list, list);
            -   free(aux);
            -}
            -
            -
          10. - - -
          - -

          Generic Value

          - -

          The Eina_Value object provides generic data storage and access, allowing you to store what you want in one single type of Eina_Value. It is meant for simple data types, providing uniform access and release functions, useful to exchange data preserving their types. The Eina_Value comes with predefined types for numbers, array, list, hash, blob, and structs, and it can convert between data types, including string.

          - -

          The Eina_Value can handle the following types:

          -
            -
          • EINA_VALUE_TYPE_UCHAR: unsigned char
          • -
          • EINA_VALUE_TYPE_USHORT: unsigned short
          • -
          • EINA_VALUE_TYPE_UINT: unsigned int
          • -
          • EINA_VALUE_TYPE_ULONG: unsigned long
          • -
          • EINA_VALUE_TYPE_TIMESTAMP: unsigned long used for timestamps
          • -
          • EINA_VALUE_TYPE_UINT64: unsigned integer of 64 bits
          • -
          • EINA_VALUE_TYPE_CHAR: char
          • -
          • EINA_VALUE_TYPE_SHORT: short
          • -
          • EINA_VALUE_TYPE_INT: int
          • -
          • EINA_VALUE_TYPE_LONG: long
          • -
          • EINA_VALUE_TYPE_INT64: integer of 64 bits
          • -
          • EINA_VALUE_TYPE_FLOAT: float
          • -
          • EINA_VALUE_TYPE_DOUBLE: double
          • -
          • EINA_VALUE_TYPE_STRINGSHARE: stringshared string
          • -
          • EINA_VALUE_TYPE_STRING: string
          • -
          • EINA_VALUE_TYPE_ARRAY: array
          • -
          • EINA_VALUE_TYPE_LIST: list
          • -
          • EINA_VALUE_TYPE_HASH: hash
          • -
          • EINA_VALUE_TYPE_TIMEVAL: 'struct timeval'
          • -
          • EINA_VALUE_TYPE_BLOB: blob of bytes
          • -
          • EINA_VALUE_TYPE_STRUCT: struct
          • -
          - - -

          To set up a generic value:

          -
            -
          1. Declare the necessary variables: -
            -// The Eina_Value itself
            -Eina_Value v;
            -// An integer 
            -int i;
            -// And a char *
            -char *newstr;
            -
            -
          2. - -
          3. To set up an Eina_Value for an integer, use the eina_value_setup() function. The first argument is the Eina_Value and the second is the type. -
            -eina_value_setup(&v, EINA_VALUE_TYPE_INT);
            -
            -
          4. -
          -

          To manage the generic value:

          -
            -
          • To set an integer, use the eina_value_set() function: -
            -eina_value_set(&v, 123);
            -
            -
          • - -
          • To get the value, use the eina_value_get() function. Pass the Eina_Value as the first argument, and a pointer to a variable to store the value (the target variable must have the same type as the Eina_Value). -
            -eina_value_get(&v, &i);
            -printf("v=%d\n", i);
            -
            -

            The above example prints "v=123".

            -
          • - - -
          • To store an Eina_List, use the Eina_Value that corresponds to the EINA_VALUE_TYPE_LIST type. -
          • -
          • To create an Eina_Value_List, use the eina_value_list_setup() function. The function initializes a generic value storage of the list type. The first parameter is the "object" value, and the second one is the type (how to manage the stored list members). -
          • -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/data_types_tools_n.htm b/org.tizen.ui.guides/html/native/efl/data_types_tools_n.htm deleted file mode 100755 index a5bca4a..0000000 --- a/org.tizen.ui.guides/html/native/efl/data_types_tools_n.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - Data Types and Tools: Using Eina Resources - - - -
          -
          -

          Mobile native Wearable native

          -
          - - -
          - -
          - -

          Data Types and Tools: Using Eina Resources

          - -

          UI toolkits, such as Qt and Gtk, generally support their own data types, structures, functions, and macros in order for you to easily and efficiently make their applications. EFL, as one of Tizen native UI toolkits, provides data types and useful tools as well.

          - -

          The Eina library in EFL implements APIs for data types and structures easy to use and optimized in an efficient way. It also provides some useful tools, such as opening shared libraries, error management, type conversion, time accounting, and memory pool to help convenient application development.

          - -

          The main features of Eina are:

          -
            -
          • Data Types

            The Eina library is a central part of the EFL. It implements an API for data types, and allows you to create and manipulate several data types.

          • -
          • Tools

            Eina provides a number of tools, such as string manipulation, that make your life easier when coding applications.

          • -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/datetime_tutorial_wn.htm b/org.tizen.ui.guides/html/native/efl/datetime_tutorial_wn.htm deleted file mode 100755 index 2febe03..0000000 --- a/org.tizen.ui.guides/html/native/efl/datetime_tutorial_wn.htm +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - Creating Wearable Datetimes - - - - - - -
          -

          Creating Wearable Datetimes

          - - -

          This tutorial explains how you can create UI components that allow the user to select a date or time.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - - -

          Creating a Date Picker

          - -

          Use the elm_datetime component to add a date picker style (Year : Month : Day).

          -

          The following example creates the datepicker-styled Datetime and adds it in the conform.

          - -
          -// Add a datepicker style Datetime component
          -datetime = elm_datetime_add(ad->win);
          -evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5);
          -evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, 1.0);
          -elm_object_style_set(datetime, "datepicker_layout");
          -evas_object_show(datetime);
          -
          -elm_object_content_set(ad->conform, datetime);
          -
          - -

          Creating a Time Picker

          -

          Use the elm_datetime component to add a time picker style (Hour(12) : Min : AM/PM, or Hour(24) : Min).

          -

          The following example creates the timepicker-styled Datetime and adds it in the conform.

          - -
          -// Add a timepicker style Datetime component
          -datetime = elm_datetime_add(ad->win);
          -evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5);
          -evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, 1.0);
          -elm_object_style_set(datetime, "timepicker_layout");
          -evas_object_show(datetime);
          -
          -elm_object_content_set(ad->conform, datetime);
          -
          - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/ecore_animation_n.htm b/org.tizen.ui.guides/html/native/efl/ecore_animation_n.htm deleted file mode 100755 index 944e05c..0000000 --- a/org.tizen.ui.guides/html/native/efl/ecore_animation_n.htm +++ /dev/null @@ -1,451 +0,0 @@ - - - - - - - - - - - - - Ecore Animations - - - - - -
          - -

          Ecore Animations

          - -

          Ecore provides a facility for animations called Ecore_Animator. Ecore animators use the Ecore main loop for creating animations, running a specific action on each tick of a timer in the main loop.

          - -

          To create an Ecore animation:

          -
            -
          1. Determine the duration of the animation.
          2. -
          3. Define a callback function that performs the animation with that duration.
          4. -
          - -

          To use Ecore animators in your application, you must include the <Ecore.h> file. This file is included by default if you are already using the <Elementary.h> file in your application. You then declare an Ecore_Animator* variable and use the variable in the ecore_animator_* functions.

          - -

          The following example shows how to create a simple animation with a finite duration:

          - -
          -static Eina_Bool
          -_do_animation(void *data, double pos)
          -{
          -   evas_object_move(data, 100 * pos, 100 * pos);
          -   // Do some more animating...
          -}
          -ecore_animator_timeline_add(2, _do_animation, my_evas_object);
          -
          - -

          In the above example, we create a linear transition to move my_evas_object from position (0,0) to position (100,100) in 2 seconds.

          - -

          Creating an Animation with a Finite Duration

          - -

          Most of the time, you will want to create animations that last for a predefined time.

          - -

          The ecore_animator_timeline_add() function allows you to define an animator that is automatically deleted after the animation is finished:

          - -
          ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data)
          - -
            -
          • The first argument is the duration of the animation in seconds. The duration is not affected by frame rate.
          • -
          • The second argument is the callback function that performs the animation.
          • -
          • The third argument is the parameter passed to the callback function. This is usually the Evas object to animate.
          • -
          - - - - - - - - - - -
          Note
          The callback function can return ECORE_CALLBACK_RENEW to keep the animator running or ECORE_CALLBACK_CANCEL to stop the animator and have it be deleted automatically at any time. The callback function is also passed a timeline position parameter with a value between 0.0 (start) to 1.0 (end) to indicate where along the timeline the animator is running.
          - -

          The following example performs a linear horizontal translation of 500 pixels in 8 seconds:

          -
          -static Eina_Bool
          -_my_animation(void *data, double pos)
          -{
          -   Evas_Object *obj = data; // Get the target object
          -   int x, y, w, h; // Target object geometry
          -   evas_object_geometry_get(obj, &x, &y, &w, &h); // Get current object position and size attributes
          -   evas_object_move(obj, 500 * pos, y); // Linear translation of the Evas object
          -}
          -ecore_animator_timeline_add(8, _my_animation, my_evas_object);
          -
          - -

          Position Mappings

          - -

          The Ecore_Pos_Map position mappings are used to define the evolution of a given position in accordance with the desired effects. The value ranges from 0.0 to 1.0 on a given timeline. This position variation allows you to apply dynamic changes to any attribute of your Evas object, such as position, width, height, scale, angle, and color.

          - -

          Ecore supports the following position mappings (with the listed v1 and v2 parameters):

          - -
            -
          • ECORE_POS_MAP_LINEAR: linear 0.0 - 1.0 -
              -
            • v1: not used
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_ACCELERATE: start slow, then speed up -
              -
            • v1: not used
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_DECELERATE: start fast, then slow down -
              -
            • v1: not used
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_SINUSOIDAL: start slow, speed up, then slow down at the end -
              -
            • v1: not used
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_ACCELERATE_FACTOR: start slow, then speed up -
              -
            • v1: power factor: 0.0 is linear, 1.0 is standard acceleration, 2.0 is a much more pronounced acceleration (squared), 4.0 is cubed, and so on
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_DECELERATE_FACTOR: start fast, then slow down -
              -
            • v1: power factor: 0.0 is linear, 1.0 is standard deceleration, 2.0 is a much more pronounced deceleration (squared), 3.0 is cubed, and so on
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_SINUSOIDAL_FACTOR: start slow, speed up, then slow down at the end -
              -
            • v1: power factor: 0.0 is linear, 1.0 is a standard sinusoidal, 2.1 is a much more pronounced sinusoidal (squared), 3.0 is cubed, and so on
            • -
            • v2: not used
            • -
            -
          • -
          • ECORE_POS_MAP_DIVISOR_INTERP: start at gradient * v1, interpolated via power of v2 curve -
              -
            • v1: multiplication factor for gradient
            • -
            • v2: curve value
            • -
            -
          • -
          • ECORE_POS_MAP_BOUNCE: start at 0.0, then "drop" like a ball bouncing to the ground at 1.0, and bounce v2 times, with a decay factor of v1 -
              -
            • v1: bounce decay factor
            • -
            • v2: number of bounces
            • -
            -
          • -
          • ECORE_POS_MAP_SPRING: start at 0.0, then "wobble" like a spring until rest position at 1.0, and wobble v2 times, with a decay factor of v1 -
              -
            • v1: wobble decay factor
            • -
            • v2: number of wobbles
            • -
            -
          • -
          - -

          Figure: Position mappings

          -

          Position mappings

          - -

          Using Position Mappings

          -

          When using the animation callback function, the animator passes a timeline position parameter with a value between 0.0 (start) and 1.0 (end) to indicate where along the timeline the animator is running.

          - -

          If you want to create a non-linear animation, map the position value to one of several curves and mappings:

          -
          ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2)
          -
            -
          • The first argument is the current position value, which ranges from 0.0 to 1.0.
          • -
          • The second argument is the position mapping you want to apply.
          • -
          • The third argument is the first parameter (v1) to pass to the position mapping.
          • -
          • The fourth argument is the second parameter (v2) to pass to the position mapping.
          • -
          - - - - - - - - - - -
          Note
          The v1 and v2 arguments are specific to the chosen position mapping. For example, if you are using ECORE_POS_MAP_BOUNCE, v1 represents the bouncing level and v2 the number of bounces.
          - -

          The following example performs a transition that bounces 7 times, diminishing by a factor of 1.8 over 5 seconds:

          - -
          static Eina_Bool
          -_my_animation_callback(void *data, double pos)
          -{
          -   Evas_Object *obj = data; // Get the target object
          -   int x, y, w, h; // Target object geometry
          -   double frame = pos; // Actual position variation
          -   // Get frame relative position depending on desired effect
          -   frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.8, 7);
          -   evas_object_geometry_get(obj, &x, &y, &w, &h); // Get current object position and size attributes
          -   evas_object_move(obj, x, 600 * frame); // Move the Evas object according to desired effect
          -
          -   return EINA_TRUE;
          -}
          -ecore_animator_timeline_add(5, _my_animation_callback, my_evas_object);
          - -

          Creating an Infinite Animation

          - -

          If you want the animation to run for an unspecified amount of time, use the ecore_animator_add() function. This function works the same way as the ecore_animation_timeline_add() function, except its interval is based on frame rate. Using frame rate as the basis benefits performance, especially if you define multiple animations, since you may want to have a different timer for each callback function.

          - -
          -ecore_animator_add(Ecore_Task_Cb func, const void *data)
          -
          - -
            -
          • The first argument is the callback function that performs the animation.
          • -
          • The second argument is the parameter passed to the callback function. This is usually the Evas object to animate.
          • -
          - - - - - - - - - - -
          Note
          The function returns a pointer to an Ecore_Animator object, which you can use to adjust the animation.
          - -

          The following example creates a rectangle sliding from left to right and back again. When the rectangle hits one edge of the screen, it changes direction.

          - -
          static Eina_Bool
          -_slide_back_and_forth(void *data)
          -{
          -   typedef enum {LEFT, RIGHT} direction_t; // Direction datatype
          -   static int x = 0; // Initial position
          -   static direction_t direction = RIGHT; // Initial direction
          -   if (x >= 250)
          -      direction = LEFT; // Change direction
          -   else if (x <= 0)
          -      direction = RIGHT; // Change direction
          -   if (direction == RIGHT)
          -      evas_object_move(data, ++x, 350); // Slide to right
          -   else if (direction == LEFT)
          -      evas_object_move(data, --x, 350); // Slide to left
          -
          -   return EINA_TRUE;
          -}
          -int
          -main(int argc, char *argv[])
          -{
          -   // Declarations
          -
          -   // Ecore Evas init
          -
          -   // Draw Evas objects
          -
          -   // Animations go here
          -   anim = ecore_animator_add(_slide_back_and_forth, rectangle);
          -   // Ecore main loop
          -
          -   // Free memory
          -}
          - - - - - - - - - - -
          Note
          To use this code, you have to merge it with the Ecore transition example above.
          - -

          Chaining Animations

          - -

          You may sometimes want to delay animating an object. This can be useful if, for example, you want to start an animation only after another one has finished.

          - -

          You can simply set a delay to the second animation equal to the duration of the first animation:

          - -
          -static int runtime = 5;
          -static int delay = runtime;
          -static Eina_Bool
          -_start_fold_animation(void *data)
          -{
          -   ecore_animator_timeline_add(runtime, _fold_animation, data);
          -
          -   return EINA_FALSE;
          -}
          -static Eina_Bool
          -_start_unfold_animation(void *data)
          -{
          -   ecore_animator_timeline_add(runtime, _unfold_animation, data);
          -
          -   return EINA_FALSE;
          -}
          -_start_fold_animation(my_evas_object);
          -ecore_timer_add(delay, _start_unfold_animation, my_evas_object);
          -
          - -

          Pausing and Resuming Animations

          - -

          You can pause and resume Ecore animations. To pause a running animation, use the ecore_animator_freeze() function:

          - -
          ecore_animator_freeze(Ecore_Animator *animator)
          - -

          The parameter is the Ecore_Animator to pause.

          - -

          To resume the paused animation, use the ecore_animator_thaw() function:

          - -
          ecore_animation_thaw(Ecore_Animator *animator)
          - -

          The parameter is the Ecore_Animator to resume.

          - -

          The following example pauses a transition after 5 seconds and resumes it after 5 more seconds:

          - -
          -static Eina_Bool
          -_freeze_animation(void *data)
          -{
          -   ecore_animator_freeze(data);
          -
          -   return EINA_FALSE;
          -}
          -static Eina_Bool
          -_thaw_animation(void *data)
          -{
          -   ecore_animator_thaw(data);
          -
          -   return EINA_FALSE;
          -}
          -ecore_timer_add(5, _freeze_animation, animator);
          -ecore_timer_add(10, _thaw_animation, animator);
          -
          - -

          Freeing Up Memory

          - -

          When you create an animation that does not have a timeout, you will have to manually free up the memory allocated to the Ecore_Animator object. By comparison, if the animation has a timeout, Ecore implements the mechanisms to automatically delete the animator from the list of pointers: When your animation callback returns 0 or ECORE_CALLBACK_CANCEL, the animator manager takes care of freeing up the allocated memory.

          - -

          To manually free up the memory, delete the pointer by using the ecore_animator_del() function:

          - -
          ecore_animator_del(Ecore_Animator *animator)
          - -

          The argument is the Ecore_Animator whose memory allocation to free up.

          - -

          Regardless of the type of animation, it is good practice to always ensure that the allocated memory is freed up before the program exits:

          - -
          if (animator != NULL)
          -   ecore_animator_del(animator);
          - -

          Frametime

          -

          In most cases, you will want to use the default timer ECORE_ANIMATOR_SOURCE_TIMER. This timer ticks every "frametime" seconds and allows you to perform transitions within a predefined timeline. The timer uses the system clock to tick over every Nth second, with the default being 1/30th of a second.

          - -

          To tweak performance, you can change the frametime value:

          - -
          ecore_animator_frametime_set(double frametime)
          - -

          The argument is the new frametime value.

          - - - - - - - - - - -
          Note
          Too small a value can cause performance issues, whereas too high a value can cause your animation to seem jerky.
          - -

          If you want to get the current frametime value, use the ecore_animator_frametime_get() function.

          - -

          Custom Timer

          - -

          You may want to specify a custom timer to match your animation to third-party events. For example, the filling speed of a progress bar will mainly depend on the time it takes for a task to complete and the velocity at which the remaining time estimation evolves. This kind of animation requires you to use a custom timer.

          - -

          To use a custom timer, first set ECORE_ANIMATOR_SOURCE_CUSTOM as the timer source, and then drive the timer based on an input tick source (such as another application via IPC or a vertical blanking interrupt):

          - -
          ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data)
          - -

          The first argument is the callback function to call on the tick start. The second argument is the data to pass to the callback function.

          - -
          ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data)
          - -

          The first argument is the callback function to call on the tick end. The second argument is the data to pass to the callback function to set the functions that will be called to start and stop the ticking source.

          - -

          Next, trigger a tick over one frame:

          - -
          ecore_animator_custom_tick(void)
          - -

          The following example supposes a progress bar that will be refreshed every time some progress occurs:

          - -
          ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM);
          -void _on_progress_update()
          -{
          -   // Called when some progress occurs
          -   ecore_animator_custom_tick(); // Tick (next frame in progress bar animation)
          -}
          - -

          Finally, to get the current animator source, use the ecore_animator_source_get() function.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/ecore_animation_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/ecore_animation_tutorial_n.htm deleted file mode 100755 index dcd1204..0000000 --- a/org.tizen.ui.guides/html/native/efl/ecore_animation_tutorial_n.htm +++ /dev/null @@ -1,417 +0,0 @@ - - - - - - - - - - - - - - Creating Ecore Animations - - - - - - -
          -

          Creating Ecore Animations

          - - -

          This tutorial demonstrates how you can use Ecore animators to simplify the creation of animations. Using Ecore animators, you can manually create your own animations by changing and manipulating Evas object attributes. Ecore animators work like timers, running callback functions over a given duration (an animation timeline).

          - -

          Setting Up the Application

          - -

          In this part of the tutorial, we create a simple application that manipulates and animates an Evas object. We use a "Basic UI Application" as the basis for the application.

          -

          First, we set up the UI components we are going to use in the application:

          - -
          typedef struct appdata 
          -{
          -   // Main window
          -   Evas_Object *win;
          -   // Application title
          -   Evas_Object *label;
          -
          -   // Buttons
          -   Evas_Object *bt1;
          -   Evas_Object *bt2;
          -   Evas_Object *bt3;
          -
          -   // Animation target
          -   Evas_Object *target;
          -} appdata_s;
          -
          - -

          We then create the actual UI components in the create_base_gui() function, starting with the main window and application title:

          - -
          // Main window
          -ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -if (elm_win_wm_rotation_supported_get(ad->win)) 
          -{
          -   int rots[4] = { 0, 90, 180, 270 };
          -   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          -}
          -
          -evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -
          -// Application title
          -ad->label = elm_label_add(ad->win);
          -elm_object_text_set(ad->label, "Ecore Animator Tutorial");
          -evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(ad->win, ad->label);
          -evas_object_show(ad->label);
          -
          - -

          Next, we create the animation target, which is an Evas object of type Elm_Image. The image that is used in the source code is stored in the res/images folder of the application. The image that is used in the EDC file is stored in the edje/images folder.

          - -
          // Animation target
          -// Setting the image path
          -char buf[PATH_MAX];
          -snprintf(buf, sizeof(buf), "/opt/usr/apps/%s/res/images/tizen-logo.png", PACKAGE);
          -// Adding the image
          -ad->target = elm_image_add(ad->win);
          -// Setting the image path
          -if (!elm_image_file_set(ad->target, buf, NULL))
          -   printf("error: could not load image \"%s\"\n", buf);
          -evas_object_size_hint_weight_set(ad->target, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -// Moving the image
          -evas_object_move(ad->target, 130, 100);
          -// Resizing the image
          -evas_object_resize(ad->target, 200, 100);
          -// Showing the image
          -evas_object_show(ad->target);
          -
          - -

          All images are available in the /opt/usr/apps/<PACKAGE_NAME>/res/images folder of the application. The package name is defined at the begin of the application code:

          - -
          #if !defined(PACKAGE)
          -#define PACKAGE "org.tizen.ecoreanimator"
          -#endif
          -
          - -

          The image path is set by calling the elm_image_file_set() function. This function takes as arguments the ad->target Evas object and the path of the image file, built with the snprintf() function and stored in a buffer.

          - -
          // Setting the image path
          -char buf[PATH_MAX];
          -snprintf(buf, sizeof(buf), "/opt/usr/apps/%s/res/images/tizen-logo.png", PACKAGE);
          -// Adding the image
          -ad->target = elm_image_add(ad->win);
          -// Setting the image path
          -if (!elm_image_file_set(ad->target, buf, NULL))
          -   printf("error: could not load image \"%s\"\n", buf);
          -evas_object_size_hint_weight_set(ad->target, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          - -

          The remaining code moves and resizes the image:

          - -
          //Moving the image
          -evas_object_move(ad->target, 130, 100);
          -//Resizing the image
          -evas_object_resize(ad->target, 200, 100);
          -//Showing the image
          -
          - -

          Creating a Rotation Effect

          - -

          After the animation target is created, we can create the first button and the associated rotation animation:

          - -
          // Button 1
          -ad->bt1 = elm_button_add(ad->win);
          -elm_object_text_set(ad->bt1, "Rotate");
          -evas_object_size_hint_weight_set(ad->bt1, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_move(ad->bt1, 25, 0);
          -evas_object_resize(ad->bt1, 90, 70);
          -evas_object_smart_callback_add(ad->bt1, "clicked", _btn_rotate_cb, ad);
          -evas_object_show(ad->bt1);
          -
          - -

          We create the button for triggering the rotation effect. The button is placed and resized, and associated with the _btn_rotate_cb() callback function. This callback function calls the animation on the animation target.

          - -
          static void _btn_rotate_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   ecore_animator_timeline_add(1, _do_rotate, ad->target);
          -}
          -
          - -

          In this callback function, we create an Ecore animator timeline using the ecore_animator_timeline_add() function. This function adds an animator that runs for a limited time: we run the _do_rotate() animation callback function for 1 second on the ad->target Evas object.

          - -

          Next, we write the animation callback function that actually runs the animation. This callback is an Ecore_Timeline_Cb function, meaning it returns an Eina_Bool value and takes as arguments some data and the current position along the animation timeline (pos).

          - -

          To create the rotation animation, we use an Evas Map. The map handles the necessary map points and allows you to manipulate the target Evas object on the X, Y, and Z axes.

          - -
          static Eina_Bool
          -_do_rotate(void *data, double pos)
          -{
          -   // Get the animation target
          -   Evas_Object *obj = data;
          -   // Declaration of an `Evas_Map`
          -   Evas_Map *m;
          -   // Variables to store the target size and position
          -   int x, y, w, h;
          -
          -   // Getting the size and position of the target
          -   evas_object_geometry_get(obj, &x, &y, &w, &h);
          -   // Creation of an `Evas_Map` of 4 points
          -   m = evas_map_new(4);
          -   // Populate source and destination map points to match exactly object.
          -   evas_map_util_points_populate_from_object(m, obj);
          -   // Create a rotation of 360° with x+(w/2) "x" center and y +(h/2) "y" center.
          -   evas_map_util_rotate(m, 360.0 * pos, x + (w / 2), y + (h / 2));
          -   // Setting the object to "animate" in the `Evas_Map`
          -   evas_object_map_set(obj, m);
          -   // Starting the Animation
          -   evas_object_map_enable_set(obj, EINA_TRUE);
          -   // Free used memory
          -   evas_map_free(m);
          -
          -   return EINA_TRUE;
          -}
          -
          - -

          In the animation callback function, we first declare the Evas Map. To implement the rotation, we need to set an X and Y center, so we create 4 integer variables to store the size and position of the target. This information is provided by the evas_object_geometry_get() function, which returns the X and Y coordinates and the weight and height of the target Evas object. Now we have all the required data to build the animation.

          - -

          We create an Evas Map consisting of four points, and we populate these points with the animation target:

          - -
          // Creation of an Evas_Map of 4 points
          -m = evas_map_new(4);
          -// Populate source and destination map points to match the object.
          -evas_map_util_points_populate_from_object(m, obj);
          -
          - -

          Now we can define the rotation using the evas_map_util_rotate() function:

          - -
          // Create a rotation of 360° with x+(w/2) "x" center and y +(h/2) "y" center.
          -evas_map_util_rotate(m, 360.0 * pos, x + (w / 2), y + (h / 2));
          -
          - -

          The animation callback function will be called at several points along the timeline, which is why we multiply the rotation angle (360°) by the timeline position (pos) to get the actual animation angle. If we do not do this, we will never see the animation take place. We then join the target object to the map and run the animation:

          - -
          // Setting the object to "animate" in the Evas Map
          -evas_object_map_set(obj, m);
          -// Starting the Animation
          -evas_object_map_enable_set(obj, EINA_TRUE);
          -
          - -

          Each call to the animation callback function will rotate the object (360 * timeline position) degrees.

          - -

          Finally, we free up the memory allocated to the Evas Map:

          - -
          // Free used memory
          -evas_map_free(m);
          -
          - -

          Creating a Zoom Effect

          - -

          The next animation is a zoom, for which we also use an Evas Map.

          - -

          First, we create the button in the create_base_gui() function:

          - -
          // Button 2
          -ad->bt2 = elm_button_add(ad->win);
          -elm_object_text_set(ad->bt2, "Zoom");
          -evas_object_size_hint_weight_set(ad->bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_move(ad->bt2, 315, 0);
          -evas_object_resize(ad->bt2, 90, 70);
          -evas_object_smart_callback_add(ad->bt2, "clicked", _btn_zoom_cb, ad);
          -evas_object_show(ad->bt2);
          -
          - -

          We then create the button callback function with a new timeline:

          - -
          static void _btn_zoom_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   ecore_animator_timeline_add(1, _do_zoom, ad->target);
          -}
          -
          - -

          Next, we create the _do_zoom() animation callback function, which is almost identical to the _do_rotate() callback function, except that we use the evas_map_util_zoom() function to create the animation:

          - -
          static Eina_Bool
          -_do_zoom(void *data, double pos)
          -{
          -   Evas_Object *obj = data;
          -   Evas_Map *m;
          -   int x, y, w, h;
          -
          -   evas_object_geometry_get(obj, &x, &y, &w, &h);
          -   m = evas_map_new(4);
          -   evas_map_util_points_populate_from_object(m, obj);
          -   evas_map_util_zoom(m, 2 * pos, 2 * pos, x , y);
          -   evas_object_map_set(obj, m);
          -   evas_object_map_enable_set(obj, EINA_TRUE);
          -   evas_map_free(m);
          -
          -   return EINA_TRUE;
          -}
          -
          - -

          The evas_map_util_zoom() function takes the following arguments:

          - -
            -
          • The map to change
          • -
          • The horizontal zoom factor
          • -
          • The vertical zoom factor
          • -
          • The horizontal position (X coordinate) of the zooming center
          • -
          • The vertical position (Y coordinate) of the zooming center
          • -
          - -

          Here, we use a horizontal and vertical zoom factor of 2, and the X and Y coordinates of the target as the horizontal and vertical center coordinates.

          - -

          The _do_zoom() callback function is called at several points along the animation timeline, which is why we multiply the horizontal and vertical zoom factor values by the timeline position. Each call will zoom more than the previous one, thereby creating the animation effect.

          - -

          Creating a 3D Rotation Effect

          - -

          The last animation is a 3D rotation. For this one, we are going to rotate the Evas object on all three axes (X, Y, Z).

          - -

          First, we create the button and its callback function:

          - -
          // Button 3
          -ad->bt3 = elm_button_add(ad->win);
          -elm_object_text_set(ad->bt3, "3D");
          -evas_object_size_hint_weight_set(ad->bt3, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_move(ad->bt3, 170, 0);
          -evas_object_resize(ad->bt3, 90, 70);
          -evas_object_smart_callback_add(ad->bt3, "clicked", _btn_3d_cb, ad);
          -evas_object_show(ad->bt3);
          -
          - -
          static void _btn_3d_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   ecore_animator_timeline_add(1, _do_3d, ad->target);
          -}
          -
          - -

          Next, we create the _do_3d() animation callback function, which is very similar to the rotate and zoom callback functions. To create the animation, we use the evas_map_util_3d_rotate() function, which allows you to rotate any Evas object on all three axes.

          - -
          static Eina_Bool
          -_do_3d(void *data, double pos)
          -{
          -   Evas_Object *obj = data;
          -   Evas_Map *m;
          -   int x, y, w, h;
          -
          -   evas_object_geometry_get(obj, &x, &y, &w, &h);
          -   m = evas_map_new(4);
          -   evas_map_util_points_populate_from_object(m, obj);
          -   evas_map_util_3d_rotate(m, pos * 360, pos * 360, pos * 360, x + (w / 3), y + 60, 0);
          -   evas_object_map_set(obj, m);
          -   evas_object_map_enable_set(obj, EINA_TRUE);
          -   evas_map_free(m);
          -
          -   return EINA_TRUE;
          -}
          -
          - -

          The evas_map_util_3d_rotate() function takes the following arguments:

          - -
            -
          • The map to change
          • -
          • The angle (0-360°) to rotate around the X axis
          • -
          • The angle (0-360°) to rotate around the Y axis
          • -
          • The angle (0-360°) to rotate around the Z axis
          • -
          • The X coordinate of the rotation center
          • -
          • The Y coordinate of the rotation center
          • -
          • The Z coordinate of the rotation center
          • -
          - -

          Here, we rotate 360 degrees around each axis. The horizontal (X) rotation center is the X position of the target plus its width divided by 2. The vertical (Y) rotation center is the Y position of the target plus 60. The Z rotation center is 0.

          - -

          As with the rotation and zoom animations, we multiply the angles by the timeline position to gently rotate the target on each call to the _do_3d() callback function along the timeline.

          - -

          Creating Drop and Bounce Effects

          - -

          To finish, we add drop and bounce effects to our buttons at application start. To do this, we create one timeline per button after creating the buttons in the create_base_gui() function:

          - -
          ecore_animator_timeline_add(2, _do_drop, ad->bt1);
          -ecore_animator_timeline_add(2.3, _do_drop, ad->bt2);
          -ecore_animator_timeline_add(2.5, _do_drop, ad->bt3);
          -
          - -

          We call the same _do_drop() animation callback function for each timeline. In this callback, instead of using an Evas Map, we simply change the position of the target using the evas_object_move() function:

          - -
          static Eina_Bool
          -_do_drop(void *data, double pos)
          -{
          -   Evas_Object *obj = data;
          -   int x, y, w, h;
          -   double frame = pos;
          -   frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 2, 4);
          -
          -   evas_object_geometry_get(obj, &x, &y, &w, &h);
          -   evas_object_move(obj, x, 600 * frame);
          -
          -   return EINA_TRUE;
          -}
          -
          - -

          To get the bounce effect, we use the ecore_animator_pos_map() function, which maps an input position from 0.0 to 1.0 along the timeline to a position on a different curve. The curve can be of different types, such as LINEAR, SINUSOIDAL, and BOUNCE. This function takes the following arguments:

          - -
            -
          • The input position to map
          • -
          • The mapping to use (LINEAR, SINUSOIDAL, and so on)
          • -
          • v1, which is the first parameter used by the mapping
          • -
          • v2, which is the second parameter used by the mapping
          • -
          - -

          The ECORE_POS_MAP_BOUNCE map we use starts at 0.0, then drops like a ball bouncing to the ground at 1.0, bouncing v2 times with a decay factor of v1. Here, we bounce 4 times with a decay factor of 2:

          - -
          frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 2, 4);
          -
          - -

          This frame is used in the move function to create the animation. The value increases on each _do_drop() call along the timeline, which produces a nice drop of the buttons from their initial position to 600 pixels on the vertical axis.

          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/edc_optimization_n.htm b/org.tizen.ui.guides/html/native/efl/edc_optimization_n.htm deleted file mode 100755 index a7aa126..0000000 --- a/org.tizen.ui.guides/html/native/efl/edc_optimization_n.htm +++ /dev/null @@ -1,556 +0,0 @@ - - - - - - - - - - - - - - Optimizing EDC - - - - - - -
          -

          Optimizing EDC

          - - -

          To optimize EDC:

          - - - -

          Removing Unnecessary Parts

          -

          When you create EDC, there can be obsolete and unnecessary parts. Since they have an effect on performance, remove them.

          - - - - - - - - - - - - - - - -
          BeforeAfter
          -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "bg";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.relative: 0.0 0.0;
          -               rel2.relative: 1.0 1.0;
          -               color: 255 255 255 255;
          -            }
          -         }
          -         part 
          -         { 
          -            name: "new";
          -            type: RECT;
          -            scale: 1;
          -            mouse_events: 1;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 255 255 0 255;
          -               rel1.relative: 0.2 0.2;
          -               rel2.relative: 0.8 0.8;
          -            }
          -         }
          -         part 
          -         { 
          -            name: "old";
          -            type: RECT;
          -            scale: 1;
          -            mouse_events: 1;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 0 0 0 0;
          -               rel1.relative: 0.5 0.5;
          -               rel2.relative: 1.0 1.0;
          -            }
          -         }
          -      }
          -   }
          -}
          -
          -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "bg";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.relative: 0.0 0.0;
          -               rel2.relative: 1.0 1.0;
          -               color: 255 255 255 255;
          -            }
          -         }
          -         part 
          -         { 
          -            name: "new";
          -            type: RECT;
          -            scale: 1;
          -            mouse_events: 1;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 255 255 0 255;
          -               rel1.relative: 0.2 0.2;
          -               rel2.relative: 0.8 0.8;
          -            }
          -         }  
          -
          -
          -
          -
          -
          -
          -
          -
          -
          -
          -
          -
          -
          -       
          -      }
          -   }
          -}
          -
          - -

          Using Text instead of Textblock

          - -

          The following EDCs lead to the same result. However, use TEXT for the simple texts for high performance apart from using tags or multiple lines.

          - - - - - - - - - - - - - - - -
          BeforeAfter
          -
          -collections 
          -{
          -   styles 
          -   {
          -      style 
          -      { 
          -         name: "text_style";
          -         base: "font="Sans" font_size=30 text_class=entry 
          -         color=#0088AA style=shadow,bottom 
          -         shadow_color=#00000080 valign=0.5 ellipsis=1.0 
          -         wrap=none align=center";
          -      }
          -   }
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "text";
          -            type: TEXTBLOCK;
          -            scale: 1;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               text 
          -               {
          -                  style: "text_style";
          -                  text: "TEXT";
          -               }
          -            }
          -         }
          -      }
          -   }
          -}
          -
          -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      part 
          -      { 
          -         name: "simple";
          -         type: TEXT;
          -         scale: 1;
          -         effect: SHADOW;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            align: 0.5 0.5;
          -            color: 0 136 170 255;
          -            visible: 1;
          -            text 
          -            {
          -               size: 30;
          -               font: "Sans";
          -               text: "TEXT";
          -            }
          -         }
          -      }
          -   }
          -}
          -
          - -

          Compressing Images and Embedding into EDC

          - -

          When you use a fixed image, it is more efficient to call an image within EDC. This save time in accessing the image data and is more suitable for the data size.

          - -
          -collections 
          -{
          -   images 
          -   {
          -      image: "logo.png" COMP;
          -   }
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "logo";
          -            type: IMAGE;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.relative: 0.0 0.0;
          -               rel2.relative: 1.0 1.0;
          -               image.normal: "logo.png";
          -               aspect: 1 1;
          -               aspect_preference: BOTH;
          -            }
          -         }
          -      }
          -   }
          -}
          -
          - -

          Using a Spacer

          -

          When you use a part (such as Padding) which is invisible but has a size, using Spacer is more efficient. Since Spacer is invisible, it does not have the visible and color options.

          - - - - - - - - - - - - - - - - -
          BeforeAfter
          -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "bg";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 255 255 255 255;
          -            }         
          -         }
          -         part 
          -         { 
          -            name: "padding_left_top";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 0 0 0 0;
          -               rel1.to: "bg";
          -               rel2.to:"bg";
          -               rel2.relative: 0.0 0.0;
          -               align: 0.0 0.0;               
          -               min: 100 100;        
          -            }
          -         }
          -         part 
          -         { 
          -            name: "padding_right_bottom";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 0 0 0 0;
          -               rel1.to: "bg";
          -               rel1.relative: 1.0 1.0;
          -               rel2.to:"bg";
          -               align: 1.0 1.0;               
          -               min: 100 100;
          -            }         
          -         }
          -         part 
          -         { 
          -            name: "content";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 255 255 0 255;
          -               rel1.to: "padding_left_top";
          -               rel1.relative: 1.0 1.0;
          -               rel2.to:"padding_right_bottom";
          -               rel2.relative: 0.0 0.0;
          -            }         
          -         }
          -      }
          -   }
          -}
          -
          -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "bg";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 255 255 255 255;
          -            }         
          -         }
          -         part 
          -         { 
          -            name: "padding_left_top";
          -            type: SPACER;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.to: "bg";
          -               rel2.to:"bg";
          -               rel2.relative: 0.0 0.0;
          -               align: 0.0 0.0;               
          -               min: 100 100;
          -            }         
          -         }
          -         part 
          -         { 
          -            name: "padding_right_bottom";
          -            type: SPACER;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.to: "bg";
          -               rel1.relative: 1.0 1.0;
          -               rel2.to:"bg";
          -               align: 1.0 1.0;               
          -               min: 100 100;
          -            }         
          -         }
          -         part 
          -         { 
          -            name: "content";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               color: 255 255 0 255;
          -               rel1.to: "padding_left_top";
          -               rel1.relative: 1.0 1.0;
          -               rel2.to:"padding_right_bottom";
          -               rel2.relative: 0.0 0.0;
          -            }         
          -         }
          -      }
          -   }
          -}
          -
          - -

          Using the Image Border Feature

          - -

          When you use an image, you do not need to use a full size or larger size image. As you can see below, it is much more efficient to scale the image using a border option.

          - - - - - - - - - - - - - - - - - - - -
          BeforeAfter
          -
          -collections 
          -{
          -   images 
          -   {
          -      image: "test.png" COMP;
          -   }
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "test";
          -            type: IMAGE;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.relative: 0.2 0.2;
          -               rel2.relative: 0.8 0.8;
          -               image.normal: "test.png";
          -
          -            }
          -         }
          -      }
          -   }
          -}
          -
          -
          -collections 
          -{
          -   images 
          -   {
          -      image: "test.png" COMP;
          -   }
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "test";
          -            type: IMAGE;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               rel1.relative: 0.2 0.2;
          -               rel2.relative: 0.8 0.8;
          -               image.normal: "test.png";
          -               image.border: 5 5 5 5;
          -            }
          -         }
          -      }
          -   }
          -}
          -

          Image before

          Image after

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edc_part_block_n.htm b/org.tizen.ui.guides/html/native/efl/edc_part_block_n.htm deleted file mode 100755 index 4b2c935..0000000 --- a/org.tizen.ui.guides/html/native/efl/edc_part_block_n.htm +++ /dev/null @@ -1,2080 +0,0 @@ - - - - - - - - - - - - - EDJE Data Collection Reference - - - - - -
          - -

          EDJE Data Collection Reference

          - - - -

          Edje Blocks

          - -

          A typical Edje file starts with the following definitions:

          - -
          -images {}
          -fonts {}
          -color_classes {}
          -styles {}
          -collections 
          -{
          -   sounds 
          -   {
          -      tone: "tone-1" 2300;
          -      tone: "tone-2" 2300;
          -      sample 
          -      {
          -         name: "sound1" RAW;
          -         source: "sound_file1.wav";
          -      }
          -   }
          -   group {}
          -   group {}
          -}
          -
          - -

          To get more details above each sub-block, click on the links inside the collections block above.

          - - - - - - - - - - -
          Note
          This guide is based on original work from Andres Blanc (dresb) andresblanc@gmail.com, it has been heavily expanded and edited since then.
          - -

          Images Block

          - -
          -images 
          -{
          -   image: "filename1.ext" COMP;
          -   image: "filename2.ext" LOSSY 99;
          -   set {}
          -   set {}
          -}
          -
          - -

          The images block is used to list each image file which are used in the theme. If any compression method is used, it is also defined here. Besides the document's root, additional images blocks can be included inside other blocks, usually collections, group, and part. This makes file list maintenance easier when the theme is split among multiple files.

          - -
            -
          • image [image file] [compression method] (compression level) -

            This is included in each image file. The full path to the directory holding the images can be defined later with edje_cc's "-id" option. Available compression methods are:

            -
              -
            • RAW: Uncompressed
            • -
            • COMP: Lossless compression
            • -
            • LOSSY [0-100]: JPEG lossy compression with quality from 0 to 100
            • -
            • USER: Not embedded to the file, refer to the external file instead
            • -
            -
          • -
          - -

          Images.set Block

          - -
          -set 
          -{
          -   name: "image_name_used";
          -   image {}
          -   image {}
          -}
          -
          - -

          The set block is used to define an image with different content depending on their size. Besides the document's root, additional set blocks can be included inside other blocks, normally collections, group, and part. This makes file list maintenance easier when the theme is split among multiple files.

          - -
            -
          • name [image name] -

            Defines the name that refer to this image description.

            -
          • -
          - -

          Images.set.image Block

          - -
          -image 
          -{
          -   image: "filename4.ext" COMP;
          -   size: 51 51 200 200;
          -   border: 0 0 0 0;
          -   border_scale_by: 0.0;
          -}
          -
          - -

          The image block inside a set block defines the characteristic of an image. Every block describes one image and the size rule to use it.

          - -

          For full documentation, see Image.

          - -
            -
          • image [image file] [compression method] (compression level) -

            This is included in each image file. The full path to the directory holding the images can be defined later with edje_cc's -id option. Available compression methods are:

            -
              -
            • RAW: Uncompressed
            • -
            • COMP: Lossless compression
            • -
            • LOSSY [0-100]: JPEG lossy compression with quality from 0 to 100
            • -
            • USER: Not embedded to the file, refer to the external file instead
            • -
            -
          • -
          • size [minw] [minh] [maxw] [maxh] -

            Defines the minimum and maximum size that selects the specified image.

            -
          • -
          • border [left] [right] [top] [bottom] -

            If set, the area (in pixels) of each side of the image is displayed as a fixed size border, from the side to inwards, preventing the corners from being changed on a resize.

            -
          • -
          • border_scale_by [value] -

            If border scaling is enabled then normally the OUTPUT border sizes (e.g. if 3 pixels on the left edge are set as a border, then normally at scale 1.0, those 3 columns are always the exact 3 columns of output, or at scale 2.0 they will be 6 columns, or 0.33 they will merge into a single column). This property multiplies the input scale factor by this multiplier, allowing the creation of supersampled borders to make much higher resolution outputs possible by always using the highest resolution artwork and then runtime scaling it down. Valid values are: 0.0 or bigger (0.0 or 1.0 to turn it off).

            -
          • -
          - -

          Fonts Block

          - -
          -fonts 
          -{
          -   font: "filename1.ext" "fontname";
          -   font: "filename2.ext" "otherfontname";
          -}
          -
          - -

          The fonts block is used to list each font file with an alias used later in the theme. As with the images block, additional fonts blocks can be included inside other blocks.

          - -
            -
          • font [font filename] [font alias] -

            Defines each font file and alias, the full path to the directory containing the font files can be defined with edje_cc's -fd option. -

          • -
          - -

          Data Block

          - -
          -data 
          -{
          -   item: "key" "value";
          -   file: "otherkey" "filename.ext";
          -}
          -
          - -

          This block behaves in the same way as the data block inside the parts, only the use-cases are different: this is useful for data that is for the whole theme, for instance license information, version, authors, and so on.

          - -

          Color_classes Block

          - -
          -color_classes 
          -{
          -   color_class 
          -   {
          -      name: "colorclassname";
          -      color: [0-255] [0-255] [0-255] [0-255];
          -      color2: [0-255] [0-255] [0-255] [0-255];
          -      color3: [0-255] [0-255] [0-255] [0-255];
          -   }
          -}
          -
          - -

          The color_classes block contains a list of one or more color_class blocks. Each color_class allows the designer to name an arbitrary group of colors to be used in the theme, the application can use that name to alter the color values at runtime.

          - -
            -
          • name [color class name] -

            Sets the name for the color class, used as reference by both the theme and the application.

            -
          • - -
          • color [red] [green] [blue] [alpha] -

            The main color.

            -
          • - -
          • color2 [red] [green] [blue] [alpha] -

            Used as outline in text and textblock parts.

            -
          • - -
          • color3 [red] [green] [blue] [alpha] -

            Used as shadow in text and textblock parts.

            -
          • -
          - -

          Styles Block

          - -
          -styles 
          -{
          -   style 
          -   {
          -      name: "stylename";
          -      base: "..default style properties..";
          -      tag: "tagname" "..style properties..";
          -   }
          -}
          -
          - -

          The styles block contains a list of one or more style blocks. A style block is used to create style <tags> for advanced TEXTBLOCK formatting.

          - -
            -
          • name [style name] -

            The name of the style to be used as reference later in the theme.

            -
          • - -
          • base [style properties string] -

            The default style properties that is applied to the complete text. The available tags that can be used in the style property are the following:

            -
              -
            • font
            • -
            • font_size - - - - - - - - - -
              Note
              The font size is a point size, and the size of the rendered text is affected by the ppi information. The system basic ppi is 96, and you can change it on the Emulator menu.
              - -
            • -
            • color
            • -
            • color_class
            • -
            • text_class
            • -
            • ellipsis
            • -
            • wrap
            • -
            • style
            • -
            • valign
            • -
            • align
            • - -
            - -
          • - -
          • tag [tag name] [style properties string] -

            Style to be applied only to text between style <tags>..</tags>. When creating paired tags, like <bold></bold>, a '+' sign must be added at the start of the style properties of the first part (<bold>). If the second part (</bold>) is also defined, a '-' sign must be added to its style properties. This applies only to paired tags; single tags, like <tab>, must not have a starting '+'.

            -
              -
            • br
            • -
            • tab
            • -
            • b
            • -
            • match
            • -
            - -
          • -
          - -

          The following code is the sample of a text style for the text style:

          - -
          -style 
          -{ 
          -   name: "list_text_main";
          -   base: "font=Tizen:style=Regular font_size=30 color=#ffffff ellipsis=1.0";
          -   tag: "br" "\n";\
          -   tag: "ps" "ps";\
          -   tag: "tab" "\t";\
          -   tag: "b" "+ font_weight=Bold";
          -}
          -
          - - - -

          Collections Block

          - -
          -collections 
          -{
          -   base_scale: 1.8;
          -   sounds 
          -   {
          -      tone: "tone-1" 2300;
          -      tone: "tone-2" 440;
          -      sample 
          -      {
          -         name: "sound_file1" RAW;
          -         source: "sound_file1.wav";
          -      }
          -   }
          -   group 
          -   {
          -      name: "groupname";
          -      alias: "anothername;"
          -      min: width height;
          -      max: width height;
          -      parts {}
          -      scripts {}
          -      limits {}
          -      data {}
          -      programs {}
          -   }
          -}
          -
          - -

          The collections block is used to list the groups that compose the theme. Additional collections blocks do not prevent overriding group names.

          - -

          The sounds block contains a list of one or more sound sample and tone items.

          - -

          Base Scale

          - -
            -
          • base_scale: [scale factor] -

            Information about the scale factor in the edc file.

            -
          • -
          - -

          Object scaling must be defined in the config.xml file of this application to show the application in a proper size in other devices. However, the scaling must be based on the scale 1.0 or, if the application is based on another scale, this scale must be defined in the config.xml file. This predefined scale is called the "base scale".

          - -

          The size of a scalable object is multiplied with the device scale value. If the scalable object with the size 10 is created in a device with the scale 1.0, the size of the object is 20 in a device with the scale 2.0, and 40 in a device with the scale 4.0.

          - -

          For more information about supporting multiple screens in one edc, see the Multiple Screen Support guide.

          - - -

          Sounds Block

          - -

          -
            -
          • tone [tone name] [frequency] -

            A sound of the given frequency.

            -
          • -
          - - -

          Sounds.sample Block

          - -

          The sample block defines the sound sample.

          - -

          -
            -
          • name [sample name] [compression type] (quality) -

            Used to include each sound file. The full path to the directory holding the sounds can be defined later with edje_cc's -sd option. Valid types are:

            -
              -
            • RAW: Uncompressed
            • -
            • COMP: Lossless compression
            • -
            • LOSSY [-0.1 - 1.0]: Lossy compression with quality from 0.0 to 1.0
            • -
            • AS_IS: No compression or encoding, write the file information as it is
            • -
            -
          • -
          - -

          -
            -
          • source [file name] -

            The sound source file name (source can be mono/stereo WAV file. Only files with 44.1 KHz sample rate are supported for now).

            -
          • -
          - - -

          Group Block

          - -
          -group 
          -{
          -   name: "nameusedbytheapplication";
          -   alias: "anothername";
          -   min: width height;
          -   max: width height;
          -   parts 
          -   {
          -      <definitions of parts>
          -   }
          -   script 
          -   {
          -      <embryo script>
          -   }
          -   limits 
          -   {
          -      vertical: "limit_name" height_barrier;
          -      horizontal: "limit_name" width_barrier;
          -   }
          -   data 
          -   {
          -      items: "key" "value";
          -      file: "key" "file";
          -   }
          -   programs {}
          -}
          -
          - -

          Group

          - -

          A group block contains the list of parts and programs that compose a given Edje Object.

          - -
            -
          • name [group name] -

            The name that is used by the application to load the resulting Edje object and to identify the group to swallow in a GROUP part. If a group with the same name exists already it will be completely overridden by the new group.

            -
          • - -
          • inherit_only [1 or 0] -

            This flags the group as being used only for inheriting, which will inhibit edje_cc resolving of programs and parts that may not exist in this group, but are located in the group which is inheriting this group.

            -
          • - -
          • inherit [parent group name] -

            Parent group name for inheritance. Group inherit is used to inherit any predefined group and change some property which belongs to part, description, items or program. The child group has the same properties as its parent group. If you specify the type again in an inherited part, it causes an error.

            - - - - - - - - - -
            Note
            When inheriting any parts, descriptions without state names are not allowed.
            -
          • - -
          • script_recursion [1/0] -

            This flag (1 or 0) determines whether to error on unsafe calls when recursively running Embryo programs. For example, running an Embryo script which calls EDC that has a script{} block is unsafe, and the outer-most (first) Embryo stack is corrupted. It is strongly unadvisable to use this flag.

          • - -
          • alias [additional group name] -

            Additional name to be used as an identifier. Defining multiple aliases is supported.

            -
          • - -
          • min [width] [height] -

            The minimum size for the container defined by the composition of the parts. It is not enforced.

            -
          • - -
          • max [width] [height] -

            The maximum size for the container defined by the totality of the parts. It is not enforced.

            -
          • - -
          • broadcast_signal [on/off] -

            Signal gets automatically broadcasted to all sub group parts. Default is "true".

            -
          • - -
          • orientation [AUTO/LTR/RTL] -

            This defines GROUP orientation. It is useful if you want match interface orientation with language.

            -
              -
            • AUTO: Follow system defaults
            • -
            • LTR: Used in Left To Right Languages (Latin)
            • -
            • RTL: Used in Right To Left Languages (Hebrew, Arabic interface)
            • -
            -
          • - -
          • mouse_events [1 or 0] -

            Changes the default value of mouse_events for every part in this group. Default is "1", to maintain compatibility.

            -
          • - -
          • program_source [source name] -

            Change the default value of source for every program in the current group which is declared after this value is set. Defaults to an unset value to maintain compatibility. The name of source can be set on every program, but if the name can be defined in the group level, it reduces the effort to indicate it in every program.

            -
          • -
          - -

          Group.parts

          - -
          -parts 
          -{
          -   part {}
          -   part {}
          -   part {}
          -}
          -
          - -

          The parts group contain one or more part. Each part describes a visual element and has a type: text, image, table, etc.

          - -

          For complete documentation, see the Part Block guide.

          - -

          Group.script

          - -
          -group 
          -{
          -   script 
          -   {
          -      <embryo script>
          -   }
          -   program 
          -   {
          -      script 
          -      {
          -         <embryo script>
          -      }
          -   }
          -}
          -
          - -

          This block is used to inject embryo scripts to a given Edje theme and it functions in two modalities. When it is included inside a program block, the script is executed every time the program is run, on the other hand, when included directly into a group, part, or description block, it is executed once at the load time, in the load order.

          - -

          For more information, see the Program guide.

          - -

          Group.limits

          - -
          -limits 
          -{
          -   vertical: "limit_name" height_barrier;
          -   horizontal: "limit_name" width_barrier;
          -}
          -
          - -

          This block is used to trigger signals when the Edje object is resized.

          -

          -
            -
          • vertical [name] [height barrier] -

            This sends a signal limit,name,over when the object is resized and passes the limit by growing over it. When the object's size is reduced below the limit, signal limit,name,below is sent. This limit is applied on the y axis and is given in pixels.

            -
          • -
          - -

          -
            -
          • horizontal [name] [width barrier] -

            This sends a signal limit,name,over when the object is resized and passes the limit by growing over it. When the object's size is reduced below the limit, signal limit,name,below is sent. This limit is applied on the x axis and is given in pixels.

            -
          • -
          - -

          Group.data

          - -
          -data 
          -{
          -   item: "key" "value";
          -   file: "key2" "somefile";
          -}
          -
          - -

          The data block is used to pass arbitrary parameters from the theme to the application. Unlike the images and fonts blocks, additional data blocks can only be included inside the group block.

          - -
            -
          • items: "key" "value"; -

            Defines a new parameter, the value is the string specified next to it.

            -
          • -
          • file: "key" "file"; -

            Defines a new parameter, the value is the contents of the specified file formatted as a single string of text. This property only works with plain text files.

            -
          • -
          - - - - - - - - - - -
          Note
          For genlist item styles, keys must be texts and icons, respectively for text parts and swallow parts; values must the names of the parts, separated with spaces.
          - -

          Group.programs

          - -
          -programs 
          -{
          -   program {}
          -   program {}
          -   program {}
          -}
          -
          - -

          The programs group contain one or more program.

          - -

          For more information about the program structure, see the Program guide.

          - - -

          Part Block

          - -
          -part 
          -{
          -   // inherit all the fields of another part
          -   inherit: "partname";
          -   // name the part
          -   name: "partname";
          -   // set the part type
          -   type: IMAGE;
          -   // enable mouse events on the part
          -   mouse_events: 0/1;
          -   // repeat mouse events to parts below the current one
          -   repeat_events: 0/1;
          -   ignore_flags: NONE;
          -   // whether the part sizes scale with the edje scaling factor
          -   scale: 0/1;
          -   // whether fully-transparent pixels are taken into account for collision detection
          -   precise_is_inside: 0/1;
          -   // only render the area of the part that coincides with the given part
          -   clip_to: "anotherpart";
          -   // for group/textblock parts: swallow the given group (for textblock: goes below text)
          -   source: "groupname";
          -   // same as source but goes on top of text
          -   source2: "groupname";
          -   // for textblock parts: swallow the given group below the mouse cursor when it hovers over the part
          -   source3: "groupname";
          -   // same as source3 but goes on top of the cursor
          -   source4: "groupname";
          -   // for textblock parts: swallow the given group below text anchors (<a>...</a>)
          -   source5: "groupname";
          -   // same as source5 but goes on to top of the anchor
          -   source6: "groupname";
          -   // add a shadow effect to the part
          -   effect: SOFT_SHADOW (BOTTOM_RIGHT);
          -   // for textblock parts: makes the text editable, possibly with a specific behavior
          -   entry_mode: PASSWORD;
          -   // for textblock parts: change how the tex selection is triggered
          -   select_mode: EXPLICIT;
          -   // for editable textblock parts: where to draw the (blinking) cursor
          -   cursor_mode: UNDER;
          -   // for editable textblock parts: allow multiple lines
          -   multiline: 0/1;
          -   // for textblock parts: accessibility features will be used
          -   access: 0/1;
          -   // no-one uses that
          -   pointer_mode: AUTOGRAB;
          -   use_alternate_font_metrics: 0/1;
          -   // remove the given program; useful when it was inherited
          -   program_remove: "programname";
          -   // remove the given part; useful when it was inherited
          -   part_remove: "partname";
          -   // insert the current part below the given part, as if it were declared before
          -   insert_before: "partname";
          -   // insert the current part above the given part, as if it were declared after
          -   insert_after: "partname";
          -   // define a new part inside this one
          -   part 
          -   {
          -      <part definition>
          -   }
          -   draggable 
          -   {
          -      // confine the current part to the given part
          -      confine: "another part";
          -      // only start drag when it would have moved enough to be outside of the given part
          -      threshold: "another part";
          -      // forward drag events to the given part instead of handling them
          -      events: "another draggable part";
          -      // enable horizontal drag of the part with steps each step_size or with steps_count steps
          -      x: 0/1 <step_size> <steps_count>;
          -      // same as x but vertical
          -      y: 1 0 100;
          -   }
          -   // for box or table parts
          -   box/table 
          -   {
          -      // list of items
          -      items 
          -      {
          -         item 
          -         {
          -            // define item type, can only be GROUP
          -            type: GROUP;
          -            // name the item
          -            name: "name";
          -            // set the source for this item, i.e. its contents
          -            source: "groupname";
          -            // minimum horizontal and vertical item sizes (-1 for expand)
          -            min: -1 -1;
          -            // maximum horizontal and vertical item sizes (-1 for ignore)
          -            max: 100 100;
          -            // set the item padding in pixels
          -            padding: 2 2 2 2;
          -            spread: 1 1;
          -            // set the item alignment
          -            align: 0.5 0.5;
          -            // set a weight hint in the box for the given object
          -            weight: 1 1;
          -            // set the aspect ratio hint
          -            aspect: 1 1;
          -            aspect_mode: BOTH;
          -            // number of columns and rows the item will take
          -            span: 1 1;
          -         }
          -      }
          -   }
          -   description 
          -   {
          -      // inherit another description
          -      inherit: "default" 1.0;
          -      // name the current description
          -      state: "default" 1.0;
          -      // use another part as content of the current "PROXY" part (This description only works in the PROXY part and the current part mirrors the rendering content of the source part)
          -      source: "partname";
          -      // make the part (in)visible (invisible parts emit no signals)
          -      visible: 0/1;
          -      // emit a signal when the given dimension becomes zero or stops being zero
          -      limit: WIDTH;
          -      // horizontal and vertical alignment of the part inside its parent
          -      align: 0.5 0.5;
          -      // set that the part does not change size
          -      fixed: 0/1 0/1;
          -      // set the minimum size for the part
          -      min: 200 200;
          -      // forcibly multiply the minimum sizes by the given factors
          -      minmul: 1.2 1.2;
          -      // set the maximum size for the part
          -      max: 400 400;
          -      // make vertical and horizontal resizes happen in steps
          -      step: 0 0;
          -      // force aspect ratio to be kept between min and max between resizes
          -      aspect: 0.8 1.2;
          -      // the dimension to which the aspect ratio applies
          -      aspect_preference: BOTH;
          -      // use the given color class which can be used to factor font colors
          -      color_class: "colorclassname";
          -      // set the text color
          -      color: 255 0 0 255;
          -      // set the color of the text's shadow
          -      color2: 0 255 0 255;
          -      // set the color of the text's outline
          -      color3: 0 0 255 255;
          -      // define the positions of the top-left (rel1) and bottom-right (rel2) corners
          -      rel1/rel2 
          -      {
          -         // make relative and offset use the given part for their positioning
          -         to: "partname";
          -         // position the corner relative to the part given through to (0.0 being axis beginning, 1.0 being its end)
          -         relative: 0.1 0.1;
          -         // add an absolute offset (in pixels) along each axis
          -         offset: 10 10;
          -         // same as to but only for the x axis
          -         to_x: "partname";
          -         // same as to but only for the y axis
          -         to_y: "partname";
          -      }
          -      // settings specific to parts of type image
          -      image 
          -      {
          -         // name (not path) of the regular image
          -         normal: "imagename";
          -         // image to use while transitioning to the normal image; use several times to create animations
          -         tween: "imagename2";
          -         // set the number of pixels that make up each border of the image, i.e. are not resized when the image is
          -         border: 4 4 4 4;
          -         // hide, strip from its alpha or show (default) the non-border part of the image
          -         middle: DEFAULT;
          -         border_scale_by: 1.0;
          -         // whether to scale the border or not
          -         border_scale: 0/1;
          -         scale_hint: STATIC;
          -         // set how the image is going to fill its part
          -         fill: 
          -         {
          -            // whether to smooth the image when scaling it
          -            smooth: 0/1;
          -            spread: ??;
          -            // whether to scale or tile to fit when resizing the image is needed
          -            type: SCALE/TILE;
          -            // only display the part of the image that is below and to the right of the given point
          -            origin 
          -            {
          -               // specify top-left point as relative coordinates
          -               relative: 0.1 0.1;
          -               // specify top-left point as a pixel offset
          -               offset: 10 10;
          -            }
          -            // specify bottom-right point as relative coordinates
          -            size 
          -            {
          -               relative: 0.1 0.1;
          -               // specify bottom-right point as a pixel offset
          -               offset: 10 10;
          -            }
          -         }
          -      }
          -      // settings specific to parts of type text and textblock
          -      text 
          -      {
          -         // set the part's text
          -         text: "some text";
          -         // set the text's font
          -         font: "Tizen Sans";
          -         // set the text's size
          -         size: 14;
          -         // set the text's class which can be used to factor font and font-size settings
          -         text_class: "classname";
          -         // use the styles defined in stylename
          -         style: "stylename";
          -         // for textblocks in password mode, replace characters to hide with this string
          -         repch: "*";
          -         // set the min and max font sizes allowed when resizing (default is 0 0, i.e. unrestricted)
          -         size_range: 6 18;
          -         // increase font size as much as possible while still remaining in the container for both axis
          -         fit: 0/1 0/1;
          -         // make the min size of the container equal to the min size of the current text (0 0 by default)
          -         min: 0/1 0/1;
          -         // make the max size of the container equal to the max size of the current text (0 0 by default)
          -         max: 0/1 0/1;
          -         // set the vertical and horizontal alignments of the text
          -         align: 0.5 0.5;
          -         // re-use the text of another part
          -         text_source: "partname";
          -         // when text is too long to fit, relative position at which to cut the text and put an ellipsis ("...")
          -         ellipsis: 0.9;
          -      }
          -      // settings specific to parts of type box
          -      box 
          -      {
          -         // set how children while be arranged in the box
          -         layout: horizontal_homogeneous;
          -         // set the vertical and horizontal alignments of box
          -         align: 0.5 0.5;
          -         // set the padding between items of the box
          -         padding: 1 1;
          -         // make the box' min size be the min size of its elements (i.e. make it shrinkable as much as its items)
          -         min: 0 1;
          -      }
          -      table 
          -      {
          -         // make items homogeneous
          -         homogeneous: NONE;
          -         // set the vertical and horizontal alignments of box
          -         align: 0.5 0.5;
          -         // set the padding between items of the box
          -         padding: 1 1;
          -         // make the table's min size be the min size of its elements (i.e. make it shrinkable as much as its items)
          -         min: 0 1;
          -      }
          -      map 
          -      {
          -         perspective: "partname";
          -         light: "partname";
          -         on: 0/1;
          -         smooth: 0/1;
          -         alpha: 0/1;
          -         backface_cull: 0/1;
          -         perspective_on: 0/1;
          -         color: 0/1;
          -         rotation 
          -         {
          -            center: "partname";
          -            x: 45;
          -            y: 120;
          -            z: 90;
          -         }
          -         perspective 
          -         {
          -            zplane: 0/1;
          -            focal: 20;
          -         }
          -         // simpler syntax to create transitions to the current part
          -         link 
          -         {
          -            base: "edje,signal" "edje";
          -         }
          -      }
          -   }
          -}
          -
          - -

          Part

          - -
          -part 
          -{
          -   name: "partname";
          -   type: IMAGE;
          -   mouse_events:  1;
          -   repeat_events: 0;
          -   ignore_flags: NONE;
          -   clip_to: "anotherpart";
          -   source:  "groupname";
          -   pointer_mode: AUTOGRAB;
          -   use_alternate_font_metrics: 0;
          -
          -   dragable {}
          -   items {}
          -   description {}
          -}
          -
          - -

          Parts are used to represent the most basic design elements of the theme, for example, a part can represent a line in a border or a label on a button.

          - -
            -
          • inherit [part name] -

            Copies all attributes except part name from referenced part into current part. All existing attributes, except part name, are overwritten.

            - - - - - - - - - -
            Note
            When inheriting any parts, descriptions without state names are not allowed.
            -
          • - -
          • program_remove [program name] (program name) (program name) ... -

            Removes the listed programs from an inherited group. Removing non-existing programs is not allowed.

            - - - - - - - - - -
            Note
            This breaks program sequences if a program in the middle of the sequence is removed.
            -
          • - -
          • part_remove [part name] (part name) (part name) ... -

            Removes the listed parts from an inherited group. Removing non-existing parts is not allowed.

            -
          • - -
          • name [part name] -

            The part's name is used as reference in the theme's relative positioning system, by programs and in some cases by the application. It must be unique within the group.

            -
          • - -
          • type [TYPE] -

            Sets the type. This is set to IMAGE by default. Valid types are:

            -
              -
            • RECT: Rectangle object in the screen
            • -
            • TEXT: Simple text
            • -
            • IMAGE: Image area
            • -
            • SWALLOW: Area where you can add the object
            • -
            • TEXTBLOCK: Complex text with multiple lines, mark-up elements, and such.
            • -
            • GROUP: Part which can include other groups in the same group.
            • -
            • BOX: Container object as a container. It has a row or column.
            • -
            • TABLE: Container object as a container. It has a row and column.
            • -
            • PROXY: Clone of another part in the same group. It shares the memory of the source part.
            • - -
            • SPACER: Rectangle object, but invisible. Recommended to padding because it does not allocate any memory.
            • - -
            -
          • - -
          • part [part declaration] -

            Nested parts adds hierarchy to Edje. Nested part inherits its location relatively to the parent part. To declare a nested part create a new part within current part declaration. Define parent part name before adding nested parts.

            -
            -part 
            -{
            -   name: "parent_rect";
            -   type: RECT;
            -   description {}
            -   part 
            -   {
            -      name: "nested_rect";
            -      type: RECT;
            -      description {}
            -   }
            -}
            -
            -
          • - -
          • insert_before [another part's name] -

            The part's name which this part is inserted before. One part cannot have both insert_before and insert_after. One part cannot refer more than one by insert_before.

            -
          • - -
          • insert_after [another part's name] -

            The part's name which this part is inserted after. One part cannot have both insert_before and insert_after. One part cannot refer more than one by insert_after.

            -
          • - -
          • mouse_events [1 or 0] -

            Specifies whether the part emits signals, although it is named mouse_events. Disabling it (0) prevents the part from emitting signal. It is set to 1 by default, or to the value set to mouse_events at the group level, if any.

            -
          • - -
          • repeat_events [1 or 0] -

            Specifies whether a part echoes a mouse event to other parts below the pointer (1), or not (0). It is set to 0 by default.

            -
          • - -
          • ignore_flags [FLAG] ... -

            Specifies whether events with the given flags are ignored, i.e., do not emit signals to the parts. Multiple flags must be separated by spaces, the effect is ignoring all events with one of the flags specified. Possible flags are:

            -
              -
            • NONE: Event is handled properly (default value)
            • -
            • ON_HOLD: Event is not handled or passed in this part
            • - -
            -
          • - -
          • scale [1 or 0] -

            Specifies whether the part scales its size with an Edje scaling factor. By default scale is off (0) and the default scale factor is 1.0 which means no scaling. This is used to scale properties such as font size, min/max size of the part, and it can also be used to scale based on DPI of the target device. The reason to be selective is that some parts are scaled well, others are not, so choose what works best.

            -
          • - -
          • pointer_mode [MODE] -

            Sets the mouse pointer behavior for a given part. The default value is AUTOGRAB. Available modes are:

            -
              -
            • AUTOGRAB, when the part is clicked and the button remains pressed, the part is the source of all future mouse signals emitted, even outside the object, until the button is released.
            • -
            • NOGRAB, the effect is limited to the part's container.
            • -
            -
          • - -
          • precise_is_inside [1 or 0] -

            Enables precise point collision detection for the part, which is more resource-intensive. It is disabled by default.

            -
          • - -
          • use_alternate_font_metrics [1 or 0] -

            Only affects text and textblock parts, when enabled Edje uses different size measurement functions. It is disabled by default.

            -
          • - -
          • clip_to [another part's name] -

            Only renders the area of part that coincides with another part's container. Overflowing content is not displayed. Note that the part being clipped to can only be a rectangle part.

            -
          • - -
          • source [another group's name] -

            Only available to GROUP or TEXTBLOCK parts. Swallows the specified group into the part's container if it is a GROUP. If TEXTBLOCK it is used for the group to be loaded and used for selection display UNDER the selected text. source2 is used for on top of the selected text, if source2 is specified.

            -
          • - -
          • source2 [another group's name] -

            Only available to TEXTBLOCK parts. It is used for the group to be loaded and used for selection display OVER the selected text. source is used for under of the selected text, if source is specified.

            -
          • - -
          • source3 [another group's name] -

            Only available to TEXTBLOCK parts. It is used for the group to be loaded and used for cursor display UNDER the cursor position. source4 is used for over the cursor text, if source4 is specified.

            -
          • - -
          • source4 [another group's name] -

            Only available to TEXTBLOCK parts. It is used for the group to be loaded and used for cursor display OVER the cursor position. source3 is used for under the cursor text, if source4 is specified.

            -
          • - -
          • source5 [another group's name] -

            Only available to TEXTBLOCK parts. It is used for the group to be loaded and used for anchors display UNDER the anchor position. source6 is used for over the anchors text, if source6 is specified.

            -
          • - -
          • source6 [another group's name] -

            Only available to TEXTBLOCK parts. It is used for the group to be loaded and used for anchor display OVER the anchor position. source5 is used for under the anchor text, if source6 is specified.

            -
          • - -
          • effect [effect] (shadow direction) -

            Apply the selected outline, shadow, or glow effect to "textblock" (take care that this effect only works for the textblock). The available effects are:

            -
              -
            • PLAIN
            • -
            • OUTLINE
            • -
            • SOFT_OUTLINE
            • -
            • SHADOW
            • -
            • SOFT_SHADOW
            • -
            • OUTLINE_SHADOW
            • -
            • OUTLINE_SOFT_SHADOW
            • -
            • FAR_SHADOW
            • -
            • FAR_SOFT_SHADOW
            • -
            • GLOW
            • -
            - -

            The available shadow directions definitions are (default is BOTTOM_RIGHT):

            -
              -
            • BOTTOM_RIGHT
            • -
            • BOTTOM
            • -
            • BOTTOM_LEFT
            • -
            • LEFT
            • -
            • TOP_LEFT
            • -
            • TOP
            • -
            • TOP_RIGHT
            • -
            • RIGHT
            • -
            -
          • - -
          • entry_mode [mode] -

            Sets the edit mode for a textblock part. The available modes are:

            -
              -
            • NONE: -

              The textblock is non-editable.

            • -
            • PLAIN: -

              The textblock is non-editable, but selectable.

            • -
            • EDITABLE: -

              The textblock is editable.

            • -
            • PASSWORD: -

              The textblock is editable if the Edje object has the keyboard focus and the part has the Edje focus (or selectable always regardless of focus). In the event of password mode, not selectable and all text chars replaced with *'s but editable and pastable.

            • -
            -
          • - -
          • select_mode [mode] -

            Sets the selection mode for a textblock part. The available modes are:

            -
              -
            • DEFAULT, selection mode is what you would expect on any desktop. Press mouse, drag and release to end.
            • -
            • EXPLICIT, this mode requires the application controlling the Edje object has to explicitly begin and end selection modes, and the selection itself is draggable at both ends.
            • -
            -
          • - -
          • cursor_mode [mode] -

            Sets the cursor mode for a textblock part. The available modes are:

            -
              -
            • UNDER, the cursor draws below the character pointed at. That is the default.
            • -
            • BEFORE, the cursor is drawn as a vertical line before the current character, just like many other GUI toolkits handle it.
            • -
            -
          • - -
          • multiline [1 or 0] -

            It causes a textblock that is editable to allow multiple lines for editing.

            -
          • - -
          • access [1 or 0] -

            Specifies whether the part uses accessibility feature (1), or not (0). It is set to 0 by default.

            -
          • -
          - -

          Draggable

          - -
          -dragable 
          -{
          -   confine: "another part";
          -   threshold: "another part";
          -   events:  "another draggable part";
          -   x: 0 0 0;
          -   y: 0 0 0;
          -}
          -
          - -

          When this block is used the part can be dragged around the interface, do not confuse with external drag and drop. By default Edje (and most applications) attempts to use the minimal size possible for a draggable part. If the min property is not set in the description the part is (most likely) set to 0px width and 0px height, thus invisible.

          - -
            - -
          • x [enable/disable] [step] [count] -

            Used to set up dragging events for the X axis. The first parameter is used to enable (1 or -1) and disable (0) dragging along the axis. When enabled, 1 sets the starting point at 0.0 and -1 at 1.0. The second parameter takes any integer and limits movement to values divisible by it, causing the part to jump from position to position. If step is set to 0 it is calculated as width of confine part divided by count.

            -
          • - -
          • y [enable/disable] [step] [count] -

            Used to set up dragging events for the Y axis. The first parameter is used to enable (1 or -1) and disable (0) dragging along the axis. When enabled, 1 sets the starting point at 0.0 and -1 at 1.0. The second parameter takes any integer and limits movement to values divisible by it, causing the part to jump from position to position. If step is set to 0 it is calculated as height of confine part divided by count.

            -
          • - -
          • confine [another part's name] -

            Limits the movement of the dragged part to another part's container. Set a min size for the part, or the dragged object will not show up.

            -
          • - -
          • threshold [another part's name] -

            When set, the movement of the dragged part can only start when it get moved enough to be outside of the threshold part.

            -
          • - -
          • events [another draggable part's name] -

            Causes the part to forward the drag events to another part, thus ignoring them for itself.

            -
          • - -
          - -

          Box/table

          - -

          Items

          - -
          -box/table 
          -{
          -   items 
          -   {
          -      item 
          -      {
          -         type: GROUP;
          -         source: "some source";
          -         min: -1 -1;
          -         max: 100 100;
          -         padding: 1 1 2 2;
          -      }
          -      item 
          -      {
          -         type: GROUP;
          -         source: "some other source";
          -         name: "some name";
          -         align: 1.0 0.5;
          -      }
          -   }
          -}
          -
          - -

          On a BOX part, this block is used to set other groups as elements of the box. These can be mixed with external objects set by the application through the edje_object_part_box*() functions.

          - -
          Item
          - -
            - -
          • type [item type] -

            Sets the type of the object this item holds. The supported type is:

            -
              -
            • GROUP (default)
            • -
            -
          • - -
          • name [name for the object] -

            Sets the name of the object via evas_object_name_set().

            -
          • - -
          • source [another group's name] -

            Sets the group this object is made of.

            -
          • - -
          • min [width] [height] -

            Sets the minimum size hints for this object.

            - - - - - - - - - -
            Note
            Must be -1 to get expand behavior.
            -
          • - -
          • spread [width] [height] -

            Replicates the item in a rectangle of size width x height box starting from the defined position of this item. The default value is 1 1;.

            -
          • - -
          • prefer [width] [height] -

            Sets the preferred size hints for this object.

            -
          • - -
          • max [width] [height] -

            Sets the maximum size hints for this object.

            -
          • - -
          • padding [left] [right] [top] [bottom] -

            Sets the padding hints for this object.

            -
          • - -
          • align [x] [y] -

            Sets the alignment hints for this object.

            -
          • - -
          • weight [x] [y] -

            Sets the weight hints for this object.

            -
          • - -
          • aspect [w] [h] -

            Sets the aspect width and height hints for this object.

            -
          • - -
          • aspect_mode [mode] -

            Sets the aspect control hints for this object. The available hints are:

            -
              -
            • NONE
            • -
            • NEITHER
            • -
            • HORIZONTAL
            • -
            • VERTICAL
            • -
            • BOTH
            • -
            -
          • - -
          • options [extra options] -

            Sets extra options for the object.

            -
          • - -
          • position [col] [row] -

            Sets the position this item has in the table. This is required for parts of type TABLE.

            -
          • - -
          • span [col] [row] -

            Sets how many columns and rows this item uses. The default value is 1 1.

            -
          • - -
          - -

          Description

          - -
          -description 
          -{
          -   inherit: "another_description" INDEX;
          -   state: "description_name" INDEX;
          -   visible: 1;
          -   min: 0 0;
          -   max: -1 -1;
          -   align: 0.5 0.5;
          -   fixed: 0 0;
          -   step: 0 0;
          -   aspect: 1 1;
          -
          -   rel1 
          -   {
          -      ...
          -   }
          -
          -   rel2 
          -   {
          -      ...
          -   }
          -}
          -
          - -

          Every part can have one or more description blocks. Each description is used to define style and layout properties of a part in a given "state".

          - -
            - -
          • inherit [another description's name] [another description's index] -

            Thee description inherits all the properties from the named description. The properties defined in this part override the inherited properties, reducing the amount of necessary code for simple state changes. Note: inheritance in Edje is single level only.

            -
          • - -
          • source [another part's name] -

            Causes the part to use another part's content as the content of this part. This works only with PROXY part.

            -
          • - -
          • state [name for the description] [index] -

            Sets a name used to identify a description inside a given part. Multiple descriptions are used to declare different states of the same part, like "clicked" or "invisible". All state declarations are also coupled with an index number between 0.0 and 1.0. All parts must have at least one description named "default 0.0".

            -
          • - -
          • visible [0 or 1] -

            Takes a Boolean value specifying whether part is visible (1) or not (0). Non-visible parts do not emit signals. The default value is 1.

            -
          • - -
          • limit [mode] -

            Emits a signal when the part size changes from zero or to a zero (limit,width,over, limit,width,zero). By default no signal are emitted. Valid values are:

            -
              -
            • NONE
            • -
            • WIDTH
            • -
            • HEIGHT
            • -
            • BOTH
            • -
            -
          • - -
          • align [X axis] [Y axis] -

            When the displayed object's size is smaller or bigger than its container, this property moves it relatively along both axis inside its container. "0.0" means left/top edges of the object touching container's respective ones, and "1.0" stands for right/bottom edges of the object (on horizontal/vertical axis, respectively). The default value is "0.5 0.5". For a more detailed explanation, see the Align Size Hint.

            -
          • - -
          • fixed [width, 0 or 1] [height, 0 or 1] -

            Sets the minimum size calculation. See edje_object_size_min_calc() and edje_object_size_min_restricted_calc(). This tells the min size calculation routine that this part does not change size in width or height (1 for it does not, 0 for it does), so the routine does not try to expand or contract the part.

            -
          • - -
          • min [width] [height] or SOURCE -

            Sets the minimum size of the state. When min is defined to SOURCE, it looks at the original image size and enforces its minimal size to match at least the original one. The part must be an IMAGE or a GROUP part.

            -
          • - -
          • minmul [width multiplier] [height multiplier] -

            A multiplier forcibly applied to whatever minimum size is only during minimum size calculation.

            -
          • - -
          • max [width] [height] or SOURCE -

            The maximum size of the state. A size of -1.0 means that it is ignored in one direction. When max is set to SOURCE, Edje enforces the part to be not more than the original image size. The part must be an IMAGE part.

            -
          • - -
          • step [width] [height] -

            Restricts resizing of each dimension to values divisible by its value. This causes the part to jump from value to value while resizing. The default value is "0 0" which disables stepping.

            -
          • - -
          • aspect [min] [max] -

            Normally width and height can be resized to any values independently. The aspect property forces the width to height ratio to be kept between the minimum and maximum set. For example, "1.0 1.0" increases the width a pixel for every pixel added to height. The default value is "0.0 0.0" which disables aspect. For a more detailed explanation, see the Min Size Hint .

            -
          • - -
          • aspect_preference [DIMENSION] -

            Set the dimensions to which the "aspect" property applies. Available options are:

            -
              -
            • BOTH
            • -
            • VERTICAL
            • -
            • HORIZONTAL
            • -
            • SOURCE
            • -
            • NONE
            • -
            -

            For a more detailed explanation, see Min Size Hint.

            -
          • - -
          • color_class [color class name] -

            The part uses the color values of the named color_class, these values can be overridden by the "color", "color2" and "color3" properties.

            -
          • - -
          • color [red] [green] [blue] [alpha] -

            Sets the main color to the specified values (between 0 and 255).

            - - - - - - - - - -
            Note
            The textblock part is not affected by the color description. Set the color in the text style.
            - -
          • - -
          • color2 [red] [green] [blue] [alpha] -

            Sets the text shadow color to the specified values (0 to 255).

            -
          • - -
          • color3 [red] [green] [blue] [alpha] -

            Sets the text outline color to the specified values (0 to 255).

            -
          • - -
          - -

          Rel1/rel2

          -
          -description 
          -{
          -   rel1 
          -   {
          -      relative: 0.0 0.0;
          -      offset:     0   0;
          -   }
          -   rel2 
          -   {
          -      relative: 1.0 1.0;
          -      offset:    -1  -1;
          -   }
          -}
          -
          - -

          The rel1 and rel2 blocks are used to define the position of each corner of the part's container. With rel1 being the left-up corner and rel2 being the right-down corner.

          - -
            - -
          • relative [X axis] [Y axis] -

            Moves the corner to a relative position inside the container of the relative "to" part. Values from 0.0 (0%, beginning) to 1.0 (100%, end) of each axis.

            -
          • - -
          • offset [X axis] [Y axis] -

            Affects the corner position a fixed number of pixels along each axis.

            -
          • - -
          • to [another part's name] -

            Positions the corner relatively to another part's container. Setting to "" resets this value for inherited parts.

            -
          • - -
          • to_x [another part's name] -

            Positions the corner relatively to the X axis of another part's container. This affects the first parameter of "relative". Setting to "" resets this value for inherited parts.

            -
          • - -
          • to_y [another part's name] -

            Positions the corner relatively to the Y axis of another part's container. This affects the second parameter of "relative". Setting to "" resets this value for inherited parts.

            -
          • - -
          - -

          Image

          - -
          -description 
          -{
          -   image 
          -   {
          -      normal: "filename.ext";
          -      tween:  "filename2.ext";
          -      tween:  "filenameN.ext";
          -      border:  left right top bottom;
          -      middle:  0/1/NONE/DEFAULT/SOLID;
          -      fill {}
          -   }
          -}
          -
          - -
            - -
          • normal [image's filename] -

            Name of image to be used as previously declared in the images block. In an animation, this is the first and last image displayed. It is required in any image part

            -
          • - -
          • tween [image's filename] -

            Name of an image to be used in an animation loop, an image block can have none, one or multiple tween declarations. Images are displayed in the order they are listed, during the transition to the state they are declared in; the "normal" image is the final state.

            -
          • - -
          • border [left] [right] [top] [bottom] -

            Sets the area (in pixels) of each side of the image is displayed as a fixed size border, from the side -> inwards, preventing the corners from being changed on a resize.

            -
          • - -
          • middle [mode] -

            If border is set, this value tells Edje if the rest of the image (not covered by the defined border) displayed or not or be assumed to be solid (without alpha). The default value is 1/DEFAULT. The available values are:

            -
              -
            • 0 or NONE
            • -
            • 1 or DEFAULT
            • -
            • SOLID (strip alpha from the image over the middle zone)
            • -
            -
          • - -
          • border_scale_by [value] -

            If border scaling is enabled then normally the OUTPUT border sizes (e.g. if 3 pixels on the left edge are set as a border, then normally at scale 1.0, those 3 columns are always exactly 3 columns of output, or at scale 2.0 they are 6 columns, or 0.33 they merge into a single column). This property multiplies the input scale factor by this multiplier, allowing the creation of supersampled borders to make higher resolution outputs possible by always using the highest resolution artwork and then runtime scaling it down. Value can be: 0.0 or bigger (0.0 or 1.0 to turn it off)

            -
          • - -
          • border_scale [0/1] -

            Tells Edje if the border is scaled by the object/global Edje scale factors.

            -
          • - -
          • scale_hint [mode] -

            Sets the evas image scale hint letting the engine more effectively save cached copies of the scaled image if it makes sense. Valid values are:

            -
              -
            • 0 or NONE
            • -
            • DYNAMIC
            • -
            • STATIC
            • -
            -
          • - -
          - -
          Image.fill
          - -
          -image 
          -{
          -   fill 
          -   {
          -      type: SCALE;
          -      smooth: 0-1;
          -      origin {}
          -      size {}
          -   }
          -}
          -
          - -

          The fill method is an optional block that defines the way an IMAGE part is going to be displayed inside its container. It can be used for tiling (repeating the image) or displaying only part of an image. See evas_object_image_fill_set() documentation for more details.

          - -
            - -
          • smooth [0 or 1] -

            The smooth property takes a boolean value to decide if the image will be smoothed on scaling (1) or not (0). The default value is 1.

            -
          • - -
          • spread -
          • - -
          • type [fill type] -

            Sets the image fill type. The part parameter "min" must be set, it is size of tiled image. If parameter "max" set tiled area has the size accordingly "max" values. SCALE is default type. Valid values are:

            -
              -
            • SCALE, image is scaled accordingly the value of the parameters "relative" and "offset" from "origin" and "size" blocks.
            • -
            • TILE, image is tiled accordingly parameters value "relative" and "offset" from "origin" and "size" blocks.
            • -
            -
          • - -
          - -
          Image.fill.origin
          - -
          -image 
          -{
          -   fill 
          -   {
          -      origin 
          -      {
          -         relative: 0.0 0.0;
          -         offset: 0 0;
          -      }
          -   }
          -}
          -
          - -

          The origin block is used to place the starting point, inside the displayed element, that is used to render the tile. By default, the origin is set at the element's left-up corner.

          - -
            - -
          • relative [X axis] [Y axis] -

            Sets the starting point relatively to displayed element's content.

            -
          • -
          • offset [X axis] [Y axis] -

            Affects the starting point a fixed number of pixels along each axis.

            -
          • - -
          - -
          Image.fill.size
          - -
          -image 
          -{
          -   fill 
          -   {
          -      size 
          -      {
          -         relative: 1.0 1.0;
          -         offset: -1 -1;
          -      }
          -   }
          -}
          -
          - -

          The size block defines the tile size of the content that are displayed.

          - -
            - -
          • relative [width] [height] -

            Takes a pair of decimal values that represent the percentage of the original size of the element. For example, "0.5 0.5" represents half the size, while "2.0 2.0" represents the double. The default value is "1.0 1.0".

            -
          • -
          • offset [X axis] [Y axis] -

            Affects the size of the tile a fixed number of pixels along each axis.

            -
          • - -
          - -

          Text

          - -
          -text 
          -{
          -   text: "some string of text to display";
          -   font: "font_name";
          -   size: SIZE;
          -   text_class: "class_name";
          -   fit: horizontal vertical;
          -   min: horizontal vertical;
          -   max: horizontal vertical;
          -   align: X-axis Y-axis;
          -   source: "part_name";
          -   text_source: "text_part_name";
          -   style: "stylename";
          -}
          -
          - - -
            - -
          • text [a string of text, or nothing] -

            Sets the default content of a text part, normally the application is the one changing its value.

            -
          • - -
          • text_class [text class name] -

            Similar to color_class, this is the name used by the application to alter the font family and size at runtime.

            -
          • - -
          • font [font alias] -

            This sets the font family to one of the aliases set up in the "fonts" block. Can be overridden by the application.

            -
          • - -
          • style [the style name] -

            Causes the part to use the default style and tags defined in the "style" block with the specified name.

            -
          • - -
          • repch [the replacement character string] -

            If this is a textblock and is in PASSWORD mode this string is used to replace every character to hide the details of the entry. Normally * is used, but you can use anything you like.

            -
          • - -
          • size [font size in points (pt)] -

            Sets the default font size for the text part. Can be overridden by the application.

            -
          • - -
          • size_range [font min size in points (pt)] [font max size in points (pt)] -

            Sets the allowed font size for the text part. Setting min and max to 0 means that sizing is not restricted. This is also the default value.

            -
          • - -
          • fit [horizontal] [vertical] -

            When any of the parameters is set to 1 Edje resizes the text for it to fit in its container. Both are disabled by default.

            -
          • - -
          • min [horizontal] [vertical] -

            When any of the parameters is enabled (1) it forces the minimum size of the container to be equal to the minimum size of the text. The default value is "0 0".

            -
          • - -
          • max [horizontal] [vertical] -

            When any of the parameters is enabled (1) it forces the maximum size of the container to be equal to the maximum size of the text. The default value is "0 0".

            -
          • - -
          • align [horizontal] [vertical] -

            Changes the position of the point of balance inside the container. The default value is 0.5 0.5.

            -
          • - -
          • source [another TEXT part's name] -

            Causes the part to use the text properties (like font and size) of another part and update them as they change.

            -
          • - -
          • text_source [another TEXT part's name] -

            Causes the part to display the text content of another part and update them as they change.

            -
          • - -
          • ellipsis [point of balance] -

            Balances the text in a relative point from 0.0 to 1.0, this point is the last section of the string to be cut out in case of a resize that is smaller than the text itself. The default value is 0.0.

            -
          • - -
          - - -

          Box

          - -
          -box 
          -{
          -   layout: "vertical";
          -   padding: 0 2;
          -   align: 0.5 0.5;
          -   min: 0 0;
          -}
          -
          - -

          A box block can contain other objects and display them in different layouts, any of the predefined set, or a custom one, set by the application.

          - -
            - -
          • layout [primary layout] (fallback layout) -

            Sets the layout for the box:

            -
              -
            • horizontal (default)
            • -
            • vertical
            • -
            • horizontal_homogeneous
            • -
            • vertical_homogeneous
            • -
            • horizontal_max (homogeneous to the max sized child)
            • -
            • vertical_max
            • -
            • horizontal_flow
            • -
            • vertical_flow
            • -
            • stack
            • -
            • some_other_custom_layout_set_by_the_application -

              Set a custom layout as a fallback. For more information, see edje_box_layout_register(). If an unregistered layout is used, it defaults to horizontal.

            • - -
            -
          • - -
          • align [horizontal] [vertical] -

            Changes the position of the point of balance inside the container. The default value is 0.5 0.5.

            -
          • - -
          • padding [horizontal] [vertical] -

            Sets the space between cells in pixels. The default value is 0 0.

            -
          • - -
          • min [horizontal] [vertical] -

            When any of the parameters is enabled (1) it forces the minimum size of the box to be equal to the minimum size of the items. The default value is 0 0.

            -
          • - -
          - -

          Table

          - -
          -table 
          -{
          -   homogeneous: TABLE;
          -   padding: 0 2;
          -   align: 0.5 0.5;
          -   min: 0 0;
          -}
          -
          - -

          A table block can contain other objects packed in multiple columns and rows, and each item can span across more than one column and/or row.

          - -
            - -
          • homogeneous [homogeneous mode] -

            Sets the homogeneous mode for the table:

            -
              -
            • NONE: default
            • -
            • TABLE: available space is evenly divided between children (which overflows onto other children if too little space is available)
            • -
            • ITEM: size of each item is the largest minimal size of all the items
            • -
            -
          • - -
          • align [horizontal] [vertical] -

            Changes the position of the point of balance inside the container. The default value is 0.5 0.5.

            -
          • - -
          • padding [horizontal] [vertical] -

            Sets the space between cells in pixels. The default value is 0 0.

            -
          • - -
          • min [horizontal] [vertical] -

            When any of the parameters is enabled (1), it forces the minimum size of the table to be equal to the minimum size of the items. The default value is 0 0.

            -
          • - -
          - -

          Map

          - -
          -map 
          -{
          -   perspective: "name";
          -   light: "name";
          -   on: 1;
          -   smooth: 1;
          -   perspective_on: 1;
          -   backface_cull: 1;
          -   alpha: 1;
          -
          -   rotation 
          -   {
          -      ...
          -   }
          -}
          -
          - -
            - -
          • perspective [another part's name] -

            This sets the part that is used as the perspective point for giving a part a 3D look. The perspective point must have a perspective section that provides zplane and focal properties. The center of this part is used as the focal point, thus size, color and visibility are not relevant, just center point, zplane and focal are used. This also implicitly enables perspective transforms.

            -
          • - -
          • light [another part's name] -

            This sets the part that is used as the light for calculating the brightness (based on how directly the part's surface is facing the light source point). Like the perspective point part, the center point is used and zplane is used for the z position (0 being the zero-plane where all 2D objects normally live) and positive values being further away into the distance. The light part color is used as the light color (alpha not used for light color). The color2 color is used for the ambient lighting when calculating brightness (alpha also not used).

            -
          • - -
          • on [1 or 0] -

            This enables mapping for the part. Default is 0.

            -
          • - -
          • smooth [1 or 0] -

            This enables smooth map rendering. This may be linear interpolation, anisotropic filtering or anything the engine decides is smooth. This is a best-effort hint and may not produce precisely the same results in all engines and situations. The default value is 1.

            -
          • - -
          • alpha [1 or 0] -

            This enables alpha channel when map rendering. The default value is 1.

            -
          • - -
          • backface_cull [1 or 0] -

            This enables backface culling (when the rotated part that normally faces the camera is facing away after being rotated etc.). This means that the object are hidden when backface is culled.

            -
          • - -
          • perspective_on [1 or 0] -

            This enables perspective when rotating even without a perspective point object. This uses perspective set for the object itself or for the canvas as a whole as the global perspective with edje_perspective_set() and edje_perspective_global_set().

            -
          • - -
          • color [point] [red] [green] [blue] [alpha] -

            This sets the color of a vertex in the map. Colors are linearly interpolated between vertex points through the map. The default color of a vertex in a map is white solid (255, 255, 255, 255) which means it has no affect on modifying the part pixels. Currently only four points are supported: 0 - Left-Top point of a part. 1 - Right-Top point of a part. 2 - Left-Bottom point of a part. 3 - Right-Bottom point of a part.

            -
          • - -
          - -
          Map.rotation
          - -
          -rotation 
          -{
          -   center: "name";
          -   x: 45.0;
          -   y: 45.0;
          -   z: 45.0;
          -}
          -
          - -

          Rotates the part, optionally with the center on another part.

          - -
            - -
          • center [another part's name] -

            This sets the part that is used as the center of rotation when rotating the part with this description. The part's center point is used as the rotation center when applying rotation around the x, y and z axes. If no center is given, the parts original center itself is used for the rotation center.

            -
          • - -
          • x [X degrees] -

            This sets the rotation around the x axis of the part considering the center set. The value is given in degrees.

            -
          • - -
          • y [Y degrees] -

            This sets the rotation around the y axis of the part considering the center set. The value is given in degrees.

            -
          • - -
          • z [Z degrees] -

            This sets the rotation around the z axis of the part considering the center set. The value is given in degrees.

            -
          • - -
          - -
          Perspective
          - -
          -perspective 
          -{
          -   zplane: 0;
          -   focal: 1000;
          -}
          -
          - -

          Adds focal and plane perspective to the part. Active if perspective_on is true. Must be provided if the part is being used by other part as it is perspective target.

          - -
            - -
          • zplane [unscaled Z value] -

            This sets the z value that is not scaled. Normally this is 0 as that is the z distance.

            -
          • - -
          • focal [distance] -

            This sets the distance from the focal z plane (zplane) and the camera - i.e. equating to focal length of the camera

            -
          • - -
          - - - -
          -link 
          -{
          -   base: "edje,signal" "edje";
          -   transition: LINEAR 0.2;
          -   in: 0.5 0.1;
          -   after: "some_program";
          -}
          -
          - -

          The link block can be used to create transitions to the enclosing part description state. The result of the above block is identical to creating a program with

          - - -
          -action: STATE_SET "default"";
          -signal: "edje,signal";
          -source: "edje";
          -
          - -
            - -
          • base [signal] [source] -

            Defines the signal and source which triggers the transition to this state. The source parameter is optional here and is filled with the current group's default value if it is not provided.

            -
          • -
          - -

          Program

          - -
          -program
          -{
          -   // name of the program
          -   name: "programname";
          -   // signals which trigger the program
          -   signal: "signalname";
          -   // filter incoming signals depending on the sender name
          -   source: "partname";
          -   // filter incoming signals depending on the part's state
          -   filter: "partname" "statename";
          -   // delay the program by X seconds plus a random time between 0 and Y
          -   in: 0.3 0.0;
          -   // action to perform
          -   action: STATE_SET "statename" state_value;
          -   // if action is STATE_SET, define a transition from the current to the target state
          -   transition: LINEAR 0.5;
          -   // if action is SIGNAL_EMIT, the name of the part which will receive the signal
          -   target: "partname";
          -   // run another program after the current one is done
          -   after: "programname";
          -   after: "anotherprogram";
          -}
          -
          - -

          Program

          - -

          Programs define how your interface reacts to events. Programs can change the state of parts or trigger other events.

          - -
            - -
          • name [program name] -

            Symbolic name of program as a unique identifier.

            -
          • - -
          • signal [signal name] -

            Specifies signals that cause the program to run. The signal received must match the specified source to run. There may be several signals, but only one signal keyword per program can be used. Also, there are some predefined signals for touch event handling. The predefined signals are:

            -
              -
            • "hold,on": Holding on the mouse event matching the source that starts the program.
            • -
            • "hold,off": Holding off the mouse event matching the source that starts the program.
            • -
            • "focus,part,in": Focusing in the matching source that starts the program.
            • -
            • "focus,part,out": Focusing out of the matching source that starts the program.
            • -
            • "mouse,in": Moving the mouse into the matching source that starts the program.
            • -
            • "mouse,out": Moving the mouse out of the matching source that starts the program.
            • -
            • "mouse,move": Moving the mouse in the matching source that starts the program.
            • -
            • "mouse,down,*": Pressing the mouse button in the matching source that starts the program.
            • -
            • "mouse,up,*": Releasing the mouse button in the matching source that starts the program.
            • -
            • "mouse,clicked,*": Clicking any mouse button in the matching source that starts the program.
            • -
            • "mouse,wheel,0,*": Moving the mouse wheel in the matching source that starts the program. A positive number moves up and a negative number moves down.
            • -
            • "drag,start": Starting a drag of the mouse in the matching source that starts the program. This signal works only in the draggable part.
            • -
            • "drag,stop": Stopping a drag of the mouse in the matching source that starts the program. This signal works only in the draggable part.
            • -
            • "drag": Dragging the mouse in the matching source that starts the program. This signal works only in the draggable part.
            • -
            -
          • - -
          • source [source name] -

            Source of accepted signal. There may be several signals, but only one source keyword per program can be used. For example, source: "button-*"; (signals from any part or program named "button-*" are accepted).

            -
          • - -
          • filter [part] [state] -

            Filter signals to be only accepted if the part is in state named [state]. Only one filter per program can be used. If [state] is not given, the source of the event is used instead.

            -
          • - -
          • in [from] [range] -

            Wait [from] seconds before executing the program and add a random number of seconds (from 0 to [range]) to the total waiting time.

            -
          • - -
          • action [type] (param1) (param2) (param3) (param4) -

            Action to be performed by the program. Valid actions (only one can be specified) are:

            -
              -
            • STATE_SET: Set "target part" state as "target state"
            • -
            • ACTION_STOP: Stop the ongoing transition.
            • -
            • SIGNAL_EMIT: Emit a signal to the application level. The application can register a callback for handling actions based on the EDC state.
            • -
            • DRAG_VAL_SET: Set a value for the dragable part (x, y values).
            • -
            • DRAG_VAL_STEP: Set a step for the dragable part (x, y values).
            • -
            • DRAG_VAL_PAGE: Set a page for the dragable part (x, y values).
            • -
            • FOCUS_SET: Set the focus to the target group.
            • -
            • PLAY_SAMPLE "sample name" speed (channel): Play a music sample clip. - -

              PLAY_SAMPLE's (optional) channel can be one of:

              -
                -
              • EFFECT/FX
              • -
              • BACKGROUND/BG
              • -
              • MUSIC/MUS
              • -
              • FOREGROUND/FG
              • -
              • INTERFACE/UI
              • -
              • INPUT
              • -
              • ALERT
              • -
              -
            • - -
            • PLAY_TONE "tone name" duration_in_seconds (Range 0.1 to 10.0): Play a predefined tone of a specific duration.
            • -
            • PLAY_VIBRATION "sample name" repeat (repeat count)
            • -
          • - - -
          • transition [type] [length] (interp val 1) (interp val 2) (option) -

            Defines how transitions occur using STATE_SET action. [type] is the style of the transition and [length] is a double specifying the number of seconds in which to preform the transition. Valid types are:

            -
              -
            • LIN or LINEAR
            • -
            • SIN or SINUSOIDAL
            • -
            • ACCEL or ACCELERATE
            • -
            • DECEL or DECELERATE
            • -
            • ACCEL_FAC or ACCELERATE_FACTOR
            • -
            • DECEL_FAC or DECELERATE_FACTOR
            • -
            • SIN_FAC or SINUSOIDAL_FACTOR
            • -
            • DIVIS or DIVISOR_INTERP
            • -
            • BOUNCE
            • -
            • SPRING
            • -
            - -

            ACCEL_FAC, DECEL_FAC and SIN_FAC need the extra optional "interp val 1" to determine the "factor" of curviness. 1.0 is the same as their non-factor counterparts and 0.0 is equal to linear. Numbers higher than 1.0 make the curve angles steeper with a more pronounced curve point.

            - -

            DIVIS, BOUNCE and SPRING also require "interp val 2" in addition to "interp val 1".

            - -

            DIVIS uses [val 1] as the initial gradient start (0.0 is horizontal, 1.0 is diagonal (linear), 2.0 is twice the gradient of linear, etc.). [val 2] is interpreted as an integer factor defining how much the value swings outside the gradient before going back to the final resting spot at the end. 0.0 for [val 2] is equivalent to linear interpolation. Note that DIVIS can exceed 1.0.

            - -

            BOUNCE uses [val 2] as the number of bounces (so it is rounded down to the nearest integer value), with [val 1] determining how much the bounce decays; 0.0 gives linear decay per bounce and higher values give much more decay.

            - -

            SPRING is similar to bounce; [val 2] specifies the number of spring swings and [val 1] specifies the decay, but it can exceed 1.0 on the outer swings.

            - -

            Valid options are:

            -
              -
            • CURRENT causes the object to move from its current position. Can be used as the last parameter of any transition type.
            • -
            -
          • - -
          • target [target] -

            Program or part on which the specified action acts.

            -
          • - -
          • after [after] -

            Specifies a program that is run after the current program completes. The source and signal parameters of a program run as an after are ignored. Multiple after statements can be specified per program.

            -
          • - -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edc_positioning_n.htm b/org.tizen.ui.guides/html/native/efl/edc_positioning_n.htm deleted file mode 100755 index 57093ad..0000000 --- a/org.tizen.ui.guides/html/native/efl/edc_positioning_n.htm +++ /dev/null @@ -1,488 +0,0 @@ - - - - - - - - - - - - - Positioning Parts with the EDC File - - - - - -
          - -

          Positioning Parts with the EDC File

          - - -

          Positioning Basic Parts

          - -

          Size of a part (in pixels) is set using the min and max parameters. The following code example sets the minimum and maximum size of the rectangle part to 200x200 px.

          - -
          -part 
          -{ 
          -   name: "rectangle";
          -   type: RECT;
          -   description 
          -   { 
          -      state: "blue" 0.0;
          -      align: 0.0 0.0;
          -      // set the size to 200x200
          -      min: 200 200;
          -      max: 200 200;
          -      // blue color
          -      color: 0 0 255 255;
          -   }
          -}
          -
          - -

          Position of the parts is defined in the rel1 and rel2 blocks. rel1 and rel2 blocks are used to define respectively the upper-left corner and the lower-right corner of the part. Position can be defined relatively to other parts (with the relative parameter) as an offset (offset parameter). When using relative positioning, the to, to_x and to_y parameters are used to define to which part the relative positioning is done. If nothing else is specified, the positioning is relative to the parent's part.

          - -

          To demonstrate the relative positioning, here is a code example that creates another part and positions it under the first part (the upper-left corner of the new part will start at the lower-left corner of the previous one).

          - -
          -part 
          -{ 
          -   name: "rectangle2";
          -   type: RECT;
          -   description 
          -   { 
          -      state: "green" 0.0;
          -      align: 0.0 0.0;
          -      // set the size to 200x200
          -      min: 200 200;
          -      max: 200 200;
          -      // green color
          -      color: 0 255 0 255;
          -      // set the position
          -      // rel1 is relative to "rectangle"
          -      rel1 
          -      {
          -         relative: 0.0 1.0;
          -         to: "rectangle";
          -      }
          -      // rel2 is relative to the parent
          -      rel2 
          -      {
          -         relative: 1.0 1.0;
          -      }
          -   }
          -}
          -
          - - - - - - - - - - -
          Note
          The align parameter defines how the parts align themselves in the main window if their size is smaller than the main window. If nothing is specified, the parts are aligned in the center of the window.
          - -

          Adding Offset to Relative Positioning

          - -

          The rel1 and rel2 structures also support offset which is a complement to the relative positioning: the corners are first placed according to their relative parameters and then adjusted using the offsets.

          - -

          The picture below shows the pixel positions for a 4x4 rectangle. The indices start in the top-left corner at (0, 0) increase to the right and to the bottom. Since the indices have started at 0, the 4th pixel has an index of 3.

          - -

          Therefore, in order to create a 2x2 blue rectangle centered inside that green square, the top-left corner has to be (1, 1) and the bottom-right one has to be (2, 2).

          - -

          Figure: Offset indices

          -

          Offset indices

          - -

          Edje needs the following things defined:

          -
            -
          • the part coordinates depending on the size and position of the green rectangle
          • -
          • the relative component of positions is the same: the top-left corner of the green rectangle
          • -
          • the top-left pixel is (1, 1) and the bottom-right one is (2, 2)
          • -
          - -

          The following code example defines these things:

          - -
          -name: "blue rectangle";
          -
          -rel1.to: "green rectangle";
          -rel1.relative: 0 0;
          -rel1.offset: 1 1;
          -
          -rel2.to: "green rectangle";
          -rel2.relative: 0 0;
          -rel2.offset: 2 2;
          -
          - -

          For most tasks, relative positioning is simpler than using offsets. Offsets are usually left for fine-tuning and creating borders.

          - -

          The example below is similar to the previous one but uses relative positioning instead of offsets to achieve an equivalent at 4x4 but could scale to larger sizes.

          - -

          The blue square starts at 25% of the green square (both vertically and horizontally) and ends at 75% of it (again, both vertically and horizontally).

          - -

          Just like in the previous example, the blue rectangle is named and Edje is told what the object of reference is:

          - -
          -name: "blue rectangle";
          -rel1.to: "green rectangle";
          -rel2.to: "green rectangle";
          -
          - -

          The image below shows how to refer pixels using relative positioning when the offsets are (0, 0).

          - -

          Figure: Relative positioning

          -

          Relative positioning

          - -

          Note the addressing of pixels: (0, 0) is addressed through relative: 0 0; offset 0 0; and each additional 0.25 in the relative field gives a 1-pixel move. With this, the pixel addressed through relative: 0.75 0.75; offset: 0 0; is at (3, 3) and not (2, 2)!.

          - -

          This comes from a design choice in Evas and Edje which favor simplicity. In the examples shown in this guide, there are 4 pixels and therefore when the [0; 1) range is divided in 4, the result is [0; 0.25), [0.25; 0.50), [0.50; 0.75), [0.75; 0.100). With Edje, the value used to refer to each segment is the left bound and therefore, 0.75 refers to [0.75; 0.100), i.e. the bottom-right pixel of the green rectangle and not the 3/4th one.

          - -

          The way to refer to the pixel right before is to set the rel2 bound to relative: 0.75 0.75;, as would be expressed naturally, and offset: -1 -1;. This can also be understood as extending the rectangle up to 75% of its parent with the upper bound excluded (as shown in the [0.50; 0.75)).

          - -

          Since -1 -1 is the most common offset wanted for rel2, it is the default value; i.e. the default behavior is practical.

          - -

          Calculating Edje Object Total Size

          - -

          When the EDC file is composed of a lot of parts, Edje calculates the size of the global Edje object, by taking all the parts and their parameters into account. Some parameters have an role in this calculation and affect the global size:

          - -
            -
          • min and max: these define the minimum and the maximum size of a part.
          • -
          • rel1 and rel2: these specify the relative position of a part.
          • -
          • align: this relates to the alignment of the part in the parent's object.
          • -
          • fixed: this defines if the part has a fixed size.
          • -
          - - - - - - - - - - -
          Note
          fixed parameter can only be used on TEXTBLOCK type parts. Setting this parameter to fixed: 1 1 will not take into account the part for the calculation of the global size.
          - -

          Using Edje Size Hints

          - -

          Any Evas_Object can have hints, so that the object knows how to properly position and resize. Edje uses these hints when swallowing an Evas_Object to position and resize it in the SWALLOW part of the EDC file.

          - -

          Size hints are not a size enforcement, they just tell the parent object the desired size for this object. Then, the parent tries to get as close as possible to the hint.

          - -

          Hints are set in an Evas_Object using the evas_object_size_hint_*() functions.

          - -

          Min Size Hint

          - -

          This sets the hints for the object's minimum size, given in pixels.

          - -

          Here the horizontal and vertical min size hints of an Evas_Object are set to 0 pixels.

          - -
          -Evas_Object *object;
          -evas_object_size_hint_min_set(object, 0, 0);
          -
          - -

          Max Size Hint

          - -

          This sets the hints for the object's maximum size, given in pixels.

          - -

          Here the horizontal and vertical max size hints of an Evas_Object are set to 200 pixels.

          -
          evas_object_size_hint_max_set(object, 200, 200);
          - -

          Request Size Hint

          - -

          This sets the hints for the object's optimum size.

          - -

          The following code example defines that the optimum size of a part is 200x200 pixels.

          - -

          Aspect Size Hint

          - -

          This sets the hints for the object's aspect ratio. Available aspect size hints are:

          - -
            -
          • EVAS_ASPECT_CONTROL_NONE
          • -
          • EVAS_ASPECT_CONTROL_HORIZONTAL
          • -
          • EVAS_ASPECT_CONTROL_VERTICAL
          • -
          • EVAS_ASPECT_CONTROL_BOTH
          • -
          - -

          The other parameters are aspect width and height ratio. These integers are used to calculate the proportions of the object. If aspect ratio terms are null, the object's container ignores the aspect and scale of the object and occupies the whole available area.

          - -

          Figure: Aspect control

          -

          Aspect control

          - -

          Aspect control

          - -

          Aspect control

          - -

          The following code example sets the aspect size hint to EVAS_ASPECT_CONTROL_BOTH with a width of 100 and a height of 200. So aspect ratio should be 1/2.

          - -
          -evas_object_size_hint_aspect_set(object, EVAS_ASPECT_CONTROL_BOTH, 100, 200);
          -
          - -

          Align Size Hint

          -

          This sets the hints for the object's alignment. This hint is used when the object size is smaller than its parent's. The special EVAS_HINT_FILL parameter uses maximum size hints with higher priority, if they are set. Also, any padding hints set on objects are added up to the alignment space on the final scene composition.

          - -

          Figure: Alignment

          -

          Alignment

          - -

          In the code below, the special EVAS_HINT_FILL parameter is used.

          - -
          -evas_object_size_hint_align_set(object, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          - -

          Weight Size Hint

          - -

          This sets the hints for the object's weight. The weight tells to a container object how the given child is resized. Using EVAS_HINT_EXPAND parameter asks to expand the child object's dimensions to fit the container's own.

          - -

          When several child objects have different weights in a container object, the container distributes the space it has to layout them by those factors. Most weighted children get larger in this process than the least ones.

          - -

          Here the container is asked to expand the object in both directions.

          - -
          -evas_object_size_hint_weight_set(object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -
          - -

          Padding Size Hint

          - -

          This sets the hints for the object's padding space. Padding is extra space an object takes on each of its delimiting rectangle sides. The padding space is rendered transparent. Four hints can be defined, for the left, right, top, and bottom padding.

          - -

          Figure: Padding

          -

          Padding

          - -

          Here the padding hints are set to 5 pixels on each side of the object.

          - -
          -evas_object_size_hint_padding_set(object, 5, 5, 5, 5);
          -
          - - -

          Edje Swallow

          - -

          The parent of all layout components is Edje. Edje as explained in the Edje Blocks is a library which convert edc files into Evas object. EDC is a description language. It means that the objects of interface are described by using text description. One of its main features is the possibility to create "Swallows" objects. When this kind of object is added in an Evas, it contains any other Evas_Object. To create a swallow part, create first the EDC file:

          - -
          -collections
          -{
          -   group 
          -   { 
          -      name: "container";
          -      parts 
          -      {
          -         part 
          -         {
          -            name: "part.swallow"
          -            type: SWALLOW;
          -            description 
          -            {
          -               state: "default" 0.0;
          -               rel1.offset: 31 31;
          -               rel2.offset: -32 -32;
          -            }
          -         }
          -      }
          -   }
          -}
          -
          - -

          This EDC describes a group named "container", with one part inside of type SWALLOW and with the name part.swallow. This part is centered inside the parent (it is the default behavior) but there are 32 pixels free all around this part. Use edje_cc to compile the EDC file into a binary EDJ file:

          - -
          -edje_cc -o container.edj container.edc
          -
          - -

          Create an Edje object and load this file:

          - -
          -edje = edje_object_add(evas_object_evas_get(parent));
          -edje_object_file_set(edje, "container.edj", "container");
          -
          - - - - - - - - - - -
          Note
          edje_object_add as opposed as all elementary object, does not take an Evas_Object as a parent. Give it the Evas on which the object is added. As the parent is already added on an Evas by elementary, retrieve a reference on it by using the evas_object_evas_get() function.
          - -

          edje_object_file_set is used to set the Edje file from which the object is loaded. The object itself is the name of the group as defined in the EDC file, in this case it is "container".

          - -

          Use the API edje_object_swallow to swallow any kind of Evas_Object inside.

          - -
          -ic = elm_icon_add(parent);
          -elm_image_file_set(ic, "c1.png", NULL);
          -edje_object_part_swallow(edje, "part.swallow", ic);
          -
          - - - - - - - - - - -
          Note
          The elm_image_file_set() function parameters are linked to Edje. The second argument in this example is a PNG file; however, it can also be an Edje file. In that case, the third argument must be the Edje group to load, exactly as previously shown with the edje_object_file_set() function.
          - -

          Create complex layout for your application with Edje. It is may not be the most easy way, but it is the most powerful. This Edje layout is used all around elementary and is the basis of the layout component.

          - -

          ELM Layout

          - -

          Layout is a container component. For the basic use of the elm_layout with a default style, see Layout. Elm layout takes a standard Edje design file and wraps it in a UI component. Layouts are the basis of graphical UI components which are used in Elementary.

          - -

          Adding Layout

          - -

          Create a new elementary layout using elm_layout_add:

          - -
          -Evas_Object *layout;
          -layout = elm_layout_add(parent);
          -
          - -

          As for Edje swallows, load an Edje file. Create first an Edje file, that contains a black rectangle and an icon in the center.

          - -
          -images
          -{
          -   image: "c1.png" COMP;
          -}
          -
          -collections
          -{
          -   group 
          -   { 
          -      name: "my_layout";
          -      parts 
          -      {
          -         part 
          -         {
          -            name: "background";
          -            type: RECT; description 
          -            { 
          -               state: "default" 0.0; color: 0 0 0 255; 
          -            } 
          -         } 
          -         part 
          -         { 
          -            name: "background"; 
          -            type: IMAGE; 
          -            description 
          -            { 
          -               state: "default" 0.0; 
          -               rel1.offset: 31 31; 
          -               rel2.offset: -32 -32; 
          -               default.image: "c1.png"; 
          -            } 
          -         }
          -      } 
          -   } 
          -}
          -
          -

          Compile it with edje_cc -o edje_example.edj edje_example.edc.

          -

          This file can be loaded with elm_layout_file_set:

          - -
          -elm_layout_file_set(layout, "edje_example.edj", "my_layout");
          -
          - -

          The layout component may contain as many parts/children as described in its theme file (EDC). Some of these children can have special types:

          - -
            -
          • SWALLOW (content holder)
          • -
          • BOX
          • -
          • TABLE
          • -
          - -

          Only one object can be added to a SWALLOW. The elm_layout_content_set()/get/unset functions are used to manage objects in a SWALLOW part. After being set to this part, the object's size, position, visibility, clipping and other description properties are controlled by the description of the given part (inside the Edje theme file).

          - -

          The BOX layout can be used through the elm_layout_box_*() set of functions. It is very similar to the elm_box component but the BOX layout's behavior is completely controlled by the Edje theme. The TABLE layout is like the BOX layout, the difference is that it is used through the elm_layout_table_*() set of functions.

          - -

          Signals

          -

          Elm can send Edje signals to the EDC part by using the elm_layout_signal_emit. You can also use elm_layout_signal_callback_add to receive signals.

          - -

          Use the following code to listen to any signals sent by the layout:

          - -
          -elm_layout_signal_callback_add(layout, "*", "*", _signal_cb, NULL);
          -
          -static void _signal_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
          -{
          -   printf("Info received from layout : %s %s\n", emission, source);
          -}
          -
          - -

          For more details on this, see the section on edje signals and layouts.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/edje_animation_n.htm b/org.tizen.ui.guides/html/native/efl/edje_animation_n.htm deleted file mode 100755 index 3a64886..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_animation_n.htm +++ /dev/null @@ -1,535 +0,0 @@ - - - - - - - - - - - - - Edje Animations - - - - - -
          - -

          Edje Animations

          - -

          One of the greatest strengths of EFL and Edje is the ability to create animations. This tutorial demonstrates how Elm_Transit can create predefined animations, but you can also use the Edje library to create your own animations.

          - -

          The Edje animations are based on a very simple principle: going from one state to another. If you want to animate something with Edje, you must define two states and move from the first state to the second.

          - -

          Animating a Rectangle

          - -

          This example shows how to animate a rectangle. It is positioned in the top left corner of the window and is moved to the bottom right corner in five seconds. To do that with Edje, define a part called "rectangle" with the type RECT: this part has two descriptions (or states). In the first state, the rectangle is in is the top left corner. In the second state, it is in is the bottom right corner. To create the transition, set this EDC code for Edje to switch the object from its current state to another.

          - -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "rectangle";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               align: 0.0 0.0;
          -               rel1 {relative: 0.0 0.0;}
          -               rel2 {relative: 0.3 0.1;}
          -               color: 0 0 255 255;
          -            }
          -            description 
          -            { 
          -               state: "default" 0.5;
          -               align: 0.0 0.0;
          -               rel1 {relative: 0.7 0.9;}
          -               rel2 {relative: 1.0 1.0;}
          -               color: 0 0 255 255;
          -            }
          -         }
          -      }
          -      programs 
          -      {
          -         program 
          -         { 
          -            name: "animation,state1";
          -            source: "";
          -            signal: "load";
          -            action: STATE_SET "default" 0.5;
          -            target: "rectangle";
          -            transition: LINEAR 5;
          -         }
          -      }
          -   }
          -}
          -
          - -

          The "rectangle" part has two descriptions that share the same name, but have a different "version".

          - -
          -part 
          -{ 
          -   name: "rectangle";
          -   type: RECT;
          -   description 
          -   { 
          -      state: "default" 0.0;
          -   }
          -   description 
          -   { 
          -      state: "default" 0.5;
          -   }
          -}
          -
          - -

          The program defines when and how to move from one state to another. A program is called upon reception of a signal from a source. Here the program is called when the signal load is received from any source.

          - -
          -program 
          -{ 
          -   name: "animation,state1";
          -   source: "";
          -   signal: "load";
          -}
          -
          - -

          An action is performed upon the signal reception. In this example, the state is changed.

          - -
          -action: STATE_SET "default" 0.5;
          -
          - -

          The program has a target, here the "rectangle".

          - -
          -target: "rectangle";
          -
          - -

          The program uses a transition to perform the action.

          - -
          -transition: LINEAR 5;
          -
          - -

          This example produces a blue rectangle that moves from the upper left to the lower right corner with a linear transition in five seconds.

          - -

          Actions

          - -

          The Edje programs are not only for animations. There are different actions, for example STATE_SET and ACTION_STOP. You may also send signals with SIGNAL_EMIT.

          - -

          The STATE_SET action changes the state of the "target".

          - -

          In the following example, the state of the part named "image" changes to "default" "0.0".

          - -
          -program 
          -{
          -   name: "animate";
          -   signal: "animate";
          -   action: STATE_SET "default" 0.0;
          -   transition: LINEAR 3.0;
          -   target: "image";
          -}
          -
          - -

          The ACTION_STOP stops the program specified by "target".

          - -
          -program 
          -{
          -   name: "animate_stop";
          -   signal: "animate_stop";
          -   action: ACTION_STOP;
          -   target: "animate_loop";
          -}
          -
          - -

          The previous example stops the program defined as "target" named animate_loop. This program runs on the animate_stop signal.

          - -

          The SIGNAL_EMIT emits a signal that is used to communicate with the application directly from the theme.

          - -

          The following example emits a signal frame_move "start" when it receives the signal mouse,down,* from the video_over part. In other words, it sends the signal frame_move "start" when the mouse is pressed in the video_over part.

          - -
          -program 
          -{ 
          -   name: "video_move_start";
          -   signal: "mouse,down,*";
          -   source: "video_mover";
          -   action: SIGNAL_EMIT "frame_move" "start";
          -}
          -
          - -

          Transitions

          - -

          The transitions available are:

          -
            -
          • LIN or LINEAR: makes a linear transition and takes the duration in seconds as the parameter
          • -
          • SIN or SINUSOIDAL: makes a sinusoidal transition and takes the duration in seconds as the parameter
          • -
          • ACCEL or ACCELERATE: makes an accelerated transition and takes the duration in seconds as the parameter
          • -
          • DECEL or DECELERATE: makes a decelerated transition and takes the duration in seconds as the parameter
          • -
          • ACCEL_FAC or ACCELERATE_FACTOR: makes an accelerated transition and takes the duration and the factor as the parameters
          • -
          • DECEL_FAC or DECELERATE_FACTOR: makes a decelerated transition and takes the duration and the factor as the parameters
          • -
          • SIN_FAC or SINUSOIDAL_FACTOR: makes a sinusoidal transition and takes the duration and the factor as the parameters
          • -
          • DIVIS or DIVISOR_INTERP: takes 3 parameters: -
              -
            • the duration
            • -
            • the initial gradient start (0.0 is horizontal, 1.0 is diagonal (linear), 2.0 is twice the gradient of linear, and so on)
            • -
            • an integer factor that defines how much the value swings outside the gradient to come back to the final resting spot at the end. 0.0 for the third parameter is equivalent to linear interpolation. Note that DIVIS may exceed 1.0.
            • -
            -
          • -
          • BOUNCE: makes a bounce transition and takes 3 parameters: -
              -
            • the duration
            • -
            • how much the bounce decays, with 0.0 giving linear decay per bounce, and higher values giving more decay
            • -
            • the number of bounces (rounded down to the nearest integer value)
            • -
            -
          • -
          • SPRING: makes a spring transition and takes 3 parameters: -
              -
            • the duration
            • -
            • the decay, with the level exceeding 1.0 on the outer swings
            • -
            • the number of spring swings
            • -
            -
          • -
          - -

          There are graphical representations of these effects in the Ecore_Evas section above.

          - -

          Chaining Edje Programs

          - -

          To define a couple of Edje programs and chain them, we can, for example, create a program to make the rectangle return to its initial state with another transition (such as BOUNCE).

          - -

          Use the statement after in the first program. after takes the name of the transition to run when the program is done.

          - -
          -after: "animation,state0";
          -
          - -

          This is how to add the bounce animation. To return the blue rectangle to its initial position with a BOUNCE transition: it bounces with a factor of 1.8, six times. This program is only to be used at the end of the first one, so it does not have any signal statement.

          - -
          -program 
          -{ 
          -   name: "animation,state0";
          -   source: "";
          -   signal: "";
          -   action: STATE_SET "default" 0.0;
          -   target: "rectangle";
          -   transition: BOUNCE 5 1.8 6;
          -}
          -
          - -

          Playing on Signals

          - -

          The programs start when they receive a signal from a source. Edje handles many kind of signals, including mouse events.

          - - - - - - - - - - -
          Note
          To show the signals, use edje_player -p myfile.edj.
          - -

          For example, in another transition the rectangle is left clicked. The corresponding signal name is mouse,clicked,1.

          - -

          For this transition, define a new state. This state changes the color and the position of the rectangle.

          - -
          -// To be placed in the "part" definition
          -description 
          -{ 
          -   state: "color" 0.0;
          -   rel1 {relative: 0.3 0.3;}
          -   rel2 {relative: 0.7 0.4;}
          -   color: 255 0 0 255;
          -}
          -
          - -

          The program is as follows:

          - -
          -program 
          -{ 
          -   name: "animation,color";
          -   source: "rectangle";
          -   signal: "mouse,clicked,1";
          -   action: STATE_SET "color" 0.0;
          -   target: "rectangle";
          -   transition: SIN 2;
          -}
          -
          - -

          This starts when the rectangle is left clicked.

          - -

          If you want to send a signal from your application when you use signals to start transitions, create a program waiting for your own special signal. For example:

          - -
          -program 
          -{ 
          -   name: "animation,menu_side,hide";
          -   source: "MenuButton";
          -   signal: "hide,sidemenu";
          -   action: STATE_SET "default" 1.0;
          -   target: "menu/side";
          -   transition: LINEAR 0.2;
          -}
          -
          - -

          This program changes the state of the target named animation,menu_side,hide to "default" 1.0. It waits for the hide,sidemenu signal emitted by a source called MenuButton.

          - -
          -edje_object_signal_emit(layout, "hide,sidemenu", "MenuButton");
          -
          - -

          This statement sends a signal named hide,sidemenu with a source named MenuButton to the object called layout.

          - -

          The edje_object_signal_emit function emits a signal on an Evas_Object part of the application.

          - -
          -edje_object_signal_emit(Evas_Object *obj,
          -                        const char *emission,
          -                        const char *source)
          -
          - -
            -
          • The first parameter is the Evas_Object, which emits the signal (layout in the example).
          • -
          • The second parameter is the emission string (the name of the signal hide,sidemenu in the example).
          • -
          • The third parameter is the source of the signal (the name of the source, MenuButton in the example).
          • -
          - -

          If you use the Elementary in the application, you can use elm_object_signal_emit. It functions exactly the same way as edje_object_signal_emit and takes the same parameters.

          - - - - - - - - - - -
          Note
          To find a complete example, use elm_object_signal_emit in Creating Mobile Menus.
          - -

          Rotating with Edje

          - -

          The Edje library allows you to rotate objects, using the map statement. For example, if you want to rotate the blue rectangle on a right click, you must define a new rotate state. To enable the map on you object you must add a map part to your default state.

          - -
          -map 
          -{
          -   on: 1;
          -   smooth: 1;
          -   perspective_on: 1;
          -   rotation.x: 0;
          -   rotation.y: 0;
          -   rotation.z: 0;
          -}
          -
          - -
            -
          • on: 1; enables the map on the object
          • -
          • perspective_on: 1, enables the perspective when rotating, even without a perspective point object
          • -
          • smooth: 1; enables a smooth map rendering
          • -
          • The rotation statements define the default rotation of the object on x, y, and z axes.
          • -
          - -

          To add a new rotate state with a rotation around any axis, do the following.

          - -
          -description 
          -{ 
          -   state: "rotate" 0.0;
          -   inherit: "default" 0.0;
          -   map.rotation.z: 120;
          -}
          -
          - -

          This rotate state inherits all the default state properties, but changes the value of map.rotation.z from 0° to 120°.

          - -

          To set a program to run the rotate state, do the following.

          - -
          -program 
          -{ 
          -   name: "animation,rotate";
          -   source: "rectangle";
          -   signal: "mouse,clicked,3";
          -   action: STATE_SET "rotate" 0.0;
          -   target: "rectangle";
          -   transition: LIN 5;
          -}
          -
          - -

          This program runs on a right click on the rectangle object.

          - -

          The complete code of this example is as follows.

          - -
          -collections 
          -{
          -   group 
          -   { 
          -      name: "main";
          -      parts 
          -      {
          -         part 
          -         { 
          -            name: "rectangle";
          -            type: RECT;
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               align: 0.0 0.0;
          -               rel1 {relative: 0.0 0.0;}
          -               rel2 {relative: 0.3 0.1;}
          -               map 
          -               {
          -                  on: 1;
          -                  smooth: 1;
          -                  perspective_on: 1;
          -                  rotation 
          -                  {
          -                     z: 0;
          -                     x: 0;
          -                     y: 0;
          -                  }
          -               }
          -               color: 0 0 255 255;
          -            }
          -            description 
          -            { 
          -               state: "default" 0.5;
          -               align: 0.0 0.0;
          -               rel1 {relative: 0.7 0.9;}
          -               rel2 {relative: 1.0 1.0;}
          -               color: 0 0 255 255;
          -            }
          -            description 
          -            { 
          -               state: "color" 0.0;
          -               rel1 {relative: 0.3 0.3;}
          -               rel2 {relative: 0.7 0.4;}
          -               color: 255 0 0 255;
          -            }
          -            description 
          -            { 
          -               state: "rotate" 0.0;
          -               inherit: "default" 0.0;
          -               map.rotation.z: 120;
          -            }
          -         }
          -      }
          -      programs 
          -      {
          -         program 
          -         { 
          -            name: "animation,state1";
          -            source: "";
          -            signal: "load";
          -            action: STATE_SET "default" 0.5;
          -            target: "rectangle";
          -            transition: LINEAR 1;
          -            after: "animation,state0";
          -         }
          -         program 
          -         { 
          -            name: "animation,state0";
          -            source: "";
          -            signal: "";
          -            action: STATE_SET "default" 0.0;
          -            target: "rectangle";
          -            transition: BOUNCE 2 1.8 26;
          -         }
          -         program 
          -         { 
          -            name: "animation,color";
          -            source: "rectangle";
          -            signal: "mouse,clicked,1";
          -            action: STATE_SET "color" 0.0;
          -            target: "rectangle";
          -            transition: SIN 2;
          -         }
          -         program 
          -         { 
          -            name: "animation,rotate";
          -            source: "rectangle";
          -            signal: "mouse,clicked,3";
          -            action: STATE_SET "rotate" 0.0;
          -            target: "rectangle";
          -            transition: LIN 5;
          -         }
          -      }
          -   }
          -}
          -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edje_animation_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/edje_animation_tutorial_n.htm deleted file mode 100755 index aa85f96..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_animation_tutorial_n.htm +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - - - - - - - - - Creating Edje Animations - - - - - - -
          -

          Creating Edje Animations

          - - -

          One of the greatest strengths of EFL and Edje is the ability to create animations. This tutorial demonstrates how Elm_Transit can create pre-defined animations, but you can also use the Edje library to create your own animations.

          - -

          Animating on Application Start-up

          - - -

          The goal of this tutorial is to create an animation target and buttons to start animations, all this in an EDC (Edje Data Collection) file.

          -

          First create an application using Basic EDC UI Application. This model provides a simple application just like the one used in the previous chapter, but with one more element: an .edc file.

          -

          Animations can be run at application startup. By default the Basic EDC UI Application model produces an empty window with a title. In this example a Tizen logo is added to the window and the behavior of the window title is changed.

          -

          The images used by the Edje file are stored in the edje/images directory of the application. Copy the Tizen logo available in shared/res/<yourapplicationname>.png into the Edje image directory edje/images. Then add the image to the Edje images collection.

          -
          images 
          -{
          -   image: "edceffects.png" COMP;
          -   image: "tizen-logo.png" COMP;
          -}
          -
          - -

          Then add an Edje part using the small logo: this part has two states. This is the first important notion for animations. The STATE describes the appearance of a part: size, position, color, etc.

          -

          In this example, the part has two states, default and down-state:

          -
          // An image using the tizen logo
          -part 
          -{ 
          -   name: "logo";
          -   type: IMAGE;
          -   description 
          -   { 
          -      state: "default" 0.0;
          -      max: 63 63;
          -      min: 63 63;
          -      image { normal: "small-logo.png"; }
          -      rel1.relative: 0.1 0.0;
          -      rel2.relative: 0.0 0.0;
          -   }
          -
          -   description 
          -   { 
          -      state: "down-state" 1.0;
          -      inherit: "default" 0.0;
          -      rel1.relative: 0.1 0.92;
          -      rel2.relative: 0.05 1.0;
          -   }
          -}
          -

          The logo part has the IMAGE type. The default state contains in the first description of the part sets:

          -
            -
          • the maximum and minimum size using the min and max statements
          • -
          • the image to use in this part
          • -
          • the default position.
          • -
          -

          The second state, down-state, inherits all of the default's attributes, and only changes the position to put the image at the bottom of the application window.

          -

          These two states are the start and end states of the animation. To actually create the animation, add a program to the Edge programs collection.

          -
          // Icon drop animation
          -program 
          -{ 
          -   name: "animation,state1";
          -   source: "";
          -   signal: "load";
          -   action: STATE_SET "down-state" 1.0;
          -   target: "logo";
          -   transition: BOUNCE 2.5 0.0 5.0;
          -}
          -

          This program is named animation,state1 and is started when the application receives the load signal immediately on startup. It runs the STATE_SET action so it changes the object state from default to down-state. The target of the program is the logo part.

          -

          In order to switch from one state to another, it uses a transition of the BOUNCE type with 3 parameters, the bounce_decay, the number_of_bounces, and the duration which here is set to five seconds.

          -

          This produces an falling and bouncing effect.

          -

          Also add an animation for the window title to make it move from the left to the right with a bounce effect while growing the font size.

          -

          Create a new state on the part called "txt_title" inside which both the font size and position are changed.

          -
          part 
          -{ 
          -   name: "txt_title";
          -   type: TEXT;
          -   mouse_events: 0;
          -
          -   // The default State
          -   description 
          -   { 
          -      state: "default" 0.0;
          -      align: 0.0 0.0;
          -      rel1 { relative: 0.0 0.0; }
          -      rel2 { relative: 0.0 0.0; }
          -      text 
          -      { 
          -         font: "Tizen:style=regular";
          -         size: 24;
          -         min: 1 1;
          -      }
          -      color: 0 0 0 255;
          -   }
          -
          -   // The "Bigger" state
          -   description 
          -   { 
          -      state: "Bigger" 0.0;
          -      align: 0.0 0.0;
          -      rel1 { relative: 0.75 0.0; }
          -      rel2 { relative: 0.0 0.0; }
          -      text 
          -      { 
          -         font: "Tizen:style=regular";
          -         size: 28;
          -         min: 1 1;
          -      }
          -      color: 0 0 0 255;
          -   }
          -}
          -
          -

          Create a program to animate this part on startup, just like the small Tizen logo.

          -
          // Make the title bigger
          -program 
          -{ 
          -   name: "animation,bigtitle";
          -   source: "";
          -   signal: "load";
          -   action: STATE_SET "Bigger" 1.0;
          -   target: "txt_title";
          -   transition: LINEAR 5.0;
          -}
          -
          -

          This program goes from the default state to the bigger state in five seconds with a LINEAR effect, automatically running on the application startup.

          - -

          Animating Object on Click

          - -

          All the previous animations are automatic and do not have any relation with the user's actions. Next animate a part by clicking on another one. Make the title restore its default aspect when clicking on the small logo.

          -

          The parts and the states are already defined. The animation goes back to the default state, there is no need to add any parts or states: only add a program which makes the transition when clicking on logo part.

          -
          // Make the title go back to normal
          -program 
          -{
          -   name: "animation,normaltitle";
          -   source: "logo";
          -   signal: "mouse,clicked,*";
          -   action: STATE_SET "default" 1.0;
          -   target: "txt_title";
          -   transition: LINEAR 0.5;
          -}
          -

          This program starts when the application receives the signal mouse,clicked,* (any button of the mouse is clicked) from the part called logo, (source). It performs the STATE_SET action and sets the default state on the target txt_file part with a LINEAR transition.

          -

          When clicking any mouse button on the small logo, the title goes back to its original state.

          -

          Rotating Parts

          -

          Next add two more buttons to the application and create programs to animate a target.

          -

          It is possible to create a button with Edje from scratch, but to save time, the SWALLOW part is used in this example to store Elementary UI components.

          -

          First create the SWALLOW parts, and then the Elementary UI components in the .c file.

          -
          // Container for the rotate button
          -part 
          -{
          -   type: SWALLOW;
          -   name: "btn/rotate";
          -   description 
          -   {
          -      state: "default" 0.0;
          -      rel1.relative: 0.10 0.80;
          -      rel2.relative: 0.30 0.90;
          -   }
          -}
          -

          This part is called btn/rotate, it only has a SWALLOW type and a default state with its position being on the bottom left of the screen.

          -
          // Container for the grow button
          -part 
          -{
          -   type: SWALLOW;
          -   name: "btn/grow";
          -   description 
          -   {
          -      state: "default" 0.0;
          -      rel1.relative: 1.02 0;
          -      rel1.to: "btn/rotate";
          -      rel2.relative: 2.02 1;
          -      rel2.to: "btn/rotate";
          -   }
          -}
          -

          This second SWALLOW part is very similar to the first one. It is placed relatively to btn/rotate, in order to remain next to it.

          -

          Next create the actual UI components. This is done in the .c file and is very similar to what is done for the buttons in the first chapter.

          -

          This code is added to the create_base_ui function.

          -
          // Creation button in the app window
          -ad->button = elm_button_add(ad->win);
          -elm_object_text_set(ad->button, "Rotate");
          -// Add the button to the edje layout container called "btn/rotate"
          -elm_object_part_content_set(ad->layout, "btn/rotate", ad->button);
          -evas_object_show(ad->button);
          -
          -// Creation a up button in the app window
          -ad->btn_up = elm_button_add(ad->win);
          -// Add the button to the edje layout container called "btn/grow"
          -elm_object_text_set(ad->btn_up, "Grow");
          -elm_object_part_content_set(ad->layout, "btn/grow", ad->btn_up);
          -evas_object_show(ad->btn_up);
          -

          In the default Basic EDC UI Application, the Edje layout is loaded by default. Create two Elementary buttons and add them to the SWALLOW containers, without having to setup sizes or positions as this is done in the SWALLOW container.

          -

          Note that the part name is very important because it is used to be merged the Elementary UI component and the SWALLOW part.

          -

          When the buttons placed and set, create the animation target. it is done in the EDC file.

          -

          Add the animation target part.

          -

          The part initialization and the default state:

          -
          // The animation target
          -part 
          -{
          -   name: "atarget";
          -   type: IMAGE;
          -
          -   // Default state
          -   description 
          -   {
          -      state: "default" 0.0;
          -      image { normal: "tizen-logo.png"; }
          -      color: 255 0 0 255; // red
          -      rel1 { relative: 0.3 0.3; }
          -      rel2 { relative: 0.7 0.4; }
          -   }
          -}
          -
          -

          This part is an image displaying a big Tizen logo, placed on the top of the screen more or less centered.

          -

          Create a state to change the color and add the map statement.

          -
          // The rotate state
          -description 
          -{
          -   state: "rotate" 0.0;
          -   inherit: "default" 0.0;
          -
          -   map 
          -   {
          -      // Enable Map on the part
          -      on: 1;
          -      // Enable smooth rendering
          -      smooth: 1;
          -      // Enable perspective
          -      perspective_on: 1;
          -
          -      // Apply rotations on the part
          -      rotation.x: 0;
          -      rotation.y: 0;
          -      rotation.z: 0;
          -   }
          -   color: 0 255 0 255; // green
          -}
          -

          This part changes the color to green and defines the map. This statement makes rotations possible on an Edje part. Rotations are done around the x, y or z axes. In this example, the map is enabled and a 0° rotation is applied around each axis.

          -

          Add a state with a rotation around the z axis of 360°.

          -
          description 
          -{
          -   state: "rotate" 1.0;
          -   inherit: "rotate" 0.0;
          -   map.rotation.z: 360;
          -}
          -

          This state inherits from the default state parameters and add a rotation around the z axis.

          -

          Finally add a state to the other button animation grow. Change the size of the animation target and add an offset.

          -
          // The grow state
          -description 
          -{
          -   state: "grow" 0.0;
          -   color: 0 0 255 255; // blue
          -   rel1 
          -   {
          -      relative: 0.2 0.2;
          -      offset: 0.3 0.3;
          -   }
          -   rel2 
          -   {
          -      relative: 0.7 0.4;
          -      offset: 0.3 0.3;
          -   }
          -}
          -

          The last step is to create the programs to make all these states animate.

          -

          To make the rotation animation smoother, create and chain several programs with different durations.

          -

          First create the main one: it goes from the default state to the rotate 0.0 state in 0.2 seconds.

          -

          Note that the states are all named the same way (rotate) but not with the same version. This version allows you to have more than one state with the same name, in fact the actual name of the state is the name plus the version.

          -
          // Change the color of target to green
          -program 
          -{
          -   name: "rotate,target";
          -   source: "btn/rotate";
          -   signal: "mouse,clicked,*";
          -   action: STATE_SET "rotate" 0.0;
          -   target: "atarget";
          -   transition: SIN 0.2;
          -   after: "rotate,target,2";
          -}
          -

          The program starts when the btn/rotate part is clicked with any mouse button. When the animation ends, it calls the next one called rotate,target,2.

          -
          // Rotate 360°
          -program 
          -{
          -   name: "rotate,target,2";
          -   action: STATE_SET "rotate" 1.0;
          -   target: "atarget";
          -   transition: SIN 0.7;
          -   after: "rotate,end";
          -}
          -

          This program sets the part state to rotate 1.0 in 0.7 seconds, and when done calls the next one rotate,end.

          -
          // Go back to the normal
          -program 
          -{
          -   name: "rotate,end";
          -   action: STATE_SET "rotate" 0.0;
          -   target: "atarget";
          -   transition: LINEAR 0.2;
          -}
          -

          rotate,end is the last program of the rotation effect: it sets the state to rotate 0.0 very fast.

          -

          The last program of this example is the grow effect, it switches from one state to another.

          -
          // Grow the target and go back to normal state
          -program 
          -{
          -   name: "grow,target";
          -   source: "btn/grow";
          -   signal: "mouse,clicked,*";
          -   action: STATE_SET "grow" 1.0;
          -   after: "go,default";
          -   target: "atarget";
          -   transition: SINUSOIDAL 1.0;
          -}
          -

          It starts when the btn/grow part is clicked, it goes from the current state to grow 1.0 in one second. It then calls the go,default program. In this program, both size and color change during the transition.

          -

          The go,default program sets the status back default for the animation target.

          -
          // Go back to normal (default) state
          -program 
          -{
          -   name: "go,default";
          -   action: STATE_SET "default" 1.0;
          -   target: "atarget";
          -   transition: SIN 1.0;
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/edje_color_n.htm b/org.tizen.ui.guides/html/native/efl/edje_color_n.htm deleted file mode 100755 index 48d272a..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_color_n.htm +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - Using Edje Color Classes - - - - - - -
          -

          Using Edje Color Classes

          - -

          This tutorial demonstrates how you can change the color of 2 or more parts using Edje color classes.

          -

          If a part is assigned with a color class, setting color values to this class causes all those parts to have their colors multiplied by the values. Setting the values to a color class affects all parts within that color class at process level, while at object level, it only affects the parts inside a specified object.

          - -

          Create a simple application with a menu and separate screens for each Edje Animation function:

          - -
            -
          1. In the Tizen IDE, go to Tizen Native project > UI application > EDC and create a new project named colorclass.
          2. - -
          3. Open the colorclass.edc file and replace it with the following code: -
            color_classes 
            -{
            -   color_class 
            -   {
            -      name: "A";
            -      color: 255 255 0 255;
            -      color2: 255 0 0 255;
            -      color3: 0 0 255 255;
            -   }
            -   color_class 
            -   {
            -      name: "B";
            -      color: 0 255 0 255;
            -      color2: 0 0 255 255;
            -      color3: 255 0 0 255;
            -   }
            -   color_class 
            -   {
            -      name: "C";
            -      color: 125 0 0 255;
            -      color2: 255 0 0 255;
            -      color3: 0 0 255 255;
            -   }
            -}
            -
            -collections 
            -{
            -   group 
            -   { 
            -      name: "main";
            -      parts 
            -      {
            -         part 
            -         { 
            -            name: "bg";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "textA";
            -            type: TEXT;
            -            effect: OUTLINE_SHADOW;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "A";
            -               rel1.relative: 0.0 0.0;
            -               rel2.relative: 0.2 0.2;
            -               color2: 255 255 255 255;
            -               color3: 255 255 255 255;
            -               text 
            -               {
            -                  text: "A:";
            -                  size: 44;
            -               }
            -            }
            -         }
            -         part 
            -         { 
            -            name: "textB";
            -            type: TEXT;
            -            effect: OUTLINE_SHADOW;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "B";
            -               rel1.relative: 0.0 0.2;
            -               rel2.relative: 0.2 0.4;
            -               color2: 255 255 255 255;
            -               color3: 255 255 255 255;
            -               text 
            -               {
            -                  text: "B:";
            -                  size: 44;
            -               }
            -            }
            -         }
            -         part 
            -         { 
            -            name: "textC";
            -            type: TEXT;
            -            effect: OUTLINE_SHADOW;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "C";
            -               rel1.relative: 0.0 0.4;
            -               rel2.relative: 0.2 0.6;
            -               color2: 255 255 255 255;
            -               color3: 255 255 255 255;
            -               text 
            -               {
            -                  text: "C:";
            -                  size: 44;
            -               }
            -            }
            -         }
            -         part 
            -         { 
            -            name: "rect1";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "A";
            -               rel1.relative: 0.2 0.0;
            -               rel2.relative: 0.4 0.2;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "rect2";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "B";
            -               rel1.relative: 0.4 0.2;
            -               rel2.relative: 0.6 0.4;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "rect3";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "A";
            -               rel1.relative: 0.6 0.0;
            -               rel2.relative: 0.8 0.2;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "rect4";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color_class: "B";
            -               rel1.relative: 0.8 0.2;
            -               rel2.relative: 1.0 0.4;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "rect5";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color: 125 0 0 255;
            -               color_class: "C";
            -               rel1.relative: 0.6 0.4;
            -               rel2.relative: 0.8 0.6;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "rect6";
            -            type: RECT;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               color: 255 255 255 255;
            -               color_class: "C";
            -               rel1.relative: 0.8 0.4;
            -               rel2.relative: 1.0 0.6;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "swallow.btn1";
            -            type: SWALLOW;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               rel1.relative: 0.0 0.8;
            -               rel2.relative: 0.45 1.0;
            -            }
            -         }
            -         part 
            -         { 
            -            name: "swallow.btn2";
            -            type: SWALLOW;
            -            description 
            -            { 
            -               state: "default" 0.0;
            -               rel1.relative: 0.55 0.8;
            -               rel2.relative: 1.0 1.0;
            -            }
            -         }
            -      }
            -   }
            -}
            - -

            Setting the color class of a part causes its colors to be multiplied by color_class color values. To see how the color class affects the shadow and outline colors, set those colors as white in the part:

            - -
            color2: 255 255 255 255;
            -color3: 255 255 255 255;
            - -

            Parts with color_class "C" have different colors because their base colors are different.

            -
          4. - -
          5. Replace the create_base_gui() function with the following code: - -
            static void
            -btn1_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   edje_color_class_set("A", rand()%255, rand()%255, rand()%255, 255,
            -                        rand()%255, rand()%255, rand()%255, 255,
            -                        rand()%255, rand()%255, rand()%255, 255);
            -}
            -static void
            -btn2_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   edje_color_class_set("B", rand()%255, rand()%255, rand()%255, 255,
            -                        rand()%255, rand()%255, rand()%255, 255,
            -                        rand()%255, rand()%255, rand()%255, 255);
            -}
            -
            -static void
            -create_base_gui(appdata_s *ad)
            -{
            -   char edj_path[PATH_MAX] = {0, };
            -
            -   // Window
            -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            -   elm_win_conformant_set(ad->win, EINA_TRUE);
            -   elm_win_autodel_set(ad->win, EINA_TRUE);
            -
            -   if (elm_win_wm_rotation_supported_get(ad->win)) 
            -   {
            -      int rots[4] = { 0, 90, 180, 270 };
            -      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            -   }
            -
            -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            -
            -   // Conformant
            -   ad->conform = elm_conformant_add(ad->win);
            -   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            -   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_win_resize_object_add(ad->win, ad->conform);
            -   evas_object_show(ad->conform);
            -
            -   // Base layout
            -   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -   ad->layout = elm_layout_add(ad->win);
            -   elm_layout_file_set(ad->layout, edj_path, GRP_MAIN);
            -   evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);
            -   elm_object_content_set(ad->conform, ad->layout);
            -
            -   // Buttons
            -   ad->btn1 = elm_button_add(ad->win);
            -   elm_object_part_content_set(ad->layout, "swallow.btn1", ad->btn1);
            -   evas_object_smart_callback_add(ad->btn1, "clicked", btn1_cb, ad);
            -   elm_object_part_text_set(ad->btn1, NULL, "Change A");
            -   ad->btn2 = elm_button_add(ad->win);
            -   elm_object_part_content_set(ad->layout, "swallow.btn2", ad->btn2);
            -   evas_object_smart_callback_add(ad->btn2, "clicked", btn2_cb, ad);
            -   elm_object_part_text_set(ad->btn2, NULL, "Change B");
            -
            -   // Show the window
            -   evas_object_show(ad->win);
            -}
            - -

            Pressing the Change A button changes all colors of all parts with color_class set as "A" but does not affect other parts. The actual color, color2, and color3 values remain unchanged but they are multiplied by values from the color class.

            -

            You can omit the color class declaration in the .edc file and still use it in parts. There are no visual effects unless you change the color class in the code. For example, you can comment out the color class "B" and see what happens when you press the Change B button.

            -
          6. - -

            Figure: Edje colorclass application

            -

            Edje colorclass application

            - -
          - - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/edje_files_n.htm b/org.tizen.ui.guides/html/native/efl/edje_files_n.htm deleted file mode 100755 index 55b54b3..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_files_n.htm +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - Handling Edje Files - - - - - - -
          -

          Handling Edje Files

          - -

          This tutorial demonstrates how you can manage EDJ files. An EDJ file is a specific eet file that collects layouts. The Edje layout is called Style and created using the EDC language. The file that contains the layout collection called Theme.

          - -

          Initializing the Application

          - -

          The following example shows a typical Elementary application that creates a window entitled Genlist Basic Tutorial. It is consisted of a conformant widget that contains a naviframe widget. The genlist goes inside the naviframe.

          - -
          static void
          -create_base_gui(appdata_s *ad)
          -{
          -   char edj_path[PATH_MAX] = {0, };
          -
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_conformant_set(ad->win, EINA_TRUE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   if (elm_win_wm_rotation_supported_get(ad->win)) 
          -   {
          -      int rots[4] = {0, 90, 180, 270};
          -      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          -   }
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, ad);
          -
          -   // Conformant
          -   ad->conform = elm_conformant_add(ad->win);
          -   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
          -   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
          -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->conform);
          -   evas_object_show(ad->conform);
          -
          -   // Naviframe
          -   ad->navifr = elm_naviframe_add(ad->win);
          -   elm_object_content_set(ad->conform, ad->navifr);
          -   eext_object_event_callback_add(ad->navifr, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, ad);
          -
          -   // Genlist
          -   ad->itc = elm_genlist_item_class_new();
          -   ad->itc->func.text_get =_genlist_item_text_get;
          -
          -   ad->genlist = elm_genlist_add(ad->win);
          -   evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_naviframe_item_simple_push(ad->navifr, ad->genlist);
          -
          -   // Show window after base GUI is set up
          -   evas_object_show(ad->win);
          -}
          -
          -static bool
          -app_create(void *data)
          -{
          -   // Initialize UI resources and application data
          -   // If this function returns true, the main loop of application starts
          -   // If this function returns false, the application is terminated
          -   appdata_s *ad = data;
          -
          -   create_base_gui(ad);
          -
          -   return true;
          -}
          - -

          Declare the struct appdata:

          - -
          typedef struct appdata
          -{
          -   Evas_Object *win;
          -   Evas_Object *conform;
          -   Evas_Object *navifr;
          -   Evas_Object *genlist;
          -   Eina_List *list;
          -   Elm_Genlist_Item_Class *itc;
          -} 
          -appdata_s;
          - -

          Loading the Collection List from an EDJ File

          - -

          Edje provides the functionality to manipulate the EDJ files. First, get the list of styles from EDJ file:

          - -
          // Get the collection list from the EDJ file
          -app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
          -ad->list = edje_file_collection_list(edj_path);
          - -

          When you do not use the collection list, delete it:

          - -
          static void
          -win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *ad = data;
          -   // Free the collection list
          -   edje_file_collection_list_free(ad->list);
          -   ui_app_exit();
          -}
          - - - - - - - - - - -
          Note
          The list returned after using the edje_file_collection_list() function must only be deleted using the edje_file_collection_list_free() function.
          - -

          Add the item in the genlist to display the list:

          - -
          EINA_LIST_FOREACH(ad->list, l, str)
          -{
          -   elm_genlist_item_append(ad->genlist, ad->itc, str, NULL, ELM_GENLIST_ITEM_NONE, _genlist_clicked, ad);
          -}
          - - -

          Creating an Edje Object

          - -

          Implement callbacks for the clicked (tapped) event. Check that the required style exists using the edje_file_group_exists() function. The first argument is the path to EDJ file and style name. Create the Edje object and load the given style.

          - -
          static void
          -_genlist_clicked(void *data, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *ad = data;
          -   Elm_Object_Item *eoi = NULL;
          -   const char *str;
          -   char edj_path[PATH_MAX] = {0, };
          -   Evas_Object *edje_object;
          -
          -   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
          -   eoi = elm_genlist_selected_item_get(obj);
          -
          -   str = elm_object_item_part_text_get(eoi, "elm.text");
          -   // Check whether a group matching glob exists in an edje file
          -   // If there is no matching group
          -   if (!edje_file_group_exists(edj_path, str)) return;
          -
          -   // Load the given style to the object
          -   edje_object = edje_object_add(evas_object_evas_get(ad->win));
          -   edje_object_file_set(edje_object, edj_path, str);
          -   // Check object loading errors
          -   if (edje_object_load_error_get(edje_object) != EDJE_LOAD_ERROR_NONE)
          -   {
          -      evas_object_del(edje_object);
          -
          -      return;
          -   }
          -   evas_object_size_hint_weight_set(edje_object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_naviframe_item_simple_push(ad->navifr, edje_object);
          -}
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/edje_intro_n.htm b/org.tizen.ui.guides/html/native/efl/edje_intro_n.htm deleted file mode 100755 index dd8df7b..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_intro_n.htm +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - Introduction to EDC Programming - - - - - -
          - -

          Introduction to EDC Programming

          - - - -

          This programming guide shows you how to write an EDC file that can be used to theme a Tizen application. It describes concepts about parts positioning and resizing. It also explains part animations that can be done through programs.

          - -

          What is an EDC File?

          - -

          An EDC file stands for Edje data collection. It is a text file that contains special code format describing the position, size, and other parameters of graphical elements that compose the visual aspect of your application. In addition to graphical elements, it can also handle sounds.

          - -

          The syntax for the Edje data collection files follows a simple structure of "blocks { .. }" that can contain "properties: ..", more blocks, or both.

          - -

          An EDC file has the ".edc" extension.

          - -

          Compiling the EDC File

          -

          EDC file needs to be compiled into a ".edj" file using Edje library tools. After compiling the ".edj" file can be used by a native Tizen application.

          - -

          Here is an example about compiling helloworld.edc to ".edj" file using edje_cc tool:

          - -
          -$ edje_cc helloworld.edc
          -
          - -

          This command creates a helloworld.edj file.

          - -

          An EDC file can use external files such as sounds, images, or fonts. The path to these resources are passed to the edje_cc tool so that they are included in the final ".edj" file.

          - -
          -$ edje_cc -sd $SOUNDS_DIR -fd $FONTS_DIR -id $IMAGES_DIR
          -
          - -

          SOUNDS_DIR, FONTS_DIR, and IMAGES_DIR are the paths for sounds, fonts, and images resources respectively.

          - -

          Tizen SDK calls edje_cc during the project building if it finds an EDC source file in the ./res/edje/ directory.

          - -
          -Building file: ../res/edje/helloworld.edc
          -Invoking: EDC Resource Compiler
          -edje_cc -sd ../edje/sounds -fd ../edje/fonts -id ../edje/images ../res/edje/helloworld.edc ../res/edje/helloworld.edj
          -
          - - -

          The Tizen SDK compilation log extract shows you that if your EDC file uses pictures, they must be copied to the ./edje/images directory. Fonts and sounds go to the ./edje/fonts and ./edje/sounds directory respectively. The SDK builds the helloworld.edj file in the ./res/edje/ folder.

          - -

          Writing a Simple EDC File

          -

          The code example below shows you the structure of an EDC file. It is a collection of groups that contain parts and programs.

          - -
          -collections 
          -{
          -   group 
          -   {
          -      name: "my_group";
          -      parts {}
          -      programs {}
          -   }
          -}
          -
          - -

          Groups are identified with a name, parts correspond to the graphical elements. Each one of them can have several states that describe a specific position, size, and visual aspect. Programs contain the program code, such as interaction with the main application through signals. Also animations are defined here (changing a part state using an animated transition).

          - -

          The description field is where the state of a part is written.

          - -
          -part
          -{
          -   description 
          -   { 
          -      state: "default" 0.0;
          -   }
          -   description 
          -   { 
          -      state: "state1" 0.0;
          -   }
          -   description 
          -   { 
          -      state: "state2" 0.0;
          -   }
          -}
          -
          - -

          As an example, here is a simple EDC file that contains only one part and one program. The part is a rectangle with blue state and red state, the program changes the state from blue to red when user clicks on the rectangle.

          - -
          -collections 
          -{
          -   group 
          -   {
          -      name: "example";
          -      parts 
          -      {
          -         // create the part
          -         part 
          -         { 
          -            name: "rectangle";
          -            // set the type to RECT (rectangle)
          -            type: RECT;
          -            // default state (blue color)
          -            description 
          -            { 
          -               state: "default" 0.0;
          -               align: 0.0 0.0;
          -               // blue color
          -               color: 0 0 255 255;
          -            }
          -            // second state (red color)
          -            description 
          -            { 
          -               state: "red" 0.0;
          -               align: 0.0 0.0;
          -               // red color
          -               color: 255 0 0 255;
          -            }
          -         }
          -      }
          -      programs 
          -      {
          -         // create a program
          -         program 
          -         { 
          -            name: "change_color";
          -            // program is triggered on mouse click
          -            signal: "mouse,clicked,*";
          -            source: "*";
          -            // set the red state of the "rectangle" part
          -            action: STATE_SET "red" 0.0;
          -            target: "rectangle";
          -         }
          -      }
          -   }
          -}
          -
          - -

          A program is triggered when receiving a signal from a specific source (here all the sources are taken into account). When launched, it does the action (changing the state of a part) on the target (the rectangle).

          - -

          Quick How-tos

          - -
          • Adding an element on the screen -

            Add a new part inside the parts block.

          • -
          • Using an image -

            List the image in the images block, make sure the part has type "IMAGE" and set the normal property inside description.image of part.

          • -
          • Using the same color definitions across multiple elements -

            Define a color class and set the description.color_class property.

          • -
          • Positioning or resizing a part (relative and absolute positioning) -

            Fill in the rel1 and rel2 structures inside the description block.

          • -
          • Hiding a part -

            Set the visible property to 0.

          • -
          • Animating a part -
            1. Create several description blocks inside your part and give each of them a different value for state. Set one description for the initial state and one for the end state.

            2. -
            3. Create a program with an action that is STATE_SET "end_state" 0.0; and with a target that is the name of the part. You can also set a non-default transition.

            4. -
            5. When defining the second description, inherit from the first part in order to re-use the values which are already defined.

            6. -
            7. The after property of the program block is used to trigger another program after the animation is done. It can be used to trigger another animation or to emit a signal to the C part of the program.

          • -
          • Making a genlist item theme -

            Create a group with one part element for each part that can be filed from the C code and set the items properties inside the group element:

            - -
            -items: "texts" "text_part_1 text_part_2";
            -items: "icons" "image_part_1 image_part_2";
            -
            -

            On the C side, the text_get and content_get callback are called respectively with text_part_1 and text_part_2, and image_part_1 and image_part_2.

          • - -
          • Using the image masking effect -

            EDC files support an image masking effect that applies the transparency of a mask image to a content object.

            - -

            Figure: Masking effect

            -

            Masking effect

            - -

            To use the image masking effect, add 2 new parts inside the parts block used as a content and mask. Set the mask using the clip_to keyword in the content part.

            -
            -part 
            -{
            -   name: "bg";
            -   type: RECT;
            -   description 
            -   {
            -      state: "default" 0.0;
            -   }
            -}
            -part 
            -{
            -   name: "text";
            -   type: TEXTBLOCK;
            -   clip_to: "mask";
            -   description 
            -   {
            -      state: "default" 0.0;
            -      align: 0.5 0.5;
            -      text 
            -      {
            -         style: "text_style";
            -         text: "TEXT<br>WITH<br>MASK";
            -      }
            -   }
            -}
            -part 
            -{
            -   name: "mask";
            -   type: IMAGE;
            -   description 
            -   {
            -      state: "default" 0.0;
            -      image.normal: "mask.png";
            -   }
            -}
            -
            -

            The content part is cropped off in the mask shape, which depends on the alpha value per pixel. The content part can be almost any type in the EDC files, but the mask part can only be the IMAGE type.

            -
          • -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edje_manage_animation_n.htm b/org.tizen.ui.guides/html/native/efl/edje_manage_animation_n.htm deleted file mode 100755 index 23049bf..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_manage_animation_n.htm +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - Edje Animations - - - - - -
          - -

          Edje Animations

          - -

          This tutorial demonstrates how you can turn Edje animations on and off, pause, stop and resume them, and check the status of Edje parts.

          - - -

          Creating the Application Layout

          - -

          Create a simple application with a menu and separate screens for each Edje Animation function:

          - -
            -
          1. -

            Create a simple main layout with a swallow for demo animation and another for controls:

            - -
            collections 
            -{
            -   group 
            -   {
            -      name: "demo";
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "swallow.demo";
            -            type: SWALLOW;
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel2 
            -               {
            -                  relative: 1.0 0.0;
            -                  to_y: "swallow.control";
            -               }
            -            }
            -         }
            -         part 
            -         {
            -            name: "swallow.control";
            -            type: SWALLOW;
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 
            -               {
            -                  relative: 0.0 0.8;
            -               }
            -            }
            -         }
            -      }
            -   }
            -}
            -
            -
          2. - -
          3. -

            Create a group for the cycled animation:

            -
            group 
            -{
            -   name: "cycled_animation";
            -   parts 
            -   {
            -      part 
            -      {
            -         name: "bg";
            -         type: RECT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            color: 100 100 100 255;
            -         }
            -         description 
            -         {
            -            state: "clicked" 0.0;
            -            color: 200 100 100 255;
            -         }
            -      }
            -      part 
            -      {
            -         name: "a";
            -         type: RECT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            color: 0 255 0 255;
            -            rel2 
            -            {
            -               relative: 0.3 0.3;
            -            }
            -         }
            -         description 
            -         {
            -            state: "red" 0.0;
            -            color: 255 0 0 255;
            -            rel1 
            -            {
            -               relative: 0.35 0.7;
            -            }
            -            rel2 
            -            {
            -               relative: 0.65 1.0;
            -            }
            -         }
            -         description 
            -         {
            -            state: "blue" 0.0;
            -            color: 0 0 255 255;
            -            rel1 
            -            {
            -               relative: 0.7 0.0;
            -            }
            -            rel2 
            -            {
            -               relative: 1.0 0.3;
            -            }
            -         }
            -      }
            -   }
            -   programs 
            -   {
            -      program 
            -      {
            -         name: "bg_click";
            -         signal: "mouse,clicked,*";
            -         source: "bg";
            -         action: STATE_SET "clicked" 0.0;
            -         target: "bg";
            -      }
            -      program 
            -      {
            -         name: "step1";
            -         signal: "load";
            -         source: "";
            -         action: STATE_SET "red" 0.0;
            -         transition: LINEAR 1.0;
            -         target: "a";
            -         after: "step2";
            -      }
            -      program 
            -      {
            -         name: "step2";
            -         action: STATE_SET "blue" 0.0;
            -         transition: LINEAR 1.0;
            -         target: "a";
            -         after: "step3";
            -      }
            -      program 
            -      {
            -         name: "step3";
            -         action: STATE_SET "default" 0.0;
            -         transition: LINEAR 1.0;
            -         target: "a";
            -         after: "step1";
            -      }
            -   }
            -}
            -
          4. - -
          5. -

            Create another group for animation that can be activated by clicking:

            -
            group 
            -{
            -   name: "clickme";
            -   parts 
            -   {
            -      part 
            -      {
            -         name: "bg";
            -         type: RECT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            color: 100 100 100 255;
            -         }
            -      }
            -      part 
            -      {
            -         name: "text_bg";
            -         type: RECT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            rel1 
            -            {
            -               to: "text";
            -            }
            -            rel2 
            -            {
            -               to: "text";
            -            }
            -         }
            -      }
            -      part 
            -      {
            -         name: "text";
            -         type: TEXT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            color: 0 0 0 255;
            -            text 
            -            {
            -               text: ":-)";
            -               font: "Sans";
            -               size: 42;
            -               min: 1 1;
            -               max: 1 1;
            -            }
            -         }
            -         description 
            -         {
            -            state: "state2" 0.0;
            -            inherit: "default" 0.0;
            -            align: 1.0 1.0;
            -            text.text: ":-D";
            -         }
            -      }
            -      part 
            -      {
            -         name: "text_bg2";
            -         type: RECT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            color: 0 200 0 255;
            -            rel1 
            -            {
            -               to: "text2";
            -            }
            -            rel2 
            -            {
            -               to: "text2";
            -            }
            -         }
            -         description 
            -         {
            -            state: "state2" 0.0;
            -            inherit: "default" 0.0;
            -            color: 200 0 0 255;
            -         }
            -      }
            -      part 
            -      {
            -         name: "text2";
            -         type: TEXT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            align: 0.0 1.0;
            -            visible: 0;
            -            text 
            -            {
            -               text: "Click me";
            -               font: "Sans";
            -               size: 42;
            -               min: 1 1;
            -               max: 1 1;
            -            }
            -         }
            -         description 
            -         {
            -            state: "state2" 0.0;
            -            inherit: "default" 0.0;
            -            visible: 1;
            -         }
            -      }
            -      part 
            -      {
            -         name: "text3";
            -         type: TEXT;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            align: 0.0 1.0;
            -            visible: 1;
            -            text 
            -            {
            -               text: "Click me";
            -               font: "Sans";
            -               size: 42;
            -               min: 1 1;
            -               max: 1 1;
            -            }
            -         }
            -         description 
            -         {
            -            state: "state2" 0.0;
            -            inherit: "default" 0.0;
            -            visible: 0;
            -         }
            -      }
            -   }
            -   programs 
            -   {
            -      program 
            -      {
            -         name: "clicked";
            -         signal: "mouse,clicked,1";
            -         source: "text3";
            -         action: STATE_SET "state2" 0.00;
            -         transition: LINEAR 3.00000;
            -         target: "text";
            -         target: "text2";
            -         target: "text3";
            -         target: "text_bg2";
            -      }
            -      program 
            -      {
            -         name: "return";
            -         signal: "mouse,clicked,1";
            -         source: "text2";
            -         action: STATE_SET "default" 0.00;
            -         transition: LINEAR 1.00000;
            -         target: "text";
            -         target: "text2";
            -         target: "text3";
            -         target: "text_bg2";
            -      }
            -   }
            -}
            -
          6. -
          - -

          Creating the Application Logic

          - -
            -
          1. Create new project named test.
          2. - -
          3. Add 2 new files to the application project:edje_animation.h and edje_animation.c.
          4. -
          5. To access the application data from the newly created files, move the appdata_s structure from the test.c file to the test.h file and remove the static specifier.
          6. - -
          7. Add the following code to the edje_animation.h file: -
            #ifndef __edje_animation_H__
            -#define __edje_animation_H__
            -#include "test.h"
            -
            -typedef struct _edje_animation_item_s 
            -{
            -   const char *name;
            -   Evas_Object* (*func)(appdata_s *ap);
            -} 
            -Edje_Animation_Menu_Item;
            -
            -#endif // __edje_animation_H__
            - -

            This structure will define menu items and their callbacks.

            -
          8. - -
          9. -

            Create a global menu array in the edje_animation.c file and fill it with necessary items:

            -
            Edje_Animation_Menu_Item edje_animation_items[] =
            -{
            -   {"test1", _test1_func },
            -   {"test2", _test2_func },
            -
            -   {NULL, NULL } // Do not delete
            -};
            -
          10. - -
          11. -

            Use the array to fill the main menu:

            -
            extern Edje_Animation_Menu_Item edje_animation_items[];
            -
            -static void
            -create_base_gui(appdata_s *ad)
            -{
            -   // Genlist
            -   ad->itc = elm_genlist_item_class_new();
            -   ad->itc->func.text_get =_genlist_item_text_get;
            -   ad->genlist = elm_genlist_add(ad->win);
            -   evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -
            -   int i;
            -   Elm_Object_Item *eoi = NULL;
            -
            -   for (i = 0; edje_animation_items[i].name; ++i)
            -   {
            -      eoi = elm_genlist_item_append(ad->genlist, ad->itc, edje_animation_items[i].name, NULL,
            -                                    ELM_GENLIST_ITEM_NONE, _genlist_clicked, ad);
            -      elm_object_item_data_set(eoi, (void *)&edje_animation_items[i]);
            -   }
            -}
            -
          12. - -
          13. All examples use the same basic layout: -
            static void
            -app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max)
            -{
            -   char *res_path = app_get_resource_path();
            -   if (res_path) 
            -   {
            -        snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in);
            -        free(res_path);
            -   }
            -}
            -
            -static void
            -_example_layout_create(appdata_s *ad,
            -                       const char *layout_group,
            -                       const char *demo_group,
            -                       Evas_Object **layout_out,
            -                       Evas_Object **animation_out)
            -{
            -   char edj_path[PATH_MAX] = {0, };
            -
            -   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -
            -   *layout_out = elm_layout_add(ad->win);
            -   elm_layout_file_set(*layout_out, edj_path, layout_group);
            -   evas_object_size_hint_weight_set(*layout_out, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -
            -   *animation_out = edje_object_add(evas_object_evas_get(ad->win));
            -   edje_object_file_set(*animation_out, edj_path, demo_group);
            -   evas_object_size_hint_weight_set(*animation_out, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_layout_content_set(*layout_out, SWALLOW_DEMO, *animation_out);
            -   evas_object_show(*animation_out);
            -}
            -
          14. - -
          15. You can try out the following operations to see how the application works: - -
              -
            • Check the time for each frame. - -

              The edje_frametime_get() function allows you to check how much time is elapsed for single frame. This is a value of an internal parameter and not actual frame time. You can change it using the edje_frametime_set() function.

              - - - - - - - - - - -
              Note
              Changing the frame time affects all objects on the same canvas, not only on the given one.
              - -

              Use the edje_frametime_get() function and edje_frametime_set() function in the edje_animation.c file:

              -
              // edje_frametime_set/get
              -static void
              -_frametime_test_spinner_changed_cb(void *data, Evas_Object *obj, void *event_info)
              -{
              -   edje_frametime_set(elm_spinner_value_get(obj));
              -}
              -
              -Evas_Object *
              -frametime_test(appdata_s *ad)
              -{
              -   Evas_Object *layout, *animation, *spinner;
              -   _example_layout_create(ad, GRP_DEMO, GRP_CYCLED_ANIM, &layout, &animation);
              -
              -   spinner = elm_spinner_add(ad->win);
              -   elm_spinner_label_format_set(spinner, "Frame_t: %1.3f");
              -   double framerate = edje_frametime_get();
              -   elm_spinner_min_max_set(spinner, 0.001, 2.0);
              -   elm_spinner_step_set(spinner, 0.005);
              -   elm_spinner_value_set(spinner, framerate);
              -   evas_object_smart_callback_add(spinner, "changed", _frametime_test_spinner_changed_cb, NULL);
              -   elm_layout_content_set(layout, SWALLOW_CONTROL, spinner);
              -   evas_object_show(spinner);
              -
              -   return layout;
              -}
              -
              -Edje_Animation_Menu_Item edje_animation_items[] =
              -{
              -   {"frametime test", frametime_test},
              -
              -   {NULL, NULL}
              -};
              - -

              The spinner displays the current frame time value and enables changing it. Extreme values (> 0.9) are affecting animation.

              - -

              Figure: Displaying the frame time

              -

              Displaying the frame time

              - -
            • - -
            • Pause and resume animation and check its status. - -

              The edje_object_play_set() function allows you to pause or resume animation for a given object. A resumed animation starts from the same point.

              -

              To check whether the animation is paused, use the edje_object_play_get() function.

              - -
              // edje_object_play_set/get
              -static void
              -_play_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              -{
              -   Evas_Object *anim = data;
              -   if (edje_object_play_get(anim))
              -   {
              -      edje_object_play_set(anim, EINA_FALSE);
              -      elm_object_text_set(obj, "Play");
              -   }
              -   else
              -   {
              -      edje_object_play_set(anim, EINA_TRUE);
              -      elm_object_text_set(obj, "Pause");
              -   }
              -}
              -
              -Evas_Object *
              -play_test(appdata_s *ad)
              -{
              -   Evas_Object *layout, *animation, *button;
              -   _example_layout_create(ad, GRP_DEMO, GRP_CYCLED_ANIM, &layout, &animation);
              -   button = elm_button_add(ad->win);
              -   elm_object_text_set(button, "Pause");
              -   evas_object_smart_callback_add(button, "clicked", _play_test_button_cb, animation);
              -   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              -   evas_object_show(button);
              -
              -   return layout;
              -}
              -
              -Edje_Animation_Menu_Item edje_animation_items[] =
              -{
              -   {"frametime test", frametime_test},
              -   {"play test", play_test},
              -   
              -   {NULL, NULL}
              -};
              -
            • - -
            • Stop the animation. - -

              The edje_object_freeze() function allows you to stop animation rendering. This function puts all changes on hold. Successive freezes are nested, requiring an equal number of thaws. Using the edje_object_thaw() function, you can apply all changes immediately.

              - -
              // edje_object_freeze/thaw
              -static void
              -_freeze_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              -{
              -   Evas_Object *anim = data;
              -   static int i = 0;
              -   if(!i)
              -   {
              -      i = edje_object_freeze(anim);
              -      elm_object_text_set(obj, "Thaw");
              -   }
              -   else
              -   {
              -      i = edje_object_thaw(anim);
              -      elm_object_text_set(obj, "Freeze");
              -   }
              -}
              -
              -Evas_Object *
              -freeze_test(appdata_s *ad)
              -{
              -   Evas_Object *layout, *animation, *button;
              -   _example_layout_create(ad, GRP_DEMO, GRP_CYCLED_ANIM, &layout, &animation);
              -
              -   button = elm_button_add(ad->win);
              -   elm_object_text_set(button, "Freeze");
              -   evas_object_smart_callback_add(button, "clicked", _freeze_test_button_cb, animation);
              -   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              -   evas_object_show(button);
              -
              -   return layout;
              -}
              -
              -Edje_Animation_Menu_Item edje_animation_items[] =
              -{
              -   {"frametime test", frametime_test},
              -   {"play test", play_test},
              -   {"freeze/thaw test", freeze_test},
              -
              -   {NULL, NULL}
              -};
              - -

              The edje_freeze() function and edje_thaw() function freeze or thaw all objects in the entire application.

              -
            • - -
            • Enable and disable the animation. - -

              All transitions in edje programs are ignored and parts go directly to their final states.

              - -
              // edje_object_animation_set/get
              -static void
              -_animation_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              -{
              -   Evas_Object *anim = data;
              -   if (edje_object_animation_get(anim))
              -   {
              -      edje_object_animation_set(anim, EINA_FALSE);
              -      elm_object_text_set(obj, "Turn animation on");
              -   }
              -   else
              -   {
              -      edje_object_animation_set(anim, EINA_TRUE);
              -      elm_object_text_set(obj, "Turn animation off");
              -   }
              -}
              -
              -Evas_Object *
              -animation_test(appdata_s *ad)
              -{
              -   Evas_Object *layout, *animation, *button;
              -   _example_layout_create(ad, GRP_DEMO, GRP_CLICKME, &layout, &animation);
              -
              -   button = elm_button_add(ad->win);
              -   elm_object_text_set(button, "Turn animation off");
              -   evas_object_smart_callback_add(button, "clicked", _animation_test_button_cb, animation);
              -   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              -   evas_object_show(button);
              -
              -   return layout;
              -}
              -
              -Edje_Animation_Menu_Item edje_animation_items[] =
              -{
              -   {"frametime test", frametime_test},
              -   {"play test", play_test},
              -   {"freeze/thaw test", freeze_test},
              -   {"animation test", animation_test},
              -
              -   {NULL, NULL}
              -};
              -
            • - -
            • Get the current state of given part. - -

              Parts that are in transition return the transition's starting state.

              - -
              // edje_object_part_state_get
              -static void
              -_state_get_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              -{
              -   Evas_Object *anim = data;
              -   const char *state;
              -   double state_val = 0;
              -   state = edje_object_part_state_get(anim, "text", &state_val);
              -   edje_object_part_text_set(anim, "text", state);
              -}
              -
              -Evas_Object *
              -state_get_test(appdata_s *ad)
              -{
              -   Evas_Object *layout, *animation, *button;
              -   _example_layout_create(ad, GRP_DEMO, GRP_CLICKME, &layout, &animation);
              -
              -   button = elm_button_add(ad->win);
              -   elm_object_text_set(button, "Get state");
              -   evas_object_smart_callback_add(button, "clicked", _state_get_test_button_cb, animation);
              -   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              -   evas_object_show(button);
              -
              -   return layout;
              -}
              -
              -Edje_Animation_Menu_Item edje_animation_items[] =
              -{
              -   {"frametime test", frametime_test},
              -   {"play test", play_test},
              -   {"freeze/thaw test", freeze_test},
              -   {"animation test", animation_test},
              -   {"part state get test", state_get_test},
              -
              -   {NULL, NULL}
              -};
              -
            • -
            -
          16. -
          - - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edje_message_signal_n.htm b/org.tizen.ui.guides/html/native/efl/edje_message_signal_n.htm deleted file mode 100755 index 958a3fe..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_message_signal_n.htm +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - - - - - - - - Managing Signals and Messages - - - - - -
          - -

          Managing Signals and Messages

          - - -

          Edje objects have 2 communication interfaces between the application logic (code) and GUI (theme). You can either emit a signal from the code to the theme, or create handles for the signals emitted from the theme. Signals are identified by strings. With Edje messages, you can communicate values, such as strings, float numbers, and integer numbers. Messages can also be identified by integer numbers.

          - - -

          Signals

          -

          You can emit signals from code to a theme, or create handles for the signals emitted from themes. Signals are identified by strings.

          - -

          Using signals in the EDC file is simple. Create a program and set the signal name to the signal attribute.

          - -
          -group 
          -{ 
          -   name: "main";
          -   parts 
          -   {
          -      part 
          -      { 
          -         name: "rect1";
          -         type: RECT;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            min: 100 100;
          -            max: 100 100;
          -            color: 255 0 0 255;
          -         }
          -         description 
          -         { 
          -            state: "default" 1.0;
          -            min: 100 100;
          -            max: 100 100;
          -            color: 0 0 255 255;
          -         }
          -      }
          -      part 
          -      { 
          -         name: "swallow.check";
          -         type: SWALLOW;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            align: 0.5 0.0;
          -            rel2 
          -            {
          -               relative: 0.0 0.0;
          -               to_x: "swallow.slider_ver";
          -            }
          -         }
          -      }
          -   }
          -   programs 
          -   {
          -      program 
          -      { 
          -         name: "to_default_0";
          -         signal: "to,state,default,0";
          -         action: STATE_SET "default" 0.00;
          -         transition: ACCELERATE 0.5 CURRENT;
          -         target: "rect1";
          -      }
          -      program 
          -      { 
          -         name: "to_default_1";
          -         signal: "to,state,default,1";
          -         action: STATE_SET "default" 1.00;
          -         transition: ACCELERATE 0.5 CURRENT;
          -         target: "rect1";
          -      }
          -   }
          -}
          -
          - -

          Emitting Signals from the C Code

          - -

          Create the Edje Object and widget check. When a changed event is triggered, a signal is emitted from the C code to the EDC file.

          - -
          -static void
          -create_base_gui(appdata_s *ad)
          -{
          -   char edj_path[PATH_MAX] = {0, };
          -   
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_conformant_set(ad->win, EINA_TRUE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   if (elm_win_wm_rotation_supported_get(ad->win)) 
          -   {
          -      int rots[4] = { 0, 90, 180, 270 };
          -      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          -   }
          -
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          -
          -   // Conformant
          -   ad->conform = elm_conformant_add(ad->win);
          -   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
          -   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
          -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->conform);
          -   evas_object_show(ad->conform);
          -
          -   // Base layout
          -   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
          -   ad->edje_object = edje_object_add(evas_object_evas_get(ad->win));
          -   edje_object_file_set(ad->edje_object, edj_path, GRP_MAIN);
          -   evas_object_size_hint_weight_set(ad->edje_object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   
          -   ad->check = elm_check_add(ad->win);
          -   edje_object_part_swallow(ad->edje_object, "swallow.check", ad->check);
          -   evas_object_smart_callback_add(ad->check, "changed", _check_toggled, ad);
          -
          -   elm_object_content_set(ad->conform, ad->edje_object);
          -   // Show the window
          -   evas_object_show(ad->win);
          -}
          -
          - -

          The following figure displays the result.

          - -

          Figure: Signal implemented on the screen

          -

          Signal implemented on the screen

          - -

          The following example implements the callback for the changed event from the widget check.

          -
          -static void
          -_check_toggled(void *data, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *ad = data;
          -
          -   if (elm_check_state_get(obj))
          -      edje_object_signal_emit(ad->edje_object, "to,state,default,1", "");
          -   else
          -      edje_object_signal_emit(ad->edje_object, "to,state,default,0", "");
          -}
          -
          - -

          The following figure displays the result.

          - -

          Figure: Widget check status changed

          -

          Widget check status changed

          - - -

          Messages

          - -

          Edje messages are used for communication between code and a given Edje object's theme. With messages, you can communicate values, such as strings, float numbers, and integer numbers. Messages can also be identified by integer numbers.

          - -

          In the following example, the rect1 part is made draggable and 2 sliders added to change the part position.

          - -
          -group 
          -{ 
          -   name: "main";
          -   parts 
          -   {
          -      part 
          -      { 
          -         name: "drag_area";
          -         type: RECT;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            rel1 
          -            {
          -               relative: 0.0 1.0;
          -               to_y: "swallow.check";
          -            }
          -            rel2 
          -            {
          -               relative: 0.0 0.0;
          -               to_x: "swallow.slider_ver";
          -               to_y: "swallow.slider_hor";
          -            }
          -         }
          -      }
          -      part 
          -      { 
          -         name: "rect1";
          -         type: RECT;
          -         dragable 
          -         {
          -            x: 1 1 1;
          -            y: 1 1 1;
          -            confine: "drag_area";
          -         }
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            min: 100 100;
          -            max: 100 100;
          -            color: 255 0 0 255;
          -         }
          -         description { state: "default" 1.0;
          -            min: 100 100;
          -            max: 100 100;
          -            color: 0 0 255 255;
          -         }
          -      }
          -      part 
          -      { 
          -         name: "swallow.check";
          -         type: SWALLOW;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            align: 0.5 0.0;
          -            rel2 
          -            {
          -               relative: 0.0 0.0;
          -               to_x: "swallow.slider_ver";
          -            }
          -         }
          -      }
          -      part 
          -      { 
          -         name: "swallow.slider_ver";
          -         type: SWALLOW;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            align: 1.0 0.5;
          -            rel1 
          -            {
          -               relative: 1.0 1.0;
          -               to_y: "swallow.check";
          -            }
          -            rel2 
          -            {
          -               relative: 1.0 0.0;
          -               to_y: "swallow.slider_hor";
          -            }
          -         }
          -      }
          -      part 
          -      { 
          -         name: "swallow.slider_hor";
          -         type: SWALLOW;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            align: 0.5 1.0;
          -            rel1 
          -            {
          -               relative: 0.0 1.0;
          -            }
          -            rel2 
          -            {
          -               relative: 0.0 1.0;
          -               to_x: "swallow.slider_ver";
          -            }
          -         }
          -      }
          -   }
          -   programs 
          -   {
          -      program 
          -      { 
          -         name: "to_default_0";
          -         signal: "to,state,default,0";
          -         action: STATE_SET "default" 0.00;
          -         transition: ACCELERATE 0.5 CURRENT;
          -         target: "rect1";
          -      }
          -      program 
          -      { 
          -         name: "to_default_1";
          -         signal: "to,state,default,1";
          -         action: STATE_SET "default" 1.00;
          -         transition: ACCELERATE 0.5 CURRENT;
          -         target: "rect1";
          -      }
          -      program 
          -      {
          -         signal: "drag";
          -         source: "rect1";
          -         script 
          -         {
          -               new Float:x, Float:y;
          -               get_drag(PART:"rect1", x, y);
          -               send_message(MSG_FLOAT, 2, x);
          -               send_message(MSG_FLOAT, 3, y);
          -         }
          -      }
          -   }
          -}
          -
          - -

          Add the sliders:

          - -
          -ad->slider_ver = elm_slider_add(ad->win);
          -edje_object_part_swallow(ad->edje_object, "swallow.slider_ver", ad->slider_ver);
          -elm_slider_horizontal_set(ad->slider_ver, EINA_FALSE);
          -evas_object_smart_callback_add(ad->slider_ver, "changed", _slider_changed, ad);
          -
          -ad->slider_hor = elm_slider_add(ad->win);
          -evas_object_smart_callback_add(ad->slider_hor, "changed", _slider_changed, ad);
          -
          - -

          The following figure displays the result.

          -

          Figure: Sliders added

          -

          Sliders added

          - -

          To handle the message in the Style, add the following script to the EDC file:

          - -
          -group 
          -{ 
          -   name: "main";
          -   script 
          -   {      	
          -      public message(Msg_Type:type, id, ...) 
          -      {
          -         if ((type == MSG_FLOAT_SET) && (id == 1)) 
          -         {
          -            new Float:x, Float:y;
          -            
          -            x = getfarg(2);
          -            y = getfarg(3);
          -            set_drag(PART:"rect1", x, y);
          -         }
          -      }
          -   }
          -}
          -
          - -

          This script is called when an incoming message is detected.

          - -

          Sending Messages

          - -

          Add a callback for the changed event to send a message to the Style:

          - -
          -static void
          -_slider_changed(void *data, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *ad = data;
          -   Edje_Message_Float_Set *msg;
          -   
          -   msg = malloc(sizeof(*msg) + 1 * sizeof(float));
          -   msg->count = 2;
          -   msg->val[0] = elm_slider_value_get(ad->slider_hor);
          -   msg->val[1] = elm_slider_value_get(ad->slider_ver);
          -   
          -   edje_object_message_send(ad->edje_object, EDJE_MESSAGE_FLOAT_SET, 1, msg);
          -   free(msg);
          -}
          -
          - -

          The same message can be sent in the opposite direction. To send messages in EDC script (Embryo – link to Embryo), use the sent_message() function.

          - -
          -program 
          -{
          -   signal: "drag";
          -   source: "rect1";
          -   script 
          -   {
          -      new Float:x, Float:y;
          -      get_drag(PART:"rect1", x, y);
          -      send_message(MSG_FLOAT, 2, x);
          -      send_message(MSG_FLOAT, 3, y);
          -   }
          -}
          -
          - -

          2 messages are sent using the drag signal from the rect1 part.

          - -

          Add a message handler in the C code:

          - -
          -edje_object_message_handler_set(ad->edje_object, _message_handle, ad);
          -
          - -

          Add a callback:

          - -
          -static void
          -_message_handle(void *data, Evas_Object *obj, Edje_Message_Type type,
          -                int id, void *msg)
          -{
          -   Edje_Message_Float *m;
          -   appdata_s *ad = data;
          -   
          -   if (type != EDJE_MESSAGE_FLOAT) return;
          -   m = msg;
          -   if (id == 2) elm_slider_value_set(ad->slider_hor, m->val);
          -   if (id == 3) elm_slider_value_set(ad->slider_ver, m->val);
          -}
          -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edje_objects_n.htm b/org.tizen.ui.guides/html/native/efl/edje_objects_n.htm deleted file mode 100755 index 0c0bb0b..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_objects_n.htm +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - Edje Objects: Managing Layouts and Layout Components - - - - - -
          - -

          Edje Objects: Managing Layouts and Layout Components

          - - -

          You can build and handle layouts using Edje objects. An Edje object is a type of Evas object for displaying units, such as rectangles, lines, polygons, text, and images. Edje objects are only used in Edje and provide functions that deal with Edje layouts and layout components. Namely, there is no Edje object type in the source code for implementing an application. The objects are mainly layouts or themes defined by groups and parts, and declared in EDC files.

          -

          Edje provides functions for the following features:

          - -
            -
          • Handling Edje Files -

            Edje layouts are called themes and created using the EDC language. The EDC language is declarative and must be compiled before being used. The output of this compilation is an EDJ file, which can be loaded by Edje, and the result is an Edje object.

          • - -
          • Scaling Edje Objects -

            Edje enables you to build scalable interfaces. There are 2 types of scaling factors, which are set to neutral (1.0) values by default (no scaling, actual sizes): global and individual. Scaling affects the minimum and maximum values of the part sizes, which are multiplied. Font sizes are scaled, too.

          • - -
          • Using Edje Color Classes -

            To change the color and text of 2 or more parts simultaneously, you can use color classes. If parts are assigned with a color class, setting the color values to this class causes all the parts to have their colors multiplied by the values. Setting the values to a color class at a process level affects all parts with that color class, while at the object level, only the parts inside a specified object are affected.

          • - -
          • Using Edje Text Classes -

            To change the text of 2 or more parts simultaneously, you can use text classes. If parts are assigned with a text class, setting the font attributes to this class updates all these parts with the new font attributes. Setting the values to a text class at a process level affects all parts with that text class, while at the object level, only the parts inside a specified object are affected.

          • - -
          • Using Edje Perspective -

            Perspective is a graphical tool that makes 2D objects appear as 3D. The perspective can be used with all Edje objects.

          • - -
          • Managing Signals and Messages -

            Edje objects have 2 communication interfaces between the logic and GUI. You can either emit a signal from the logic to the GUI, or create handles for the signals emitted from the GUI. Signals are identified by strings. With Edje messages, you can communicate values, such as strings, float numbers, and integer numbers. Messages can also be identified by integer numbers.

          • - -
          • Managing Edje Animations -

            Edje has the ability to animate their objects. You can start, stop, play, pause, freeze, and thaw Edje animations, and check their status.

          • -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edje_perspective_n.htm b/org.tizen.ui.guides/html/native/efl/edje_perspective_n.htm deleted file mode 100755 index cb50901..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_perspective_n.htm +++ /dev/null @@ -1,486 +0,0 @@ - - - - - - - - - - - - - Using Edje Perspective - - - - - -
          - -

          Using Edje Perspective

          - - -

          This tutorial demonstrates how you can create a 3D projection of a 2D object.

          -

          Edje Perspective is a graphical tool that makes 2D objects appear like they have a 3D appearance.

          -

          Edje Perspective can be used in all Edje objects to create and configure a perspective objects and to set the to an Edje object or a canvas, affecting all the objects within that have no specific perspective already defined.

          - -

          Creating the Basic Application

          -

          The perspective application has buttons to move the Edje object and change its perspective. The Edje object is a 2D object that changes its position so that the perspective point can be applied.

          - - - - - - - - - - -
          Note
          The loaded Edje object must have the perspective option enabled in its EDC source code.
          - -

          Create a simple Edje object that has 4 states: left-top, right-top, left-bottom, and right-bottom. Clicking a button emits signals into the object and makes the object move.

          - -
            -
          1. - -

            The following example implements the Edje object:

            - -
            -group 
            -{
            -   name: "example/group";
            -   min: 480 320;
            -   parts 
            -   {
            -      part 
            -      {
            -         name: "bg";
            -         type: RECT;
            -         mouse_events: 1;           
            -         description 
            -         {
            -            state: "default" 0.0;
            -         }
            -      }       
            -      part 
            -      {
            -         name: "rectangle";
            -         type: RECT;
            -         mouse_events: 0;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            color: 255 0 0 128;
            -            rel1 
            -            {
            -               offset: -5 -5;
            -               to: "title";
            -            }
            -            rel2 
            -            {
            -               offset: 4 4;
            -               to: "title";
            -            }
            -            map 
            -            {
            -               on: 1;
            -               perspective_on: 1;
            -               rotation 
            -               {
            -                  x: 45;
            -                  y: 15;
            -               }
            -            }
            -         }
            -      }
            -      part 
            -      {
            -         name: "title";
            -         type: TEXT;
            -         mouse_events: 0;
            -         description 
            -         {
            -            state: "default" 0.0;
            -            color: 200 200 200 255;
            -            align: 0.0 0.5;
            -            rel1.relative: 0.2 0.2;
            -            rel2.relative: 0.2 0.2;
            -            text 
            -            {
            -               text: "Perspective example";
            -               font: "Sans";
            -               size: 16;
            -               min: 1 1;
            -            }
            -            map 
            -            {
            -               on: 1;
            -               perspective_on: 1;
            -               rotation 
            -               {
            -                  x: 45;
            -                  y: 15;
            -               }
            -            }
            -         }
            -         description 
            -         {
            -            state: "right" 0.0;
            -            inherit: "default" 0.0;
            -            rel1.relative: 0.5 0.2;
            -            rel2.relative: 0.5 0.2;
            -         }
            -         description 
            -         {
            -            state: "bottom" 0.0;
            -            inherit: "default" 0.0;
            -            rel1.relative: 0.2 0.8;
            -            rel2.relative: 0.2 0.8;
            -         }
            -         description 
            -         {
            -            state: "bottomright" 0.0;
            -            inherit: "default" 0.0;
            -            rel1.relative: 0.5 0.8;
            -            rel2.relative: 0.5 0.8;
            -         }
            -      }
            -   }
            -   programs 
            -   {
            -      program 
            -      {
            -         name: "move,right";
            -         signal: "move,1,0";
            -         action: STATE_SET "right" 0.0;
            -         transition: SINUSOIDAL 1.0;
            -         target: "title";
            -         after: "animation,end";
            -      }
            -      program 
            -      {
            -         name: "move,bottom";
            -         signal: "move,0,1";
            -         action: STATE_SET "bottom" 0.0;
            -         transition: SINUSOIDAL 1.0;
            -         target: "title";
            -         after: "animation,end";
            -      }
            -      program 
            -      {
            -         name: "move,bottomright";
            -         signal: "move,1,1";
            -         action: STATE_SET "bottomright" 0.0;
            -         transition: SINUSOIDAL 1.0;
            -         target: "title";
            -         after: "animation,end";
            -      }
            -      program 
            -      {
            -         name: "move,default";
            -         signal: "move,0,0";
            -         action: STATE_SET "default" 0.0;
            -         transition: SINUSOIDAL 1.0;
            -         target: "title";
            -         after: "animation,end";
            -      }
            -      program 
            -      {
            -         name: "animation,end";
            -         action: SIGNAL_EMIT "animation,end" "";
            -      }
            -   }
            -}
            -
            -
          2. - -
          3. -

            Create the application. Create a basic window widget that is going to be loaded and created in the main starting function:

            - -
            -// Window
            -ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            -elm_win_conformant_set(ad->win, EINA_TRUE);
            -elm_win_autodel_set(ad->win, EINA_TRUE);
            -
            -if (elm_win_wm_rotation_supported_get(ad->win)) 
            -{
            -   int rots[4] = 
            -   {
            -      0, 90, 180, 270 
            -   };
            -   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            -}
            -
            -
          4. - -
          5. -

            Add a conformant and set the main layout of the application.

            -

            The main layout is described in the EDC part and consists of 2 swallows. The first swallow has the Edje object loaded into it. The second contains a box of buttons to manipulate the perspective of the Edje object.

            - -
            -// Conformant
            -ad->conform = elm_conformant_add(ad->win);
            -elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            -elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            -evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_win_resize_object_add(ad->win, ad->conform);
            -evas_object_show(ad->conform);
            -
            -// Base layout
            -app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -ad->layout = elm_layout_add(ad->win);
            -elm_layout_file_set(ad->layout, edj_path, GRP_MAIN);
            -evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);
            -elm_object_content_set(ad->conform, ad->layout);
            -
            -
          6. - -
          7. -

            Create the Edje object on Evas using the evas_object_evas_get() function. This function is very useful because you must operate on the canvas, but have only an object pointer to a window object.

            - -
            -Evas *evas;
            -evas = evas_object_evas_get(ad->win);
            -ad->edje_obj = edje_object_add(evas);
            -
            -
          8. - -
          9. -

            Instantiate a new Edje object by creating a new Edje smart object and returning its Evas_Object handle:

            - -
            -ad->edje_obj = edje_object_add(evas);
            -
            -
          10. - -
          11. -

            An Edje object is useless without a source file set to it, so use the edje_object_file_set() function to set the object into the main layout:

            - -
            -ad->edje_obj = edje_object_add(evas);
            -edje_object_file_set(ad->edje_obj, edj_path, "example/group");
            -evas_object_move(ad->edje_obj, 0, 0);
            -evas_object_show(ad->edje_obj);
            -elm_object_part_content_set(ad->layout, "swallow", ad->edje_obj);
            -
            - -

            Figure: Main layout with the swallow part highlighted

            -

            Main layout with the swallow part highlighted

            -
          12. - -
          13. -

            Create the actual perspective object, define its position, focal distance and Z plane position, and set it as global:

            - -
            -ad->ps = edje_perspective_new(evas);	
            -edje_perspective_set(ad->ps, 160, 320, 0, ad->focal);
            -edje_perspective_global_set(ad->ps, EINA_TRUE);
            -
            - -

            To set the perspective of the Edje object, instead of setting it as global to the entire canvas, you can use the edje_object_perspective_set() function. -

            -
          14. - -
          15. -

            Create a new perspective in the canvas by setting up the transformation for the perspective object:

            - -
            -void 
            -edje_perspective_set(Edje_Perspective * ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc)
            -
            - -

            This sets the parameters of the perspective transformation. X, Y, and Z values are used. The px and py points specify the infinite distance point in the 3D conversion, where all lines converge. The z0 point specifies the Z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates. Any points on the Z value do not have their X and Y values modified in the transformation. The points further away (with a higher Z value) shrink into the distance, and those that are closer expand and become bigger.

            -

            The foc value determines the focal length of the camera. This is the distance between the camera lens plane and the z0 Z value. This allows for some depth control. The foc value must be greater than 0.

            -
          16. - -
          17. -

            The Swallow buttons layout part contains a box of buttons to manipulate the perspective of the loaded Edje object.

            - -

            Figure: Main layout with swallow buttons highlighted

            -

            Main layout with swallow buttons highlighted

            - -

            Add the box and pack the buttons into it. Name the first button Global and register a callback for clicking:

            - -
            -Evas_Object *box, *button;
            -// Adding box
            -box = elm_box_add(ad->layout);
            -evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
            -evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
            -elm_box_horizontal_set(box, EINA_TRUE);
            -evas_object_show(box);
            -elm_object_part_content_set(ad->layout, "swallow.buttons", box);
            -
            -button = elm_button_add(ad->layout);
            -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_object_text_set(button, "move");
            -evas_object_show(button);
            -elm_box_pack_end(box, button);
            -evas_object_smart_callback_add(button, "clicked", _on_btn_clicked, ad);
            -
            -button = elm_button_add(ad->layout);
            -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_object_text_set(button, "more");
            -evas_object_show(button);
            -elm_box_pack_end(box, button);
            -evas_object_smart_callback_add(button, "clicked", _on_btn_more_clicked, ad);
            -
            -button = elm_button_add(ad->layout);
            -evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_object_text_set(button, "less");
            -evas_object_show(button);
            -elm_box_pack_end(box, button);
            -evas_object_smart_callback_add(button, "clicked", _on_btn_less_clicked, ad);
            -
            -ad->edje_obj = edje_object_add(evas);
            -edje_object_file_set(ad->edje_obj, edj_path, "example/group");
            -evas_object_move(ad->edje_obj, 0, 0);
            -evas_object_show(ad->edje_obj);
            -elm_object_part_content_set(ad->layout, "swallow", ad->edje_obj);
            -
            -
          18. - -
          19. -

            Show the main window:

            - -
            -evas_object_show(ad->win);
            -
            - -

            Figure: Main screen

            -

            Figure: Main screen

            - -
          20. -
          - -

          Playing with the Perspective

          - -
            -
          1. -

            The callback for a clicked button is converted to a signal determining where the text and rectangle must be moved:

            - -
            -static void
            -_part_move(appdata_s *ad, int dx, int dy)
            -{
            -   char emission[64];
            -
            -   dlog_print(DLOG_ERROR, "AAAA", "x,y = %d, %d", dx, dy);
            -   snprintf(emission, sizeof(emission), "move,%d,%d", dx, dy);
            -   edje_object_signal_emit(ad->edje_obj, emission, "");
            -}
            -
            -
          2. - -
          3. -

            The callback representing the Edje object move calls the part_move() function that directly sends a signal to the Edje part. The moving action is treated in the program according to the passed signal.

            - -
            -static void
            -_on_btn_clicked(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   static int i = 0;
            -   switch (i) 
            -   {
            -      case 0:
            -         _part_move(ad, 1, 0);
            -         break;
            -      case 1:
            -         _part_move(ad, 1, 1);
            -         break;
            -      case 2:
            -         _part_move(ad, 0, 1);
            -         break;
            -      case 3:
            -         _part_move(ad, 0, 0);
            -         break;
            -   }
            -   i++;
            -   i = i%4;
            -}
            -
            - -

            Figure: Moving process

            -

            ->Figure: Moving process Figure: Moving process

            -
          4. - -
          5. -

            By clicking the More and Less buttons, you can increase or decrease the focal length of the camera:

            - -
            -static void
            -_on_btn_more_clicked(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   ad->focal += 5;
            -   edje_perspective_set(ad->ps, 160, 320, 0, ad->focal);
            -   edje_perspective_global_set(ad->ps, EINA_TRUE);
            -}
            -
            -static void
            -_on_btn_less_clicked(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   ad->focal -= 5;
            -   edje_perspective_set(ad->ps,160, 320, 0, ad->focal);
            -   edje_perspective_global_set(ad->ps, EINA_TRUE);
            -}
            -
            - -

            Figure: Decreasing and increasing the focal length

            - -

            Decreasing and increasing the focal length

            -
          6. -
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/edje_scaling_n.htm b/org.tizen.ui.guides/html/native/efl/edje_scaling_n.htm deleted file mode 100755 index ff9b16e..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_scaling_n.htm +++ /dev/null @@ -1,794 +0,0 @@ - - - - - - - - - - - - - - Scaling Edje Objects - - - - - - -
          -

          Scaling Edje Objects

          - -

          This demonstrates how you can scale Edje objects. Scalability is important when building user interfaces for different environments, such as mobile phones and laptops.

          -

          The natural value of scale factors is 1.0. Scaling affects minimum and maximum part size and font size, and multiplies them.

          - -

          You can disable scaling of certain parts.

          - -

          Initializing the EDC File

          - -

          Set up and prepare the EDC source code for loading the Edje objects in your application:

          - -
            -
          1. -

            To demonstrate Edje scale usability, set up 2 groups. The first group contains only one scalable part.

            - -
            group 
            -{ 
            -   name: "scale_group_1";
            -   parts 
            -   {
            -      part
            -      { 
            -         name: "scalable_rect";
            -         type: RECT;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            min: 16 16;
            -            max: 16 16;
            -            color: 0 0 255 255;
            -         }
            -      }
            -   }
            -}
            - -

            Figure: First scalable group

            -

            First scalable group

            - -

            For this example, the group is used for showing Edje's global scale.

            - -

            The other group is used for showing usability of the edje_object_scale function. The group has 2 non-scalable parts (not_scalable_rect1 and not scalable_rect2 ), which are related to the scalable parts. It can be seen that scalability actually changes the scalable parts and all UI can be changed according to new relatives.

            - -

            Scalability of certain parts is usually preset in the EDC source code with the scale property:

            - -
            -group 
            -{ 
            -   name: "scale_group_2";
            -   parts 
            -   {
            -      part 
            -      { 
            -         name: "not_scalable_rect1";
            -         type: RECT;
            -         scale: 0;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.5;
            -            min: 40 40;
            -            max: 40 40;
            -            color: 255 0 255 255;
            -         }
            -      }
            -      part 
            -      { 
            -         name: "scalable_rect";
            -         type: RECT;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.5;
            -            min: 25 19;
            -            max: 25 19;
            -            color: 0 255 255 255;
            -            rel1 
            -            {
            -               relative: 1.0 0.0;
            -               to_x: "not_scalable_rect1";
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "not_scalable_rect2";
            -         type: RECT;
            -         scale: 0;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.5;
            -            min: 40 40;
            -            max: 40 40;
            -            color: 255 0 255 255;
            -            rel1 
            -            {
            -               relative: 1.0 0.0;
            -               to_x: "scalable_rect";
            -            }
            -         }
            -      }
            -   }
            -}
            -
            - -

            Figure: Second scalable group

            -

            Second scalable group

            -
          2. - -
          3. - -

            The base_scale factor can be used when the whole collection in the EDC file contains it:

            - -
            collections 
            -{
            -   base_scale: 1.2;
            -   group 
            -   { 
            -      name: "scale_group_1";
            -   }
            -   group 
            -   { 
            -      name: "scale_group_2";
            -   }
            -   group 
            -   {
            -      name: "main_layout";
            -   }
            -}
            -
          4. - -
          5. -

            An application must contain controls, such as a spinner, to change the scale and see the result.

            - -

            Add a box with 2 groups loaded as edje objects, and spinners for changing the scale values:

            - -
            -group 
            -{ 
            -   name: "main_application";
            -   parts 
            -   {
            -      part 
            -      { 
            -         name: "edje.swallow.content";
            -         type: SWALLOW;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 1.0;
            -            rel1 
            -            {
            -               relative: 0.0 1.0;
            -               offset: 0 20;
            -               to_y: "title2";
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "title1";
            -         type: TEXT;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 100 32;
            -            color: 0 0 0 255;
            -            text 
            -            {
            -               text: "edje scale:";
            -               font: "Sans";
            -               size: 16;
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "title2";
            -         type: TEXT;
            -         scale: 1;
            -         description
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 150 32;
            -            color: 0 0 0 255;
            -            rel1 
            -            {
            -               relative: 0.0 1.0;
            -               to_y: "scale.swallow";
            -            }
            -            text 
            -            {
            -               text: "edje object scale:";
            -               font: "Sans";
            -               size: 16;
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "scale.swallow";
            -         type: SWALLOW;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 200 48;
            -            rel1 
            -            {
            -               relative: 1.0 0.0;
            -               to_x: "title2";
            -               to_y: "title1";
            -            }
            -            rel2 
            -            {
            -               to_y: "title1";
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "scale.swallow2";
            -         type: SWALLOW;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 200 48;
            -            rel1 
            -            {
            -               relative: 1.0 0.0;
            -               to: "title2";
            -            }
            -            rel2 
            -            {
            -               to_y: "title2";
            -            }
            -         }
            -      }
            -   }
            -}
            -
            - -

            Figure: Main application layout

            -

            Main application layout

            - -

            In the example, there are the following swallows:

            -
              -
            • edje.swallow.content is used for the box containing the Edje objects.
            • -
            • scale.swallow is used for the spinner that changes the scale value a loaded Edje object.
            • -
            • scale.swallow2 is used for the spinner that changes the global scale, so changing this value changes the scale of all Edje objects if they do not have their own scales set using the edje_object_scale_set() function.
            • -
            -
          6. -
          - -

          Initializing the Application

          - -

          All application code lays in the create_base_gui() function that creates and loads all objects and forms, and creates application's main look.

          - -
            -
          1. -

            Create a window and get the path to the EDJ file:

            - -
            -ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);   elm_win_conformant_set(ad->win, EINA_TRUE);
            -elm_win_autodel_set(ad->win, EINA_TRUE);
            -if (elm_win_wm_rotation_supported_get(ad->win))
            -{
            -   int rots[4] = 
            -   {
            -      0, 90, 180, 270
            -   };
            -   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            -}
            -// Path to edj group with three groups
            -app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -
            -
          2. - -
          3. -

            Set the conformant containing the main layout into the window:

            - -
            -ad->conform = elm_conformant_add(ad->win);
            -elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            -elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            -evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_win_resize_object_add(ad->win, ad->conform);
            -evas_object_show(ad->conform);
            -// Main layout
            -ad->main_layout = elm_layout_add(ad->win);
            -evas_object_size_hint_weight_set(ad->main_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_layout_file_set(ad->main_layout, edj_path, "main_application");
            -elm_object_content_set(ad->conform, ad->main_layout);
            -evas_object_show(ad->main_layout);
            -app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -
            - - - - - - - - - - -
            Note
            If you have layout for your window written in the EDC file, use and load it as Layout with Elementary layout API (using, for example, the elm_layout_add() , elm_object_style_set() , and elm_layout_file_set() functions).
            -
          4. - -
          5. -

            Add the box and set it into the edje.swallow.content main layout swallow:

            - -
            -// Add the box
            -ad->box = elm_box_add(ad->main_layout);
            -evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, 0.0);
            -evas_object_size_hint_align_set(ad->box, EVAS_HINT_FILL, 0.0);
            -elm_box_horizontal_set(ad->box, EINA_TRUE);
            -evas_object_show(ad->box);
            -// Set the box into the main layout
            -elm_object_part_content_set(ad->main_layout, "edje.swallow.content", ad->box);
            -
          6. - -
          7. -

            Load the Edje objects:

            - -
            -// Add group1
            -ad->edje_object_1 = edje_object_add(evas_object_evas_get(ad->win));
            -evas_object_size_hint_weight_set(ad->edje_object_1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -edje_object_file_set(ad->edje_object_1, edj_path, "scale_group_1");
            -// Check object loading errors
            -if (edje_object_load_error_get(ad->edje_object_1) != EDJE_LOAD_ERROR_NONE)
            -{
            -   evas_object_del(ad->edje_object_1);
            -
            -   return;
            -}
            -evas_object_show(ad->edje_object_1);
            -
          8. - -
          9. -

            Pack the Edje objects into the box:

            - -
            -elm_box_pack_end(ad->box, ad->edje_object_1);
            -elm_box_pack_end(ad->box, ad->edje_object_2);
            -
          10. - -
          11. -

            Add 2 spinners that change the scale values:

            - -
            -ad->edje_scale = elm_spinner_add(ad->win);
            -evas_object_size_hint_weight_set(ad->edje_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -evas_object_size_hint_align_set(ad->edje_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -elm_spinner_min_max_set(ad->edje_scale, 1, 300);
            -elm_spinner_step_set(ad->edje_scale, 10);
            -evas_object_show(ad->edje_scale);
            -elm_spinner_value_set(ad->edje_scale, 100);
            -elm_object_part_content_set(ad->main_layout, "scale.swallow", ad->edje_scale);
            -
            -ad->edje_object_scale = elm_spinner_add(ad->win);
            -evas_object_size_hint_weight_set(ad->edje_object_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -evas_object_size_hint_align_set(ad->edje_object_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -elm_spinner_min_max_set(ad->edje_object_scale, 1, 300);
            -elm_spinner_step_set(ad->edje_object_scale, 10);
            -evas_object_show(ad->edje_object_scale);
            -elm_spinner_value_set(ad->edje_object_scale, 100);
            -elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_scale);
            -
          12. - -
          13. Display the window:

            - -
            -evas_object_show(ad->win);
            - -

            Figure: Scale testing application

            -

            Scale testing application

            -
          14. -
          - - -

          Setting Global Scales

          - -
            -
          1. -

            Add a callback for the second spinner that changes Edje global scale value and, as a result, affects all loaded Edje objects:

            - -
            static void
            -create_base_gui(appdata_s *ad)
            -{
            -   // Add scale spinners
            -   ad->edje_object_scale = elm_spinner_add(ad->win);
            -   evas_object_size_hint_weight_set(ad->edje_object_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   evas_object_size_hint_align_set(ad->edje_object_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   elm_spinner_min_max_set(ad->edje_object_scale, 1, 300);
            -   elm_spinner_step_set(ad->edje_object_scale, 10);
            -   evas_object_show(ad->edje_object_scale);
            -   elm_spinner_value_set(ad->edje_object_scale, 100);
            -   elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_object_scale);
            -
            -   evas_object_smart_callback_add(ad->edje_object_scale, "changed", _on_global_scale_change, ad);
            -}
            -
          2. - -
          3. - -

            Set the scale using the edje_scale_set() function:

            - -
            static void
            -_on_global_scale_change(void *data, Evas_Object *obj, void *event_info)
            -{
            -   edje_scale_set(elm_spinner_value_get(obj) / 100);
            -}
            - -

            By clicking the spinner buttons, you can change the scale of all loaded Edje objects. The Edje object on the right has its own scale values, so global scale values do not apply to it.

            - -

            Figure: Different global scales

            -

            Different global scales

            -
          4. - -
          - - - - - - - - - -
          Note
          Using the edje_scale_set() function that changes the global scale values can affect your whole application and destroy the UI layout. Be careful with this function.
          - -

          Setting Scales for Edje Objects

          - -

          Add a callback to get the value of the first spinner and apply it to the Edje object on the right:

          - -
          static void
          -_on_scale_change(void *data, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *ad = data;
          -   edje_object_scale_set(ad->edje_object_2, elm_spinner_value_get(obj) / 100);
          -}
          -
          -static void
          -create_base_gui(appdata_s *ad)
          -{
          -   // Add scale spinners
          -   ad->edje_scale = elm_spinner_add(ad->win);
          -   evas_object_size_hint_weight_set(ad->edje_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(ad->edje_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   elm_spinner_min_max_set(ad->edje_scale, 1, 300);
          -   elm_spinner_step_set(ad->edje_scale, 10);
          -   evas_object_show(ad->edje_scale);
          -   elm_spinner_value_set(ad->edje_scale, 100);
          -   elm_object_part_content_set(ad->main_layout, "scale.swallow", ad->edje_scale);
          -   evas_object_smart_callback_add(ad->edje_scale, "changed", _on_scale_change, ad);
          -}
          - - -

          By clicking on spinner buttons, you can change the scale of the second Edje object in the box.

          - -

          Figure: Edje object scales

          -

          Edje object scales

          - - -

          Personal, Global, and Base Scales

          - -

          Modify the main layout and add a swallow for the buttons. The buttons are used for showing the current scale:

          - -
            -
          1. -

            Modify the main layout EDC code by creating another swallow part, swallow.buttons , and modifying the edje.swallow.content part:

            - -
            -group 
            -{ 
            -   name: "main_application";
            -   parts 
            -   {
            -      part 
            -      { 
            -         name: "edje.swallow.content";
            -         type: SWALLOW;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 1.0;
            -            rel1 
            -            {
            -               relative: 0.0 1.0;
            -               offset: 0 20;
            -               to_y: "title2";
            -            }
            -            rel2 
            -            {
            -               relative: 1.0 0.0;
            -               to_y: "swallow.buttons";
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "title1";
            -         type: TEXT;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 100 32;
            -            color: 0 0 0 255;
            -            text 
            -            {
            -               text: "edje scale:";
            -               font: "Sans";
            -               size: 16;
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "title2";
            -         type: TEXT;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 150 32;
            -            color: 0 0 0 255;
            -            rel1 
            -            {
            -               relative: 0.0 1.0;
            -               to_y: "scale.swallow";
            -            }
            -            text 
            -            {
            -               text: "edje object scale:";
            -               font: "Sans";
            -               size: 16;
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "scale.swallow";
            -         type: SWALLOW;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 200 48;
            -            rel1 
            -            {
            -               relative: 1.0 0.0;
            -               to_x: "title2";
            -               to_y: "title1";
            -            }
            -            rel2 
            -            {
            -               to_y: "title1";
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "scale.swallow2";
            -         type: SWALLOW;
            -         scale: 1;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 0.0;
            -            max: 200 48;
            -            rel1 
            -            {
            -               relative: 1.0 0.0;
            -               to: "title2";
            -            }
            -            rel2 
            -            {
            -               to_y: "title2";
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "swallow.buttons";
            -         type: SWALLOW;
            -         scale: 0;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.0 1.0;
            -            min: 0 60;
            -            max: -1 60;
            -         }
            -      }
            -   }
            -}
            -
            -
          2. - -
          3. -

            Add a box with buttons and set it into the main layout:

            - -
            static void
            -_edje_object_scale_get(void *data, Evas_Object *obj, void *event_info)
            -{
            -   char title[PATH_MAX] = {0, };
            -   appdata_s *ad = data;
            -   snprintf(title, (int)PATH_MAX, "object %.2f", edje_object_scale_get(ad->edje_object_2));
            -   elm_object_text_set(obj, title);
            -}
            -static void
            -_edje_scale_get(void *data, Evas_Object *obj, void *event_info)
            -{
            -   char title[PATH_MAX] = {0, };
            -   snprintf(title, (int)PATH_MAX, "global %.2f", edje_scale_get());
            -   elm_object_text_set(obj, title);
            -}
            -static void
            -_edje_object_base_scale_get(void *data, Evas_Object *obj, void *event_info)
            -{
            -   char title[PATH_MAX] = {0, };
            -   appdata_s *ad = data;
            -   snprintf(title, (int)PATH_MAX, "base %.2f", edje_object_base_scale_get(ad->edje_object_2));
            -   elm_object_text_set(obj, title);
            -}
            -
            -static void
            -create_base_gui(appdata_s *ad) 
            -{
            -   Evas_Object *box, *button;
            -   // Add the box
            -   box = elm_box_add(ad->main_layout);
            -   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
            -   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
            -   elm_box_horizontal_set(box, EINA_TRUE);
            -   evas_object_show(box);
            -   elm_object_part_content_set(ad->main_layout, "swallow.buttons", box);
            -
            -   button = elm_button_add(ad->main_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, "object ");
            -   evas_object_show(button);
            -   evas_object_smart_callback_add(button, "clicked", _edje_object_scale_get, ad);
            -   elm_box_pack_end(box, button);
            -
            -   button = elm_button_add(ad->main_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, "global ");
            -   evas_object_show(button);
            -   evas_object_smart_callback_add(button, "clicked", _edje_scale_get, ad);
            -   elm_box_pack_end(box, button);
            -
            -   button = elm_button_add(ad->main_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, "base ");
            -   evas_object_show(button);
            -   evas_object_smart_callback_add(button, "clicked", _edje_object_base_scale_get, ad);
            -   elm_box_pack_end(box, button);
            -}
            - - -

            Clicking a button gets a specific scale and prints its value on the button. For example, clicking the Global button shows the global scale value.

            - -

            Figure: Scale values

            -

            Scale values

            -
          4. - -
          5. -

            The loaded Edje object does not have its own scale value (0.00), so it uses the global scale value defined in the EFL configuration based on the device. A mobile device that is being used here, has the global scale ~1.8). The base scale is set to 1.2.

            - -
            collections 
            -{
            -   base_scale: 1.2;
            -   group 
            -   { 
            -      name: "scale_group_1";
            -   }
            -   group 
            -   { 
            -      name: "scale_group_2";
            -   }
            -   group 
            -   { 
            -      name: "main_layout";
            -   }
            -}
            - -

            Figure: Scale values after changing the Edle object scale

            -

            Figure: Scale values after changing the Edle object scale

            - -

            After applying the scale of the new object, the global scale does not apply to this Edje object anymore. While all other objects have the scale value 1.8, the new object has the scale value 1.37.

            - - - - - - - - - - -
            Note
            The default base scale value is 1.0. All scale values in Edje objects, either set with the global scale value using the edje_scale_set() function or with a personal scale factor using the edje_object_scale_set() function are divided by base scale.
            - -

            Figure: Base scale

            -

            Base scale

            - -

            Setting a scale value that is same as the base scale makes the layout appear as if it had the scale value 1.0.

            -
          6. -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/edje_text_n.htm b/org.tizen.ui.guides/html/native/efl/edje_text_n.htm deleted file mode 100755 index 47ca76f..0000000 --- a/org.tizen.ui.guides/html/native/efl/edje_text_n.htm +++ /dev/null @@ -1,712 +0,0 @@ - - - - - - - - - - - - - - Using Edje Text Classes - - - - - - -
          -

          Using Edje Text Classes

          - -

          This tutorial demonstrates how you can change the text of 2 or more parts using Edje text classes.

          -

          If a part is assigned with a text class, setting font attributes to this class updates all those parts with the new font attributes. Setting the values to a text class affects all parts in that text class at process level, while at the object level, it only affects the parts inside a specified object.

          - -

          Creating the Basic Application

          - -

          The example application has 2 screen with different UIs. The screens demonstrate different text class APIs. The screen contains a genlist with 2 items set into a naviframe. Clicking an item opens displays a screen. Pressing the hardware Back button displays the main screen with the genlist.

          - -
            -
          1. Create the basic application: - -
            static void
            -win_back_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   elm_naviframe_item_pop(ad->navifr);
            -}
            -
          2. - -
          3. -

            Get the path to the EDC file that contains the main layout and the Edje object to load:

            - -
            static void
            -app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max)
            -{
            -   char *res_path = app_get_resource_path();
            -   if (res_path) 
            -   {
            -      snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in);
            -      free(res_path);
            -   }
            -}
            - -

            Create a window and register an event callback that calls the win_back_cb() function after pressing the Back button on the device:

            - -
            static void
            -create_base_gui(appdata_s *ad)
            -{
            -   Elm_Object_Item *eoi = NULL;
            -
            -   // Window
            -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            -   elm_win_conformant_set(ad->win, EINA_TRUE);
            -   elm_win_autodel_set(ad->win, EINA_TRUE);
            -
            -   if (elm_win_wm_rotation_supported_get(ad->win)) 
            -   {
            -      int rots[4] = {0, 90, 180, 270};
            -      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            -   }
            -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
            -}
            -
            -
          4. - -
          5. -

            Add a conformant that contains the naviframe and genlist. Add item selection callbacks for the genlist items to show different screens:

            - -
            static char *
            -_genlist_item_text_get(void *data, Evas_Object *obj, const char *part)
            -{
            -   Eina_Stringshare *text_class = (Eina_Stringshare *)data;
            -   if (strcmp(part, "elm.text") == 0)
            -      return strdup(text_class);
            -   else
            -      return NULL;
            -}
            -
            -static void
            -create_base_gui(appdata_s *ad)
            -{
            -   // Conformant
            -   ad->conform = elm_conformant_add(ad->win);
            -   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            -   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_win_resize_object_add(ad->win, ad->conform);
            -   evas_object_show(ad->conform);
            -
            -   // Naviframe
            -   ad->navifr = elm_naviframe_add(ad->win);
            -   elm_object_content_set(ad->conform, ad->navifr);
            -   eext_object_event_callback_add(ad->navifr, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, ad);
            -
            -   // Genlist
            -   ad->itc = elm_genlist_item_class_new();
            -   ad->itc->func.text_get =_genlist_item_text_get;
            -
            -   ad->genlist = elm_genlist_add(ad->win);
            -   evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -
            -   eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Text Class List"), NULL,
            -                                 ELM_GENLIST_ITEM_NONE, NULL, ad);
            -   eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Object Text Class API"), NULL,
            -                                 ELM_GENLIST_ITEM_NONE, NULL, ad);
            -   elm_naviframe_item_simple_push(ad->navifr, ad->genlist);
            -
            -   // Show the window
            -   evas_object_show(ad->win);
            -}
            - - -

            The following figure shows the result.

            - -

            Figure: Main screen

            -

            Main screen

          6. -
          - -

          Getting, Deleting, and Displaying Text Classes

          - -

          The first screen of the application shows an example of the edje_text_class_del(), edje_text_class_list(), and edje_text_class_get() functions.

          - -

          The following code implements the layout:

          - -
          -group 
          -{ 
          -   name: "class_list_application";
          -   parts 
          -   {
          -      part 
          -      { 
          -         name: "text_view";
          -         type: TEXT;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            visible: 1;
          -            color: 0 0 0 255;
          -            align: 0.5 0.0;
          -            text 
          -            {
          -               text: "text part number 3";
          -               font: "Sans";
          -               min: 1 1;
          -               max: 1 1;
          -               size: 20;
          -            }
          -         }
          -      }
          -      part 
          -      { 
          -         name: "edje.swallow.list";
          -         type: SWALLOW;
          -         description
          -         { 
          -            state: "default" 0.0;
          -            align: 0.5 0.0;
          -            color: 0 0 0 255;
          -            rel1 
          -            {
          -               relative: 0.0 1.0;
          -               to_y: "text_view";
          -            }
          -         }
          -      }
          -   }
          -}
          -
          - -

          Figure: First screen EDC layout

          -

          First screen EDC layout

          - -

          The first part (text_view) shows the properties of the selected text class. Clicking a text class in the genlist shows its properties, such as font, size, and name in the text part.

          - -
            -
          1. -

            Add the base genlist:

            - -
            -ad->genlist = elm_genlist_add(ad->win);
            -evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Text Class List"), NULL, 
            -                              ELM_GENLIST_ITEM_NONE, _create_class_list_gui, ad);
            -eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Object Text Class API"), 
            -                              NULL, ELM_GENLIST_ITEM_NONE, NULL, ad);
            -elm_naviframe_item_simple_push(ad->navifr, ad->genlist);
            -
            -
          2. - -
          3. -

            Load the layout:

            - -
            static void
            -_create_class_list_gui(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data; // Get application's data
            -   char edj_path[PATH_MAX] = {0, }; // path to edc file
            -   Eina_List *l;  //  Used later
            -   const char *str; // Used later
            -   Elm_Object_Item *eoi = NULL; // Used later
            -   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -
            -   // Main layout
            -   ad->gui1_layout = elm_layout_add(ad->win);
            -   evas_object_size_hint_weight_set(ad->gui1_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_layout_file_set(ad->gui1_layout, edj_path, "class_list_application");
            -}
            -
            -
          4. - -
          5. -

            Get a list of all text classes loaded into the system.In the following example, the Eina_List list is a field in application data.

            - -
            ad->list = edje_text_class_list();
            -
          6. - -
          7. -

            Create the genlist:

            - -
            // Genlist
            -ad->itc_text_classes = elm_genlist_item_class_new();
            -ad->itc_text_classes->func.text_get =_genlist_item_text_get;
            -
            -ad->genlist_text_classes = elm_genlist_add(ad->win);
            -evas_object_size_hint_weight_set(ad->genlist_text_classes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -
            -
          8. - -
          9. -

            Go through the text class list and insert each text class to the genlist. Set the genlist into the main layout of the current screen and show it in the naviframe:

            - -
            -EINA_LIST_FOREACH(ad->list, l, str)
            -{
            -   eoi = elm_genlist_item_append(ad->genlist_text_classes, ad->itc_text_classes, str, NULL, ELM_GENLIST_ITEM_NONE, NULL, ad);
            -   elm_object_item_data_set(eoi, (void *)str);
            -}
            -elm_object_part_content_set(ad->gui1_layout, "edje.swallow.list", ad->genlist_text_classes);
            -evas_object_show(ad->genlist_text_classes);
            -elm_naviframe_item_simple_push(ad->navifr, ad->gui1_layout);
            -
            - - -

            Clicking Text Class List displays the screen with a genlist of text classes.

            - -

            Figure: Text class list

            -

            Text class list

            -
          10. - -
          11. -

            The edje_text_class_del() function deletes a text class (in the following example, T094):

            - -
            -// Main layout
            -ad->gui1_layout = elm_layout_add(ad->win);
            -evas_object_size_hint_weight_set(ad->gui1_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_layout_file_set(ad->gui1_layout, edj_path, "class_list_application");
            -evas_object_show(ad->gui1_layout);
            -
            -// Get the collection list
            -app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -edje_text_class_del("T094");
            -ad->list = edje_text_class_list();
            -
            -// Genlist
            -ad->itc_text_classes = elm_genlist_item_class_new();
            -ad->itc_text_classes->func.text_get =_genlist_item_text_get;
            -
            - -

            Figure: Text class list after deleting a class

            -

            Text class list after deleting a class

            -
          12. - -
          13. -

            Every text class contains specific information, such as the font name, font size, and text class name. To show the properties when the text class name is clicked, create a callback that uses the edje_text_class_get() function:

            - -
            static void
            -_genlist_clicked(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   char text_class[PATH_MAX] = {0, };
            -   Elm_Object_Item *eoi = NULL;
            -   const char *str;
            -   char *font;
            -   Evas_Font_Size size;
            -
            -   eoi = elm_genlist_selected_item_get(obj);
            -   str = elm_object_item_data_get(eoi);
            -   edje_text_class_get(str, &font, &size);
            -   snprintf(text_class, PATH_MAX, "%s font{%s} size{%d}", str, font, size);
            -   elm_object_part_text_set(ad->gui1_layout, "text_view", text_class);
            -}
            -
          14. - -
          15. -

            Register the added callback function in the genlist:

            - -
            -EINA_LIST_FOREACH(ad->list, l, str)
            -{
            -   eoi = elm_genlist_item_append(ad->genlist_text_classes, ad->itc_text_classes, str, NULL, ELM_GENLIST_ITEM_NONE, _genlist_clicked, ad);
            -   elm_object_item_data_set(eoi, (void *)str);
            -}
            -elm_object_part_content_set(ad->gui1_layout, "edje.swallow.list", ad->genlist_text_classes);
            -
            -evas_object_show(ad->genlist_text_classes);
            -elm_naviframe_item_simple_push(ad->navifr, ad->gui1_layout);
            -
            - -

            Figure: Displaying text class properties

            -

            Displaying text class properties

            -
          16. -
          - - -

          Application Layout

          - -

          The second screen contains 2 Edje object with text parts containing the custom_text_class text class. When a text class is modified, all text parts assigned to it are changed as well.

          - -

          The following example shows a simple Edje object layout:

          - -
          -group 
          -{ 
          -   name: "edje_example";
          -   parts 
          -   {
          -      part 
          -      { 
          -         name: "text_example";
          -         type: TEXT;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            visible: 1;
          -            color: 0 0 0 255;
          -            text 
          -            {
          -               text: "text part number 3";
          -               font: "Sans";
          -               size: 10;
          -               text_class: "custom_text_class";
          -            }
          -         }
          -      }
          -   }
          -}
          - -
            -
          1. -

            After loading the Edje objects, add a spinner for changing the font size.

            - -

            Add 2 buttons for changing the text class of a specific object or setting the font size of the custom_text_class text class. The Set1 button sets a new size for the text class of the first Edje object and the Set2 button for the second object, respectively.

            - -

            The Get1 and Get2 buttons get the text class properties and display them on the screen.

            -

            The Global button changes the text class globally, causing all Edje object parts to be changed in case they contain the custom_text_class text class.

            - -
            -group 
            -{ 
            -   name: "class_list_application";
            -   parts 
            -   {
            -      part 
            -      { 
            -         name: "text_view";
            -         type: TEXT;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            visible: 1;
            -            color: 0 0 0 255;
            -            align: 0.5 0.0;
            -            text 
            -            {
            -               text: "text part number 3";
            -               font: "Sans";
            -               min: 1 1;
            -               max: 1 1;
            -               size: 20;
            -            }
            -         }
            -      }
            -      part 
            -      { 
            -         name: "edje.swallow.list";
            -         type: SWALLOW;
            -         description 
            -         { 
            -            state: "default" 0.0;
            -            align: 0.5 0.0;
            -            color: 0 0 0 255;
            -            rel1 
            -            {
            -               relative: 0.0 1.0;
            -               to_y: "text_view";
            -            }
            -      }
            -   }
            -}
            -
            -
          2. - -
          3. -

            Create a view for the new screen:

            - -
            static void
            -_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   char edj_path[PATH_MAX] = {0, };
            -
            -   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            -
            -   // Main Layout
            -   ad->gui2_layout = elm_layout_add(ad->win);
            -   evas_object_size_hint_weight_set(ad->gui2_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_layout_file_set(ad->gui2_layout, edj_path, "object_text_class_application");
            -   evas_object_show(ad->gui2_layout);
            -
            -   // Add group1
            -   ad->edje_object_1 = edje_object_add(evas_object_evas_get(ad->win));
            -   evas_object_size_hint_weight_set(ad->edje_object_1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   edje_object_file_set(ad->edje_object_1, edj_path, "edje_example");
            -   // Check the object loading error
            -   if (edje_object_load_error_get(ad->edje_object_1) != EDJE_LOAD_ERROR_NONE)
            -   {
            -      evas_object_del(ad->edje_object_1);
            -
            -      return;
            -   }
            -   evas_object_show(ad->edje_object_1);
            -   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.group1", ad->edje_object_1);
            -
            -   // Addgroup2
            -   ad->edje_object_2 = edje_object_add(evas_object_evas_get(ad->win));
            -   evas_object_size_hint_weight_set(ad->edje_object_2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   edje_object_file_set(ad->edje_object_2, edj_path, "edje_example");
            -   // Check object loading errors
            -   if (edje_object_load_error_get(ad->edje_object_2) != EDJE_LOAD_ERROR_NONE)
            -   {
            -      evas_object_del(ad->edje_object_2);
            -
            -      return;
            -   }
            -   evas_object_show(ad->edje_object_2);
            -   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.group2", ad->edje_object_2);
            -
            -   // Add spinner
            -   ad->spinner = elm_spinner_add(ad->win);
            -   evas_object_size_hint_weight_set(ad->spinner, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   evas_object_size_hint_align_set(ad->spinner, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   elm_spinner_min_max_set(ad->spinner, 1, 64);
            -   elm_spinner_step_set(ad->spinner, 1);
            -   evas_object_show(ad->spinner);
            -   elm_spinner_value_set(ad->spinner, 10);
            -   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.spinner", ad->spinner);
            -   elm_naviframe_item_simple_push(ad->navifr, ad->gui2_layout);
            -}
            - - -

            Figure: Second application screen

            -

            Second application screen

          4. -
          - -

          Setting the Text Class for All Edje Objects

          - -

          To set the text class globally, use the edje_test_class_set() function:

          - -
            -
          1. -

            Add a box and pack the buttons into it. Add the Global button and register a callback for clicking:

            - -
            static void
            -_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            -{
            -   Evas_Object *box, *button;
            -   // Add the box
            -   box = elm_box_add(ad->gui2_layout);
            -   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
            -   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
            -   elm_box_horizontal_set(box, EINA_TRUE);
            -   evas_object_show(box);
            -
            -   button = elm_button_add(ad->gui2_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, "Global");
            -   evas_object_show(button);
            -   evas_object_smart_callback_add(button, "clicked", _edje_text_class_set, ad);
            -   elm_box_pack_end(box, button);
            -
            -   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.buttons", box);
            -
            -   elm_naviframe_item_simple_push(ad->navifr, ad->gui2_layout);
            -}
            -
          2. - -
          3. -

            The callback contains functions for setting the text class globally:

            - -
            static void
            -_edje_text_class_set(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   edje_text_class_set("custom_text_class", "Sans", elm_spinner_value_get(ad->spinner));
            -}
            - -

            Clicking the Global button recalculates all text parts in every Edje object that contains the custom_text_class text class and changes their size.

            - - -

            Figure: Changing the text class globally

            -

            Changing the text class globally

          4. - -
          - -

          Setting the Text Class of a Specific Object

          - -

          To set the text class of a specific Edje object, use the edje_object_test_class_set() function.

          - -
            -
          1. -

            Add 2 more buttons, Set1 and Set2.

            -

            The first button sets the text class of the first Edje object on the left, and the second sets the text class of the other object, respectively.

            - -
            static void
            -_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            -{
            -   button = elm_button_add(ad->gui2_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, Set1);
            -   evas_object_show(button);
            -   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_set_1, ad);
            -   elm_box_pack_end(box, button);
            -
            -   button = elm_button_add(ad->gui2_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, Set2);
            -   evas_object_show(button); 
            -   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_set_2, ad);
            -   elm_box_pack_end(box, button);
            -}
            -
          2. - -
          3. -

            Add callbacks:

            - -
            static void
            -_edje_object_text_class_set_1(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   edje_object_text_class_set(ad->edje_object_1, "custom_text_class", "Sans", elm_spinner_value_get(ad->spinner));
            -}
            -
            -static void
            -_edje_object_text_class_set_2(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   edje_object_text_class_set(ad->edje_object_2, "custom_text_class", "Sans", elm_spinner_value_get(ad->spinner));
            -}
            -
          4. - -
          5. -

            Test the functionality:

            - -
              -
            1. Set the size of the left object to 16. - -

              Font size 16

            2. - -
            3. Set the size of the right object to 44. - -

              Font size 44

            4. - -
            5. Set the size of the right object to 22. - -

              Font size 22

            6. -
            -
          6. -
          - - -

          Getting the Text Class of an Object

          - -

          To get the text class of a specific Edje object, use the edje_object_test_class_get() function.

          - -
            -
          1. -

            Add 2 more buttons, Get1 and Get2. The first gets the text class of the first Edje object on the left and sets into that object result, and the second gets the text class of the other object, respectively.

            - -
            static void
            -_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            -{
            -   button = elm_button_add(ad->gui2_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, Get1);
            -   evas_object_show(button); 
            -   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_get_1, ad);
            -   elm_box_pack_end(box, button);
            -
            -   button = elm_button_add(ad->gui2_layout);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   elm_object_text_set(button, Get2);
            -   evas_object_show(button); 
            -   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_get_2, ad);
            -   elm_box_pack_end(box, button);
            -}
            -
          2. - -
          3. -

            Add callbacks:

            -
            static void
            -_edje_object_text_class_get_1(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   char *font;
            -   Evas_Font_Size size;
            -   char text_class[PATH_MAX] = {0, };
            -
            -   edje_object_text_class_get(ad->edje_object_1, "custom_text_class", &font, &size);
            -   snprintf(text_class, PATH_MAX, "font{%s} size{%d}", font, size);
            -   edje_object_part_text_set(ad->edje_object_1, "text_example", text_class);
            -}
            -
            -static void
            -_edje_object_text_class_get_2(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   char *font;
            -   Evas_Font_Size size;
            -   char text_class[PATH_MAX] = {0, };
            -
            -   edje_object_text_class_get(ad->edje_object_2, "custom_text_class", &font, &size);
            -   snprintf(text_class, PATH_MAX, "font{%s} size{%d}", font, size);
            -   edje_object_part_text_set(ad->edje_object_2, "text_example", text_class);
            -}
            - - -

            The following figure shows the result.

            - -

            Figure: Displaying text class changes

            -

            Displaying text class changes

            - - -

            Changing the custom_text_class for the first object changed its font size to 16 size, while changing the custom_text_class for the second object changes its font size to 22.

          4. -
          - - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/efl_overview_n.htm b/org.tizen.ui.guides/html/native/efl/efl_overview_n.htm deleted file mode 100755 index 80a2aef..0000000 --- a/org.tizen.ui.guides/html/native/efl/efl_overview_n.htm +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - EFL Overview: Getting Started with EFL UI Programming - - - - - -
          - -

          EFL Overview: Getting Started with EFL UI Programming

          - -

          EFL stands for Enlightenment Foundation Libraries. Enlightenment is a project consisting of the Enlightenment window manager, EFL libraries, and various utilities and applications. The Enlightenment team needed powerful libraries to handle, among others, rendering, main loops, and events, so EFL was introduced during the development of the Enlightenment window manager to fill these gaps. EFL is now widely used outside of the Enlightenment window manager.

          - -

          EFL Features

          - -

          The general UI design features include:

          -
            -
          • UI component support -

            You can use basic core UI components, such as buttons, genlists, and sliders, and also create a layout for the Tizen native application by using container UI components.

          • -
          • Theme support -

            You can create and change a theme that is a preset package containing graphical details. Tizen supports specifying the UI look and feel through a default theme.

          • -
          • Font settings -

            Tizen supports various methods to change the font of your application to another system default font or your own font.

          • -
          • Scalability -

            Elementary provides a way to scale UI components in order to be comfortably used with a finger and to make the text more readable.

          • -
          • Event handling and main loop -

            The user interface relies on callbacks designed to react to EFL events generated by the system or the user. You can handle various events, from low-level Ecore system events to Evas smart object events that happen on object collections.

            -

            The Ecore library provides a main loop abstraction that gets you data when it is available and sends you events. You can handle the main loop and use threads with the Ecore main loop.

          • -
          • UI animating with animators and effects -

            Tizen supports various methods to create animations and effects in your application.

          • -
          • Data types and tools support -

            Tizen supports a core library for data types and some useful tools.

          • -
          • Hardware input event support -

            Tizen supports the handling of hardware input events.

          • -
          - -

          EFL Characteristics

          - -

          EFL is aimed at not only desktop computers but also touch-screen and embedded devices, making EFL applications portable to many different types of devices. Applications do not need to care about the types of devices and profiles they run on. Instead of changing the code, it is typically enough to simply configure the applications for different devices.

          - -

          The key characteristics of EFL include:

          - -
            -
          • Performance -

            The main reason Tizen adopted EFL as its native toolkit is its speed. EFL is highly optimized by using a scene graph and retained-mode rendering. EFL is fast even in software rendering.

          • -
          • Small memory footprint -

            Despite its fast performance, EFL's memory footprint is smaller than that of other toolkits with similar features. A small memory footprint is useful in the embedded world, since embedded devices do not normally have much memory.

          • -
          • Back-end engine support -

            EFL supports several back-end engines, such as X11 (OpenGL, Xlib, Xcb), Wayland (OpenGL, SHM), Direct Framebuffer, DRM, memory buffers, PS3 native, Windows, and Mac OS. Applications do not need to deal with each back-end engine separately.

          • -
          • GUI and logic separation -

            EFL supports GUI layout and logic separation by having the layout description in a plain text file and the logic code in the C or C++ source files.

          • -
          • Themeable -

            An EFL theme can be changed at runtime without restarting the application. UI components are customizable so that each application can create its own customized theme to overlay above the default theme, adding customized versions of UI components to achieve a specific look and feel.

          • -
          • Scalable -

            EFL supports a scale factor that affects the size of objects in the application at runtime. By configuring the scale factor, applications can scale up and down as needed. The scale factor also supports a default setting that allows applications to scale nicely out-of-the-box.

          • -
          • Animations -

            EFL supports different types of animations. Evas supports Evas maps with low-level APIs for performing 2D, 2.5D, and 3D object transformations. Edje supports pre-defined transitions and wrapping of Evas maps. Elementary supports transit APIs for various types of animations, which can be combined.

          • -
          • Hardware acceleration -

            EFL supports OpenGL® and OpenGL-ES acceleration.

          • -
          - - -

          EFL Libraries

          - -

          The EFL are a set of layered libraries, as shown in the following diagram:

          - -

          Figure: EFL layers

          -

          EFL layers

          - -

          When you create a basic EFL application, you use the following main libraries as a basis:

          - -
            -
          • Elementary is the top-most library with which you create your EFL application. It 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. The full list of UI components that can be used in Tizen can be found in Mobile UI Components and Wearable UI Components.
          • -
          • Edje is the library used by Elementary to provide a powerful theme. You can also use Edje to create your own objects and use them in your application. You may also want to extend the default theme. You will find more information about Edje and the EDC format in Themes and Customizing Components.
          • -
          • Ecore is the library which manages the main loop of your application. The main loop is one of the most important concepts you need to know about to develop an application. The main loop is where events are handled, and where you interact with the user through the callback mechanism. The main loop mechanisms are explained in the Handling the Main Loop guide.
          • -
          • Evas is the canvas engine. Evas is responsible for managing the drawing of your content. All graphical objects that you create are Evas objects. Evas handles the entire state of the window by filling the canvas with objects and manipulating their states. In contrast to other canvas libraries, such as Cairo, OpenGL, and XRender, Evas is not a drawing library but a scene graph library that retains the state of all objects. The Evas concept is explained in Evas Rendering Concept and Method. Evas objects are created and then manipulated until they are no longer needed, at which point they are deleted. This allows the developer to work in the same terms that a designer thinks in: it is a direct mapping, as opposed to having to convert the concepts into drawing commands in the right order, calculate minimum drawing calls needed to get the job done, and so on.
          • -
          • Eina is the basis of all the EFL libraries. 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. Eina concepts are explained in Data Types and Tools.
          • -
          - -

          The EFL include more than just the above libraries, but the above are the most important libraries to get started with. The other libraries, such as Eet, Embryo, and Emotion, will be explored later in the programming guides and the API Reference (in mobile and wearable applications).

          - -

          The Hello World example shows you how to develop your first application with the EFL.

          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/elementary_animation_n.htm b/org.tizen.ui.guides/html/native/efl/elementary_animation_n.htm deleted file mode 100755 index f956971..0000000 --- a/org.tizen.ui.guides/html/native/efl/elementary_animation_n.htm +++ /dev/null @@ -1,872 +0,0 @@ - - - - - - - - - - - - - Elementary Animations - - - - - -
          - -

          Elementary Animations

          - -

          Elementary transitions (Elm_Transit) allow you to apply various transition effects, such as translation and rotation, to Evas objects. Elementary transitions are mostly based on Ecore animators, but provide some transition methods at a higher level of abstraction. Elementary transitions provide a simpler way of animating objects than Ecore animators or Edje animations.

          - -

          To use Elementary transitions, you must create an Elm_Transit object and define the desired transitions using the methods of this object. After the transitions are registered, they will be automatically managed: their callback functions will be called for the set duration, and they will be deleted upon completion.

          - -

          Use Elementary transitions only when Edje animations are not sufficient. Edje animations are better at handling transitions, have more flexibility, and can be manipulated inside themes. The only drawback is that Edje animations have their own definition language. If you want to code with the C language, use Elementary transitions.

          - -

          Getting Started

          -

          The first thing you need to do when creating an transition with Elm_Transit is to build your transit object using the elm_transit_add() function:

          - -
          Elm_Transit *transit = elm_transit_add();
          - -

          You now have an Elm_Transit instance that will allow you to perform transitions on one or more objects. The transit object holds the information about the target objects and the transition effects that will be used. The transit object also contains information about animation duration, number of repetitions, auto-reverse, and so on. The transit object starts playing as soon as the application enters the main loop.

          - -

          Adding Objects to an Animation

          - -

          You can add your Evas objects to your transition using the elm_transit_object_add() function:

          - -
          elm_transit_object_add(Elm_Transit *transit, Evas_Object *obj)
          - -

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the Evas object to animate.

          - - - - - - - - - - -
          Note

          The Evas object can be a low-level component, such as a rectangle, but also a UI component, such as a button, image, or calendar.

          -

          If you want to animate an Evas object handled by a container, such as a box, you need to either unpack the object before the animation or animate the whole container.

          - -

          If you want to know which objects are currently in your transition, use the elm_transit_objects_get() function. You will get a list of all the objects that are subject to the transition.

          - -

          At any time, you can remove objects from the transition:

          - -
          elm_transit_object_remove(Elm_Transit *transit, Evas_Object *obj)
          - -

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the Evas object to remove from the transition.

          - - - - - - - - - - -
          Note
          After you have added at least one Evas object to your transition, if the list of objects gets emptied somehow, be it because the transition has been terminated or all objects have been deleted, the transition will be automatically deleted. Otherwise, you will have to delete the transition by yourself using the elm_transit_del() function. If you delete the transit while the transition is running, the transition will stop.
          - -

          Adding Images to an Animation

          - -

          If you do not want to manage UI components for animating images, Elm_Transit provides a helper function for directly manipulating images:

          - -
          -elm_transit_effect_image_animation_add(Elm_Transit *transit, Eina_List *images)
          -
          - -

          The first argument is the Elm_Transit instance that handles the transition. The second argument is a list of the image paths.

          - - - - - - - - - - -
          Note
          This list and its contents will be deleted after the effect ends by the elm_transit_effect_image_animation_context_free() function.
          - -

          You can now define your image transitions exactly the same way as with any Evas object.

          - -

          The following example shows how to use Elm_Transit with images:

          - -
          char buf[PATH_MAX];
          -Eina_List *images = NULL;
          -Elm_Transit *transit = elm_transit_add();
          -snprintf(buf, sizeof(buf), "%s/images/btn_default.png", PACKAGE_DATA_DIR);
          -images = eina_list_append(images, eina_stringshare_add(buf));
          -snprintf(buf, sizeof(buf), "%s/images/btn_hover.png", PACKAGE_DATA_DIR);
          -images = eina_list_append(images, eina_stringshare_add(buf));
          -elm_transit_effect_image_animation_add(transit, images);
          - -

          Animation Duration

          - -

          With Elm_Transit, setting the transition duration is mandatory. To set the duration, use the elm_transit_duration_set() function:

          - -
          elm_transit_duration_set(Elm_Transit *transit, double duration)
          - -

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the duration in seconds.

          - - - - - - - - - - -
          Note
          The purpose of Elm_Transit is to abstract the low-level details of object interpolation, so you cannot create an infinite transition by specifying the duration. However, you can make your transition last forever using the repeat function.
          - -

          The following example shows how to make a complete revolution of the target Evas object in 2 seconds:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, my_evas_object);
          -elm_transit_effect_rotation_add(transit, 0.0, 360);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_go(transit);
          -
          - -

          To get the duration of the transition, use the elm_transit_duration_get() function.

          - -

          Animation Acceleration Mode ("Tween Mode")

          - -

          Elm_Transit supports a number of built-in interpolation methods. By default, all interpolations are linear. If you want to change the animation's dynamics, use the elm_transit_tween_mode_set() function:

          - -
          elm_transit_tween_mode_set(Elm_Transit *transit, Elm_Transit_Tween_Mode tween_mode)
          - -

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the tween mode of the transition, which can be one of the following:

          -
            -
          • ELM_TRANSIT_TWEEN_MODE_LINEAR: The default mode.
          • -
          • ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL: The transition starts with acceleration and ends with deceleration.
          • -
          • ELM_TRANSIT_TWEEN_MODE_DECELERATE: The transition decelerates over time.
          • -
          • ELM_TRANSIT_TWEEN_MODE_ACCELERATE: The transition accelerates over time.
          • -
          • ELM_TRANSIT_TWEEN_MODE_BEZIER_CURVE: The transition uses an interpolated cubic-bezier curve adjusted with parameters.
          • -
          - -

          To get the current tween mode, use the elm_transit_tween_mode_get() function.

          - -

          Animation Repeat

          - -

          To set a transition to repeat, use the elm_transit_repeat_times_set() function:

          - -
          elm_transit_repeat_times_set(Elm_Transit *transit, int repeat)
          - -

          The function takes the following arguments:

          -
            -
          • The transition you want to repeat.
          • -
          • The number of times the transition repeats.
          • -
          - - - - - - - - - - -
          Note
          If the repeat argument is set to 0, the transition will not loop at all. If set to 1, the transition will run twice. If set to a negative value, the transition will repeat forever.
          - -

          To get the repeat value, use the elm_transit_repeat_times_get() function. The default value is 0.

          - -

          The following example shows how to make an Evas object spin for 3 complete revolutions in 6 seconds:

          - -
          Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, my_evas_object);
          -elm_transit_effect_rotation_add(transit, 0.0, 360);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_repeat_set(transit, 3.0);
          -elm_transit_go(transit);
          - -

          Animation Auto-reverse

          - -

          Elm_Transit provides a helper function for automatically reversing the transition once it finishes:

          - -
          elm_transit_auto_reverse_set(Elm_Transit *transit, Eina_Bool reverse)
          - -

          The first argument is the transition you want to reverse. The second argument is the reverse state. If the reverse state is set to EINA_TRUE, this function will perform the same transition backwards as soon as the first transition is complete.

          - - - - - - - - - - -
          Note
          -

          Reversing the transition doubles the duration of the transition. Moreover, if the transition is set to repeat, the transition will run back and forth until the repeat count is finished.

          -

          You can calculate the duration as follows if both auto-reverse and repeat are set: 2 * duration * repeat.

          -
          - -

          The following example shows how to make an object perform half a turn and then reverse the animation to its original position in 4 seconds:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, my_evas_object);
          -elm_transit_effect_rotation_add(transit, 0.0, 360);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_auto_reverse_set(transit, EINA_TRUE);
          -elm_transit_go(transit);
          -
          - -

          To determine whether the auto-reverse mode is enabled, use the elm_transit_auto_reverse_get() function.

          - -

          Transitions

          - -

          We distinguish two main transition types:

          -
            -
          • Transitions that are applied to the properties of objects, such as position, size, angle, and color.
          • -
          • Transitions from one object to another, where the first object is hidden to let the second one appear.
          • -
          -

          All transitions are based on the same principle: we set the starting and the ending values for the properties we want to animate, we then set the lifespan of the animation, and finally we inquire the preferred interpolation method (such as linear, acceleration, or bounce).

          - -

          You must declare the transitions after the parent window has been created, since the transition effects make use of the geometric properties of the parent window. If the parent window does not yet exist when calculating the interpolation, the interpolation may end up being based on wrong information.

          - -

          Built-in Transitions

          - -

          Elm_Transit provides several built-in transition definitions that are useful for the most common cases, so you that will not have to code them from scratch.

          - -

          All these built-in effects are implemented as follows:

          - -
          Elm_Transit *transit = elm_transit_add();
          -elm_transit_effect_add(transit,
          -                       elm_transit_effect_translation_op,
          -                       elm_transit_effect_translation_context_new(),
          -                       elm_transit_effect_translation_context_free);
          - -
            -
          • transit: The Elm_Transit object that contains the target Evas objects and all the information needed to setup the transition.
          • -
          • elm_transit_effect_translation_op: The callback function that performs the transition (resizing interpolation in this example).
          • -
          • elm_transit_effect_translation_context_new(): The callback function that returns the context used in the transition for calculations. In this example, the context is the coordinates of the before and after objects.
          • -
          • elm_transit_effect_translation_context_free: The callback function that frees up the memory once the transition is complete.
          • -
          - -

          All the definitions above can be rewritten as follows:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_effect_translation_add(transit, from_x, from_y, to_x, to_y);
          -
          - -

          Translation

          -

          To perform a translation on an Evas object, use the following method:

          - -
          -elm_transit_effect_translation_add(Elm_Transit *transit,
          -                                   Evas_Coord from_dx,
          -                                   Evas_Coord from_dy,
          -                                   Evas_Coord to_dx,
          -                                   Evas_Coord to_dy)
          -
          - -
            -
          • The first argument is the transit object that contains (among other things) all the Evas objects subject to the translation.
          • -
          • from_dx: The starting X coordinate (source).
          • -
          • from_dy: The starting Y coordinate (source).
          • -
          • to_dx: The ending X coordinate (destination).
          • -
          • to_dy: The ending Y coordinate (destination).
          • -
          - -

          The following example shows how to slide an Evas object (a rectangle) on a 45-degree diagonal, from bottom-left to top-right, at a constant speed, and in 1 second:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, rectangle);
          -elm_transit_effect_translation_add(transit, 0, 0, 280, 280);
          -elm_transit_duration_set(transit, 1);
          -elm_transit_go(transit);
          -
          - -

          Color Transition

          - -

          Color transitions allow you to dynamically change the color of Evas objects. The first argument is the transit object, while the other arguments will be used to define the color transition using RGB colors. There is also an alpha channel that controls the opacity of the color (the background of the object, not the object itself).

          - -
          -elm_transit_effect_color_add(Elm_Transit *transit,
          -                             unsigned int from_r,
          -                             unsigned int from_g,
          -                             unsigned int from_b,
          -                             unsigned int from_a,
          -                             unsigned int to_r,
          -                             unsigned int to_g,
          -                             unsigned int to_b,
          -                             unsigned int to_a)
          -
          - -
            -
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • -
          • from_r: The start value for "Red".
          • -
          • from_g: The start value for "Green".
          • -
          • from_b: The start value for "Blue".
          • -
          • from_a: The start value for "Alpha".
          • -
          • to_r: The end value for "Red".
          • -
          • to_g: The end value for "Green".
          • -
          • to_b: The end value for "Blue".
          • -
          • to_a: The end value for "Alpha".
          • -
          - -

          The following example shows how to transit a rectangle from red to blue in 3 seconds:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, rectangle);
          -elm_transit_effect_color_add(transit, // Target object
          -                             255, 0, 0, 255, // From color
          -                             0, 0, 255, 255); // To color
          -elm_transit_duration_set(transit, 3);
          -elm_transit_go(transit);
          -
          - -

          Rotation

          - -
          elm_transit_effect_rotation_add(Elm_Transit *transit, float from_degree, float to_degree)
          - -
            -
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • -
          • from_degree: The start degree of rotation.
          • -
          • to_degree: The end degree of rotation.
          • -
          - -

          This function can be used to perform a rotation on any Evas object. It works the same way as the other transit effects and takes two arguments for the starting and ending angles. Note that if you apply a rotation on multiple objects, they will individually mill around and not act as a group. If you want several objects to revolve around a common point, you must encapsulate the objects into a single parent object and apply the rotation to the parent object. The following example shows how to achieve this:

          - -
          -// Parent container
          -Evas_Object *parent = elm_box_add(my_window);
          -evas_object_show(parent);
          -elm_box_horizontal_set(parent, EINA_TRUE);
          -elm_box_homogeneous_set(parent, EINA_TRUE);
          -
          -// Button 1
          -Evas_Object *btn1 = elm_button_add(parent);
          -elm_object_text_set(btn1, "Btn1");
          -elm_box_pack_start(parent, btn1);
          -evas_object_show(btn1);
          -
          -// Button 2
          -Evas_Object *btn2 = elm_button_add(parent);
          -elm_object_text_set(btn2, "Btn2");
          -elm_box_pack_end(parent, btn2);
          -evas_object_show(btn2);
          -
          -// Make the parent container do a 360 degrees spin
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, parent);
          -elm_transit_effect_rotation_add(transit, 0.0, 360);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_go(transit);
          -
          - -

          Wipe Effect

          - -

          The wipe effect is designed to dynamically hide or show any element on the scene.

          - -
          -elm_transit_effect_wipe_add(Elm_Transit *transit,
          -                            Elm_Transit_Effect_Wipe_Type type,
          -                            Elm_Transit_Effect_Wipe_Dir dir)
          -
          - -

          In addition to the Elm_Transit instance passed as the first argument, the function takes the following arguments:

          - -
            -
          • type: The wipe type Elm_Transit_Effect_Wipe_Type defines whether to show or hide the target elements. The value can be one of the following: -
              -
            • ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE
            • -
            • ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW
            • -
            -
          • -
          • dir: The wipe direction Elm_Transit_Effect_Wipe_Dir defines in which direction the target will progressively appear or disappear. The value can be one of the following: -
              -
            • ELM_TRANSIT_EFFECT_WIPE_DIR_LEFT
            • -
            • ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT
            • -
            • ELM_TRANSIT_EFFECT_WIPE_DIR_UP
            • -
            • ELM_TRANSIT_EFFECT_WIPE_DIR_DOWN
            • -
            -
          • -
          - -

          The following example shows how to make an object disappear progressively from left to right:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, my_evas_object);
          -elm_transit_effect_wipe_add(transit,
          -                            ELM_TRANSIT_EFFECT_TYPE_HIDE,
          -                            ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_go(transit);
          -
          - -

          Zoom Effect

          -

          Elm_Transit provides a zoom function.

          - -
          -elm_transit_effect_zoom_add(Elm_Transit *transit,
          -                            float from_rate,
          -                            float to_rate)
          -
          - -
            -
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • -
          • from_rate: The starting level of the zoom.
          • -
          • to_rate: The ending level of the zoom.
          • -
          - -

          The from_rate argument defines the scale of the target objects at the beginning of the animation. A value of 1 represents the initial scale of the objects.

          - -

          Setting the value of the to_rate argument to 2 will double the size of the target objects (double the width and double the height). When using this effect, the width and height of a target object will remain proportional to one another. If you want to customize the zoom effect, use the elm_transit_effect_resizing_add() function.

          - -

          The following example shows how to implement a zoom-out transition. At the end of the 2-secondstransition, the animated object will be half its original size.

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, my_evas_object);
          -elm_transit_effect_zoom_add(transit, 1, 0.5);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_go(transit);
          -
          - -

          Resizing Effect

          - -

          The resizing effect allows you to design an interpolation of the width and height attributes of one or more target elements.

          - -
          -elm_transit_effect_resizing_add(Elm_Transit *transit,
          -                                Evas_Coord from_w,
          -                                Evas_Coord from_h,
          -                                Evas_Coord to_w,
          -                                Evas_Coord to_h)
          -
          - -
            -
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • -
          • from_w: The starting width.
          • -
          • from_h: The starting height.
          • -
          • to_w: The ending width.
          • -
          • to_h: The ending height.
          • -
          - -

          The from_w and from_h arguments define the size at the beginning of the animation. The to_w and to_h arguments define the size at the end.

          - - - - - - - - - - -
          Note
          If you are planning to use this method to hide an Evas object by setting one of the length attributes to zero, consider using the elm_transit_effect_wipe_add() function instead.
          - -

          The following example shows how to make a rectangle exchange its width and height properties in a 2-second transition:

          - -
          -Evas_Coord w, h;
          -evas_object_geometry_get(my_evas_object, NULL, NULL, &w, &h);
          -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, my_evas_object);
          -elm_transit_effect_resize_add(transit, // Transition object
          -                              w, h, // Original sizing
          -                              h, w); // Target sizing
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_go(transit);
          -
          - -

          Flip Effect

          -

          This transition combines the target Evas objects in pairs, so that one object will show up while the other one disappears. This association relates the even objects in the transit list of objects with the odd ones. The even objects are shown at the beginning of the animation, and the odd objects shown when the transition is complete. In other words, the effect applies to each pair of objects in the order in which they are listed in the transit list of objects.

          - -

          The flip effect itself is a pseudo-3D effect where the first object in the pair is the front object and the second one is the back object. When the transition launches, the front object rotates around a preferred axis in order to let the back object take its place.

          - -
          -elm_transit_effect_flip_add(Elm_Transit *transit,
          -                            Elm_Transit_Effect_Flip_Axis axis,
          -                            Eina_Bool cw)
          -
          - -

          The first argument is the transit object. The second argument is the preferred axis of rotation:

          -
            -
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_X
          • -
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_Y
          • -
          - -

          The third argument is the direction of the rotation:

          -
            -
          • EINA_TRUE is clockwise.
          • -
          • EINA_FALSE is counter-clockwise.
          • -
          - -

          The following example shows how to create a coin that flips indefinitely. Note that we use images as Elementary UI components for demonstration purposes. You can use the elm_transit_effect_image_animation_add() function if you do not want to bother creating UI components.

          - -
          -// Coin Heads
          -Evas_Object *coin_heads = elm_image_add(ad->win);
          -if (!elm_image_file_set(coin_heads, IMG_DIR"/coin_heads.png", NULL))
          -   printf("error: could not load image");
          -elm_win_resize_object_add(ad->win, coin_heads);
          -
          -// Coin Tails
          -Evas_Object *coin_tails = elm_image_add(ad->win);
          -if (!elm_image_file_set(coin_tails, IMG_DIR"/coin_tails.png", NULL))
          -   printf("error: could not load image");
          -elm_win_resize_object_add(ad->win, coin_tails);
          -
          -// Transition definition
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, coin_heads);
          -elm_transit_object_add(transit, coin_tails);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_auto_reverse_set(transit, EINA_TRUE);
          -elm_transit_repeat_times_set(transit, -1);
          -elm_transit_effect_flip_add(transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_X, EINA_TRUE);
          -elm_transit_go(transit);
          -
          - -

          Figure: Coin flip

          -

          Coin flip

          - -

          Resizable Flip Effect

          -

          In the flip example above, we used two objects that have the same size. However, you may sometimes want to flip from one object to another object with different size attributes. The most common example would be using buttons with dimensions that depend on their contents (such as labels). If you decide to use the classic elm_transit_effect_flip_add() function, the size of the object will change at the moment one object becomes completely hidden and the other one begins to show up. If you wish to interpolate the size attributes as well, use the elm_transit_effect_resizable_flip_add() function:

          - -
          -elm_transit_effect_resizable_flip_add(Elm_Transit *transit,
          -                                      Elm_Transit_Effect_Flip_Axis axis,
          -                                      Eina_Bool cw)
          -
          - -

          The first argument is the transit object. The second argument is the preferred axis of rotation:

          -
            -
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_X
          • -
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_Y
          • -
          - -

          The third argument is the direction of the rotation:

          -
            -
          • EINA_TRUE is clockwise.
          • -
          • EINA_FALSE is counter-clockwise.
          • -
          - -

          This function works the exact same way as the standard flip effect function.

          - -

          Fade Effect

          - -

          This effect is used to transition from one Evas object to another one using a fading effect: the first object will slowly disappear to let the second object take its place.

          - -
          elm_transit_effect_fade_add(Elm_Transit *transit)
          - -

          This effect is applied to each pair of objects in the order in which they are listed in the transit list of objects. The first object in the pair will be the before object and the second one will be the after object.

          - -

          Building on the coin flip example, the following example shows how to fade out one face of the coin while fading in the other face:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, coin_heads);
          -elm_transit_object_add(transit, coin_tails);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_effect_fade_add(transit);
          -elm_transit_go(transit);
          -
          - -

          If you simply want to hide an object with a fade transition, consider using a transparent after object.

          - -

          Blend Effect

          - -

          Another transition involving at least two Evas objects is the blend effect. This transition makes the before object blurry before the after object appears.

          - -
          elm_transit_effect_blend_add(Elm_Transit *transit)
          - -

          The argument is the transition target of the blend effect.

          - -

          Building on the coin flip example, the following example shows how to blur out one face of the coin while blurring in the other face:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, coin_heads);
          -elm_transit_object_add(transit, coin_tails);
          -elm_transit_duration_set(transit, 2.0);
          -elm_transit_effect_blend_add(transit);
          -elm_transit_go(transit);
          -
          - -

          If you simply want to hide an object with a blur transition, consider using a transparent after object.

          - -

          Combining Transitions

          - -

          To use multiple transitions at the same time on the same objects, simply declare the transitions one after the other.

          - -

          Building on the coin flip example, the following example shows how to roll the coin on the ground using a rotation and a translation effect:

          - -
          -Evas_Object *coin_heads = elm_image_add(ad->win);
          -if (!elm_image_file_set(coin_heads, IMG_DIR"/coin_heads.png", NULL))
          -   printf("error: could not load image");
          -evas_object_resize(coin_heads, 100, 100);
          -evas_object_show(coin_heads);
          -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_object_add(transit, coin_heads);
          -elm_transit_duration_set(transit, 5.0);
          -elm_transit_effect_translation_add(transit, 0, 0, 3.1415 * 2 * 100, 0);
          -elm_transit_effect_rotation_add(transit, 0, 360);
          -elm_transit_go(transit);
          -
          - -

          Animation Chain

          - -

          Now that we have listed all the effects that can be implemented using Elm_Transit, we will see how to chain transitions into sequences. To create complex, chained animations without worrying about synchronization between the transitions, use the elm_transit_chain_transit_add() function. This function takes as arguments two Elm_Transit objects and will automatically take care of the chaining for you: the second transition will start as soon as the first transition is finished.

          - -

          The following example shows how to move a datetime component on a square trajectory:

          - -
          -Evas_Object *dt = elm_datetime_add(ad->win);
          -evas_object_resize(dt, 350, 50);
          -evas_object_show(dt);
          -
          -// The first transition
          -Elm_Transit *t1 = elm_transit_add();
          -elm_transit_object_add(t1, dt);
          -elm_transit_duration_set(t1, 2);
          -elm_transit_effect_translation_add(t1, 0, 0, 100, 0);
          -
          -// The second transition
          -Elm_Transit *t2 = elm_transit_add();
          -elm_transit_object_add(t2, dt);
          -elm_transit_duration_set(t2, 2);
          -elm_transit_effect_translation_add(t2, 100, 0, 100, 100);
          -
          -// The third transition
          -Elm_Transit *t3 = elm_transit_add();
          -elm_transit_object_add(t3, dt);
          -elm_transit_duration_set(t3, 2);
          -elm_transit_effect_translation_add(t3, 100, 100, 0, 100);
          -
          -// The fourth transition
          -Elm_Transit *t4 = elm_transit_add();
          -elm_transit_object_add(t4, dt);
          -elm_transit_duration_set(t4, 2);
          -elm_transit_effect_translation_add(t4, 0, 100, 0, 0);
          -
          -// Chaining the transitions
          -elm_transit_chain_transit_add(t1, t2);
          -elm_transit_chain_transit_add(t2, t3);
          -elm_transit_chain_transit_add(t3, t4);
          -
          -// Starting the transitions
          -elm_transit_go(t1);
          -
          - -

          Note that we cannot use transition chaining to make a loop animation, since the transit object is automatically destroyed as soon as the transition completes. Therefore, you cannot do something like this:

          - -
          elm_transit_chain_transit_add(t4, t1);
          - -

          To create a looped animation chain, you have to use low-level components provided by the Ecore and Evas transition libraries, or you can use the elm_transit_del_cb_set() function to define a callback function for when a transition gets deleted. This way, you could recreate your objects and reiterate the transition chain as soon as the last transition ends.

          - -
          -elm_transit_del_cb_set(Elm_Transit *transit, Elm_Transit_Del_Cb cb, void *data)
          -
          - -

          The first argument is the transition object. The second argument is the callback function to run on transition delete. The third argument is the data to pass to the callback function.

          - -

          You can severe the chain relationship between two transits by using the elm_transit_chain_transit_del() function:

          - -
          elm_transit_chain_transit_del(Elm_Transit *transit, Elm_Transit *chain_transit)
          - -

          The first argument is the first transition in the chain. The second argument is the second transition in the chain.

          - -

          To get the current chain transit list, use the elm_transit_chain_transits_get() function.

          - -

          Animation Timeline

          - -

          After you have defined all the properties that define your transition, start the transition with the elm_transit_go() function:

          - -
          elm_transit_go(Elm_Transit *transit)
          - -

          You can maintain full control over the execution process even after the transition has started. You can pause the transition by setting the paused argument to EINA_TRUE:

          - -
          elm_transit_paused_set(Elm_Transit *transit, Eina_Bool paused)
          - -

          You can resume the transition by using the same method but setting the paused argument to EINA_FALSE. If you want to know whether the transition is currently paused, use the elm_transit_paused_get() function.

          - -

          You can remain informed about the present transition flow and get the current frame by using the elm_transit_progress_value_get() function. This function will return the timeline position of the animation, ranging between 0.0 (start) and 1.0 (end).

          - -

          Custom Transitions

          - -

          Elm_Transit provides a standard function for defining any effect of your choosing that will be applied to some context data:

          - -
          -elm_transit_effect_add(Elm_Transit *transit,
          -                       Elm_Transit_Effect_Transition_Cb transition_cb,
          -                       Elm_Transit_Effect *effect,
          -                       Elm_Transit_Effect_End_Cb end_cb)
          -
          - -

          The first argument is the transition target of the new effect. The second argument is the transition callback function. The third argument is the new effect. The fourth argument is the callback function to call at the end of the effect.

          - -

          As described earlier in this programming guide, this function embraces three callbacks that will allow you to define every aspects of your transition from its creation to its deletion. The following is an example of how to build a custom resizing animation.

          - -

          First, we define a structure capable of holding the context information about resizing an Evas object:

          - -
          -typedef struct
          -{
          -   struct _size
          -   {
          -      Evas_Coord w, h;
          -   }
          -   from, to;
          -}
          -Custom_Effect;
          -
          - -

          We can now implement our custom resizing callback function. This function takes the following arguments:

          - -
            -
          • The context data that holds the custom properties of our transition, which are used as parameters to calculate the interpolation.
          • -
          • The transit object that contains the list of our Evas objects to animate and all the information about duration, auto-reverse, looping, and so on.
          • -
          • The progress (position along the animation timeline) that ranges from 0.0 to 1.0 and allows us to calculate the desired interpolation for each frame.
          • -
          - -
          -static void
          -_custom_op(void *data, Elm_Transit *transit, double progress)
          -{
          -   if (!data) return;
          -   Evas_Coord w, h;
          -   Evas_Object *obj;
          -   const Eina_List *elist;
          -   Custom_Effect *custom_effect = data;
          -   const Eina_List *objs = elm_transit_objects_get(transit);
          -   if (progress < 0.5)
          -   {
          -      h = custom_effect->from.h + (custom_effect->to.h * progress * 2);
          -      w = custom_effect->from.w;
          -   }
          -   else
          -   {
          -      h = custom_effect->from.h + custom_effect->to.h;
          -      w = custom_effect->from.w + (custom_effect->to.w * (progress - 0.5) * 2);
          -   }
          -   EINA_LIST_FOREACH(objs, elist, obj)
          -      evas_object_resize(obj, w, h);
          -}
          -
          - -

          The callback function above resizes our Evas objects in two steps. During the first half of the transition, only the height changes, while the width remains the same. During the second half, it is the other way around until we get to the desired size.

          - -

          You must then define the context used by your animation:

          - -
          -static void*
          -_custom_context_new(Evas_Coord from_w, Evas_Coord from_h, Evas_Coord to_w, Evas_Coord to_h)
          -{
          -   Custom_Effect *custom_effect;
          -
          -   custom_effect = calloc(1, sizeof(Custom_Effect));
          -   if (!custom_effect) return NULL;
          -
          -   custom_effect->from.w = from_w;
          -   custom_effect->from.h = from_h;
          -   custom_effect->to.w = to_w - from_w;
          -   custom_effect->to.h = to_h - from_h;
          -
          -   return custom_effect;
          -}
          -
          - -

          You must define the function that will take care of deleting all the context objects used by your custom transition and free up the allocated memory:

          - -
          -static void
          -_custom_context_free(void *data, Elm_Transit *transit __UNUSED__)
          -{
          -   free(data);
          -}
          -
          - -

          Finally, apply your custom transition to your Elm_Transit object:

          - -
          -Elm_Transit *transit = elm_transit_add();
          -elm_transit_effect_add(transit,
          -                       _custom_op,
          -                       _custom_context_new(),
          -                       _custom_context_free);
          -
          - -

          If you want to delete an effect from your effects list, use the elm_transit_effect_del() function.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/elementary_animation_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/elementary_animation_tutorial_n.htm deleted file mode 100755 index 5f21d4c..0000000 --- a/org.tizen.ui.guides/html/native/efl/elementary_animation_tutorial_n.htm +++ /dev/null @@ -1,628 +0,0 @@ - - - - - - - - - - - - - - Creating Elementary Animations - - - - - - -
          -

          Creating Elementary Animations

          - - -

          This tutorial demonstrates how you can use Elm Transit to create animated transitions effects, such as rotation, wiping, zooming, resizing, and fading, to an Evas_Object.

          - - -

          Setting Up the Application

          - -

          First create a basic application like explained in Creating Basic Mobile Interactions.

          - -

          When the application is ready, create Evas objects and animate them. In this example, one single object is animated with different type of animations.

          - -

          Create the structure of our application represented by a struct named appdata

          - -
          typedef struct appdata 
          -{
          -   Evas_Object *win;
          -   Evas_Object *label;
          -   Evas_Object *button;
          -   Evas_Object *buttonbck;
          -   Evas_Object *hbox;
          -   Evas_Object *left_vbox;
          -   Evas_Object *center_vbox;
          -   Evas_Object *right_vbox;
          -   float rt_angle, zto, zfrom;
          -} appdata_s;
          -
          - -

          This structure holds the main UI components of the application:

          - -
            -
          • win: the main window
          • -
          • label: the title label
          • -
          • button: a button object, the target of the animations
          • -
          • buttonbck: a button representing the back of the target button
          • -
          • left_vbox: a vertical box to place the first buttons column
          • -
          • center_vbox: a vertical box to store the second buttons column
          • -
          • right_vbox: a vertical box to store the last buttons column
          • -
          • hbox: a horizontal box to store the vertical boxes
          • -
          • rt_angle, zto, zfrom: these variables are used to store values for animations
          • -
          - -

          Place the UI components on the application's canvas. To make things easier, the UI component creation is split into two functions.

          - -

          The first function creates UI components on the main window, and the second in the boxes.

          - -
          create_base_gui(appdata_s *ad)
          -{
          -   ad->rt_angle = 360.0;
          -   ad->zfrom = 1.0;
          -   ad->zto = 2.0;
          -
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   if (elm_win_wm_rotation_supported_get(ad->win)) 
          -   {
          -      int rots[4] = { 0, 90, 180, 270 };
          -      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          -   }
          -
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -
          -   // Label
          -   ad->label = elm_label_add(ad->win);
          -   elm_object_text_set(ad->label, "Effects Tutorial");
          -   evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->label);
          -   evas_object_show(ad->label);
          -
          -   // Show the window after the base GUI is set up
          -   evas_object_show(ad->win);
          -
          -   ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, ad);
          -
          -   // Creation a button in the app window
          -   ad->button = elm_button_add(ad->win);
          -
          -   // Moving the button to x=50 y=100
          -   evas_object_move(ad->button, 50, 100);
          -
          -   // Resizing the button 100x50
          -   evas_object_resize(ad->button, 200, 50);
          -
          -   // Showing the button
          -   evas_object_show(ad->button);
          -
          -   // Creation a back button in the app window
          -   ad->buttonbck = elm_button_add(ad->win);
          -   elm_object_text_set(ad->buttonbck, "Button back");
          -   evas_object_move(ad->buttonbck, 50, 100);
          -   evas_object_resize(ad->buttonbck, 200, 50);
          -
          -   _create_btn_box(ad);
          -
          -} // End of create_base_gui
          -
          - -

          This function takes appdata_s *ad as its only parameter. This function is called by the creation callback app_create of the Tizen application (event_callback.create = app_create;) in the main function of the application.

          - -

          Set up the needed values like the rotation angle, the original zoom value (zfrom), and the destination zoom value (zto).

          - -
          ad->rt_angle = 360.0;
          -ad->zfrom = 1.0;
          -ad->zto = 2.0;
          -
          - -

          Create the main window with a title and add the delete callback:

          - -
          // Window
          -ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -if (elm_win_wm_rotation_supported_get(ad->win)) 
          -{
          -   int rots[4] = { 0, 90, 180, 270 };
          -   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          -}
          -
          -evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -
          -// Label
          -ad->label = elm_label_add(ad->win);
          -elm_object_text_set(ad->label, "Effects Tutorial");
          -evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(ad->win, ad->label);
          -evas_object_show(ad->label);
          -
          -// Show the window after the base GUI is set up
          -evas_object_show(ad->win);
          -
          -ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, ad);
          -
          - -

          Next create the animation target button and the back button. Call the button box creation function with the application data as its parameter.

          - -
          _create_btn_box(ad);
          -
          - -

          Add a set of buttons to this box that starts animations on the animation target.

          - -

          Create the structure of the buttons box with three columns (vertical boxes) and one horizontal for the main container.

          - -
          // Creation of the main container box
          -ad->hbox = elm_box_add(ad->win);
          -elm_box_horizontal_set(ad->hbox, EINA_TRUE);
          -elm_box_homogeneous_set(ad->hbox, EINA_TRUE);
          -evas_object_move(ad->hbox, 10, 500);
          -evas_object_show(ad->hbox);
          -
          -// Creation of the first column
          -ad->left_vbox = elm_box_add(ad->hbox);
          -elm_box_horizontal_set(ad->left_vbox, EINA_FALSE);
          -elm_box_homogeneous_set(ad->left_vbox, EINA_TRUE);
          -evas_object_show(ad->left_vbox);
          -elm_box_pack_start(ad->hbox, ad->left_vbox);
          -
          -// Creation of the second column
          -ad->center_vbox = elm_box_add(ad->hbox);
          -elm_box_horizontal_set(ad->center_vbox, EINA_FALSE);
          -elm_box_homogeneous_set(ad->center_vbox, EINA_TRUE);
          -evas_object_show(ad->center_vbox);
          -elm_box_pack_end(ad->hbox, ad->center_vbox);
          -
          -// Creation of the last column
          -ad->right_vbox = elm_box_add(ad->hbox);
          -elm_box_horizontal_set(ad->right_vbox, EINA_FALSE);
          -elm_box_homogeneous_set(ad->right_vbox, EINA_TRUE);
          -evas_object_show(ad->right_vbox);
          -elm_box_pack_end(ad->hbox, ad->right_vbox);
          -
          - -

          Then create the first action button for the resize effect.

          - -
          // Button creation
          -btn_resize = elm_button_add(ad->win);
          -// Setting the button text
          -elm_object_text_set(btn_resize, "Resize");
          -// Setting the hint weight policy
          -evas_object_size_hint_weight_set(btn_resize, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -// Showing the button
          -evas_object_show(btn_resize);
          -// Setting the "clicked" callback
          -evas_object_smart_callback_add(btn_resize, "clicked", _btn_resize_cb, ad);
          -// Adding the button to the first column
          -elm_box_pack_end(ad->left_vbox, btn_resize);
          -
          - -

          evas_object_smart_callback_add defines the callback function that is to be called when the button is clicked. In this example, set a _btn_resize_cb function and pass the application data ad to this callback function.

          - -

          The callback by itself only sets a new text for the animation target button, and calls a function which will actually animate the button.

          - -
          static void _btn_resize_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   // Starting the rotation effect 360 degrees
          -   // evas_object_resize(ad->button, 100, 50);
          -   elm_object_text_set(ad->button, "Resize");
          -   _resize_effect(ad->button);
          -
          -}
          -
          - -

          This function is an evas_object_smart_callback and thus needs to have its specific prototype: it does not return anything and receives three parameters:

          - -
            -
          • data: data to be passed
          • -
          • btn: the object the callback is being called about
          • -
          • ev: the actual event, seldom used
          • -
          - -

          In this case, use data to pass the application data to the callback. However, the parameter's type is void * and not appdata_s *. Initialize a variable of the correct type with the pointer.

          -
          appdata_s *ad = data;
          -
          - -

          Then use the application data in the callback function. At this point create the animation directly in the callback function, but it is more straightforward to encapsulate the animation process into a dedicated function. _resize_effect implements the animation code:

          - -
          static void _resize_effect(Evas_Object *obj)
          -{
          -   // Elementary Transition declaration and creation
          -   Elm_Transit *trans = elm_transit_add();
          -
          -   // Adding the transition target object
          -   elm_transit_object_add(trans, obj);
          -
          -   // Setting the resize effect
          -   elm_transit_effect_resizing_add(trans, 100, 50, 300, 150);
          -
          -   // Setting the transition duration
          -   elm_transit_duration_set(trans, 3.0);
          -
          -   // Starting the transition
          -   elm_transit_go(trans);
          -}
          -
          - -

          Create an Elm_Transit * object representing the transition.

          - -
          Elm_Transit *trans = elm_transit_add();
          -
          - -

          Then add the target object to the transition

          - -
          elm_transit_object_add(trans, obj);
          -
          - -

          Add a resizing transition to the object with the origin and destination width and height in pixels.

          - -
          elm_transit_effect_resizing_add(trans, 100, 50, 300, 150);
          -
          -

          100 and 50 are respectively the object's width and height when the effect begins, whereas 300 and 150 are respectively the object's width and height when the effect ends: the object grows from 100×50 to 300×150.

          - -

          After that set the transition duration with elm_transit_duration_set.

          -
          elm_transit_duration_set(trans, 3.0);
          -
          - -

          The animation lasts three seconds. The duration parameter is a double.

          - -

          Now start the animation by calling elm_transit_go with the Elm_Transit object.

          - -
          elm_transit_go(trans);
          -
          - -

          When the resize button is clicked, the animation target button grows.

          - -

          All the action buttons are created exactly the same way as the resize button, with a callback and an animation function.

          - -

          Creating a Rotation Effect

          - -

          This effect rotates the animation target button with an angle of 360°. This angle is stored in the application data as ad->rt_angle.

          - -

          Create the button and add it to the center column in the _create_btn_box function.

          - -
          // The rotation button
          -btn_rotate = elm_button_add(ad->win);
          -elm_object_text_set(btn_rotate, "Rotate");
          -evas_object_size_hint_weight_set(btn_rotate, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_rotate);
          -evas_object_smart_callback_add(btn_rotate, "clicked", _btn_rotate_cb, ad);
          -elm_box_pack_end(ad->center_vbox, btn_rotate);
          -
          - -

          In the rotate button callback, call the effect function with the target button as first parameter and the rotation angle as the second one.

          - -
          static void _btn_rotate_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   // Setting the button text
          -   elm_object_text_set(ad->button, "Rotate");
          -   _rotation_effect(ad->button, ad->rt_angle);
          -}
          -
          - -

          The animation function rotates the animation target by adding a rotation effect with elm_transit_effect_rotation_add. This function takes three parameters:

          - -
            -
          • Elm_Transit
          • -
          • the rotation position at which the effect begins
          • -
          • the rotation position at which the effect ends
          • -
          - -

          Rotation starts at 0° to finish at 360°. The animation lasts two seconds.

          - -
          static void _rotation_effect(Evas_Object *obj, float angle)
          -{
          -   Elm_Transit *trans = elm_transit_add();
          -   elm_transit_object_add(trans, obj);
          -
          -   // Rotates the object from its original angle to given degrees to the right
          -   elm_transit_effect_rotation_add(trans, 0.0, angle);
          -   elm_transit_duration_set(trans, 2.0);
          -   elm_transit_go(trans);
          -}
          -
          - -

          Creating a Zoom Effect

          - -

          The zoom effect zooms on the animation target to make it twice bigger. Store the source rate and the destination rate in the application data using ad->zfrom and ad->zto.

          -

          Create the button and add it to the center column in the _create_btn_box function.

          - -
          // The zoom button
          -btn_zoom = elm_button_add(ad->win);
          -elm_object_text_set(btn_zoom, "Zoom");
          -evas_object_size_hint_weight_set(btn_zoom, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_zoom);
          -evas_object_smart_callback_add(btn_zoom, "clicked", _btn_zoom_cb, ad);
          -elm_box_pack_end(ad->right_vbox, btn_zoom);
          -
          - -

          Then add a callback function in order to perform the animation.

          - -
          static void _btn_zoom_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   // Starting the rotation effect 360 degrees
          -   // evas_object_resize(ad->button, 100, 50);
          -   elm_object_text_set(ad->button, "Zoom");
          -   _zoom_effect(ad->button, ad->zfrom, ad->zto);
          -}
          -
          - -

          To create the zoom effect, use elm_transit_effect_zoom_add with the start rate and the destination rate stored in application data (ad->zfrom and ad->zto)

          - -
          static void _zoom_effect(Evas_Object *obj, float from, float to)
          -{
          -   Elm_Transit *trans = elm_transit_add();
          -   elm_transit_object_add(trans, obj);
          -
          -   elm_transit_effect_zoom_add(trans, from, to);
          -   elm_transit_duration_set(trans, 2.0);
          -   elm_transit_go(trans);
          -}
          -
          - - -

          Creating a Flip Effect

          - -

          This effect is applied to a pair of objects, in the order they are added, to the Elm_Transit transition. In this example, add the animation target button and the button called buttonbck which represents the back of the target button.

          - -

          Create the action button for the flip effect:

          - -
          // The flip button
          -btn_flip = elm_button_add(ad->win);
          -elm_object_text_set(btn_flip, "Flip x");
          -evas_object_size_hint_weight_set(btn_flip, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_flip);
          -evas_object_smart_callback_add(btn_flip, "clicked", _btn_flip_cb, ad);
          -elm_box_pack_end(ad->left_vbox, btn_flip);
          -
          - -

          The corresponding callback to create and start the animation with the two objects (target button and back button) to animate is like follows.

          - -
          static void _btn_flip_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   // Setting the button text
          -   elm_object_text_set(ad->button, "Flip");
          -   _flip_effect(ad->button, ad->buttonbck);
          -}
          -
          - -

          Create the function which runs the animation. This flip animation is created using elm_transit_effect_flip_add. The second parameter is the axis of the flip: in this example it is the X axis, so the button flips down to top to show the back button. The last parameter is the flip direction: EINA_TRUE means clockwise.

          - -
          static void _flip_effect(Evas_Object *obj, Evas_Object *obj2)
          -{
          -   Elm_Transit *trans;
          -
          -   trans = elm_transit_add();
          -   elm_transit_object_add(trans, obj);
          -   elm_transit_object_add(trans, obj2);
          -   elm_transit_effect_flip_add(trans, ELM_TRANSIT_EFFECT_FLIP_AXIS_X, EINA_TRUE);
          -
          -   elm_transit_duration_set(trans, 3.0);
          -   elm_transit_go(trans);
          -}
          -
          - -

          Creating a Blend Transition

          - -

          The blend effect also works the same way as the flip, but without the axes or direction information. Use the back button here as well. To create the blend effect button:

          - -
          // The blend button
          -btn_blend = elm_button_add(ad->win);
          -elm_object_text_set(btn_blend, "Blend");
          -evas_object_size_hint_weight_set(btn_blend, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_blend);
          -evas_object_smart_callback_add(btn_blend, "clicked", _btn_blend_cb, ad);
          -elm_box_pack_end(ad->center_vbox, btn_blend);
          -
          - -

          The blend transition callback is:

          - -
          static void _btn_blend_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   // Setting the button text
          -   elm_object_text_set(ad->button, "Blend");
          -   _blend_effect(ad->button, ad->buttonbck);
          -}
          -
          - -

          Create and start the blend animation. This animation is created by adding it to and Elm_Transit with elm_transit_effect_blend_add. Add two objects, as for the flip.

          - -
          static void _blend_effect(Evas_Object *obj, Evas_Object *obj2)
          -{
          -   Elm_Transit *trans;
          -
          -   trans = elm_transit_add();
          -   elm_transit_object_add(trans, obj);
          -   elm_transit_object_add(trans, obj2);
          -   elm_transit_effect_blend_add(trans);
          -   elm_transit_duration_set(trans, 3.0);
          -   elm_transit_go(trans);
          -}
          -
          - -

          Creating a Fade Effect

          - -

          The fade effect works exactly the same way as the blend effect. First create the button:

          - -
          // The fade button
          -btn_fade = elm_button_add(ad->win);
          -elm_object_text_set(btn_fade, "Fade");
          -evas_object_size_hint_weight_set(btn_fade, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_fade);
          -evas_object_smart_callback_add(btn_fade, "clicked", _btn_fade_cb, ad);
          -elm_box_pack_end(ad->right_vbox, btn_fade);
          -
          - -

          Then add the button's callback:

          - -
          static void _btn_fade_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -
          -   // Setting the button text
          -   elm_object_text_set(ad->button, "Fade");
          -   _fade_effect(ad->button, ad->buttonbck);
          -}
          -
          - -

          The animation function calls elm_transit_effect_fade_add instead of elm_transit_effect_blend_add.

          - -
          static void _fade_effect(Evas_Object *obj, Evas_Object *obj2)
          -{
          -   Elm_Transit *trans;
          -
          -   trans = elm_transit_add();
          -   elm_transit_object_add(trans, obj);
          -   elm_transit_object_add(trans, obj2);
          -   elm_transit_effect_fade_add(trans);
          -   elm_transit_duration_set(trans, 3.0);
          -   elm_transit_go(trans);
          -}
          -
          - -

          Creating a Flip on y Axis

          - -

          This is same as the flip transition, but on y axis. To create a flip on y axis:

          - -
          // The flip y button
          -btn_flip_y = elm_button_add(ad->win);
          -elm_object_text_set(btn_flip_y, "Flip y");
          -evas_object_size_hint_weight_set(btn_flip_y, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_flip_y);
          -evas_object_smart_callback_add(btn_flip_y, "clicked", _btn_flip_y_cb, ad);
          -elm_box_pack_end(ad->left_vbox, btn_flip_y);
          -
          -static void _btn_flip_y_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -
          -   // Setting the button text
          -   elm_object_text_set(ad->button, "Flip 2");
          -   _flip_y_effect(ad->button, ad->buttonbck);
          -}
          -
          -static void _flip_y_effect(Evas_Object *obj, Evas_Object *obj2)
          -{
          -   Elm_Transit *trans;
          -
          -   trans = elm_transit_add();
          -   elm_transit_object_add(trans, obj);
          -   elm_transit_object_add(trans, obj2);
          -   elm_transit_effect_flip_add(trans, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE);
          -   elm_transit_duration_set(trans, 3.0);
          -   elm_transit_go(trans);
          -}
          -
          - -

          Creating a Wipe Effect

          - -

          The wipe transition is applied on an Evas object considering the wipe type and the direction. Use ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE to hide the button, and ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT to do it from left to right.

          - -

          The wipe animation button is as follows:

          - -
          // The wipe button
          -btn_wipe = elm_button_add(ad->win);
          -elm_object_text_set(btn_wipe, "Wipe");
          -evas_object_size_hint_weight_set(btn_wipe, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(btn_wipe);
          -evas_object_smart_callback_add(btn_wipe, "clicked", _btn_wipe_cb, ad);
          -elm_box_pack_end(ad->right_vbox, btn_wipe);
          -
          - -

          The wipe button callback looks like:

          - -
          static void _btn_wipe_cb(void *data, Evas_Object *btn, void *ev)
          -{
          -   appdata_s *ad = data;
          -
          -   // Starting the rotation effect 360 degrees
          -   // evas_object_resize(ad->button, 100, 50);
          -   // Setting the button text
          -   elm_object_text_set(ad->button, "Wipe");
          -   _wipe_effect(ad->button);
          -}
          -
          - -

          The animation function calls elm_transit_effect_wipe_add with ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE as the second parameter to hide the button and ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT as last parameter to set the direction (left to right).

          - -
          static void _wipe_effect(Evas_Object *obj)
          -{
          -    Elm_Transit *trans;
          -
          -    trans = elm_transit_add();
          -    elm_transit_object_add(trans, obj);
          -    elm_transit_effect_wipe_add(trans, ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
          -    elm_transit_duration_set(trans, 3.0);
          -    elm_transit_go(trans);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/elementary_transit_effect_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/elementary_transit_effect_tutorial_n.htm deleted file mode 100755 index a4e7e9a..0000000 --- a/org.tizen.ui.guides/html/native/efl/elementary_transit_effect_tutorial_n.htm +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - Creating Elementary Transit Effects - - - - - - -
          -

          Creating Elementary Transit Effects

          - -

          This tutorial demonstrates how you can implement a variety of EFL animation effects using the APIs available in the EFL library.

          - -

          Initializing the Application Layout

          - -

          The application uses UI components, such as elm_conformant and elm_naviframe for view management, layout classes, such as elm_list for the composition of the screen, and UI components, such as elm_button and elm_image for the content inside the view.

          -

          The transit is designed to apply various animated transition effects to the Evas_Object. The following transition effects are supported in the Tizen native applications:

          -
            -
          • Blend
          • -
          • Color
          • -
          • Fade
          • -
          • Flip
          • -
          • Rotation
          • -
          • Transition
          • -
          • Wipe
          • -
          • Zoom
          • -
          - -

          The application layout is created by the create_base_gui() function. First, a window is created and the elm_conformant component is added to it to decorate the window with an indicator. It then adds the elm_naviframe component, which acts as a view manager for the window and provides the window title functionality.

          -
          -static void
          -create_base_gui(appdata_s *ad)
          -{
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   if (elm_win_wm_rotation_supported_get(ad->win)) 
          -   {
          -      int rots[4] = { 0, 90, 180, 270 };
          -      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          -   }
          -
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -
          -   // Conformant
          -   ad->conform = elm_conformant_add(ad->win);
          -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->conform);
          -   evas_object_show(ad->conform);
          -
          -   // Naviframe
          -   ad->nf = create_main_view(ad);
          -   elm_object_content_set(ad->conform, ad->nf);
          -
          -   // Show window after the base GUI is set up
          -   evas_object_show(ad->win);
          -
          -   ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, ad);
          -}
          -
          - -

          The create_main_view() function creates the main content. It consists of a naviframe containing a list. This function returns a list of naviframe object pointers for the content set.

          -
          -static Evas_Object*
          -create_main_view(appdata_s *ad)
          -{
          -   Elm_Object_Item *nf_it;
          -   Evas_Object *navi, *list;
          -
          -   navi = elm_naviframe_add(ad->conform);
          -
          -   list = elm_list_add(navi);
          -   elm_list_mode_set(list, ELM_LIST_COMPRESS);
          -
          -   elm_list_item_append(list, "Blend", NULL, NULL, blend_cb, navi);
          -   elm_list_item_append(list, "Color", NULL, NULL, color_cb, navi
          -   elm_list_item_append(list, "Fade", NULL, NULL, fade_cb, navi);
          -   elm_list_item_append(list, "Flip", NULL, NULL, flip_cb, navi);
          -   elm_list_item_append(list, "Rotation", NULL, NULL, rotation_cb, navi);
          -   elm_list_item_append(list, "ResizableFlip", NULL, NULL, resizable_flip_cb, navi);
          -   elm_list_item_append(list, "Translation", NULL, NULL, translation_cb, navi);
          -   elm_list_item_append(list, "Wipe", NULL, NULL, wipe_cb, navi);
          -   elm_list_item_append(list, "Zoom", NULL, NULL, zoom_cb, navi);
          -   elm_list_item_append(list, "Custom", NULL, NULL, custom_cb, navi);
          -   elm_list_go(list);
          -
          -   nf_it = elm_naviframe_item_push(navi, "Transit", NULL, NULL, list, NULL);
          -
          -   return navi;
          -}
          -
          - -

          This document describes only the rotation and zoom implementations. For more information about other effects, see the transit.c file and the elm_transit document. The following figure illustrates the rotation and zoom effects.

          - -

          Figure: Rotation and zoom

          -

          Rotation and zoom

          - -

          Implementing the Rotation Effect

          - -

          If the list item named by rotation includes the touch event, the callback function for this event is called.

          -

          The data is sent as an Evas_Object. This implements the animation effect.

          -

          To implement the rotation effect:

          -
            -
          1. Use the elm_transit object with the elm_transit_add() function to add the transit effect.
          2. -
          3. Set the transit rotation amount and duration.
          4. -
          5. To start the transit animation, use the elm_transit_go() function.
          6. -
          -
          -static void
          -rotation_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   Evas_Object *layout = (Evas_Object *) data;
          -   Elm_Transit *transit = elm_transit_add();
          -
          -   // 360 degree rotation effect in the clock-wise direction
          -   elm_transit_object_add(transit, layout);
          -   elm_transit_effect_rotation_add(transit, 0, 360);
          -   elm_transit_duration_set(transit, 1);
          -   elm_transit_del_cb_set(transit, transit_del_cb, NULL);
          -   elm_transit_go(transit);
          -}
          -
          - -

          Implementing the Zoom Effect

          - -

          If the list item named by zoom includes the touch event, the callback function for this event is called.

          -

          The data is sent as an Evas_Object. This implements the animation effect.

          -

          There are 2 transit functions: one is for the zoom effect and the other is for returning to the original effect:

          -
            -
          1. After adding the transit object, add an evas_object to get the effect.
          2. -
          3. Set the zoom from the original size (1.0) to 0.4 times the original size, and set the duration.
          4. -
          5. Similarly, set the zoom size (0.4) back to the original size (1.0), and set the duration.
          6. -
          7. Set both of effects to be applied in sequence.
          8. -
          -
          -static void
          -zoom_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   Evas_Object *layout = (Evas_Object *) data;
          -   // Zoom out to scale 0.6
          -   Elm_Transit *transit = elm_transit_add();
          -   elm_transit_smooth_set(transit, EINA_FALSE);
          -   elm_transit_object_add(transit, layout);
          -   elm_transit_effect_zoom_add(transit, 1.0, 0.4);
          -   elm_transit_duration_set(transit, 0.5);
          -
          -   // Zoom in to the original size
          -   Elm_Transit *transit2 = elm_transit_add();
          -   elm_transit_smooth_set(transit2, EINA_FALSE);
          -   elm_transit_object_add(transit2, layout);
          -   elm_transit_effect_zoom_add(transit2, 0.4, 1.0);
          -   elm_transit_duration_set(transit2, 0.5);
          -   elm_transit_del_cb_set(transit2, transit_del_cb, NULL);
          -
          -   elm_transit_chain_transit_add(transit, transit2);
          -   elm_transit_go(transit);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/evas_advanced_objects_n.htm b/org.tizen.ui.guides/html/native/efl/evas_advanced_objects_n.htm deleted file mode 100755 index fd8c475..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_advanced_objects_n.htm +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - Advanced Manipulation of Evas Objects - - - - - - -
          -

          Advanced Manipulation of Evas Objects

          - - -

          This tutorial demonstrates how you can use Evas object extra functions.

          - -

          This tutorial shows how to create an application that enables scaling of an Evas text object by clicking buttons. Data setter and getter functions are used to pass the scalable object through the clicked button object to a callback.

          -

          The tutorial also shows how to change the Evas object rendering mode using the extra object manipulation API.

          - -

          Figure: Advanced Evas application

          -

          Advanced Evas application

          - - -

          Creating the Basic Application

          -

          To create the basic application:

          -
            -
          1. -

            To use the required APIs, include the following libraries:

            - -
            #include <app.h>
            -#include <Elementary.h>
            -#include <system_settings.h>
            -#include <efl_extension.h>
            -
          2. - -
          3. -

            Create objects for an Elementary window and buttons for scaling and changing the object render mode. Also create a text object and 2 rectangle objects to connect to the application data structure:

            - -
            typedef struct appdata 
            -{
            -   Evas_Object *win;
            -   Evas_Object *scale_incr_button;
            -   Evas_Object *scale_decr_button;
            -
            -   Evas_Object *render_text;
            -   Evas_Object *blend_mode_button;
            -   Evas_Object *copy_mode_button;
            -   Evas_Object *render_rect1;
            -   Evas_Object *render_rect2;
            -} 
            -appdata_s;
            -
          4. -
          - -

          Creating the Elementary Window

          -

          To create an elementary window:

          -
            -
          1. -

            Use the elm_win_util_standard_add() function and give there the name and title of the application. To set a callback for the Back hardware button, use the eext_object_event_callback_add() function. To display the Evas object, use the evas_object_show() function.

            - -
            static void
            -create_base_gui(appdata_s *ad)
            -{
            -   // Window
            -   ad->win = elm_win_util_standard_add("Extra object function", "Extra object function");
            -   elm_win_autodel_set(ad->win, EINA_TRUE);
            -
            -   // Window callbacks
            -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, back_cb, ad);
            -
            -   // Show the window
            -   evas_object_show(ad->win);
            -}
            -
          2. - -
          3. - -

            Implement callback functions to enable closing the application:

            - -
            static void
            -back_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -
            -   elm_win_lower(ad->win);
            -}
            -
            -static void
            -win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   ui_app_exit();
            -}
            -
          4. -
          - -

          Creating an Application

          -

          Create an Elementary application with a GUI:

          - -
          static bool
          -app_create(void *data)
          -{
          -   appdata_s *ad = data;
          -
          -   // Create the application UI
          -   create_base_gui(ad);
          -
          -   return true;
          -}
          -
          -int
          -main(int argc, char *argv[])
          -{
          -   appdata_s ad = {0,};
          -
          -   ui_app_lifecycle_callback_s event_callback = {0,};
          -
          -   event_callback.create = app_create;
          -
          -   // Run the main loop
          -   return ui_app_main(argc, argv, &event_callback, &ad);
          -}
          - -

          Creating Buttons

          -

          To create buttons:

          -
            -
          1. -

            Create the scale buttons. The move() and resize() functions configure the buttons' custom geometry.

            - -
            // Scale increasing button
            -ad->scale_incr_button = elm_button_add(ad->win);
            -elm_object_text_set(ad->scale_incr_button, "Scale +");
            -evas_object_resize(ad->scale_incr_button, 120, 50);
            -evas_object_move(ad->scale_incr_button, 180, 20);
            -evas_object_show(ad->scale_incr_button);
            -
            -// Scale decreasing button
            -ad->scale_decr_button = elm_button_add(ad->win);
            -elm_object_text_set(ad->scale_decr_button, "Scale -");
            -evas_object_resize(ad->scale_decr_button, 120, 50);
            -evas_object_move(ad->scale_decr_button, 180, 170);
            -evas_object_show(ad->scale_decr_button);
            -
          2. - -
          3. -

            Create the render mode change buttons:

            - -
            // Blend render mode button
            -ad->blend_mode_button = elm_button_add(ad->win);
            -elm_object_text_set(ad->blend_mode_button, "BLEND Mode");
            -evas_object_resize(ad->blend_mode_button, 190, 50);
            -evas_object_move(ad->blend_mode_button, 30, 280);
            -evas_object_show(ad->blend_mode_button);
            -
            -// Copy render mode button
            -ad->copy_mode_button = elm_button_add(ad->win);
            -elm_object_text_set(ad->copy_mode_button, "COPY Mode");
            -evas_object_resize(ad->copy_mode_button, 190, 50);
            -evas_object_move(ad->copy_mode_button, 260, 280);
            -evas_object_show(ad->copy_mode_button);
            -
          4. -
          - -

          Creating Callbacks for the Button Click Signal

          -

          To create the callbacks:

          -
            -
          1. -

            Create callbacks:

            - -
            -evas_object_smart_callback_add(ad->scale_incr_button, "clicked", scale_incr_cb, NULL);
            -evas_object_smart_callback_add(ad->scale_decr_button, "clicked", scale_decr_cb, NULL);
            -evas_object_smart_callback_add(ad->blend_mode_button, "clicked", blend_mode_cb, ad);
            -evas_object_smart_callback_add(ad->copy_mode_button, "clicked", copy_mode_cb, ad);
            -
          2. - -
          3. -

            Implement callback functions to enable changing the scale and render mode:

            - -
            static void
            -scale_incr_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   Evas_Object *evas_text = evas_object_data_get(obj, "evas_text");
            -   if (!evas_text)
            -      return;
            -
            -   double current_scale = evas_object_scale_get(evas_text);
            -
            -   if (current_scale >= 5.0)
            -      return;
            -
            -   evas_object_scale_set(evas_text, current_scale + 0.2);
            -}
            -
            -static void
            -scale_decr_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   Evas_Object *evas_text = evas_object_data_get(obj, "evas_text");
            -   if (!evas_text)
            -      return;
            -
            -   double current_scale = evas_object_scale_get(evas_text);
            -
            -   if (current_scale <= 0.0)
            -   {
            -      return;
            -   }
            -
            -   evas_object_scale_set(evas_text, current_scale - 0.2);
            -}
            -
            -static void
            -blend_mode_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -
            -   evas_object_text_text_set(ad->render_text, "EVAS_RENDER_BLEND: d = d * (1-sa) + s");
            -   evas_object_render_op_set(ad->render_rect2, EVAS_RENDER_BLEND);
            -}
            -
            -static void
            -copy_mode_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -
            -   evas_object_text_text_set(ad->render_text, "EVAS_RENDER_COPY: d = s");
            -   evas_object_render_op_set(ad->render_rect2, EVAS_RENDER_COPY);
            -}
            -
          4. -
          - -

          Attaching Data to the Object

          -

          To attach data to the object:

          -
            -
          1. -

            Use the evas_object_data_set() function. To create the keyword to get the data, use the evas_object_data_get() function.

            - -

            Create the text object using the evas_object_text_add() function.

            - -
            -evas = evas_object_evas_get(ad->win);
            -
          2. - -
          3. -

            Create the Evas text object to be used as data attached to the button:

            - -
            -evas_text = evas_object_text_add(evas);
            -evas_object_text_text_set(evas_text, "Scalable Text Object");
            -evas_object_text_font_set(evas_text, "Sans", 10);
            -evas_object_color_set(evas_text, 50, 100, 200, 255);
            -evas_object_move(evas_text, 10, 90);
            -evas_object_show(evas_text);
            -
          4. -
          - -

          Attaching Data

          - -

          The data is passed to the function through buttons. Use the evas_object_data_set() function for the button. Give a pointer to the attach data, and the key name to associate it with the data.

          - -
          -evas_object_data_set(ad->scale_incr_button, "evas_text", evas_text);
          -evas_object_data_set(ad->scale_decr_button, "evas_text", evas_text);
          - -

          Getting data

          - -

          To get the file data attached to the object, use the evas_object_data_get() function and give the data key name added when you attached this data:

          - -
          Evas_Object *evas_text = evas_object_data_get(obj, "evas_text");
          - -

          Deleting data

          - -

          To delete the data attached to the object, use the evas_object_data_del() function and give the data key name added when you attached this data:

          - -
          evas_object_data_del(obj, "evas_text");
          - -

          Using Scale Functions

          - -

          To set the scale factor to a single Evas object instead of setting scale to the entire application, use the evas_object_scale_set() function. This is useful when you want scalable UI elements at runtime. However, only text and textblock objects have scaling change handlers. Other objects do not change visually on this call. In this application, the scale is defined in the button click callbacks.

          - -
          double current_scale = evas_object_scale_get(evas_text);
          -
          -if (current_scale >= 5.0)
          -   return;
          -
          -evas_object_scale_set(evas_text, current_scale + 0.2);
          - -

          Get the current scale of the Evas text object and check its maximum size. If the current size is smaller than the maximum size, the scale factor for the object is increased using the evas_object_scale_set function. The text object is updated on display and its size changes.

          - -

          Configuring the Evas Object Render Mode

          - -

          To change the render operation to be used for rendering the Evas object, use the evas_object_render_op_set() function. To get the current render operation, use the evas_object_render_op_get() function.

          - -

          Creating Rectangle Objects

          - -

          Creates Evas rectangle objects to change the Evas rendering mode for them:

          - -
          // Rectangle with yellow background
          -ad->render_rect1 = evas_object_rectangle_add(evas);
          -evas_object_color_set(ad->render_rect1, 240, 220, 50, 191);
          -evas_object_resize(ad->render_rect1, 260, 260);
          -evas_object_move(ad->render_rect1, 60, 400);
          -evas_object_show(ad->render_rect1);
          -
          -// Translucent rectangle with blue foreground
          -ad->render_rect2 = evas_object_rectangle_add(evas);
          -evas_object_color_set(ad->render_rect2, 25, 110, 220, 127);
          -evas_object_resize(ad->render_rect2, 260, 260);
          -evas_object_move(ad->render_rect2, 170, 500);
          -evas_object_show(ad->render_rect2);
          - -

          Changing the Render Operation

          - -

          To change the rendering mode, use the evas_object_render_op_set() function and give the render operation constant, which informs Evas of the function to use when drawing the eEvas object on canvas. By default, all evas objects use the EVAS_RENDER_BLEND mode and all colors are drawn using the "d = d*(1-sa) + s" formula, where "d" is destination color, "sa" is source alpha, and "s" is source color.

          - -

          Change the rendering mode to copy mode (d = s):

          - -
          evas_object_render_op_set(ad->render_rect2, EVAS_RENDER_COPY);
          - - - - - - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/evas_basic_objects_n.htm b/org.tizen.ui.guides/html/native/efl/evas_basic_objects_n.htm deleted file mode 100755 index 80d5933..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_basic_objects_n.htm +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - Basic Manipulation of Evas Objects - - - - - - -
          -

          Basic Manipulation of Evas Objects

          - - -

          Most Evas objects can be manipulated using generic functions.

          - -

          The list of available basic actions does not depend on the object's type. Evas implements functionality that allows performing basic manipulation, such as showing, hiding, setting, and getting geometry, bringing a layer up or down, managing color, clipping, and reference counting.

          - -

          This tutorial introduces the basic manipulations available for Evas_Object object.

          - - -

          Working with Evas

          - -
            -
          1. -

            To start interacting with Evas, first create an Evas instance or get a reference to an already allocated Evas object:

            - -
            ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            -elm_win_autodel_set(ad->win, EINA_TRUE);
            -
            -Evas *evas = evas_object_evas_get(ad->win);
            -
          2. - -
          3. -

            When an instance of Evas object exists, you can start creating basic Evas objects using obtained reference to Evas as a parent for child objects. The following example creates an Evas_Object with size 480x800, position on window at 0,0 by x and y axis, and set as a background:

            - -
            -ad->bg = evas_object_rectangle_add(evas);
            -evas_object_color_set(ad->bg, 255, 255, 255, 255);
            -evas_object_resize(ad->bg, 480, 800);
            -evas_object_move(ad->bg, 0, 0);
            -evas_object_show(ad->bg);
            -
            - -

            Figure: Empty window

            -

            Empty window

            - -
          4. -
          - - -

          Clipping an Object

          - -

          You can set an Evas object as a clipper for another Evas object. To obtain a clipper object, create an Evas object, set its width and height parameters, and call the evas_object_clip_set() function to set the object as a clipper for other Evas objects:

          - -
          ad->img = evas_object_image_filled_add(evas);
          -_app_get_resource("images/enlightenment.png", image_path, PATH_MAX);
          -evas_object_image_file_set(ad->img, image_path, NULL);
          -if (evas_object_image_load_error_get(ad->img) != EVAS_LOAD_ERROR_NONE)
          -   return;
          -
          -evas_object_geometry_get(ad->spacer, NULL, NULL, &w, &h);
          -evas_object_name_set(ad->img, "background");
          -evas_object_resize(ad->img, WIDTH, HEIGHT);
          -evas_object_move(ad->img, w, h);
          -evas_object_show(ad->img);
          -
          -ad->clipper = evas_object_rectangle_add(evas);
          -evas_object_geometry_get(ad->img, &x, &y, &w, &h);
          -evas_object_move(ad->clipper, WIDTH / 4 + x, HEIGHT / 4 + y);
          -evas_object_resize(ad->clipper, w / 2, h / 2);
          -evas_object_clip_set(ad->img, ad->clipper);
          -evas_object_show(ad->clipper);
          -
          - -

          Figure: Using the clipper

          -

          Using the clipper

          - - -

          You can also unset the clipper object using the evas_object_clip_unset() function. As a result, there are 2 objects, an image and a rectangle. The rectangle is on top of the image object according to the creation order.

          - -
          static void
          -_clipper_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   const char *object_name = evas_object_name_get(ad->img);
          -   if (strcmp(object_name, "background") != 0)
          -      return;
          -
          -   if (evas_object_clip_get(ad->img) == ad->clipper)
          -      evas_object_clip_unset(ad->img);
          -   else
          -      evas_object_clip_set(ad->img, ad->clipper);
          -}
          - -

          Figure: Using the clipper

          -

          Using the clipper

          - -

          Changing Colors and Visibility

          - -

          You can manage the object colors and visibility. To change a color of a valid Evas_Object, use the evas_object_color_set() and pass a color value:

          - -
          static void
          -_color_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   int alpha, r, g, b;
          -
          -   evas_object_color_get(ad->clipper, &r, &g, &b, &alpha);
          -   evas_color_argb_unpremul(alpha, &r, &g, &b);
          -
          -   if (g > 0)
          -      g = b = 0;
          -   else
          -      g = b = 255;
          -
          -   evas_color_argb_premul(alpha, &r, &g, &b);
          -   evas_object_color_set(ad->clipper, r, g, b, alpha);
          -}
          - -

          Figure: Applying color

          -

          Applying color

          - -

          You can also change the opacity of the object:

          - -
          static void
          -_opacity_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   int alpha, r, g, b;
          -
          -   evas_object_color_get(ad->clipper, &r, &g, &b, &alpha);
          -   evas_color_argb_unpremul(alpha, &r, &g, &b);
          -
          -   alpha -= 20;
          -   if (alpha < 0)
          -      alpha = 255;
          -
          -   evas_color_argb_premul(alpha, &r, &g, &b);
          -   evas_object_color_set(ad->clipper, r, g, b, alpha);
          -}
          - -

          Figure: Changing opacity

          -

          Changing opacity

          - -

          You can also hide the object when it is not needed:

          - -
          static void
          -_visibility_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   if (evas_object_visible_get(ad->clipper))
          -      evas_object_hide(ad->clipper);
          -   else
          -      evas_object_show(ad->clipper);
          -}
          - -

          Figure: Changing visibility

          -

           Changing visibility

          - -

          Reference Counting

          - -

          Evas has a simple reference counting mechanism that is useful for scenarios like inside a code block, callbacks exist which would possibly delete an object we are operating on afterwards.

          -

          To increment the reference count of an object, use the evas_object_ref() function. If the reference count is greater than 0, the evas_object_del() function is called until all references are released. References cannot go below 0 and are limited to 2^32 - 1 for each object:

          - -
          ad->spacer = evas_object_rectangle_add(evas);
          -evas_object_color_set(ad->spacer, 0, 255, 100, 255);
          -evas_object_move(ad->spacer, 0, 0);
          -evas_object_resize(ad->spacer, 120, 20);
          -evas_object_show(ad->spacer);
          -evas_object_ref(ad->spacer);
          -
          -static void
          -_unref_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   if (!ad->spacer)
          -      return;
          -
          -   if (evas_object_ref_get(ad->spacer) != 0)
          -   {
          -      evas_object_unref(ad->spacer);
          -      return;
          -   }
          -
          -int x, y, w, h;
          -
          -evas_object_geometry_get(ad->spacer, &x, &y, NULL, NULL);
          -evas_object_move(ad->img, x, y);
          -evas_object_geometry_get(ad->img, &x, &y, &w, &h);
          -evas_object_move(ad->clipper, x + (w / 4), y + (h / 4));
          -evas_object_move(ad->clipper_border, x + (w / 4) - 3, y + (h / 4) - 3);
          -evas_object_del(ad->spacer);
          -ad->spacer = NULL;
          -}
          - - -

          A green rectangle is used as a padding and the clipper object calculates its x, y coordinates based on the rectangle position. The rectangle reference count is increased by calling the evas_object_ref() function and now it is equal to 1. When the _unref_cb callback is triggered, the reference count value is higher than 0 and the evas_object_del(ad->spacer) function has no effect on the object. After the second callback call, the evas_object_ref_get(ad->spacer) function returns 0 and the evas_object_del(ad->spacer) function marks the rectangle object for deletion.

          - -

          Figure: Removing padding

          -

          Removing padding

          - -

          Changing the Object Order on Canvas

          - -

          By default, the placing of objects on canvas is based on their creation order.

          - -
          -ad->order_rect1 = evas_object_rectangle_add(evas);
          -evas_object_name_set(ad->order_rect1, "red");
          -evas_object_color_set(ad->order_rect1, 255, 0, 0, 255);
          -evas_object_move(ad->order_rect1, 120, 310);
          -evas_object_resize(ad->order_rect1, 200, 200);
          -evas_object_show(ad->order_rect1);
          -
          -ad->order_rect2 = evas_object_rectangle_add(evas);
          -evas_object_name_set(ad->order_rect2, "blue");
          -evas_object_color_set(ad->order_rect2, 0, 0, 255, 255);
          -evas_object_move(ad->order_rect2, 180, 350);
          -evas_object_resize(ad->order_rect2, 200, 200);
          -evas_object_show(ad->order_rect2);
          -
          - -

          Figure: Default order of objects on canvas

          -

          Default order of objects on canvas

          - -

          You can change the object triggering the _object_order_cb() callback, which switches the order of the rectangles.

          - -
          static void
          -_object_order_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   Evas_Object *rect = evas_object_below_get(ad->order_rect2);
          -   if (!rect)
          -      return;
          -
          -   const char *name = evas_object_name_get(rect);
          -   if (name)
          -      if (strcmp(name, "red") == 0)
          -      {
          -         evas_object_stack_below(ad->order_rect2, rect);
          -
          -         return;
          -      }
          -
          -   rect = evas_object_below_get(ad->order_rect1);
          -   if (!rect)
          -      return;
          -
          -   name = evas_object_name_get(rect);
          -   if (name)
          -      if (strcmp(name, "blue") == 0)
          -      {
          -         evas_object_stack_below(ad->order_rect1, rect);
          -
          -         return;
          -      }
          -}
          - -

          Figure: Changed order of objects on canvas

          -

          Changed order of objects on canvas

          - -

          Evas allows placing an object to top and bottom layer of the canvas object stack. The of _raise_cb callback puts the canvas background on the top position of the screen. The call of _lower_cb callback puts the background to the bottom.

          - -
          static void
          -_lower_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   evas_object_lower(ad->bg);
          -}
          -
          -static void
          -_raise_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          -{
          -   App_Data *ad = (App_Data *)data;
          -
          -   evas_object_raise(ad->bg);
          -   ad->isBgOnTop = EINA_TRUE;
          -}
          - -

          Figure: Canvas background by default and on top

          -

          Canvas background by default and on top

          - - - - - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/evas_map_animation_n.htm b/org.tizen.ui.guides/html/native/efl/evas_map_animation_n.htm deleted file mode 100755 index d265764..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_map_animation_n.htm +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - Evas Map Effects - - - - - -
          - -

          Evas Map Effects

          - -

          Evas Map animations allow you to apply transformations to all types of objects by way of UV mapping.

          - -

          In UV mapping, you map points in the source object to 3D space positions in the target object. This allows for rotation, perspective, scale, and other transformation effects, depending on the map. In addition, each map point can carry a multiplier color, which, if properly calculated, can be used to apply 3D shading effects on the target object.

          - -

          Evas provides both raw and easy-to-use functions for UV mapping. The raw functions allow you to create UV maps outside Evas and import them into your application, for example by loading them from an external file. The easy-to-use functions allow you to create UV maps directly in Evas by calculating the map points based on high-level parameters, such as rotation angle and ambient light.

          - -

          Map Points

          - -

          A map consists of a set of points. (Currently, only four points are supported.) Each point contains X and Y canvas coordinates that can be used to alter the geometry of the mapped object, and a Z coordinate that indicates the depth of the point. The Z coordinate does not normally affect the map, but several utility functions use it to calculate the right position of the point given the other parameters.

          - -

          First, create an Evas_Map object using the evas_map_new() function. This function creates the specified number of map points (currently only up to four points). Each point is empty and ready to be modified with Evas_Map functions.

          - -
          Evas_Map *m = evas_map_new(4);
          - -

          If you want to get the size (number of points) of an existing map, use the evas_map_count_get() function.

          - -

          To set the coordinates for each point, use the evas_map_point_coord_set() function:

          - -
          evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z)
          - -

          The following example shows a common way to define a map that matches the geometry of a rectangle (a square in this case):

          - -
          -evas_map_point_coord_set(m, 0, 100, 100, 0);
          -evas_map_point_coord_set(m, 1, 300, 100, 0);
          -evas_map_point_coord_set(m, 2, 300, 300, 0);
          -evas_map_point_coord_set(m, 3, 100, 300, 0);
          -
          - -

          Figure: Map

          -

          Map

          - -

          The following examples all produce the same result as the above example, but with simpler code:

          - -
            -
          • -

            To create a rectangle map using the starting X and Y coordinates combined with width and height, use the evas_map_util_points_populate_from_geometry() function:

            -
            evas_map_util_points_populate_from_geometry(Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z)
            -

            The following example creates the same map as above:

            -
            evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
            -
          • -
          • -

            To create a map based on the geometry of a given object, use the evas_map_util_points_populate_from_object() or evas_map_util_points_populate_from_object_full() function. The former sets the Z coordinate of all points to 0, whereas the latter allows you to define the same custom Z coordinate for all points:

            -
            evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *obj)
            -
            evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z)
            -

            The following example creates the same map as above:

            -
            -Evas_Object *o;
            -evas_object_move(o, 100, 100);
            -evas_object_resize(o, 200, 200);
            -evas_map_util_points_populate_from_object(m, o);
            -// OR
            -evas_map_util_points_populate_from_object_full(m, o, 0);
            -
          • -
          - -

          You can apply several effects to an object by simply setting each point of the map to the appropriate coordinates. The following example shows how to create a simulated perspective:

          - -

          Figure: Simulated perspective

          -

          Simulated perspective

          - -
          -evas_map_point_coord_set(m, 0, 100, 100, 0);
          -evas_map_point_coord_set(m, 1, 250, 120, 0);
          -evas_map_point_coord_set(m, 2, 250, 280, 0);
          -evas_map_point_coord_set(m, 0, 100, 300, 0);
          -
          - -

          In the above example, the Z coordinate is unused: when setting points by hand, the Z coordinate is irrelevant.

          - -

          If you want to get the actual coordinates of a map, use the evas_map_point_coord_get() function:

          - -
          evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z)
          - -

          After you have defined the map points, apply them to your map for transformation:

          - -
          -evas_object_map_set(o, m);
          -evas_object_map_enable_set(o, EINA_TRUE);
          -
          - -

          Finally, after you are done with the map, release the memory allocated to it using the evas_map_free() function:

          - -
          evas_map_free(m);
          - -

          The utility functions described in the next section allow you to perform the above tasks with less coding work.

          - -

          Utility Functions

          - -

          Utility functions take an already configured map and allow you to easily modify it to produce specific effects. For example, to rotate an object around its center, you need the rotation angle and the coordinates of each corner of the object to perform the math required to get the new set of coordinates that needs to be set for the map. Evas provides a utility function that does the math for you:

          - -
          evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy)
          - -

          This function rotates the map based on the angle and the center coordinates of the rotation provided as arguments. A positive angle rotates the map clockwise, while a negative angle rotates the map counter-clockwise.

          - -

          The following example shows how to rotate an object around its center point by 45 degrees clockwise. In the following figure, the center of rotation is the red dot.

          - -
          -evas_object_geometry_get(o, &x, &y, &w, &h);
          -m = evas_map_new(4);
          -evas_map_util_points_populate_from_object(m, o);
          -evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
          -evas_object_map_set(o, m);
          -evas_object_map_enable_set(o, EINA_TRUE);
          -evas_map_free(m);
          -
          - -

          Figure: Rotating around the center point

          -

          Rotating around the center point

          - -

          You can rotate the object around any other point simply by setting the last two arguments of the evas_map_util_rotate() function to the appropriate values:

          - -
          evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
          - -

          Figure: Rotating around other points

          -

          Rotating around other points

          - -

          You can also set the center of the window as the center of the rotation using the appropriate coordinates of the Evas canvas:

          - -
          -evas_output_size_get(evas, &w, &h);
          -m = evas_map_new(4);
          -evas_map_util_points_populate_from_object(m, o);
          -evas_map_util_rotate(m, 45, w, h);
          -evas_object_map_set(o, m);
          -evas_object_map_enable_set(o, EINA_TRUE);
          -evas_map_free(m);
          -
          - -

          Zoom

          - -

          The evas_map_util_zoom() function zooms the points of the map from a center point, defined by cx and cy. The zoomx and zoomy arguments specify how much to zoom in on the X and Y axes. A value of 1.0 means no zoom, 2.0 means double the size, 0.5 means half the size, and so on. All the coordinates are global canvas coordinates.

          - -
          -evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
          -
          - -

          3D Maps

          - -

          Maps can also be used to achieve a 3D effect. In a 3D effect, the Z coordinate of each point is meaningful: the higher the value, the further back the point is located. Smaller values (usually negative) mean that the point is closer to the user.

          - -

          3D also introduces the concept of the back face of an object. An object is said to be facing the user when all its points are placed in a clockwise formation, as shown in the left map in the following figure. Rotating the map around its Y axis swaps the order of the points into a counter-clockwise formation, making the object face away from the user, as shown in the right map in the following figure. The back face is especially relevant in lighting (see below).

          - -

          Figure: Rotating around the Y axis

          -

          Rotating around the Y axis

          - -

          To determine whether a map is facing the user, use the evas_map_util_clockwise_get() function. This function returns EINA_TRUE if the map is facing the user and EINA_FALSE if the map is facing away from the user. This is normally done after all the other operations are applied to the map.

          - -
          evas_map_util_clockwise_get(Evas_Map *m)
          - -

          3D Rotation and Perspective

          - -

          The evas_map_util_3d_rotate() function transforms a map to apply a 3D rotation to the mapped object. You can apply the rotation around any point in the canvas (including a Z coordinate). You can also apply the rotation around any of the three axes.

          - -
          evas_map_util_3d_rotate(Evas_Map *m, double dx, double dy, double dz, Evas_Coord cx, Evas_Coord cy, Evas_Coord cz)
          - -

          Starting from this simple setup, and setting the maps so that the blue square rotates around the Y axis, we get the following:

          - -

          Figure: 3D rotation

          -

          3D rotation

          - -

          A simple overlay over the image shows the original geometry of each object and the axis around which they are being rotated. The Z axis is not shown, since it is orthogonal to the screen. To show the Z axis, that is, to add 3D perspective to the transformation, use the evas_map_util_3d_perspective() function on the map after its position has been set:

          - -
          evas_map_util_3d_perspective(Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc)
          - -

          The result makes the vanishing point the center of each object:

          - -

          Figure: Adding perspective

          -

          Adding perspective

          - -

          Color and Lighting

          - -

          Each point in a map can be set to a color, which will be multiplied with the object’s own color and linearly interpolated between adjacent points. To set the color separately for each point, use the evas_map_point_color_set() function:

          - -
          evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a)
          - -

          To set the same color for every point, use the evas_map_util_points_color_set() function:

          - -
          evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a)
          - -

          When using a 3D effect, colors can be used to improve its look by simulating a light source. The evas_map_util_3d_lighting() function makes this task easier by taking the coordinates of the light source and its color, along with the color of the ambient light. Evas then sets the color of each point based on its distance to the light source, the angle at which the object is facing the light source, and the ambient light. Here, the orientation of each point is important.

          - -
          evas_map_util_3d_lighting(Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab)
          - -

          If the map points are defined counter-clockwise, the object faces away from the user and is therefore obscured, since no light is reflecting back from it.

          - -

          Figure: Obscured object

          -

          Obscured object

          - -

          Mapping

          - -

          Images need special handling when mapped. While Evas can easily handle objects, it is completely oblivious to the contents of images. This means that each point in a map needs to be mapped to a specific pixel in the source image. Failing to do this can result in unexpected behavior.

          - -

          Let's get started with the following three images, each sized at 200 × 200 pixels:

          - -

          Figure: Starting point

          -

          Starting point

          - -

          The following three images illustrate the case where a map is set to an image object without setting the right UV mapping for each map point. The objects themselves are mapped properly to their new geometries, but the images are not displayed correctly within the mapped objects.

          - -

          Figure: Questionable result

          -

          Questionable result

          - -

          To transform an image correctly, Evas needs to know how to handle the image within the map. You can do this using the evas_map_point_image_uv_set() function, which allows you to map a given point in a map to a given pixel in a source image:

          - -
          -evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v)
          -
          - -

          To match our example images to the maps above, all we need is the size of each image, which we can get using the evas_object_image_size_get() function.

          - -
          -// Tux 1: Some cropping and stretch up
          -evas_map_point_image_uv_set(m, 0, 0, 20);
          -evas_map_point_image_uv_set(m, 1, 200, 20);
          -evas_map_point_image_uv_set(m, 2, 200, 180);
          -evas_map_point_image_uv_set(m, 3, 0, 180);
          -evas_object_map_set(tux1, m);
          -evas_object_map_enable_set(tux1, EINA_TRUE);
          -
          -// Inverted texture for shadow:
          -evas_map_point_image_uv_set(m, 0, 0, 180);
          -evas_map_point_image_uv_set(m, 1, 200, 180);
          -evas_map_point_image_uv_set(m, 2, 200, 20);
          -evas_map_point_image_uv_set(m, 3, 0, 20);
          -evas_object_map_set(tux1_shadow, m);
          -evas_object_map_enable_set(tux1_shadow, EINA_TRUE);
          -
          -// Tux 2: Make it fit to the map:
          -evas_map_point_image_uv_set(m, 0, 0, 0);
          -evas_map_point_image_uv_set(m, 1, 200, 0);
          -evas_map_point_image_uv_set(m, 2, 200, 200);
          -evas_map_point_image_uv_set(m, 3, 0, 200);
          -evas_object_map_set(tux2, m);
          -evas_object_map_enable_set(tux2, EINA_TRUE);
          -
          -// Tux 3: Zoom and fit relatively to image size
          -evas_object_image_size_get(evas_object_image_source_get(tux3), &w, &h);
          -evas_map_point_image_uv_set(m, 0, 0.1 * w, 0.1 * h);
          -evas_map_point_image_uv_set(m, 1, 0.9 * w, 0.1 * h);
          -evas_map_point_image_uv_set(m, 2, 0.9 * w, 0.9 * h);
          -evas_map_point_image_uv_set(m, 3, 0.1 * w, 0.9 * h);
          -evas_object_map_set(tux3, m);
          -evas_object_map_enable_set(tux3, EINA_TRUE);
          -
          - -

          Figure: Correct result

          -

          Correct result

          - -

          You can also set a map to use only part of an image, or you can even map the points in inverted order. Combined with the evas_object_image_source_set() function, you can achieve more interesting results still.

          - -

          Lighting

          - -

          Evas_Map allows you to define an ambient light and a light source within the scene. Both of these light sources have their own colors.

          - -
          evas_map_util_3d_lighting(Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab)
          - -

          The above function is used to apply lighting calculations (from a single light source) to a given map. The red, green, and blue values of each vertex will be modified to reflect the lighting based on the light source coordinates, its color, the ambient color, and the angle at which the map faces the light source. The points of a surface should be defined in a clockwise formation if the surface is facing the user, since faces have a logical side for lighting.

          - -

          To get the reflections (gradient) in the shadow of our previous example, you have to define a source of light close enough to the user and a very bright ambient light, for example:

          - -
          -evas_map_util_3d_lighting(m, // Evas_Map object
          -                          250/2, 150/2, -100, // Spot light coordinates
          -                          255, 255, 255, // Spot light color
          -                          200, 200, 200); // Ambient light color
          -
          - -

          Alpha Channel

          - -

          You can also use an alpha channel on your map by enabling the alpha channel feature:

          - -
          evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled)
          - -

          Next, set the alpha value separately for each map point:

          - -
          evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a)
          - -

          Alternatively, you can set the same alpha value to all map points:

          - -
          evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a)
          - -

          The following code sets the shadow transparency for the first image in the above three-image example:

          - -
          -// Set object transparency to 50%:
          -evas_map_util_points_color_set(m, 255, 255, 255, 127);
          -
          -// Tux's head is almost invisible in the shadow:
          -evas_map_point_color_set(m, 3, 255, 255, 255, 15);
          -evas_map_point_color_set(m, 4, 255, 255, 255, 15);
          -
          - -

          Smoothing

          - -

          To enable smoothing when rendering a map, use the evas_map_smooth_set() function:

          - -
          evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled)
          - -

          The first argument is the Evas_Map object to apply smoothing to. The second argument sets whether to enable the smoothing:

          - -
            -
          • EINA_TRUE: Enable smoothing.
          • -
          • EINA_FALSE: Disable smoothing.
          • -
          - -

          If the object is of a type that has its own smoothing settings, the smoothing settings must be disabled for both the object and the map. Map smoothing is enabled by default. To check whether map smoothing is enabled, use the evas_map_smooth_get() function.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/evas_map_effects_n.htm b/org.tizen.ui.guides/html/native/efl/evas_map_effects_n.htm deleted file mode 100755 index 3184eee..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_map_effects_n.htm +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - Creating Evas Map Effects - - - - - - -
          -

          Creating Evas Map Effects

          - - -

          This tutorial demonstrates how you can use Evas map functions to create an application in which you can change the map point coordinates of Evas objects. You can modify the map point U and V texture source point using Evas map mapping APIs. "U" and "V" denote the axes of the 2D texture.

          - -

          Figure: Evas map mapping application

          -

          Evas map mapping application

          - -

          Creating the Basic Application

          -

          To create a basic application:

          -
            -
          1. -

            To use the required APIs, include the following libraries:

            - -
            #include <app.h>
            -#include <Elementary.h>
            -#include <system_settings.h>
            -#include <efl_extension.h>
            -
          2. - -
          3. -

            Create an Evas object for an Elementary window and a button for mapping the map information:

            - -
            typedef struct appdata 
            -{
            -   Evas_Object *win;
            -   Evas_Object *button;
            -Evas_Object *default_btn;
            -} 
            -appdata_s;
            -
          4. -
          5. -

            To create an Elementary window, use the elm_win_util_standard_add() function and give the name and title of the application. To set a callback on hardware Back button, the use eext_object_event_callback_add() function. To display the Evas object, use the evas_object_show() function.

            - -
            static void
            -create_base_gui(appdata_s *ad)
            -{
            -    Evas_Object *evas_text = NULL;
            -    Evas *evas                = NULL;
            -
            -   // Window
            -   ad->win = elm_win_util_standard_add("Extra object function", "Extra object function");
            -   elm_win_autodel_set(ad->win, EINA_TRUE);
            -
            -   // Window callbacks
            -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, back_cb, ad);
            -
            -   evas = evas_object_evas_get(ad->win);
            -
            -   evas_text = evas_object_text_add(evas);
            -   evas_object_text_text_set(evas_text, "Evas Map Mapping");
            -   evas_object_text_font_set(evas_text, "Sans", 18);
            -   evas_object_color_set(evas_text, 50, 100, 200, 255);
            -   evas_object_move(evas_text, 10, 90);
            -   evas_object_show(evas_text);
            -
            -   // Evas map source code
            -
            -   evas_object_show(ad->win);
            -}
            -
          6. - -
          7. -

            Implement callback functions to enable closing the application:

            - -
            static void
            -back_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   appdata_s *ad = data;
            -
            -   elm_win_lower(ad->win);
            -}
            -
            -static void
            -win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   ui_app_exit();
            -}
            -
          8. - -
          9. -

            Create an elementary application with a GUI:

            - -
            static bool
            -app_create(void *data)
            -{
            -   appdata_s *ad = data;
            -
            -   // Create the application UI
            -   create_base_gui(ad);
            -
            -   return true;
            -}
            -
            -int
            -main(int argc, char *argv[])
            -{
            -   appdata_s ad = {0,};
            -
            -   ui_app_lifecycle_callback_s event_callback = {0,};
            -
            -   event_callback.create = app_create;
            -
            -   // Run the main loop
            -   return ui_app_main(argc, argv, &event_callback, &ad);
            -}
            -
          10. - -
          11. -

            Create the button for mapping. Use the move and resize functions to configure the button's custom geometry:

            - -
            // Create a button for mapping
            -ad->button = elm_button_add(ad->win);
            -elm_object_text_set(ad->button, "Evas Map Mapping ");
            -evas_object_move(ad->button, 15, 100);
            -evas_object_resize(ad->button, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(200));
            -evas_object_show(ad->button);
            -
            -// Create a default button
            -ad->default_btn = elm_button_add(ad->win);
            -elm_object_text_set(ad->default_btn, "Default Button ");
            -evas_object_move(ad->default_btn, 15, 300);
            -evas_object_resize(ad->default_btn, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(200));
            -evas_object_show(ad->default_btn);
            -
          12. -
          - -

          Creating Map Data

          - -

          By using the evas_map_new() and evas_map_*() functions, you can create map data to be attached to the button:

          - -
            -
          1. -

            Get the Evas_Map object to create map data using the evas_map_new() function:

            - -
            -Evas_Map *map;
            -map = evas_map_new(4);
            - -

            The map of transformation points is used later with an Evas object.

            -
          2. - -
          3. -

            Set the coordinates for each point using the evas_map_point_coord_set() function. You can apply several effects to the Evas object by setting each point of the map to the right coordinates.

            - -
            // Set map coordinates
            -evas_map_point_coord_set(map, 0, 15, 100, 0);
            -evas_map_point_coord_set(map, 1, 265, 100, 0);
            -evas_map_point_coord_set(map, 2, 265, 300, 0);
            -evas_map_point_coord_set(map, 3, 15, 400, 0);
            -
          4. - -
          5. -

            Set UV data using the evas_map_point_image_uv_set() function, which informs the map of the correct pixels in the image it is mapping:

            - -
            // Set image UV
            -evas_map_point_image_uv_set(map, 0, 0, 0);
            -evas_map_point_image_uv_set(map, 1, 500, 50);
            -evas_map_point_image_uv_set(map, 2, 500, 400);
            -evas_map_point_image_uv_set(map, 3, 0, 200);
            -
          6. -
          - - -

          Applying the Map to the Evas Object

          - -

          To set the map on a given object, use the evas_object_map_set() function for the object. A map contains 4 points, each having canvas x, y coordinates with an optional z point value for perspective correction, if available. Each point also has U an V coordinates.

          - -
          // Apply map to button evas object
          -
          -evas_object_map_set(ad->button, map);
          - -

          Clearing Map Data and Enabling Map Features

          - -

          Free the map data and all memory associated with it when you no longer need it:

          - -
          // Free map resources
          -
          -evas_map_free(map);
          - -

          You can enable or disable the map features for the object. When enabled, the object geometry is saved, and the new geometry changes its position and size to reflect the set map geometry.

          - -
          // Enable map features
          -
          -evas_object_map_enable_set(ad->button, EINA_TRUE);
          - - - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/evas_objects_n.htm b/org.tizen.ui.guides/html/native/efl/evas_objects_n.htm deleted file mode 100755 index d0a4a7d..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_objects_n.htm +++ /dev/null @@ -1,824 +0,0 @@ - - - - - - - - - - - - - Evas Objects - - - - - -
          - -

          Evas Objects

          - -

          An Evas object is the most basic visual entity used in Evas. Everything, be it a single line or a complex list of UI components, is an Evas object.

          - -

          Primitive Renderable Objects

          -

          Primitive objects are the base upon which to build a complex interface: rectangles, lines, polygons, images, textblocks, and texts.

          -

          Rectangle

          -

          There is only one function to deal with rectangle objects. However, the rectangle is manipulated using the generic evas object functions.

          -

          The evas rectangle serves a number of key functions when working on Evas programs.

          -
            -
          • background
          • -
          • debugging
          • -
          • clipper
          • -
          - -

          Background

          -

          A common requirement of Evas programs is to have a solid color background, which can be accomplished with the following code.

          -
          Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
          -
          -// Here we set the rectangles red, green, blue and opacity levels
          -evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
          -evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
          -evas_object_show(bg);
          -
          - -

          Debugging

          -

          When debugging visual issues with evas programs, the rectangle is a useful tool. The rectangle's simplicity means that it is easier to pinpoint issues with it than with more complex objects. A common technique to use when writing an evas program and not getting the desired visual result is to replace an object for a solid color rectangle and seeing how it interacts with the other elements. This often allows us to notice clipping, parenting or positioning issues. Once the issues are identified and corrected, the rectangle can be replaced for the original object, and in all likelihood any remaining issues are specific to that object's type.

          - -

          Clipping

          -

          Clipping serves two main functions:

          -
            -
          • limiting visibility
          • -
          • applying a layer of color to an object
          • -
          - - -

          Text

          -

          An Evas text object shows a basic single-line single-style text.

          -
          Evas_Object *text = evas_object_text_add(evas_canvas);
          -evas_object_text_text_set(text, "some text");
          -evas_object_color_set(text, 127, 0, 0, 127);
          -evas_object_show(text);
          -
          - -

          To set the text, use evas_object_text_text_set(text, some_text). You can set the current text with evas_object_text_text_get(text).

          -

          To set the font, use evas_object_text_font_set(text, font, size):

          -
            -
          • text: The text object
          • -
          • font: The font name you want to use
          • -
          • size: The font size you want to use. To query the current font, use evas_object_text_font_set(text, font, size).
          • -
          -

          To set the text style, use evas_object_text_style_set(text, style). The following styles are supported:

          -
            -
          • EVAS_TEXT_STYLE_PLAIN: Plain, standard text
          • -
          • EVAS_TEXT_STYLE_SHADOW: Text with shadow underneath
          • -
          • EVAS_TEXT_STYLE_OUTLINE: Text with an outline
          • -
          • EVAS_TEXT_STYLE_SOFT_OUTLINE: Text with a soft outline
          • -
          • EVAS_TEXT_STYLE_GLOW: Text with a glow effect
          • -
          • EVAS_TEXT_STYLE_OUTLINE_SHADOW: Text with both outline and shadow effects
          • -
          • EVAS_TEXT_STYLE_FAR_SHADOW: Text with (far) shadow underneath
          • -
          • EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW: Text with outline and soft shadow effects combined
          • -
          • EVAS_TEXT_STYLE_SOFT_SHADOW: Text with (soft) shadow underneath
          • -
          • EVAS_TEXT_STYLE_FAR_SOFT_SHADOW: Text with (far soft) shadow underneath
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT: Shadow growing to bottom right
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM: Shadow growing to the bottom
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT: Shadow growing to bottom left
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT: Shadow growing to the left
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT: Shadow growing to top left
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP: Shadow growing to the top
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT: Shadow growing to top right
          • -
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT: Shadow growing to the right. To query the current style, use evas_object_text_style_get(text).
          • -
          -

          If the text does not fit, make an ellipsis on it by using evas_object_text_ellipsis_set(text, ellipsis). The (float) value specifies, which part of the text is shown.

          -
            -
          • 0.0: The beginning is shown and the end trimmed.
          • -
          • 1.0: The beginning is trimmed and the end shown.
          • -
          • Any value in between means that both ends of the text have ellipsis and the set part is shown.
          • -
          • -1.0: Ellipsis is disabled. To query the current ellipsis value, use evas_object_text_ellipsis_get(text).
          • -
          -

          When the text style is set to glow, set the glow color using evas_object_text_glow_color_set(text, r, g, b, a), where r, g, b, and a are respectively the red, green, blue, and alpha values. The effect is placed at a short distance from the text but not touching it. For glows set right at the text, use evas_object_text_glow2_color_set(text, r, g, b, a). To query the current color, use evas_object_text_glow_color_get(text, r, g, b, a), respectively evas_object_text_glow2_color_get(text, r, g, b, a).

          -

          If your text style is set to display a shadow, use evas_object_text_shadow_color_set(text, r, g, b, a), where r, g, b, and a are respectively the red, green, blue, and alpha values. To query the current color, use evas_object_text_shadow_color_get(text, r, g, b, a)

          -

          If your text style is set to display an outline, use evas_object_text_outline_color_set(text, r, g, b, a), where r, g, b, and a are respectively the red, green, blue, and alpha values. To query the current color, use evas_object_text_outline_color_get(text, r, g, b, a)

          - - -

          Primitive Smart Objects

          -

          A smart object is a special Evas object that provides custom functions to handle automatically clipping, hiding, moving, resizing color setting and more on child elements, for the smart object's user. They could be, for example, a group of objects that move together, or implementations of whole complex UI components, providing some intelligence and extension to simple Evas objects.

          - -

          Primitive Container Objects

          -

          A container is a Smart object that holds children Evas objects in a specific fashion.

          -

          Table

          -

          A table is a smart object that packs children using a tabular layout.

          -
          table = evas_object_table_add(evas);
          -evas_object_table_homogeneous_set(table, EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE);
          -evas_object_table_padding_set(table, 0, 0);
          -evas_object_resize(table, WIDTH, HEIGHT);
          -evas_object_show(table);
          -
          -rect = evas_object_rectangle_add(evas);
          -evas_object_color_set(rect, 255, 0, 0, 255);
          -evas_object_size_hint_min_set(rect, 100, 50);
          -evas_object_show(rect);
          -evas_object_table_pack(table, rect, 1, 1, 2, 1);
          -
          -rect = evas_object_rectangle_add(d.evas);
          -evas_object_color_set(rect, 0, 255, 0, 255);
          -evas_object_size_hint_min_set(rect, 50, 100);
          -evas_object_show(rect);
          -evas_object_table_pack(table, rect, 1, 2, 1, 2);
          -
          -rect = evas_object_rectangle_add(d.evas);
          -evas_object_color_set(rect, 0, 0, 255, 255);
          -evas_object_size_hint_min_set(rect, 50, 50);
          -evas_object_show(rect);
          -evas_object_table_pack(table, rect, 2, 2, 1, 1);
          -
          -rect = evas_object_rectangle_add(d.evas);
          -evas_object_color_set(rect, 255, 255, 0, 255);
          -evas_object_size_hint_min_set(rect, 50, 50);
          -evas_object_show(rect);
          -evas_object_table_pack(table, rect, 2, 3, 1, 1);
          -
          - -

          In this example, we add a non-homogeneous table to the canvas with its padding set to 0.

          -

          We then add four different colored rectangles with different properties.

          -
            -
          • the first one, at the first column and first line, spans two columns and one line
          • -
          • the second one, at the first column and second line, spans one columns and two lines
          • -
          • the third one, at the second column and second line, fits in one cell
          • -
          • the fourth one, at the second column and third line, also fits in one cell
          • -
          -

          To create a table, use evas_object_table_add(evas).

          -

          To set the table layout (the cells), use evas_object_table_homogeneous_set(table, homogeneous). The following values can be homogeneous:

          -
            -
          • EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE: This default value has columns and rows calculated based on hints of individual cells. This is flexible, but much heavier on computations.
          • -
          • EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE: The table size is divided equally among children, filling the whole table area. If the children have a minimum size that is larger than this (including padding), then the table overflows and is aligned respecting the alignment hint, possibly overlapping sibling cells.
          • -
          • EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM: The greatest minimum cell size is used: if no element is set to expand, the contents of the table are the minimum size and the bounding box of all the children is aligned relatively to the table object using evas_object_table_align_get(). If the table area is too small to hold this minimum bounding box, then the objects keep their size and the bounding box overflows the box area, still respecting the alignment. To set the current mode, use evas_object_table_homogeneous_get(table).
          • -
          -

          The table's content alignment is set using evas_object_table_align_set(table, horizontal, vertical), where horizontal and vertical are floating values. To see them, use evas_object_table_align_get(table, horizontal, vertical).

          -

          To set the padding, use evas_object_table_padding_set(table, horizontal, vertical). To see the current value, use evas_object_table_padding_get(table, horizontal, vertical).

          -

          _To see the current column and row count, use evas_object_table_col_row_size_get(table, columns, rows).

          - -

          Grid

          -

          A grid is a smart object that packs its children as with a regular grid layout.

          -

          Grids are added to the canvas with evas_object_grid_add(evas).

          -

          To change a grid's virtual resolution, use evas_object_grid_size_set(grid, width, height), to see it, use evas_object_grid_size_get(grid, width, height).

          -

          To add an object, use evas_object_grid_pack(grid, child, x, y, w, h), where

          -
            -
          • x is the virtual X coordinate of the child
          • -
          • y is the virtual y coordinate of the child
          • -
          • w is the virtual width of the child
          • -
          • h is the virtual height of the child
          • -
          -

          Box

          -

          A box is a simple container that sets its children objects linearly.

          -

          To add a box to your canvas, use evas_object_box_add(evas).

          -

          To add a child to the box, use

          -
            -
          • evas_object_box_append(box, child): The child is appended.
          • -
          • evas_object_box_insert_after(box, child, reference): The child is added after reference.
          • -
          • evas_object_box_insert_before(box, child, reference): The child is added before reference.
          • -
          • evas_object_box_insert_at(box, child, pos): The child is added at the specified position.
          • -
          -

          To set the alignment, use evas_object_box_align_set(box, horizontal, vertical).

          -
            -
          • horizontal: 0.0 means aligned to the left, 1.0 means to the right;
          • -
          • vertical: 0.0 means aligned to the top, 1.0 means to the bottom.
          • -
          -

          Evas has predefined box layouts available:

          -
            -
          • evas_object_box_layout_horizontal();
          • -
          • evas_object_box_layout_vertical();
          • -
          • evas_object_box_layout_homogeneous_horizontal();
          • -
          • evas_object_box_layout_homogeneous_vertical();
          • -
          • evas_object_box_layout_homogeneous_max_size_horizontal();
          • -
          • evas_object_box_layout_homogeneous_max_size_vertical();
          • -
          • evas_object_box_layout_flow_horizontal();
          • -
          • evas_object_box_layout_flow_vertical();
          • -
          • evas_object_box_layout_stack().
          • -
          - -

          Image Objects

          - - -

          Using Evas, you can create and manipulate image objects. Evas supports image loaders of various formats as plug-in modules.

          -

          The image formats that Evas supports include bmp, edj, gif, ico, jpeg, pmaps, png, psd, svg, tga, tiff, wbmp, webp, and xpm.

          - -

          Figure: Evas image loader

          -

          Evas image loader

          - -

          Evas Object Image Functions

          - -

          Evas has over 70 image object functions. The following functions are discussed in this document:

          -
          -Evas_Object *evas_object_image_add(Evas *e);
          -void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key);
          -void evas_object_image_fill_set(Evas_Object *obj, int x, int y, int w, int h);
          -void evas_object_image_filled_set(Evas *e, Eina_Bool setting);
          -Evas_Object *evas_object_image_filled_add(Evas *e);
          -void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smoothscale);
          -void evas_object_image_load_size_set(Evas_Object *obj, int w, int h);
          -void evas_object_image_data_set(Evas_Object *obj, void *data);
          -void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing);
          -void evas_object_image_size_set(Evas_Object *obj, int w, int h);
          -void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h);
          -Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags);
          -
          - -

          Creating an Image Object and Setting the Image Data Source

          -

          A common use case of an image object is to set a file as the image data source. The process has 3 steps and each one involves the following API calls:

          -
            -
          • The evas_object_image_add() function creates an image object and returns the pointer. -
            Evas_Object *evas_object_image_add(Evas *e);
            -
          • -
          • The evas_object_image_file_set() function sets a source file on the image object. The object fetches the image pixel data from the source file. -
            void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key);
            -
          • -
          • The evas_object_image_fill_set() sets how to fill the image object's area with the given pixel data. -
            void evas_object_image_fill_set(Evas_Object *obj, int x, int y, int w, int h);
            -
          • -
          - -

          In the following code example, the main() function creates an image object and displays it on a window. The image object size is 300x300 and the source image resolution is 100x127. The image is scaled into 300 by 300 to fill the image object area using the evas_object_image_fill_set() function.

          -
          -#include <Elementary.h>
          -
          -int main(int argc, char **argv)
          -{
          -   elm_init(argc, argv);
          -
          -   // Create a window object
          -   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          -   evas_object_resize(win, 400, 400);
          -   evas_object_show(win);
          -
          -   // Return Evas handle from window
          -   Evas *e = evas_object_evas_get(win);
          -
          -   // Create an image object
          -   Evas_Object *img = evas_object_image_add(e);
          -
          -   // Set a source file to fetch pixel data
          -   evas_object_image_file_set(img, "./logo.png", NULL);
          -
          -   // Set the size and position of the image on the image object area
          -   evas_object_image_fill_set(img, 0, 0, 300, 300);
          -
          -   evas_object_move(img, 50, 50);
          -   evas_object_resize(img, 300, 300);
          -   evas_object_show(img);
          -
          -   elm_run();
          -
          -   elm_shutdown();
          -
          -   return 0;
          -}
          -
          -

          Figure: Image object display

          -

          Image object display

          - -

          Managing Images

          - -

          To manage image objects in Evas:

          - -

          Limiting Visibility

          -

          Evas always supports the image file type it was compiled with. Check your software packager for the information and use the evas_object_image_extension_can_load_get() function.

          - -

          Create the image object. Set a source file on it, so that the object knows where to fetch the image data.

          -

          Define how to fill the image object area with the given pixel data. You can use a sub-region of the original image, or have it tiled repeatedly on the image object.

          - -
          -img = evas_object_image_add(canvas);
          -evas_object_image_file_set(img, "path/to/img", NULL);
          -evas_object_image_fill_set(img, 0, 0, w, h);
          -
          - - -

          If the entire source image is to be displayed on the image object, stretched to the destination size, use the evas_object_image_filled_set() function helper that you can use instead of the evas_object_image_fill_set() function:

          - -
          -evas_object_image_filled_set(img, EINA_TRUE);
          -
          - -

          Scaling Images

          -

          Resizing image objects scales the source images to the image object size, if the source images are set to fill the object area using the evas_object_image_filled_set() function.

          -

          Control the aspect ratio of an image for different sizes with functions to load images scaled up or down in memory.

          - -

          Evas has a scale cache, which caches scaled versions of images used often. You can also have Evas rescale the images smoothly, however, that is computationally expensive.

          - -

          Users can decide how to fill the image object area with the given image pixel data by setting the position, width, and height of the image using the evas_object_image_fill_set() function. Without setting this information, the image is not displayed. If the size of the image is bigger than the image object area, only a sub-region of the original image is displayed. If the image is smaller than the area, images are tiled repeatedly to fill the object area.

          - -

          Figure: Image scaling

          -

          Image scaling

          - - - - - - - - - - - - - - -

          evas_object_image_fill_set(obj, 50, 0, 300, 300)evas_object_image_fill_set(obj, 0, 0, 200, 200)evas_object_image_fill_set(obj, 0, 0, 100, 127)
          - -

          The evas_object_image_filled_set() function scales the image to fit the object area. Resizing the image object automatically triggers an internal call to the evas_object_image_fill_set() function.

          -
          -void evas_object_image_filled_set(Evas *e, Eina_Bool setting);
          - -

          The evas_object_image_filled_add() function creates a new image object that automatically scales its bound image to the object area. This is a helper function around the evas_object_image_add() and evas_object_image_filled_set() functions.

          - -
          Evas_Object *evas_object_image_filled_add(Evas *e);
          - -

          Scaled images' quality can differ according to scaling algorithms. Smooth scaling improves the image quality in the process of size reducing or enlarging. Evas runs its own smooth scaling algorithm by default and provides an API so users can disable the function.

          - -
          -void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smoothscale);
          - -

          The algorithm is implemented using the SIMD (Single Instruction Multiple Data) vectorization in case of software rendering. It is optimized on Intel and ARM CPU through MMX and NEON command respectively.

          - -

          There is a trade-off between image smoothness and rendering performance. The load gets bigger as the image gets bigger. Users can avoid such scaling overload by using the same size of the image object and the source image.

          - -

          In the following code, 2 image objects are created to show the effects of smooth scaling. The one with smooth scaling applied appears softer on the screen.

          - -
          -#include <Elementary.h>
          -
          -int main(int argc, char **argv)
          -{
          -   elm_init(argc, argv);
          -
          -   // Create a window object
          -   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          -   evas_object_resize(win, 400, 200);
          -   evas_object_show(win);
          -
          -   // Return Evas handle from window
          -   Evas *e = evas_object_evas_get(win);
          -
          -   // Create an image object
          -   Evas_Object *img = evas_object_image_filled_add(e);
          -   evas_object_image_file_set(img, "./logo.png", NULL);
          -   evas_object_move(img, 0, 0);
          -   evas_object_resize(img, 200, 200);
          -   evas_object_show(img);
          -
          -   // Create another image object
          -   Evas_Object *img2 = evas_object_image_filled_add(e);
          -   evas_object_image_file_set(img2, "./logo.png", NULL);
          -
          -   // Disable smooth scaling
          -   evas_object_image_smooth_scale_set(img2, EINA_FALSE);
          -   evas_object_move(img2, 200, 0);
          -   evas_object_resize(img2, 200, 200);
          -   evas_object_show(img2);
          -
          -   elm_run();
          -
          -   elm_shutdown();
          -
          -   return 0;
          -}
          -
          - - - - - - - - - - - - -
          Figure: Smooth scaling effects

          Smooth scaling effects

          Smooth scaling effects

          Smooth scaling enabledSmooth scaling disabled
          - - -

          Evas caches scaled image data and reuses them. Users can save the memory by loading the image in the scaled size to the memory at the beginning. This option is available only for jpeg format at the moment.

          -
          -void evas_object_image_load_size_set(Evas_Object *obj, int w, int h);
          - -

          An example code is as follows.

          -
          -#include <Elementary.h>
          - 
          -int main(int argc, char **argv)
          -{
          -   elm_init(argc, argv);
          - 
          -   // Create a window object
          -   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          -   evas_object_resize(win, 400, 200);
          -   evas_object_show(win);
          - 
          -   // Return Evas handle from window
          -   Evas *e = evas_object_evas_get(win);
          - 
          -   // Create an image object
          -   Evas_Object *img = evas_object_image_filled_add(e); 
          - 
          -   // Load the image scaled into the object size 
          -   // before evas_object_image_file_set() is called
          -   evas_object_image_load_size_set(img, 300, 300);
          - 
          -   evas_object_image_file_set(img, "./logo.png", NULL); 
          -   
          -   evas_object_move(img, 50, 50);
          -   evas_object_resize(img, 300, 300);
          -   evas_object_show(img); 
          - 
          -   elm_run();
          - 
          -   elm_shutdown();
          -
          -   return 0;
          -}
          -
          - -

          Setting Raw Data to Image Object

          -

          Users can set raw data to the image object manually using the evas_object_image_data_set() function instead of setting an image file as the data source. The image data should be in raw data form. In case of an 200x200 sized image with alpha channel enabled (32 bits per pixel), the size of the image data is 14000 (=200*200*4) bytes.

          - -
          void evas_object_image_data_set(Evas_Object *obj, void *data);
          - -

          Image objects fetch metadata such as width or height from the header of the image files. Since the raw data does not have the metadata, users must set the size of the image using the evas_object_image_size_set() function.

          - -
          void evas_object_image_size_set(Evas_Object *obj, int w, int h);
          - -

          The evas_object_image_data_get() function returns the data pointer of an image object and requires a parameter to determine whether the data is modified or not. If users pass EINA_TRUE for for_writing, Evas updates the image pixels in the next rendering cycle.

          - -
          void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing);
          - -

          The evas_object_image_data_update_add() helps to mark the updated area for rendering efficiency.

          - -
          void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h);
          - -

          The following example code and figure show how to specify the area to update.

          -
          -evas_object_image_data_update_add(image, 100, 100, 50, 50);
          -evas_object_image_data_update_add(image, 180, 100, 50, 50);
          -evas_object_image_data_update_add(image, 85, 200, 160, 80);
          -
          - -

          Figure: Partial image update

          -

          Partial image update

          - -

          The following code creates an image object and sets a source file on it. Then it implements the blur effect to the pixel data and saves them using the evas_object_image_save() function.

          - -
          Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags);
          - -
          -#include <Elementary.h>
          -
          -void image_blur(Evas_Object *img)
          -{
          -   unsigned char *img_src = evas_object_image_data_get(img, EINA_TRUE);
          -
          -   int w, h;
          -   evas_object_image_size_get(img, &w, &h);
          -   int blur_size = 4;
          -   int x, y, xx, yy;
          -   
          -   for (y = 0; y < h; y++)
          -   {
          -      for (x = 0; x < w; x++)
          -      {
          -         int avg_color[3] = {0, 0, 0};
          -         int blur_pixel_cnt = 0;
          -
          -         for (xx = x; (xx < x + blur_size) && (xx < w); xx++)
          -         {
          -            for (yy = y; (yy < y + blur_size) && (yy < h); yy++)
          -            {
          -               int idx = (yy * w * 4) + (xx * 4);
          -               avg_color[0] += img_src[idx + 0];
          -               avg_color[1] += img_src[idx + 1];
          -               avg_color[2] += img_src[idx + 2];
          -               ++blur_pixel_cnt;
          -            }
          -         }
          -         avg_color[0] /= blur_pixel_cnt;
          -         avg_color[1] /= blur_pixel_cnt;
          -         avg_color[2] /= blur_pixel_cnt;
          -
          -         for (xx = x; (xx < x + blur_size) && (xx < w); xx++)
          -         {
          -            for (yy = y; (yy < y + blur_size) && (yy < h); yy++)
          -            {
          -               int idx = (yy * w * 4) + (xx * 4);
          -               img_src[idx + 0] = avg_color[0];
          -               img_src[idx + 1] = avg_color[1];
          -               img_src[idx + 2] = avg_color[2];
          -            }
          -         }
          -      }
          -   }
          -   evas_object_image_data_update_add(img, 0, 0, w, h);
          -}
          -
          -int main(int argc, char **argv)
          -{
          -   elm_init(argc, argv);
          -
          -   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          -   evas_object_resize(win, 200, 200);
          -   evas_object_show(win);
          -
          -   Evas *e = evas_object_evas_get(win);
          -
          -   Evas_Object *img = evas_object_image_filled_add(e);
          -   evas_object_image_file_set(img, "./logo.png", NULL);
          -   evas_object_resize(img, 200, 200);
          -   evas_object_show(img);
          -
          -   image_blur(img);
          -
          -   evas_object_image_save(img, "logo2.png", NULL, "quality=100 compress=8");
          -
          -   elm_run();
          -
          -   elm_shutdown();
          -
          -   return 0;
          -}
          -
          - - - - - - - - - - - - -
          Figure: Blur effect

          Blur effect

          Blur effect

          BeforeAfter
          - -

          Giving Performance Hints

          -

          In image viewer applications, you can display an image in full size. The navigation to the adjacent images on your album must be fluid and fast. Thus, while displaying a given image, the program can load the next and previous image in the background to be able to immediately repaint the screen with a new image.

          - -

          Evas addresses this issue with image preloading:

          - -
          -prev = evas_object_image_filled_add(canvas);
          -evas_object_image_file_set(prev, "/path/to/prev", NULL);
          -evas_object_image_preload(prev, EINA_TRUE);
          -next = evas_object_image_filled_add(canvas);
          -evas_object_image_file_set(next, "/path/to/next", NULL);
          -evas_object_image_preload(next, EINA_TRUE);
          -
          - -

          If you are loading an image which is too big, set its loading size smaller.

          - -

          Load a scaled down version of the image in the memory if that is the size you are displaying (this can speed up the loading considerably):

          -
          evas_object_image_load_scale_down_set(img, zoom);
          -

          If you know you are showing a sub-set of the image pixels, you can avoid loading the complementary data:

          -
          evas_object_image_load_region_set(img, x, y, w, h);
          -
          - -

          Specifying Borders

          -

          With Evas, you can specify image margins to be treated as borders. The margins then maintain their aspects when the image is resized. This makes setting frames around other UI objects easier. The following figure illustrates the border behavior, when the image is resized.

          - -

          Figure: Borders in Evas

          -

          Borders in Evas

          - - -

          Textblock Objects

          - -

          Unlike basic text objects, a textblock handles complex text, managing multiple styles and multiline text based on HTML-like tags. However, these extra features are heavier on memory and processing cost.

          -

          The textblock objects is an object that shows big chunks of text. Textblock supports many features, including text formatting, automatic and manual text alignment, embedding items (icons, for example). Textblock has three important parts: the text paragraphs, the format nodes and the cursors.

          -

          To set markup to format text, use for example <font_size=50>Big!</font_size>. Set more than one style directive in one tag with <font_size=50 color=#F00>Big and Red!</font_size>. Please note that we used </font_size> although the format also included color. This is because the first format determines the matching closing tag's name. You can use anonymous tags, such as <font_size=30>Big</>, which pop any type of format, but it is advisable to use the named alternatives instead.

          -

          Textblock supports the following formats:

          -
            -
          • font: Font description in fontconfig such as format, for example "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
          • -
          • font_weight: Overrides the weight defined in "font". For example, "font_weight=Bold" is the same as "font=:style=Bold". The supported weights are "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
          • -
          • font_style: Overrides the style defined in "font". For example, "font_style=Italic" is the same as "font=:style=Italic". The supported styles are "normal", "oblique", and "italic".
          • -
          • font_width: Overrides the width defined in "font". For example, "font_width=Condensed" is the same as "font=:style=Condensed". The supported widths are "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
          • -
          • lang: Overrides the language defined in "font". For example, "lang=he" is the same as "font=:lang=he".
          • -
          • font_fallbacks: A comma delimited list of fonts to try if finding the main font fails.
          • -
          • font_size: The font size in points.
          • -
          • font_source: The source of the font, for example an eet file.
          • -
          • color: The text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • underline_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • underline2_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • outline_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • shadow_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • glow_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • glow2_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • strikethrough_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • align: The text alignment in one of the following formats: "auto" (according to text direction), "left", "right", "center" or "middle", which take a value between 0.0 and 1.0 or a value between 0% to 100%.
          • -
          • valign: The vertical text alignment in one of the following formats: "top", "bottom", "middle", "center", "baseline" or "base", which take a value between 0.0 and 1.0 or a value between 0% to 100%.
          • -
          • wrap: The text wrap in one of the following formats: "word", "char", "mixed", or "none".
          • -
          • left_margin: Either "reset" or a pixel value indicating the margin.
          • -
          • right_margin: Either "reset" or a pixel value indicating the margin.
          • -
          • underline: The style of underlining in one of the following formats: "on", "off", "single", or "double".
          • -
          • strikethrough: The style of text that is either "on" or "off".
          • -
          • backing_color: The background color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • -
          • backing: The background color enabled or disabled: "on" or "off".
          • -
          • style: The style of the text in one of the following formats: "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow" or "far_soft_shadow". The direction is selected by adding "bottom_right", "bottom", "bottom_left", "left", "top_left", "top", "top_right" or "right". For example, "style=shadow,bottom_right".
          • -
          • tabstops: The pixel value for tab width.
          • -
          • linesize: To force a line size in pixels.
          • -
          • linerelsize: Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
          • -
          • linegap: To force a line gap in pixels.
          • -
          • linerelgap: Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
          • -
          • item: Creates an empty space that is filled by an upper layer. Use "size", "abssize", or "relsize" to define the item"s size, and an optional vsize = full/ascent to define the item's position in the line.
          • -
          • linefill: Either a float value or percentage indicating how much to fill the line.
          • -
          • ellipsis: A value between 0.0 and 1.0 to indicate the type of ellipsis, or -1.0 to indicate that an ellipsis is not wanted.
          • -
          • password: Either "on" or "off", this is used to specifically turn replacing chars with the password mode (that is, replacement char) on and off.
          • -
          - - -

          Clipping Objects

          - -

          Limiting Visibility

          -

          An Evas object can be clipped – in other words, its visible area is restricted with the clipper object.

          - -

          It is often necessary to show only parts of an object, and while it may be possible to create an object that corresponds only to the part that must be shown (which is not always possible), it is usually easier to use a clipper. A clipper is a rectangle that defines what is visible and what is not. The way to do this is to create a solid white rectangle (by default, so you need not use evas_object_color_set()) and give it a position and size of what is wanted visible. The following code exemplifies showing the center half of my_evas_object:

          -
          Evas_Object *clipper = evas_object_rectangle_add(evas_canvas);
          -evas_object_move(clipper, my_evas_object_x / 4, my_evas_object_y / 4);
          -evas_object_resize(clipper, my_evas_object_width / 2, my_evas_object_height / 2);
          -evas_object_clip_set(my_evas_object, clipper);
          -evas_object_show(clipper);
          -
          - -

          Layer of Color

          -

          A solid white clipper does not produce a change in the color of the clipped object, only hides what is outside the clipper's area. Changing the color of an object is accomplished by using a colored clipper. Clippers with color function by multiplying the colors of the clipped object. The following code shows how to remove all the red from an object.

          -
          Evas_Object *clipper = evas_object_rectangle_add(evas);
          -evas_object_move(clipper, my_evas_object_x, my_evas_object_y);
          -evas_object_resize(clipper, my_evas_object_width, my_evas_object_height);
          -evas_object_color_set(clipper, 0, 255, 255, 255);
          -evas_object_clip_set(obj, clipper);
          -evas_object_show(clipper);
          -
          - - -

          Mapping Objects

          - -

          Evas allows different transformations to be applied to all kinds of objects. These are applied by means of UV mapping. With UV mapping, one map points in the source object to a 3D space positioning at target. This allows rotation, perspective, scale, and many other effects depending on the map that is used.

          - -

          Creating a Map

          -

          A map consists of a set of points, but currently only four are supported. Each of these points contains a set of canvas coordinates x and y that are used to alter the geometry of the mapped object, and a z coordinate that indicates the depth of that point. This last coordinate does not normally affect the map, but is used by several of the utility functions to calculate the right position of the point given other parameters.

          -

          The coordinates for each point are set with evas_map_point_coord_set(map, index, x, y, z). In the example below, there is a rectangle whose coordinates are (100, 100) and (300, 300).

          -
          Evas_Object *object = evas_object_rectangle_add(evas);
          -evas_object_move(object, 100, 100);
          -evas_object_resize(object, 200, 200);
          -Evas_Map map = evas_map_new(4);
          -evas_map_point_coord_set(map, 0, 100, 100, 0);
          -evas_map_point_coord_set(map, 1, 300, 100, 0);
          -evas_map_point_coord_set(map, 2, 300, 300, 0);
          -evas_map_point_coord_set(map, 3, 100, 300, 0);
          -
          -

          There are functions to ease the process.

          -

          Use evas_map_util_points_populate_from_geometry(map, x, y, w, h, z), where the map coordinates are set to the given rectangle, and z is the coordinate in the Z axis, which is the same for all points.

          -
          Evas_Object *object = evas_object_rectangle_add(evas);
          -evas_object_move(object, 100, 100);
          -evas_object_resize(object, 200, 200);
          -Evas_Map map = evas_map_new(4);
          -evas_map_util_points_populate_from_geometry(map, 100, 100, 200, 200, 0);
          -
          - -

          You can also use evas_map_util_points_populate_from_object(map, object).

          -
          Evas_Object *object = evas_object_rectangle_add(evas);
          -evas_object_move(object, 100, 100);
          -evas_object_resize(object, 200, 200);
          -Evas_Map map = evas_map_new(4);
          -evas_map_util_points_populate_from_object(map, object);
          -
          - -

          You can also use evas_map_util_points_populate_from_object_full(map, object, z), where z is the coordinate in the Z axis, which is the same for all points.

          -
          Evas_Object *object = evas_object_rectangle_add(evas);
          -evas_object_move(object, 100, 100);
          -evas_object_resize(object, 200, 200);
          -Evas_Map map = evas_map_new(4);
          -evas_map_util_points_populate_from_object_full(map, object, 0);
          -
          - -

          Manual Point Setting

          -

          Several effects are applied to an object by setting each point of the map to the right coordinates. For example, a simulated perspective is achieved as follows.

          -
          evas_map_point_coord_set(map, 0, 300, 100, 0);
          -evas_map_point_coord_set(map, 1, 450, 120, 0);
          -evas_map_point_coord_set(map, 2, 450, 260, 0);
          -evas_map_point_coord_set(map, 3, 300, 300, 0);
          -
          - -

          The Z coordinate is not used when setting points by hand; thus its value is not important.

          - -

          Applying a Map

          -

          Regardless of the specific way you create a map, to apply it to a specific object, use

          -
          evas_object_map_set(object, map);
          -evas_object_map_enable_set(object, EINA_TRUE);
          -
          - -

          Basic Utility Functions

          -

          Evas provides utility functions for common transformations:

          -
            -
          • evas_map_util_rotate(map, angle, cx, cy): This performs a rotation of the angle degrees around the center point with the coordinates (cx, cy).
          • -
          • evas_map_util_zoom(map, zoomx, zoomy, cx, cy): This performs a zoomx and zoomy zoom in the X and Y directions respectively, with the center point with the coordinates (cx, cy).
          • -
          - -

          For example, the following code rotates an object around its center.

          -
          int x, y, w, h;
          -evas_object_geometry_get(object, &x, &y, &w, &h);
          -Evas_Map *map = evas_map_new(4);
          -evas_map_util_points_populate_from_object(map, object);
          -evas_map_util_rotate(map, 45, x + (w / 2), y + (h / 2));
          -evas_object_map_set(object, map);
          -evas_object_map_enable_set(object, EINA_TRUE);
          -evas_map_free(m);
          -
          - -

          The following code rotates an object around the center of the window.

          -
          int w, h;
          -evas_output_size_get(evas, &w, &h);
          -Evas_Map *map = evas_map_new(4);
          -evas_map_util_points_populate_from_object(map, object);
          -evas_map_util_rotate(map, 45, w / 2, h / 2);
          -evas_object_map_set(object, map);
          -evas_object_map_enable_set(object, EINA_TRUE);
          -evas_map_free(m);
          -
          - -

          3D Utility Functions

          -

          Evas provides utility functions for 3D transformations.

          -

          To make a 3D rotation, use evas_map_util_3d_rotate(map, anglex, angley, anglez, cx, cy, cz). With this code, you can set the Z coordinate of the rotation center, and the angles to rotate through around all axes.

          -

          Rotating in the 3D space does not look natural. A more natural look becomes by adding perspective to the transformation, which is done with evas_map_util_3d_perspective(map, px, py, z0, focal) on the map after its position has been set.

          - -
            -
          • px and py specify the "infinite distance" point in the 3D conversion, where all lines converge to.
          • -
          • z0 specifies the Z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates: any points on this Z value do not have their X and Y coordinates modified in the transform, while those further away (Z value higher) shrink into the distance, and those less than this value expand.
          • -
          • focal determines the "focal length" of the camera: this is the distance in reality between the camera lens plane (the rendering results are undefined at or closer than this) and the z0 value; this function allows for some "depth" control.
          • -
          -

          Color and Lighting

          -

          Each point in a map can be set to a color, which is multiplied with the object's own color and linearly interpolated in between adjacent points. To do this, use evas_map_point_color_set(map, index, r, g, b, a) for each point of the map, or evas_map_util_points_color_set(map, r, g, b, a) to set every point into the same color.

          -

          To add lighting for the objects, which is useful with 3D transforms, use evas_map_util_3d_lighting(map, lightx, lighty, lightz, lightr, lightg, lightb, ambientr, ambientg, ambientb):

          -
            -
          • lightx, lighty and lightz are the local light source coordinates;
          • -
          • lightr, lightg and lightb are the local light source colors;
          • -
          • ambientr, ambientg and ambientb are the ambient light colors. Evas sets the color of each point based on the distance to the light source, the angle with which the object is facing the light and the ambient light. The orientation of each point is important. If the map is defined counter-clockwise, the object faces away from the user and becomes obscured, since no light does not reflect from it.
          • -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/evas_optimization_n.htm b/org.tizen.ui.guides/html/native/efl/evas_optimization_n.htm deleted file mode 100755 index 622b72f..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_optimization_n.htm +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - Optimizing Evas - - - - - - -
          -

          Optimizing Evas

          - -

          To optimize Evas:

          - - - -

          Using a Rectangle Object instead of a Solid Color Image

          -

          When you need a solid color object, it is better (more efficient) to use a rectangle object than the image.

          - - - - - - - - - - - - - - - - - - -
          Before
          -
          -image = elm_image_add(win);
          -snprintf(buf, sizeof(buf), "%s/images/white_bg.png", elm_app_data_dir_get()); 
          -elm_image_file_set(image, buf, NULL);
          -evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(win, image);
          -evas_object_show(image);
          -
          After
          -
          -rect = evas_object_rectangle_add(evas_object_evas_get(win));
          -evas_object_color_set(rect, 255, 255, 255, 255);
          -evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(win, rect);
          -evas_object_show(rect);
          -
          - - -

          Making an Object Invisible instead of Setting Alpha as 0

          - -

          To make an object invisible, it is more efficient to use evas_object_hide() instead of changing the alpha value to 0.

          - - - - - - - - - - - - - - - -
          BeforeAfter
          -
          -static void
          -_invisible_cb(void *data, Evas_Object *obj, void *ev)
          -{
          -   evas_object_color_set(obj, 0, 0, 0, 0);   
          -}
          -
          -
          -static void
          -_invisible_cb(void *data, Evas_Object *obj, void *ev)
          -{
          -   evas_object_hide(obj);   
          -}
          -
          - -

          Using evas_object_image for Maximum Optimization

          - -

          If you need maximum optimization, use evas_object_image instead of elm_image and elm_icon.

          - - - - - - - - - - - - - - - - - - -
          Before
          -
          -img = elm_image_add((parent);
          -snprintf(buf, sizeof(buf), "%s/images/white_bg.png", elm_app_data_dir_get()); 
          -elm_image_file_set(img, buf, NULL);
          -evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(img);
          -
          After
          -
          -img = evas_object_image_add(evas_object_evas_get(parent));
          -snprintf(buf, sizeof(buf), "%s/images/white_bg.png", elm_app_data_dir_get()); 
          -evas_object_image_file_set(img, buf, NULL);
          -evas_object_image_filled_set(img, EINA_TRUE);
          -evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(img);
          -
          - - -

          Setting the Parent to Avoid the Elementary Tree Reconstruction

          -

          Before creating an object, make sure that the relationship between parent and child is set correctly to avoid having to reconstruct later.

          - - - - - - - - - - - - - - - -
          BeforeAfter
          -
          -win = elm_win_add();
          -
          -scroller = elm_scroller_add(win);
          -
          -box = elm_box_add(win);
          -
          -button = elm_button_add(win);
          -
          -
          -win = elm_win_add();
          -
          -scroller = elm_scroller_add(win);
          -
          -box = elm_box_add(scroller);
          -
          -button = elm_button_add(box);
          -
          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/evas_rendering_n.htm b/org.tizen.ui.guides/html/native/efl/evas_rendering_n.htm deleted file mode 100755 index e265bf6..0000000 --- a/org.tizen.ui.guides/html/native/efl/evas_rendering_n.htm +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - Evas Rendering Concept and Method - - - - - -
          - -

          Evas Rendering Concept and Method

          - -

          Evas is a canvas display library. It is markedly different from most display and windowing systems as the canvas is structural and is also a state engine, whereas most display and windowing systems are immediate mode display targets. Evas handles the logic between a structural display via its state engine, and controls the target windowing system in order to produce rendered results of the current canvas' state on the display.

          -

          Immediate mode display systems retain very little or no state. A program executes a series of commands, as in the following pseudo code.

          -
          -draw line from position (0, 0) to position (100, 200);
          -
          -draw rectangle from position (10, 30) to position (50, 500);
          -
          -bitmap_handle = create_bitmap();
          -scale bitmap_handle to size 100 x 100;
          -draw image bitmap_handle at position (10, 30);
          -
          -

          The series of commands is executed by the windowing system and the results are typically displayed on the screen. Once the commands are executed, the display system does not know how to reproduce this image again, and has to be instructed by the application on how to redraw sections of the screen if needed. Each successive command is executed as instructed by the application and either emulated by software or sent to the graphics hardware on the device to be performed.

          -

          The advantage of such a system is that it is simple and gives a program tight control over how something looks and is drawn. Given the increasing complexity of displays and demands by users to have better looking interfaces, more work needs to be done at this level by the internals of UI component sets, custom display components and other programs. This means that more logic and display rendering code needs to be written again each time the application needs to figure out how to minimize redraws so that display is fast and interactive, and keep track of redraw logic.

          -

          For example, if in the scene below, the windowing system requires the application to redraw the area from 0, 0 to 50, 50 (also referred to as the "expose event"). Then the programmer calculates manually the updates and repaints it again.

          -
          -Redraw from position (0, 0) to position (50, 50):
          -
          -// What was in area (0, 0, 50, 50)?
          -
          -// 1. intersection part of line (0, 0) to (100, 200)?
          -   draw line from position (0, 0) to position (25, 50);
          -
          -// 2. intersection part of rectangle (10, 30) to (50, 500)?
          -   draw rectangle from position (10, 30) to position (50, 50)
          -
          -// 3. intersection part of image at (10, 30), size 100 x 100?
          -   bitmap_subimage = subregion from position (0, 0) to position (40, 20)
          -   draw image bitmap_subimage at position (10, 30);
          -
          - -

          If all elements in the above scene are opaque, the system is doing useless paints: part of the line is behind the rectangle, and part of the rectangle is behind the image. These useless paints tend to be very costly.

          -

          Evas is a structural system in which the programmer creates and manages display objects and their properties, and as a result of this higher level state management, the canvas is able to redraw the set of objects when needed to represent the current state of the canvas.

          -

          For example, see the following pseudo code.

          -
          -line_handle = create_line();
          -set line_handle from position (0, 0) to position (100, 200);
          -show line_handle;
          -
          -rectangle_handle = create_rectangle();
          -move rectangle_handle to position (10, 30);
          -resize rectangle_handle to size 40 x 470;
          -show rectangle_handle;
          -
          -bitmap_handle = create_bitmap();
          -scale bitmap_handle to size 100 x 100;
          -move bitmap_handle to position (10, 30);
          -show bitmap_handle;
          -
          -render scene;
          -
          - -

          This looks longer, but when the display needs to be refreshed or updated, the programmer only moves, resizes, shows, hides etc. the objects that need to change. The programmer thinks at the object logic level, and the canvas software does the rest of the work, figuring out what changed in the canvas since it was last drawn, how to most efficiently redraw the canvas and its contents to reflect the current state, and doing the actual drawing of the canvas.

          -

          This allows the programmer think in a more natural way when dealing with a display, and saves time and effort of working out how to load and display images, to render given the current display system etc. Since Evas is portable across different display systems, this gives the programmer the ability to port and display the code on different display systems with little work.

          -

          Evas is a display system somewhere between a UI component set and an immediate mode display system. It retains basic display logic, but does little high-level logic such as scrollbars, sliders, push buttons etc.

          - -

          For more information on the UI rendering modes (immediate and retained), see UI Rendering Mode.

          - - -

          Evas Engines Concept

          -

          Evas delegates most of the actual rendering work to its engines. Engines are the backends that Evas uses to render (primitive) objects on a canvas. The canvas can be the screen, or a buffer in the memory.

          -

          Evas can work with and provides multiple engines, such as (this list is non-exhaustive):

          -
            -
          • buffer: all the rendering takes place in a buffer
          • -
          • fb: the rendering takes place in the system's framebuffer
          • -
          • software_x11: this is the most used, using X11
          • -
          • gl_x11: this also renders to an X11 window, except that it uses OpenGL
          • -
          -

          These implement the rendering of all the basic objects by themselves, because they often can be accelerated by the hardware or backend software libraries to provide fast rendering.

          -

          If a particular engine does not have the provision for a certain primitive object, it reverts back to using a default software version.

          - -

          UI Rendering Mode

          - -

          Evas removes the need to know about the characteristics of your display system or what graphics calls are used to draw them and how. It deals on an object level where all you do is create and manipulate objects in a canvas, set their properties, and the rest is done for you. This rendering method is called the retained mode, whereas the immediate mode is an alternative rendering method.

          - -

          Immediate Mode

          - -

          The immediate mode is the most commonly used in graphics toolkit libraries, such as GTK+, GDI, and GDI+. The application is responsible for repainting the portion of the client area that is invalidated.

          - -

          Figure: Immediate mode

          -

          Immediate mode

          - -

          The application commands any drawing issues as it needs, and the display system draws some GUIs. After the drawing is done, it appears in the destination. This mode allows you to have a exact control over the render cycles. However, if the draw commands are misused, unnecessary drawing can be performed or drawing never happen at all.

          -

          The following example explains the common usage of the immediate mode:

          - -
          -void update()
          -{
          -   Image *img = load_image(NEW_IMG);
          -
          -   // Switch button image to new one
          -   update_button_image(img);
          -
          -   // Issue the invalidate area (button area) to be redrawn on the screen
          -   invalidate_area(button_x, button_y, button_w, button_h);
          -
          -   // Move rectangle from (200, 200) to (300, 300)
          -   int rect_prev_x = rect_x;
          -   int rect_prev_y = rect_y;
          -   rectangle_x = 300;
          -   rectangle_y = 300;
          -   set_rect_position(rect_x, rect_y);
          -   
          -   // Issue the invalidate area (changed area) to be redrawn on the screen
          -   int diff_x = rect_x – rect_prev_x;
          -   int diff_y = rect_y – rect_prev_y;
          -   invalidate_area(rect_prev_x, rect_prev_y, (rect_w + diff_x), (rect_h + diff_y));
          -
          -
          -   // After setting the invalidate area, request rendering to update the screen
          -   render();
          -
          -   // Now you can see how the button image and rectangle position are changed
          -}
          -
          - -

          Retained Mode

          - -

          A graphics system adopting the retained mode is basically responsible for responding to all repaint requests for rendering the application objects. Clients do not directly cause actual rendering, but objects are redrawn when parts of them are updated.

          - -

          Figure: Retained mode

          -

          Retained mode

          - -

          Since Evas works with the retained mode, there is no need to command any drawings. The following example shows how to write a GUI code with Evas for your application:

          - -
          -void create_image()
          -{
          -   // Initialize an image object to be displayed on the screen
          -   Evas_Object *img = evas_object_image_add(e);
          -
          -   // Set image resource
          -   evas_object_image_file_set(img, IMG, NULL);
          -
          -   // Set image position 
          -   evas_object_move(img, 100, 100);
          -
          -   // Set image size
          -   evas_object_resize(img, 200, 200);
          -
          -   // Set image visibility (show or hide)
          -   evas_object_show(img);
          -}
          -
          -void create_rectangle()
          -{
          -   // Initialize an rectangle object to be displayed on the screen
          -   Evas_Object *rect = evas_object_rectangle_add(e);
          -
          -   // Set rectangle color
          -   evas_object_color_set(rect, 255, 0, 0, 255);
          -
          -   // Set rectangle position
          -   evas_object_move(rect, 200, 200);
          -
          -   // Set rectangle size
          -   evas_object_resize(rect, 200, 200);
          -
          -   // Set rectangle visibility (show or hide)
          -   evas_object_show(rect);
          -}
          -
          - -

          A few main loops later you can replace the image with another one and move the rectangle. You only need to set a new image file to the image object and move the rectangle object. Evas computes the invalidate area and redraws the image and rectangle behind the application when it's on rendering time.

          - -
          -void update()
          -{
          -   // Set new image resource
          -   elm_image_file_set(img, NEW_IMG, NULL);
          -
          -   // Set new rectangle position
          -   evas_object_move(rect, 300, 300);
          -}
          -
          - -

          Evas Rendering

          - -

          Tizen Native applications work on the ecore main loop, and the loop goes on a few steps for every frame. Evas redraws some changes in the objects when the main loop goes to the idle enterer step. If there are no changes, Evas rendering is skipped. Otherwise, Evas calculates any changed portions of all display objects and redraws them.

          - -

          Figure: Evas rendering in the main loop

          -

          Evas rendering in the main loop

          - -

          To minimize the rendering, Evas tracks the states of all display objects, such as position, size, visibility, and color. Even if some of these states are changed but the object is hidden by other obscured objects, it is not redrawn. In other words, Evas draws only the necessary changes in the screen.

          - -

          The following figures illustrate how Evas redraws the changed area:

          - -
          • In the first example, there is a blue-color background object (a sky-blue color rectangle) and a partially hidden cloud image object. Above them, there are a red and green rectangle, and the "Hello out there" text is printed on the green rectangle.

            - -

            Figure: Evas redrawing example 1

            -

            Evas redrawing example 1

          • - -
          • In the second example, some of the objects have moved (the cloud image is moved to right and the green rectangle is moved downwards).

            - -

            Figure: Evas redrawing example 2

            -

            Evas redrawing example 2

          • - -
          • As a result, the third example illustrates some regions that require updates.

            - -

            Figure: Evas redrawing example 3

            -

            Evas redrawing example 3

          • - -
          • Evas decides which portions are invalid and to be redrawn. The fourth example shows the cleaned portion of the screen, which is the redrawn area.

            -

            Evas redraws the content only in the redrawn portions.

            -

            Figure: Evas redrawing example 4

            -

            Evas redrawing example 4

          • - -
          • Finally, the fifth example shows how the screen is updated and the result is visible.

            - -

            Figure: Evas redrawing example 5

            -

            Evas redrawing example 5

            - -

            If Evas worked in an immediate mode style, the application would need to calculate the changed areas themselves, adding extra work. With Evas, you can let Evas figure out the updates and you can yourself concentrate on the application and UI core and logic.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/event_handling_n.htm b/org.tizen.ui.guides/html/native/efl/event_handling_n.htm deleted file mode 100755 index 03dc326..0000000 --- a/org.tizen.ui.guides/html/native/efl/event_handling_n.htm +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - Event Handling: Managing the Event Flow - - - - - -
          - -

          Event Handling: Managing the Event Flow

          - -

          The EFLs rely on events and callbacks. In case of an event, (for example, a key press, mouse click or a battery running low), the mainloop calls the callback functions that are associated to that specific event. After the callbacks have finished, the mainloop takes over and waits for new events, upon which to trigger new callbacks.

          -

          It is important to do light work in the callbacks and to return to the mainloop relatively quickly. If there is heavy work to do, it is best to use an asynchronous mechanism like Ecore_con for network I/O or threads for CPU-intensive tasks. Failure to return quickly to the mainloop blocks the application's UI and it appears frozen.

          - -

          EFL Event Types

          -

          There are several event types in the EFLs, and their use depends on the level of the event. The event types from lower- to higher-level are:

          -
            -
          • Evas smart events are the most often used and take place on collections of evas objects (which are most typically handled). They are called "smart" because they have internal logic and can define their own events while other event types are fixed.
          • -
          • Ecore events are the lowest-level events and come directly from the system. Except for application-wide shortcuts, it is not advisable to use them.
          • -
          • Evas object events concern the objects that are on the canvas.
          • -
          • Evas events are events on the graphical canvas as a whole. They are fairly low-level and mostly useful when drawing directly on the canvas.
          • -
          - -

          Figure: Event types in the EFLs: Inner boxes are more specific than outer ones

          -

          Event types in the EFLs: Inner boxes are more specific than outer ones

          - - - - - - - - - - - - -
          Note
          There are also Edje signals, which come from program sections in themes; they can be used from high-level Elementary APIs or a low-level Edje API.
          - -

          Basic Event Flow

          -

          A realistic scenario involving various types of events is an application showing a button, which triggers the download of a file to be processed. There are progress bars for the operations.

          -

          Create the window, create a box, set it vertical and add a button and two progress bars. At first, only the button is fully visible.

          -

          When the user clicks on the button, an evas smart object event named "clicked" is emitted. The callback then starts the download in Ecore_con, displays the first progress bar and adds a callback to monitor the download progress. When the download progress changes, the callback updates the progress bar.

          -

          After the download is finished, the second progress bar is displayed and the file processing is offloaded to another thread through Ecore_thread. The processing function regularly updates the progress bar (wrapped in ecore_main_loop_thread_safe_call_async() because GUI operations are not thread-safe).

          -

          Events enable operations taking more than a few milliseconds' time to be executed outside of the mainloop, therefore not blocking UI redraws.

          -

          Below is an illustration for the event flow that follows a click on the screen.

          - -

          Figure: Event flow for a user click

          -

          Event flow for a user click

          - - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/event_types_n.htm b/org.tizen.ui.guides/html/native/efl/event_types_n.htm deleted file mode 100755 index 31182d5..0000000 --- a/org.tizen.ui.guides/html/native/efl/event_types_n.htm +++ /dev/null @@ -1,461 +0,0 @@ - - - - - - - - - - - - - Event Types - - - - - -
          - -

          Event Types

          - -

          EFL provides various event types that you can use to monitor and react to user interactions and system events in the UI.

          - -

          Ecore Events

          - -

          Ecore events are used for low-level handling of events, such as key presses, network connections, and communication with sub-processes. In case of shortcuts, the low-level handling of key presses is particularly useful: instead of adding a signal handler to a specific graphical element, you can add one globally to guarantee that no matter which UI component is currently receiving events, the shortcut is caught correctly.

          -

          Ecore events can also be used to implement new graphical back-ends. However, they are low-level and not useful for most applications.

          - -

          In addition to using predefined Ecore events, you can create your own events with the ecore_event_type_new() function. The function generates a new unique identifier, which you can use as the event type parameter when managing your events and event handlers.

          - - -

          Shortcut Events

          - -

          The following Ecore events are available for shortcuts. The event callbacks receive additional data through a void * object, whose type depends on the received event.

          - -
            -
          • ECORE_EVENT_KEY_DOWN and ECORE_EVENT_KEY_UP events: -
            -typedef struct _Ecore_Event_Key Ecore_Event_Key;
            -
            -struct _Ecore_Event_Key 
            -{
            -   const char *keyname;
            -   const char *key;
            -   const char *string;
            -   const char *compose;
            -   Ecore_Window window;
            -   Ecore_Window root_window;
            -   Ecore_Window event_window;
            -
            -   unsigned int timestamp;
            -   unsigned int modifiers;
            -
            -   int same_screen;
            -};
            -
            - -
          • - -
          • ECORE_EVENT_MOUSE_BUTTON_DOWN and ECORE_EVENT_MOUSE_BUTTON_UP events: -
            typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button;
            -struct _Ecore_Event_Mouse_Button 
            -{
            -   Ecore_Window window;
            -   Ecore_Window root_window;
            -   Ecore_Window event_window;
            -
            -   unsigned int timestamp;
            -   unsigned int modifiers;
            -   unsigned int buttons;
            -   unsigned int double_click;
            -   unsigned int triple_click;
            -   int same_screen;
            -
            -   int x;
            -   int y;
            -   struct 
            -   {
            -      int x;
            -      int y;
            -   } root;
            -
            -   struct 
            -   {
            -      // 0 if normal mouse, 1+ for other mouse-devices (such as multi-touch - other fingers)
            -      int device; 
            -      // Radius of press point - radius_x and radius_y if it is an ellipse (radius is the average of the 2)
            -      double radius, radius_x, radius_y; 
            -      // Pressure - 1.0 == normal, > 1.0 == more, 0.0 == none
            -      double pressure; 
            -      // Angle relative to perpendicular (0.0 == perpendicular), in degrees
            -      double angle; 
            -      // Same as x, y, root.x, root.y, but with sub-pixel precision, if available
            -      double x, y; 
            -      struct 
            -      {
            -         double x;
            -         double y;
            -      } root;
            -   } multi;
            -};
            -
            - -
          • -
          • ECORE_EVENT_MOUSE_MOVE and ECORE_EVENT_MOUSE_WHEEL events: -
            -typedef struct _Ecore_Event_Mouse_Wheel Ecore_Event_Mouse_Wheel;
            -struct _Ecore_Event_Mouse_Wheel 
            -{
            -   Ecore_Window window;
            -   Ecore_Window root_window;
            -   Ecore_Window event_window;
            -
            -   unsigned int timestamp;
            -   unsigned int modifiers;
            -
            -   int same_screen;
            -   int direction;
            -   int z;
            -
            -   int x;
            -   int y;
            -   struct 
            -   {
            -      int x;
            -      int y;
            -   } root;
            -};
            -
            -
          • -
          • ECORE_EVENT_MOUSE_IN and ECORE_EVENT_MOUSE_OUT events: -
            -typedef struct _Ecore_Event_Mouse_Move Ecore_Event_Mouse_Move;
            -struct _Ecore_Event_Mouse_Move 
            -{
            -   Ecore_Window window;
            -   Ecore_Window root_window;
            -   Ecore_Window event_window;
            -
            -   unsigned int timestamp;
            -   unsigned int modifiers;
            -
            -   int same_screen;
            -
            -   int x;
            -   int y;
            -   struct 
            -   {
            -      int x;
            -      int y;
            -   } root;
            -
            -   struct 
            -   {
            -      // 0 if normal mouse, 1+ for other mouse-devices (such as multi-touch - other fingers)
            -      int device; 
            -      // Radius of press point - radius_x and radius_y if it is an ellipse (radius is the average of the 2)
            -      double radius, radius_x, radius_y; 
            -      // Pressure - 1.0 == normal, > 1.0 == more, 0.0 == none
            -      double pressure; 
            -      // Angle relative to perpendicular (0.0 == perpendicular), in degrees
            -      double angle; 
            -      // Same as x, y, root.x, root.y, but with sub-pixel precision, if available
            -      double x, y; 
            -      struct 
            -      {
            -         double x, y;
            -      } root;
            -   } multi;
            -};
            -
            - -
          • -
          -

          Managing Ecore Event Handlers

          - -

          To manage Ecore event handlers:

          - -
          1. To add an Ecore event handler, register a callback for a specific event with the ecore_event_handler_add() function. -

            The function takes as parameters the event type (such as ECORE_EVENT_KEY_DOWN for key presses), callback function, and additional data delivered to the callback. The function returns an event handler pointer, which you can use to remove the handler later.

          2. - -
          3. Define the Ecore_Event_Handler_Cb() callback function. -

            The function takes as parameters the additional data defined in the ecore_event_handler_add() function parameters, the event type, and the event object (Ecore_Event_Key, Ecore_Event_Mouse_Button, Ecore_Event_Mouse_Wheel, or Ecore_Event_Mouse_Move). The function returns ECORE_CALLBACK_PASS_ON to allow other callbacks for that event be called, or ECORE_CALLBACK_DONE to not call them.

          4. - -
          5. When no longer needed, remove the event handler with the ecore_event_handler_del() function, using the event handler pointer as a parameter.
          - -

          The following example shows how you can set a global variable to EINA_TRUE when the Ctrl key is pressed:

          -
          -Eina_Bool ctrl_pressed = EINA_FALSE;
          -
          -static Eina_Bool
          -_key_down_cb(void *data __UNUSED__, int type __UNUSED__, void *ev)
          -{
          -   // The callback is used with the ECORE_EVENT_KEY_DOWN signal: the
          -   // parameter "void *ev" is therefore of the actual type Ecore_Event_Key
          -   // The following renders its fields accessible
          -   Ecore_Event_Key *event = ev;
          -
          -   // Test whether the key that is pressed is Ctrl.
          -   if (!strcmp("Control_L", event->key))
          -   {
          -      // If it is, store that piece of information
          -      ctrl_pressed = EINA_TRUE;
          -   }
          -
          -   // Let the event continue to other callbacks which have not been called yet
          -   return ECORE_CALLBACK_PASS_ON;
          -}
          -
          -ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, NULL);
          -
          - -

          Sending Ecore Events to the Main Loop

          - -

          You can send Ecore events to the main loop yourself to handle actions of various origins through the same codepath. This is a thread-safe operation.

          -

          To send an event, use the ecore_event_add() function. The function takes as parameters the event type (such as ECORE_EVENT_KEY_DOWN for key presses), additional data delivered to the callback, the Ecore_End_Cb() function used to free the additional data after it is deliver to the callback function, and the pointer to additional data delivered to the free function. The free function and the pointer to its additional data are optional; use NULL if you do not need them.

          - - -

          Edje Events

          - -

          Edje themes have small program sections, which are triggered upon the reception of a signal that can execute actions, such as changing the state of an Edje part and running another program.

          - -

          Managing a Single Signal Emitter

          -

          The following example shoes a program section. The program is called "change_color", it is triggered on mouse clicks on the current part, and it emits a "got.a.click" signal where the source is set to "color_changer".

          -
          program 
          -{
          -   name: "change_color";
          -   signal: "mouse,clicked,*";
          -   source: "*";
          -   action: SIGNAL_EMIT "got.a.click" "color_changer";
          -}
          -
          - -

          To catch the emitted signal from the C side, use either the edje_object_signal_callback_add() or elm_object_signal_callback_add() function. Their only difference is that the previous one operates on an Edje object and the latter one on an Elementary object. Unless you do not use the Elementary library at all, use the Elementary variant.

          - -

          Both the functions take as parameters the object emitting the signal, the signal name ("*" acts as a wildcard), the signal source, the Edje_Signal_Cb() callback function called when the signal name and source match, and additional data delivered to the callback. For the signal name and source, "*" acts as a wildcard. The additional data is optional; use NULL if you do not need it.

          - -

          The callback function takes as parameters the additional data defined in the edje_object_signal_callback_add() or elm_object_signal_callback_add() function parameters, the object emitting the signal, the signal name, and the signal source.

          - - -

          Managing Multiple Signal Emitters in Layouts

          - -

          Most of the time, Edje and Elementary are used together. In particular, you can define a group in Edje and use it as a layout (containing several parts) in Elementary. The layouts enable you to perform theming and object placement in Edje while benefiting from the higher-level functions of Elementary.

          -

          Since the layout contains multiple parts, you cannot use the elm_object_signal_callback_add() and edje_object_signal_callback_add() functions, as they require a single emitter object. The solution is to use the dedicated elm_layout_signal_callback_add() function.

          - -

          The elm_layout_signal_callback_add() function works similarly as the elm_object_signal_callback_add() and edje_object_signal_callback_add() functions. The only difference is the type of the object in the first parameter. For elm_layout_signal_callback_add(), it is a pointer to an Evas_Object, which is obtained through the elm_layout_add() function. For more information, see Layout.

          - - -

          Evas Events

          - -

          Evas events happen on a canvas as a whole. These events are too low-level for writing applications and are mostly used when writing the graphical toolkit itself.

          - -

          The following Evas event types are available:

          - -
            -
          • EVAS_CALLBACK_RENDER_FLUSH_PRE: Rendering on the canvas is about to be updated.
          • -
          • EVAS_CALLBACK_RENDER_FLUSH_POST: Rendering on the canvas is updated.
          • -
          • EVAS_CALLBACK_CANVAS_FOCUS_IN: Canvas receives focus.
          • -
          • EVAS_CALLBACK_CANVAS_FOCUS_OUT: Canvas loses focus.
          • -
          • EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN: Any object on the canvas receives focus. -

            Instead of this event type, use the EVAS_CALLBACK_FOCUS_IN type with the evas_object_event_callback_add() function.

          • -
          • EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT: Any object on the canvas loses focus. -

            Instead of this event type, use the EVAS_CALLBACK_FOCUS_OUT type with the evas_object_event_callback_add() function.

          • -
          • EVAS_CALLBACK_RENDER_PRE: Rendering on the canvas starts.
          • -
          • EVAS_CALLBACK_RENDER_POST: Rendering on the canvas finishes.
          • -
          - -

          To register the event handler, use the evas_event_callback_add() function. The function takes as parameters the Evas canvas on which the event happens (to obtain the canvas, use the Evas_Object through the evas_object_evas_get() function), the event type, the Evas_Event_Cb callback function, and the pointer to the additional data delivered to the callback. The additional data is optional; use NULL if you do not need it.

          - -

          The callback function takes as parameters the additional data defined in the evas_event_callback_add() function parameters, the canvas where the event happened, and the event info data, which depends on the object type and the event at play.

          - - -

          Evas Object Events

          - -

          Each Evas object on a specific Evas canvas can be manipulated independently. Each object can send events, which you can handle by registering callback functions for them. The events all relate to single objects, not the whole canvas.

          - -

          The following Evas object event types are available:

          -
            -
          • EVAS_CALLBACK_MOUSE_IN: Pointer got over an object (with no other object between the 2). This takes place no matter how the pointer becomes directly above the object. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_In struct.
          • -
          • EVAS_CALLBACK_MOUSE_OUT: Triggered similarly to the EVAS_CALLBACK_MOUSE_IN event, but when the pointer goes outside the object area. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Out struct.
          • -
          • EVAS_CALLBACK_MOUSE_DOWN: Mouse button is pressed while the object is receiving events (either because the pointer is on top of the object or because the object had focus). The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Down struct.
          • -
          • EVAS_CALLBACK_MOUSE_UP: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Up struct.
          • -
          • EVAS_CALLBACK_MOUSE_MOVE: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Move struct.
          • -
          • EVAS_CALLBACK_MOUSE_WHEEL: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Wheel struct.
          • -
          • EVAS_CALLBACK_MULTI_DOWN: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Multi_Down struct.
          • -
          • EVAS_CALLBACK_MULTI_UP: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Multi_Up struct.
          • -
          • EVAS_CALLBACK_MULTI_MOVE: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Multi_Move struct.
          • -
          • EVAS_CALLBACK_KEY_DOWN: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Key_Down struct.
          • -
          • EVAS_CALLBACK_KEY_UP: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Key_Up struct.
          • -
          • EVAS_CALLBACK_FOCUS_IN: Object gained focus. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_In struct.
          • -
          • EVAS_CALLBACK_FOCUS_OUT: Object lost focus. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_In struct.
          • -
          • EVAS_CALLBACK_SHOW: Object is shown by a call to the evas_object_show() function. The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_HIDE: Object is hidden by a call to the evas_object_hide() function. The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_MOVE: Object origin was moved (origin is the top-left corner at the creation time of the object). The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_RESIZE: Object is resized. The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_RESTACK: Object is re-stacked by the evas_object_stack_below() or evas_object_stack_above() function, or other events. The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_DEL: Object is deleted.
          • -
          • EVAS_CALLBACK_FREE: For internal use only. Do not use (the object resources are about to be freed). The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_HOLD: For internal use only. The event info parameter in the callback is a pointer to an Evas_Event_Hold struct.
          • -
          • EVAS_CALLBACK_CHANGED_SIZE_HINTS: Object size hints changed.
          • -
          • EVAS_CALLBACK_IMAGE_PRELOADED: Image preloaded through the evas_object_image_preload() function is loaded. The event info parameter in the callback is NULL.
          • -
          • EVAS_CALLBACK_IMAGE_UNLOADED: Image data is unloaded. The event info parameter in the callback is NULL.
          • -
          - -

          To register the callback, use the evas_event_callback_add() function. The function takes as parameters the object to which the callback is attached, the event type, the Evas_Object_Event_Cb callback function, and the pointer to the additional data delivered to the callback. The additional data is optional; use NULL if you do not need it.

          - -

          The callback function takes as parameters the additional data defined in the evas_event_callback_add() function parameters, the canvas where the event happened, the object to which the event happened, and the event info data, which depends on the object type and the event at play.

          - -

          When no longer needed, remove the callback with the evas_object_event_callback_del() function.

          - - -

          Evas Smart Object Events

          - -

          Evas smart object events are the most widely-used type of events in graphical applications, since they are used for signals, such as "clicked", "clicked,double" (double-click), and "pressed". They are identified by strings, and each smart object is able to define its own events (although the names follow conventions).

          - -

          Managing Evas Smart Object Event Handlers

          - -
          1. To add an Evas Smart Object event handler, register a callback for a specific event to an object with the evas_object_smart_callback_add() function. -

            The function takes as parameters the object to which the callback is added, the event name, the callback function, and additional data delivered to the callback. The additional data is optional; use NULL if you do not need it.

          2. - -
          3. Define the Evas_Smart_Cb() callback function. -

            The function takes as parameters the additional data defined in the evas_object_smart_callback_add() function parameters, the object to which the event happened, and the event info data, which depends on the object type and the event at play.

            -

            If some of the parameters are not used by the callback function, the compiler can raise the "unused parameter" warning. To avoid it, annotate the parameter with the __UNUSED__ macro, which is a compiler-independent way to let the compiler know that the parameter is unused willingly, rather than by a mistake:

            -
            void cb(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
            -
          4. - -
          5. When no longer needed, remove the event handler with the evas_object_smart_callback_del() function. -

            The function removes the first match for the given event and callback, and returns the data pointer that was used in the corresponding call to the evas_object_smart_callback_add() function.

          - -

          The following example shows the _button_clicked() function and sets it as the callback for the clicked event of an Evas_Object button:

          - -
          -static void
          -_button_clicked(void *data, Evas_Object *obj, void *event_info)
          -{
          -   // Insert function body here
          -}
          -
          -static void
          -some_function(void) 
          -{
          -   // Code to build the window object
          -   Evas_Object *button = elm_button_add(window);
          -   evas_object_smart_callback_add(button, "clicked", _button_clicked, NULL);
          -}
          -
          - -

          For a specific object and event, callbacks are called in the order they have been registered. The evas_object_smart_callback_add() function does not execute any special processing, if it is called several times with the same callback function or data. Callbacks are called as many times as they have been added and in the order they have been added.

          - - - -

          Evas Smart Object Event Handling Examples

          - -

          The following example shows a button with a callback for the "clicked" signal:

          - -
          static void
          -_button_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
          -{
          -   fprintf(stdout, "Button clicked.\n");
          -   fflush(stdout);
          -   elm_exit();
          -}
          -
          -static void
          -_add_button(Evas_Object *window) 
          -{
          -   Evas_Object *button;
          -
          -   button = elm_button_add(window);
          -   elm_object_text_set(button, "Click Me To Exit!");
          -   evas_object_smart_callback_add(button, "clicked", _button_clicked, NULL);
          -
          -   evas_object_show(button);
          -}
          -
          - -

          The following example shows a button with a callback for the "clicked" signal. Clicking the button removes the callback:

          - -
          static void
          -_button_clicked(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
          -{
          -   fprintf(stdout, "Button clicked.\n");
          -   fflush(stdout);
          -   evas_object_smart_callback_del(obj, "clicked", _button_clicked);
          -}
          -
          -static void
          -_add_button(Evas_Object *window) 
          -{
          -   Evas_Object *button;
          -
          -   button = elm_button_add(window);
          -   elm_object_text_set(button, "Click Me!");
          -   evas_object_smart_callback_add(button, "clicked", _button_clicked, NULL);
          -
          -   evas_object_show(button);
          -}
          -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/font_setting_n.htm b/org.tizen.ui.guides/html/native/efl/font_setting_n.htm deleted file mode 100755 index d78572f..0000000 --- a/org.tizen.ui.guides/html/native/efl/font_setting_n.htm +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - - - - - - - - Fonts: Setting Application Text Fonts - - - - - -
          - -

          Fonts: Setting Application Text Fonts

          - - -

          Tizen provides various methods for setting fonts of the application text. Basically, all UI components have a default font, which can be changed according to the system settings.

          - -

          The font handling methods include:

          - -
            -
          • Setting the font for a UI component using the Elementary Fonts API (in mobile and wearable applications)
          • -
          • Setting the font using EDC
          • -
          • Changing the font and text size using the Edje Class: Text API (in mobile and wearable applications) - -

            In the application, you can set a system-wide font and font size to text(textblock) parts with text classes (except tizen). When the system applies a new system-wide font and font size to the application, the font size of text(textblock) parts with the tizen text class are not affected.

            -

            The following words in the text_class definition are reserved for the system:

            - -
              -
            • button
            • -
            • label
            • -
            • entry
            • -
            • title_bar
            • -
            • list_item
            • -
            • grid_item
            • -
            • toolbar_item
            • -
            • menu_item
            • -
            • tizen
            • -
            - - -

            Set a specific ratio to a given font size for each object through the text class. If you give a negative value as font size, it is used as the percentage of the originally given font size. The following example code show set the font size as 150% of the given font size.

            -
            -elm_config_font_overlay_set("my_class", "TizenSans:style=Bold", -150);
            -elm_config_font_overlay_apply();
            -
            -
          • -
          - - -

          You can also set your own font.

          - -

          Applying System Font Settings

          - -

          Tizen provides a special "Tizen" font name. The "Tizen" font name does not match with any specific font; it is just an alias for a system-defined font (system font). When you create a text(textblock) part with the "Tizen" font name in the application's EDC, the system font is loaded into the user application when those objects are created. Additionally, you can apply the system font to a text or textblock part by using the text class, as described above.

          - -

          The following EDC example shows how to apply the system font to a TEXT or TEXTBLOCK part by using the "Tizen" font name and the tizen text class. As font name is "Tizen" and the font size is set to 36, the system font is loaded in size 36. If the system setting changes, this part loads the new system font. However, its font size is not changed, because the text class is tizen.

          - -
          -description 
          -{
          -   text 
          -   {
          -      font: "Tizen:style=Regular";
          -      font_size: 36;
          -      text_class: "tizen";
          -   }
          -}
          - -

          If the part has a predefined text classes other than tizen, its font size is resized as well.

          - -
          -description 
          -{
          -   text 
          -   {
          -      font: "Tizen:style=Regular";
          -      font_size: 36;
          -      text_class: "label";
          -   }
          -}
          - - -

          Supported Font Styles

          -

          The font styles supported by the EFL are listed in the following table.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Supported font styles
          Font featureStyle attribute
          font_stylenormal
          oblique
          italic
          font_widthnormal
          ultracondensed
          extracondensed
          condensed
          semicondensed
          semiexpanded
          expanded
          extraexpanded
          ultraexpanded
          font_weightnormal
          thin
          ultralight
          light
          book
          medium
          semibold
          bold
          ultrabold
          black
          extrablack
          - -

          The style attributes are not case-sensitive (however, the font feature names are).

          -

          If you set the weight or width attribute to style=, it is processed to the right attribute.

          -
          -font=TizenSans:style=Bold // Textblock
          -"TizenSans:style=Bold"; // Text font
          -<font=TizenSans:style=Bold> // Markup tag
          -
          - -

          You can also use each attribute separately:

          - -
          -font=TizenSans font_style=Regular font_weight=Bold // Textblock
          -<font=TizenSans font_style=Regular font_weight=Bold> // Markup tag
          -
          - - -

          Setting the Font for a UI Component

          - -

          You can use the Elementary Fonts API (in mobile and wearable applications) to set the font for an application.

          -

          To set a font for a UI component:

          -
            -
          • Set the font for a common UI component: - - - - - - - - - - -
            Note
            You can set the font for a textblock in the code, but not in EDC (Edje Data Collection). If you add markup tags for the font inside the text, you can change the font of the text. However, you cannot set the font for a text part in this way because the TEXT type does not support markup tags.
            - -
            -char *buf = "<font=Sans:style=Regular font_size=50>Hello</font/>Font";
            -elm_object_part_text_set(layout, "textblock1", buf);
            -
            -
          • -
          • Set the font for an entry component (in mobile and wearable applications) using the elm_entry_text_style_user_push() function. It overrides the default style of the entry component for each attribute. - - - - - - - - - - -
            Note
            The elm_entry_text_style_user_push() function only affects the main text of the UI component. To change the font of the guide text, you have to add markup tags.
            -
            -char *user_style = "DEFAULT='font=Sans:style=Regular font_size=40'";
            -elm_entry_text_style_user_push(entry, user_style);
            -elm_object_part_text_set(entry, "elm.guide",
            -   "<font=Sans:style=Regular font_size=40>Guide Text</font>");
            -
            -
          • -
          - -

          Setting the Font Using EDC

          - -

          To create a layout with text using the EDC, you can set the font for each text part or textblock:

          -
            -
          • Set the font of a text part using the font family name and a specific style of the font family: -
            -part 
            -{ 
            -   name: "text";
            -   type: TEXT;
            -   scale: 1;
            -   description 
            -   { 
            -      state: "default" 0.0;
            -      rel1.relative: 0.0 0.5;
            -      rel2.relative: 0.5 1.0;
            -      color: 0 136 170 255;
            -      color2: 0 136 170 50;
            -      color3: 0 136 170 25;
            -      text 
            -      {
            -         size: 25;
            -         font: "Sans:style=Bold";
            -         text: "Enventor";
            -         align: 0.5 0.5;
            -      }
            -   }
            -}
            -
            -
          • - -
          • Add style information, which can be used for multiple textblock parts: -
            -styles 
            -{
            -   style 
            -   { 
            -      name: "textblock_style1";
            -      base: "font=Sans:style=Regular font_size=30";
            -   }
            -}
            -
            -part 
            -{ 
            -   name: "textblock";
            -   type: TEXTBLOCK;
            -   scale: 1;
            -   description 
            -   { 
            -      state: "default" 0.0;
            -      align: 0.5 0.5;
            -      fixed: 0 0;
            -      min: 0 0;
            -      visible: 1;
            -      text.text: "TEXTBLOCK";
            -      text.style: "textblock_style1";
            -      rel1.relative: 0.16 0.18;
            -      rel2.relative: 0.88 0.38;
            -   }
            -}
            -
            -
          • -
          - -

          Using the Edje Text Class

          - -

          You can use the Edje Class: Text API (in mobile and wearable applications) to change multiple text occurrences as a batch. If you set a new font or font size to a text class, the change is applied to multiple objects.

          - - - - - - - - - - -
          Note
          Note that the text_class cannot be used in a UI component with markup text or the elm_entry_text_style_user_push() function. You must set the text_class in EDC.
          - - -

          To set the text class, you can use reserved words for text class, but you can also make your own text class:

          - -
            -
          • Set a class for a text part: - -
            -part 
            -{ 
            -   name: "text";
            -   type: TEXT;
            -   scale: 1;
            -   description 
            -   { 
            -      state: "default" 0.0;
            -      rel1.relative: 0.0 0.5;
            -      rel2.relative: 0.5 1.0;
            -      color: 0 136 170 255;
            -      color2: 0 136 170 50;
            -      color3: 0 136 170 25;
            -      text 
            -      {
            -         size: 25;
            -         font: "Sans:style=Bold";
            -         text: "Enventor";
            -         align: 0.5 0.5;
            -         text_class: "my_class";
            -      }
            -   }
            -}
            -
            -
          • -
          • Set a class for a textblock: -
            -styles 
            -{
            -   style 
            -   { 
            -      name: "textblock_style1";
            -      base: "font=Sans:style=Regular font_size=30 ... text_class=my_class";
            -   }
            -}
            -
            -part 
            -{ 
            -   name: "textblock";
            -   type: TEXTBLOCK;
            -   scale: 1;
            -   description 
            -   { 
            -      state: "default" 0.0;
            -      align: 0.5 0.5;
            -      fixed: 0 0;
            -      min: 0 0;
            -      visible: 1;
            -      text.text: "TEXTBLOCK";
            -      text.style: "textblock_style1";
            -      rel1.relative: 0.16 0.18;
            -      rel2.relative: 0.88 0.38;
            -   }
            -}
            -
            -
          • -
          • -

            You can handle font and font style per text_class. If you set your own text_class in the EDC, you can change the font and font size:

            - -
            -elm_config_font_overlay_set("my_class", "TizenSans:style=Bold", 30);
            -elm_config_font_overlay_apply();
            -
            -
          • -
          • -

            Set a specific ratio to a given font size for each object through the text class. If you give a negative value as font size, it is used as the percentage of the originally given font size. The following example code show set the font size as 150% of the given font size.

            -
            -elm_config_font_overlay_set("my_class", "TizenSans:style=Bold", -150);
            -elm_config_font_overlay_apply();
            -
            -
          • -
          - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/form_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/form_tutorial_n.htm deleted file mode 100755 index f4487a5..0000000 --- a/org.tizen.ui.guides/html/native/efl/form_tutorial_n.htm +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - Creating a Form for a Basic Application Layout - - - - - - -
          -

          Creating a Form for a Basic Application Layout

          - - -

          This tutorial explains how to create a basic application for displaying a list of contacts, and a form for displaying and editing contact information when an item is selected on the contact list.

          - -

          Creating the Basic Application

          - -

          To create an elementary application with a single window, use the following code.

          -
          static bool
          -app_create(void *data)
          -{
          -   appdata_s *ad = data;
          -   create_gui(ad);
          -   return true;
          -}
          -
          -int
          -main(int argc, char **argv)
          -{
          -   appdata_s ad = { 0 };
          -   ui_app_lifecycle_callback_s event_callback = { 0 };
          -
          -   event_callback.create = app_create;
          -
          -   // Zero out the structure
          -   memset(&ad, 0x0, sizeof(struct appdata));
          -
          -   // Run the mainloop
          -   return ui_app_main(&argc, &argv, &event_callback, &ad);
          -}
          -
          - - - -

          Use a naviframe in this application to switch between different views. The first view that is displayed is the list of contacts. When a user selects an item on this list, information on the contact is displayed in a form. Both the view list and the form are opened in a naviframe, which handles the animations between the views for you. It also manages creating a back button in the top bar and launching the back animation when you select it, deletes the form view, and shows the list of contacts again.

          - -

          Naviframe

          -

          The naviframe is the main layout of the window, so it takes all the space available. To configure this, use the elm_win_resize_object_add function. The first parameter is the main window, the second is the naviframe object. The naviframe is to be resized along with the window. The object (the naviframe) fills its parent (the main window) by calling the evas_object_resize_hint_weight_set function on the naviframe object. The naviframe object expands in both x and y directions. In the end, evas shows the naviframe object on the screen.

          -
           // Create the naviframe
          -nav = elm_naviframe_add(win);
          -evas_object_size_hint_weight_set(nav, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(win, nav);
          -evas_object_show(nav);
          -
          - -

          Contact List

          -

          Handle the contact list with the _create_contact_list function. This function takes the parent object as the parameter (in this case the naviframe) and returns the genlist. To create the genlist, use the following code.

          -
          static Evas_Object *
          -_create_contact_list(Evas_Object *parent)
          -{
          -   Evas_Object *list;
          -   int i;
          -
          -   // Create a new genlist
          -   list = elm_genlist_add(parent);
          -   evas_object_show(list);
          -
          -   // Create a new item class for the genlist
          -   itc = elm_genlist_item_class_new();
          -   itc->item_style = "default";
          -   // Set the callback used when the genlist text is created
          -   itc->func.text_get = _genlist_text_get;
          -   // Set the callback be used when the content of the item is created
          -   itc->func.content_get   = _genlist_content_get;
          -   itc->func.state_get = NULL;
          -   itc->func.del = NULL;
          -}
          -
          - -

          itc is a static variable containing the item class. The item class contains all functions that are called back when an item is created. In this case, create the callbacks _genlist_text_get (for labels) and _genlist_content_get (for icons). These functions are called when labels and icons of the genlist item are created.

          -

          The list of contacts is contained in an array of Contacts.

          -
          typedef struct _Contact Contact;
          -
          -struct _Contact
          -{
          -   const char *name;
          -   const char *mobile;
          -   const char *address;
          -   const char *email;
          -   const char *icon;
          -};
          -
          -static Contact contacts[] = 
          -{
          -   {"Alexander Holmes", "+1234567896", "", "alexander_holmes@tizen.org", "c1.png"},
          -   {"Lara Alvaréz",    "+9876543216", "", "lara_alvares@tizen.org", "c2.png"   },
          -   {"Aksel Møller",    "+1679432846", "", "aksel_moller@tizen.org", "c3.png"   },
          -   {"Anir Amghar",      "+1679432846", "", "anir_amghar@tizen.org", "c4.png"    },
          -   {"Noémie Cordier",    "+1679432846", "", "noemie_cordier@tizen.org", "c5.png"   },
          -   {"Henry Thompson",    "+1679432846", "", "henry_thompson@tizen.org", "c6.png"   },
          -   {"Mai Phan",       "+1679432846", "", "mai_phan@tizen.org", "c7.png"      },
          -};
          -
          - -

          Create a genlist item for each item of the array with the following code.

          -
          -// Create a genlist item for each item in the contacts array
          -for (i = 0; i < EINA_C_ARRAY_LENGTH(contacts); i++)
          -{
          -   // Append the item, add a callback when the item is selected, and use the
          -   // current contact item as data pointer for the callbacks
          -   elm_genlist_item_append(list, itc,
          -                     &contacts[i],
          -                  NULL,
          -                     ELM_GENLIST_ITEM_NONE,
          -                     _contact_selected_cb,
          -                     &contacts[i]);
          -}
          -
          - -

          Attach the _contact_selected_cb callback function to the genlist item. When an item is selected in the list, the data pointer passed as the argument calls this function. Here it is a pointer on the contact. Pass the contact in the array to all the Item Class callbacks.

          -

          Push the list at the top of the naviframe with the following code.

          -
          -// Create the list of contacts
          -list = _create_contact_list(win);
          -
          -// Push the list on top of the naviframe
          -elm_naviframe_item_push(nav, NULL, NULL, NULL, list, NULL);
          -
          - -

          The Item class functions are called, the _genlist_text_get first.

          -
          -static char *
          -_genlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
          -{
          -   Contact *contact = data;
          -
          -   // Return a new allocated string for the contact name
          -   return strdup(contact->name);
          -}
          -
          - -

          These functions show the index of the contact in the array and return a freshly allocated string with the name of the contact.

          -

          When the user selects an item in the list, a callback registers on the select signal and calls the corresponding function; in this case, _contact_selected_cb(). The user retrieves the index of the array passed in the data and creates the form on contact information based on this index.

          -

          The _genlist_content_get function is called several times depending on the style of the created item. In this case, with the default style for the genlist item, there are two different swallow parts. A swallow part is a container in the edje file of the genlist item, which may contain an evas object. The following figure shows the layout of different parts in the theme.

          - - -

          Figure: Genlist item

          -

          Genlist item

          - - -

          There are two elm.swallow parts. When the callback function for the creation of icons is called, the part name is passed via the part variable. Compare this variable to elm.swallow.icon for the first object and to elm.swallow.end for the icon at the end.

          - -

          Icon

          -

          Create the icon when the callback is recognized. In this example, we use an elm_icon object.

          -
          -static Evas_Object *
          -_genlist_content_get(void *data, Evas_Object *obj, const char *part)
          -{
          -   Contact *contact = data;
          -
          -   // Test which part is being created
          -   if (!strcmp(part, "elm.swallow.icon"))
          -   {
          -         char filename[PATH_MAX];
          -      // Create a new icon
          -      Evas_Object *ic = elm_icon_add(obj);
          -      // Set the filename of the file which is to be loaded
          -      snprintf(filename, sizeof(filename), "%s%s", ICON_PATH, contact->icon);
          -      elm_image_file_set(ic, filename, NULL);
          -      // Keep the ratio squared
          -      evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
          -
          -      // Return the icon
          -      return ic;
          -   }
          -
          -   return NULL;
          -}
          -
          - -

          Note that in case of elm.swallow.end the return is NULL, and no icon is added.

          -

          The user may question the complexity of creating a genlist, and the benefits of callbacks for the creation of items. In a genlist with thousands of elements, graphical items are not created. Only the ones currently displayed on the screen are created with the callbacks in the Genlist Item Class. Otherwise, objects are created by calling the respective callback function when the user scrolls the list.

          - - - - - - - - - - -
          Note
          When the genlist is first created, the Elementary needs to know the height of the list. All elements in the list are not necessarily the same size due to different kind of styles. Thus, the Elementary creates all elements once to know the size, and displays the scroll bars correctly. If all your items have the same height, use the elm_genlist_homogeneous_set to impose the same height to all items. The Elementary does not create the complete list as the global size is a multiple of the height of the first item. It saves you cpu time.
          - -

          Contact Form

          -

          The contact list is created inside the _create_contact_form function. This function takes a parent Evas_Object and a contact item as parameters, and returns an Evas_Object. The parent is the naviframe object, and the contact item contains the information on the contact.

          -

          To display the various information about the contact, we use boxes in this example.

          - -

          Figure: Form contact layout

          -

          Form contact layout

          - - -

          The first box is an vertical box.

          -
          vbox = elm_box_add(parent);
          -elm_box_align_set(vbox, 0, 0);
          -evas_object_show(vbox);
          -
          - -

          elm_box_align_set keeps the box element aligned to the top left corner.

          -

          To add an icon, use the _genlist_content_get function to create the icon in the genlist item. For a bigger icon, set the minimum size of the icon object to 96x96 px.

          -

          The most important function in this case is elm_box_pack_end. It adds the icon object at the end of the vbox. As the icon is the first object added, it is displayed on top of the box.

          -
          -ic = elm_icon_add(vbox);
          -snprintf(filename, sizeof(filename), "%s%s", ICON_PATH, contact->icon);
          -elm_image_file_set(ic, filename, NULL);
          -evas_object_size_hint_min_set(ic, 96, 96);
          -evas_object_show(ic);
          -elm_box_pack_end(vbox, ic);
          -
          - -

          In the following example, add the information on the contact: the name, the mobile phone number, the postal address and the e-mail address. For each information item, create a label and an edit line. The label contains the kind of the information, and the edit box, the information itself. To set the UI components in a horizontal layout, use a horizontal box.

          -
          -hbox = elm_box_add(vbox);
          -elm_box_horizontal_set(hbox, EINA_TRUE);
          -elm_box_padding_set(hbox, 32, 32);
          -evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0);
          -evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, 0);
          -evas_object_show(hbox);
          -
          - -

          Change the orientation of the box with elm_box_horizontal_set. To get space between the elements of the vbox, set the padding to 32px. To set the item of the box not to expand vertically, use evas_object_size_hint_weight_set.

          -

          Create the label object, which is an elm_label. Set its text, and do not align or expand it.

          -
          -label = elm_label_add(hbox);
          -elm_object_text_set(label, form_items[i]);
          -evas_object_size_hint_weight_set(label, 0, 0);
          -evas_object_size_hint_align_set(label, 0, 0);
          -evas_object_show(label);
          -
          - -

          Create the edit line, which is an elm_entry.

          -
          -edit = elm_entry_add(hbox);
          -evas_object_size_hint_weight_set(edit, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(edit, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(edit);
          -
          - -

          Add the label and the edit inside the horizontal box and add the horizontal box to the vertical box.

          -
          -elm_box_pack_end(hbox, label);
          -elm_box_pack_end(hbox, edit);
          -
          -elm_box_pack_end(vbox, hbox);
          -
          - -

          Figure: Form tutorial: form

          -

          Form tutorial: form

          - -

          Figure: Form tutorial: list

          -

          Form tutorial: list

          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/genlist_tutorial_mn.htm b/org.tizen.ui.guides/html/native/efl/genlist_tutorial_mn.htm deleted file mode 100755 index 7e89479..0000000 --- a/org.tizen.ui.guides/html/native/efl/genlist_tutorial_mn.htm +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - - - - - - - - - Creating Mobile Genlists - - - - - - -
          -

          Creating Mobile Genlists

          - - -

          This tutorial deals with genlists, a list component for large sets of elements. It uses callbacks to populate entries. The same UI component handles both flat lists and trees.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - - -

          Initializing the Application

          - -

          Figure: Example of a genlist

          -

          Example of a genlist

          -

          The code below shows a typical elementary application that creates a window entitled "Genlist Basic Tutorial". It is consisted of a conformant component that contains a naviframe component. The genlist goes inside the naviframe.

          -
          static bool
          -_app_create(void *data)
          -{
          -   appdata_s *app = data;
          -
          -   app->win = elm_win_util_standard_add("main", "Genlist Basic Tutorial");
          -   elm_win_conformant_set(app->win, EINA_TRUE);
          -   evas_object_show(app->win);
          -   evas_object_resize(app->win, 480, 800);
          -   elm_win_autodel_set(app->win, EINA_TRUE);
          -
          -   app->conformant = elm_conformant_add(app->win);
          -   evas_object_size_hint_weight_set(app->conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(app->win, app->conformant);
          -   evas_object_show(app->conformant);
          -
          -   app->naviframe = elm_naviframe_add(app->win);
          -   evas_object_size_hint_weight_set(app->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(app->win, app->naviframe);
          -   evas_object_show(app->naviframe);
          -   elm_object_content_set(app->conformant, app->naviframe);
          -
          -   _create_list(app);
          -   elm_naviframe_item_push(app->naviframe, NULL, NULL, NULL, app->list, NULL);
          -
          -   return true;
          -}
          -
          -int
          -main(int argc, char **argv)
          -{
          -   // Declare a few structures and zero-initialize (C99 feature)
          -   struct app_data app = { 0 };
          -   ui_app_lifecycle_callback_s event_callback = { 0 };
          -
          -   event_callback.create = _app_create;
          -
          -   // Run the mainloop
          -   return ui_app_main(&argc, &argv, &event_callback, &ad);
          -}
          -
          -

          The declaration of the struct app_data is shown below:

          -
          struct app_data
          -{
          -   Evas_Object *win;
          -   Evas_Object *naviframe;
          -   Evas_Object *conformant;
          -   Evas_Object *list;
          -   Elm_Genlist_Item_Class *itc;
          -   Elm_Genlist_Item_Class *itc2;
          -};
          -
          - -

          Creating a Genlist

          - -

          Call elm_genlist_add() to create a genlist. Then new entries can be added. In this example, first the basic windows is created, then a genlist is added to it, and then 10000 elements with text and a colored block on each side of it.

          -
          Evas_Object *list = elm_genlist_add(parent);
          -
          - -

          Adding New Entries

          - -

          Use elm_genlist_item_append() to add new elements. Its second parameter is a structure which describes how to populate entries. Typically this structure is built once and re-used across calls to elm_genlist_item_append().

          -

          -Building a Basic Item Class

          -

          The code for the minimal genlist item class is below:

          - -
          Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
          -itc->item_style = "default";
          -itc->func.text_get = NULL;
          -itc->func.content_get = NULL;
          -itc->func.state_get = NULL;
          -itc->func.del = NULL;
          -
          - -

          It creates a simple item class, sets the item_style to "default" and every other field to NULL. However, this leaves out the text_get and content_get fields which are used to add text and an icon to the list entry. This is explained in another section.

          -

          Adding the Element

          -

          Once the genlist item class object is created, a new element is added to the list by calling elm_genlist_item_append().

          -
          elm_genlist_item_append(list,
          -   itc,
          -   NULL,                    // Item data
          -   NULL,                    // Parent item for trees, NULL if none
          -   ELM_GENLIST_ITEM_NONE,   // Item type; this is the common one
          -   NULL,                    // Callback on selection of the item
          -   NULL                     // Data for that callback function
          -);
          -
          -

          With most parameters as NULL and itc having most of its members NULL, too, the elements of that list are blank and will not trigger anything when selected. This shows the APIs that are used.

          -

          Text in the List Elements

          -

          Use text_get callback to add text in the elements in the Elm_Genlist_Item_Class structure. These callbacks must have a prototype matching to the following:

          - -
          char * text_get(void *data, Evas_Object *obj, const char *part);
          -
          -

          This callbacks returns a C string that is displayed in the part named after the part parameter. This callback is called for each user-settable text part according to the current theme.

          -

          If you are not familiar with the concept of parts in the EFLs, see Writing a Simple EDC File.

          - - - - - - - - - - - -
          Note
          The value returned is freed by the EFLs: the value must be freshly-allocated, do not free it yourself and do not re-use it across list elements.
          - -

          For the default theme there is one part named elm.text. A possible implementation of the text_get callback is therefore:

          -
          static char *
          -_genlist_text_get(void *data, Evas_Object *obj, const char *part)
          -{
          -   // Check this is text for the part we're expecting
          -   if (strcmp(part, "elm.text") == 0) 
          -   {
          -      return strdup("Some text");
          -   }
          -   else 
          -   {
          -      return NULL;
          -   }
          -}
          -
          - - - - - - - - - - -
          Note
          The names and positions of parts depends on the item_style chosen when adding new items to the genlist. Setting a custom theme makes it possible to completely change genlists by adding and moving parts. Introduction to EDC Programming explains how to do that.
          - -

          The data parameter makes it possible to behave differently according to data that is given to the EFLs during the call to elm_genlist_item_append() in the data parameter. For example, given an integer in that field through casting with (void *)(uintptr_t) i, it is possible to get its value back using (int)(uintptr_t)data:

          -
          static char *
          -_genlist_text_get(void *data, Evas_Object *obj__UNUSED__, const char *part)
          -{
          -   if (strcmp(part, "elm.text") == 0) 
          -   {
          -      char *buf = malloc(16);
          -      snprintf(buf, 16, "Entry %d.", (int)(uintptr_t)data);
          -
          -      return buf;
          -   }
          -   else 
          -   {
          -      return NULL;
          -   }
          -}
          -
          - -

          Evas_Objects in the List Elements

          -

          Icons are added in a similar fashion: there is a callback named content_get which returns a pointer to an Evas_Object and is called for each part which contents can be set.

          -

          The prototype of the callback must match this one:

          -
          Evas_Object * content_get(void *data, Evas_Object *obj, const char *part);
          -
          - -

          The only difference with the text_get callback is that it returns an Evas_Object* rather than a char *.

          -

          This leads to a fairly simple dummy implementation with colored rectangles in the parts that are to be set:

          -
          -static Evas_Object *
          -_genlist_content_get(void *data, Evas_Object *obj, const char *part)
          -{
          -   int i = (int) (uintptr_t) data;
          -
          -   if (strcmp(part, "elm.swallow.icon") == 0) 
          -   {
          -      Evas_Object *bg = elm_bg_add(obj);
          -      elm_bg_color_set(bg, 255 * cos(i / (double) 10), 0, i % 255);
          -
          -      return bg;
          -   }
          -   else if (strcmp(part, "elm.swallow.end") == 0) 
          -   {
          -      Evas_Object *bg = elm_bg_add(obj);
          -      elm_bg_color_set(bg, 0, 255 * sin(i / (double) 10), i % 255);
          -
          -      return bg;
          -   }
          -   else 
          -   {
          -      return NULL;
          -   }
          -}
          -
          -

          For the default theme, this displays a red rectangle on the left of each list item and a green one on their right.

          -

          Events on Genlist Items

          -

          Genlist items triggers a callback when clicked. This callback is chosen when adding the new item (for example, when calling elm_genlist_item_append()):

          -
          elm_genlist_item_append(list,
          -   itc,
          -   NULL,                    // Item data
          -   NULL,                    // Parent item for trees, NULL if none
          -   ELM_GENLIST_ITEM_NONE,   // Item type, other values are used for trees
          -   _genlist_selected_cb,    // Callback on selection of the item
          -   NULL                     // Data for that callback function
          -);
          -
          - -

          This callback adheres to the following prototype:

          -
          void _contact_selected_cb(void *data, Evas_Object *obj, void *event_info)
          -
          - -

          The implementation below changes the item style of items when they are selected:

          -
          static void
          -_genlist_selected_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   struct app_data *app = data;
          -
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_item_class_update(it, app->itc2);
          -}
          -
          - -

          Choosing Another Item Style to Add or Remove Parts

          - -

          As mentioned above, the number of parts to fill depends on the item style that is chosen when adding a new item. This is simply a matter of setting the right value when filling the Elm_Genlist_Item_Class struct:

          -
          app->itc->item_style = "default";
          -
          -

          The Genlist component lists all available item styles.

          -

          Further customization is achieved by modifying the theme as explained in Introduction to EDC Programming.

          -

          In case the customization is only visual, it is good practice to keep the same item style names for new themes. This makes it possible to change theme and keep the code the same while also retaining the same overall item placement.

          - -

          Using Item Modes

          - -

          So far the genlist examples have all featured bare lists while the genlist component is able to display trees or even a "group" mode where scrolling keeps the item at the top of the UI component until another group comes and replaces it.

          -

          Group Mode

          -

          The group mode makes it possible to keep an element visible as long as one of its children is visible. This is most useful for "title" items.

          -

          Mark some elements as ELM_GENLIST_ITEM_GROUP and use the returned Elm_Object_Item to establish the parent-children relationship when adding the children items.

          -

          Since there are two kind of items, create two item classes. Give them different styles and callback functions. The callback functions are visible in the example, they have no functionalities:

          -
          -app->itc = elm_genlist_item_class_new();
          -app->itc->item_style = "default_style";
          -app->itc->func.text_get = _genlist_text_get_size;
          -app->itc->func.content_get = _genlist_content_get_bg;
          -app->itc->func.state_get = NULL;
          -app->itc->func.del = NULL; 
          -
          -app->itc2 = elm_genlist_item_class_new();
          -app->itc2->item_style = "icon_top_text_bottom";
          -app->itc2->func.text_get = _genlist_text_get_nosize;
          -app->itc2->func.content_get = _genlist_content_get_icon;
          -app->itc2->func.state_get = NULL;
          -app->itc2->func.del = NULL; 
          -
          - -

          Then add a group header and follow it with 10 children. This is repeated 1000 times.

          -

          The parent has type ELM_GENLIST_ITEM_GROUP while the children have type ELM_GENLIST_ITEM_NONE.

          -

          The other important point is that the value returned by lm_genlist_item_append() is stored in it and then sent to the elm_genlist_item_append() call that adds the children. This creates the parent-children relationship.

          -
          -for (i = 0; i < 1000; i++) 
          -{
          -   it = elm_genlist_item_append(app->list, app->itc2, (void *)(uintptr_t) (10 * i), NULL,
          -                                ELM_GENLIST_ITEM_GROUP, NULL, NULL);
          -   for (j = 0; j < 10; j++)
          -   {
          -      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (10 * i + j), it,
          -                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
          -   }
          -}
          -
          - -

          Tree Mode

          -

          Like group mode, tree mode uses the parenting relationship with other items. Unlike group mode, the child elements are created on-demand when their parent is expanded and deleted when it is contracted. This is done by using smart callbacks: expand,request, expanded, contract,request, and contracted. Like any smart callback, they are registered through evas_object_smart_callback_add on the genlist object:

          -
          evas_object_smart_callback_add(app->list, "expand,request",
          -   _tree_item_expand_request, NULL);
          -evas_object_smart_callback_add(app->list, "expanded",
          -   _tree_item_expanded, NULL);
          -
          -evas_object_smart_callback_add(app->list, "contract,request",
          -   _tree_item_contract_request, NULL);
          -evas_object_smart_callback_add(app->list, "contracted",
          -   _tree_item_contracted, NULL);
          -
          - -

          The callbacks expand,request and contract,request do only one thing: decide whether the element is expanded or contracted. This is done by using elm_genlist_item_expanded_set() function; if it changes the expansion status of the item, the next callback is called (either expanded or contracted, depending on whether it was an expand,request or contract,request event). A minimal implementation of these callbacks is therefore:

          -
          -static void
          -_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_item_class_update(it, app->itc2);
          -
          -   elm_genlist_item_expanded_set(it, EINA_TRUE);
          -}
          -
          - - - - - - - - - - -
          Note
          The example above has an extra line: the call to elm_genlist_item_item_class_update(). It changes the item style and is explained in the Changing the item class of an item after its creation section.
          - -
          -static void
          -_tree_item_contract_request(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_item_class_update(it, app->itc);
          -
          -   elm_genlist_item_expanded_set(it, EINA_FALSE);
          -}
          -
          - -

          As said above, once the genlist item status is set to expanded, the expanded event is triggered and it is the duty of a callback for that event to populate the list with the item's children. This relies on the parent parameter of functions like elm_genlist_item_append(), like for the group mode.

          -

          The function below is a callback implementation for the expanded event. It adds items that are built similarly to previous items, the only change is the parent parameter which is not NULL. Conveniently, the parent Elm_Object_Item pointer that is passes to the elm_genlist_item_append() function is given in the event_info callback and needs to be cast.

          -
          static void
          -_tree_item_expanded(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
          -   int i_parent = (int)(uintptr_t) data;
          -   int i;
          -
          -   for (i = 0; i < 10; i++) 
          -   {
          -      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (i + i_parent), it_parent,
          -                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
          -   }
          -}
          -
          - -

          The following code has the callback function for the contracted event. It imply calls elm_genlist_item_subitems_clear() to clear all children (including their own children if they have any) of the given item. Again, the item that is being contracted is available through the event_info parameter to the callback.

          -
          static void
          -_tree_item_contracted(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_subitems_clear(it_parent);
          -}
          -
          - -

          Mixing Group and Tree Modes

          -

          A common UI design is to mix group and tree modes. It allows for a tree behavior while also keeping the group header item. The EFLs do not do any magic here and the way to get such a behavior is to create an item of type group, an item of type tree which parent is the group item. Then add the callbacks to populate the children of the tree item in the regular way.

          - -

          Using Other APIs

          - -

          Homogeneous Item Size

          -

          Because of the scroller, the actual height and/or width of the genlist must be computed. This means summing the sizes of all the items, the sizes must be computed. This obviously has a cost and slows down adding items to the genlist.

          -

          The elm_genlist_homogeneous_set() function alleviates this issue by assuming all the items are the same size as the first one of the list. It speeds up large insertions. However, it may lead to serious graphical issues if the items are not actually the same size. Use with care.

          - -

          Changing the Item Class of an Item After Its Creation

          -

          Changing the item class of a UI component is an easy way to change its appearance upon selection or other actions of the user. This is done by calling elm_genlist_item_class_update():

          -
          static void
          -_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   // Change the appearance and possibly content of the item being expanded.
          -   elm_genlist_item_item_class_update(it, app->itc2);
          -
          -   elm_genlist_item_expanded_set(it, EINA_TRUE);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/genlist_tutorial_wn.htm b/org.tizen.ui.guides/html/native/efl/genlist_tutorial_wn.htm deleted file mode 100755 index 7f9a993..0000000 --- a/org.tizen.ui.guides/html/native/efl/genlist_tutorial_wn.htm +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - - - - - - - - - Creating Wearable Genlists - - - - - - -
          -

          Creating Wearable Genlists

          - -

          This tutorial deals with genlists, a list component for large sets of elements. It uses callbacks to populate entries. The same UI component handles both flat lists and trees.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - - -

          Initializing the Application

          - -

          Figure: Example of a genlist

          -

          Example of a genlist

          -

          The code below shows a typical elementary application that creates a window entitled "Genlist Basic Tutorial". It is consisted of a conformant component that contains a naviframe component. The genlist goes inside the naviframe.

          -
          static bool
          -_app_create(void *data)
          -{
          -   appdata_s *app = data;
          -
          -   app->win = elm_win_util_standard_add("main", "Genlist Basic Tutorial");
          -   elm_win_conformant_set(app->win, EINA_TRUE);
          -   evas_object_show(app->win);
          -   evas_object_resize(app->win, 480, 800);
          -   elm_win_autodel_set(app->win, EINA_TRUE);
          -
          -   app->conformant = elm_conformant_add(app->win);
          -   evas_object_size_hint_weight_set(app->conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(app->win, app->conformant);
          -   evas_object_show(app->conformant);
          -
          -   app->naviframe = elm_naviframe_add(app->win);
          -   evas_object_size_hint_weight_set(app->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(app->win, app->naviframe);
          -   evas_object_show(app->naviframe);
          -   elm_object_content_set(app->conformant, app->naviframe);
          -
          -   _create_list(app);
          -   elm_naviframe_item_push(app->naviframe, NULL, NULL, NULL, app->list, NULL);
          -
          -   return true;
          -}
          -
          -int
          -main(int argc, char **argv)
          -{
          -   // Declare a few structures and zero-initialize (C99 feature)
          -   struct app_data app = { 0 };
          -   ui_app_lifecycle_callback_s event_callback = { 0 };
          -
          -   event_callback.create = _app_create;
          -
          -   // Run the mainloop
          -   return ui_app_main(&argc, &argv, &event_callback, &ad);
          -}
          -
          -

          The declaration of the struct app_data is shown below:

          -
          struct app_data
          -{
          -   Evas_Object *win;
          -   Evas_Object *naviframe;
          -   Evas_Object *conformant;
          -   Evas_Object *list;
          -   Elm_Genlist_Item_Class *itc;
          -   Elm_Genlist_Item_Class *itc2;
          -};
          -
          - -

          Creating a Genlist

          - -

          Call elm_genlist_add() to create a genlist. Then new entries can be added. In this example, first the basic windows is created, then a genlist is added to it, and then 10000 elements with text and a colored block on each side of it.

          -
          Evas_Object *list = elm_genlist_add(parent);
          -
          - -

          Adding New Entries

          - -

          Use elm_genlist_item_append() to add new elements. Its second parameter is a structure which describes how to populate entries. Typically this structure is built once and re-used across calls to elm_genlist_item_append().

          -

          -Building a Basic Item Class

          -

          The code for the minimal genlist item class is below:

          - -
          Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
          -itc->item_style = "default";
          -itc->func.text_get = NULL;
          -itc->func.content_get = NULL;
          -itc->func.state_get = NULL;
          -itc->func.del = NULL;
          -
          - -

          It creates a simple item class, sets the item_style to "default" and every other field to NULL. However, this leaves out the text_get and content_get fields which are used to add text and an icon to the list entry. This is explained in another section.

          -

          Adding the Element

          -

          Once the genlist item class object is created, a new element is added to the list by calling elm_genlist_item_append().

          -
          elm_genlist_item_append(list,
          -   itc,
          -   NULL,                    // Item data
          -   NULL,                    // Parent item for trees, NULL if none
          -   ELM_GENLIST_ITEM_NONE,   // Item type; this is the common one
          -   NULL,                    // Callback on selection of the item
          -   NULL                     // Data for that callback function
          -);
          -
          -

          With most parameters as NULL and itc having most of its members NULL, too, the elements of that list are blank and will not trigger anything when selected. This shows the APIs that are used.

          -

          Text in the List Elements

          -

          Use text_get callback to add text in the elements in the Elm_Genlist_Item_Class structure. These callbacks must have a prototype matching to the following:

          - -
          char * text_get(void *data, Evas_Object *obj, const char *part);
          -
          -

          This callbacks returns a C string that is displayed in the part named after the part parameter. This callback is called for each user-settable text part according to the current theme.

          -

          If you are not familiar with the concept of parts in the EFLs, see Writing a Simple EDC File.

          - - - - - - - - - - - -
          Note
          The value returned is freed by the EFLs: the value must be freshly-allocated, do not free it yourself and do not re-use it across list elements.
          - -

          For the default theme there is one part named elm.text. A possible implementation of the text_get callback is therefore:

          -
          static char *
          -_genlist_text_get(void *data, Evas_Object *obj, const char *part)
          -{
          -   // Check this is text for the part we're expecting
          -   if (strcmp(part, "elm.text") == 0) 
          -   {
          -      return strdup("Some text");
          -   }
          -   else 
          -   {
          -      return NULL;
          -   }
          -}
          -
          - - - - - - - - - - -
          Note
          The names and positions of parts depends on the item_style chosen when adding new items to the genlist. Setting a custom theme makes it possible to completely change genlists by adding and moving parts. Introduction to EDC Programming explains how to do that.
          - -

          The data parameter makes it possible to behave differently according to data that is given to the EFLs during the call to elm_genlist_item_append() in the data parameter. For example, given an integer in that field through casting with (void *)(uintptr_t) i, it is possible to get its value back using (int)(uintptr_t)data:

          -
          static char *
          -_genlist_text_get(void *data, Evas_Object *obj__UNUSED__, const char *part)
          -{
          -   if (strcmp(part, "elm.text") == 0) 
          -   {
          -      char *buf = malloc(16);
          -      snprintf(buf, 16, "Entry %d.", (int)(uintptr_t)data);
          -
          -      return buf;
          -   }
          -   else 
          -   {
          -      return NULL;
          -   }
          -}
          -
          - -

          Evas_Objects in the List Elements

          -

          Icons are added in a similar fashion: there is a callback named content_get which returns a pointer to an Evas_Object and is called for each part which contents can be set.

          -

          The prototype of the callback must match this one:

          -
          Evas_Object * content_get(void *data, Evas_Object *obj, const char *part);
          -
          - -

          The only difference with the text_get callback is that it returns an Evas_Object* rather than a char *.

          -

          This leads to a fairly simple dummy implementation with colored rectangles in the parts that are to be set:

          -
          -static Evas_Object *
          -_genlist_content_get(void *data, Evas_Object *obj, const char *part)
          -{
          -   int i = (int) (uintptr_t) data;
          -
          -   if (strcmp(part, "elm.swallow.icon") == 0) 
          -   {
          -      Evas_Object *bg = elm_bg_add(obj);
          -      elm_bg_color_set(bg, 255 * cos(i / (double) 10), 0, i % 255);
          -
          -      return bg;
          -   }
          -   else if (strcmp(part, "elm.swallow.end") == 0) 
          -   {
          -      Evas_Object *bg = elm_bg_add(obj);
          -      elm_bg_color_set(bg, 0, 255 * sin(i / (double) 10), i % 255);
          -
          -      return bg;
          -   }
          -   else 
          -   {
          -      return NULL;
          -   }
          -}
          -
          -

          For the default theme, this displays a red rectangle on the left of each list item and a green one on their right.

          -

          Events on Genlist Items

          - - - - - - - - - - -
          Note
          The swallow parts have no minimum size. This means that if you do not fix the minimum size, the part cannot be seen.
          - -

          Genlist items triggers a callback when clicked. This callback is chosen when adding the new item (for example, when calling elm_genlist_item_append()):

          -
          elm_genlist_item_append(list,
          -   itc,
          -   NULL,                    // Item data
          -   NULL,                    // Parent item for trees, NULL if none
          -   ELM_GENLIST_ITEM_NONE,   // Item type, other values are used for trees
          -   _genlist_selected_cb,    // Callback on selection of the item
          -   NULL                     // Data for that callback function
          -);
          -
          - -

          This callback adheres to the following prototype:

          -
          void _contact_selected_cb(void *data, Evas_Object *obj, void *event_info)
          -
          - -

          The implementation below changes the item style of items when they are selected:

          -
          static void
          -_genlist_selected_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *app = data;
          -
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_item_class_update(it, app->itc2);
          -}
          -
          - -

          Choosing Another Item Style to Add or Remove Parts

          - -

          As mentioned above, the number of parts to fill depends on the item style that is chosen when adding a new item. This is simply a matter of setting the right value when filling the Elm_Genlist_Item_Class struct:

          -
          app->itc->item_style = "default";
          -
          -

          The Genlist component lists all available item styles.

          -

          Further customization is achieved by modifying the theme as explained in Introduction to EDC Programming.

          -

          In case the customization is only visual, it is good practice to keep the same item style names for new themes. This makes it possible to change theme and keep the code the same while also retaining the same overall item placement.

          - -

          Using Item Modes

          - -

          So far the genlist examples have all featured bare lists while the genlist component is able to display trees or even a "group" mode where scrolling keeps the item at the top of the UI component until another group comes and replaces it.

          -

          Group Mode

          -

          The group mode makes it possible to keep an element visible as long as one of its children is visible. This is most useful for "title" items.

          -

          Mark some elements as ELM_GENLIST_ITEM_GROUP and use the returned Elm_Object_Item to establish the parent-children relationship when adding the children items.

          -

          Since there are two kind of items, create two item classes. Give them different styles and callback functions. The callback functions are visible in the example, they have no functionalities:

          -
          -app->itc = elm_genlist_item_class_new();
          -app->itc->item_style = "default";
          -app->itc->func.text_get = _genlist_text_get_size;
          -app->itc->func.content_get = _genlist_content_get_bg;
          -app->itc->func.state_get = NULL;
          -app->itc->func.del = NULL; 
          -
          -app->itc2 = elm_genlist_item_class_new();
          -app->itc2->item_style = "1text.1icon";
          -app->itc2->func.text_get = _genlist_text_get_nosize;
          -app->itc2->func.content_get = _genlist_content_get_icon;
          -app->itc2->func.state_get = NULL;
          -app->itc2->func.del = NULL; 
          -
          - -

          Then add a group header and follow it with 10 children. This is repeated 1000 times.

          -

          The parent has type ELM_GENLIST_ITEM_GROUP while the children have type ELM_GENLIST_ITEM_NONE.

          -

          The other important point is that the value returned by lm_genlist_item_append() is stored in it and then sent to the elm_genlist_item_append() call that adds the children. This creates the parent-children relationship.

          -
          -for (i = 0; i < 1000; i++) 
          -{
          -   it = elm_genlist_item_append(app->list, app->itc2, (void *)(uintptr_t) (10 * i), NULL,
          -                                ELM_GENLIST_ITEM_GROUP, NULL, NULL);
          -   for (j = 0; j < 10; j++)
          -   {
          -      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (10 * i + j), it,
          -                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
          -   }
          -}
          -
          - -

          Tree Mode

          -

          Like group mode, tree mode uses the parenting relationship with other items. Unlike group mode, the child elements are created on-demand when their parent is expanded and deleted when it is contracted. This is done by using smart callbacks: expand,request, expanded, contract,request, and contracted. Like any smart callback, they are registered through evas_object_smart_callback_add on the genlist object:

          -
          evas_object_smart_callback_add(app->list, "expand,request",
          -   _tree_item_expand_request, NULL);
          -evas_object_smart_callback_add(app->list, "expanded",
          -   _tree_item_expanded, NULL);
          -
          -evas_object_smart_callback_add(app->list, "contract,request",
          -   _tree_item_contract_request, NULL);
          -evas_object_smart_callback_add(app->list, "contracted",
          -   _tree_item_contracted, NULL);
          -
          - -

          The callbacks expand,request and contract,request do only one thing: decide whether the element is expanded or contracted. This is done by using elm_genlist_item_expanded_set() function; if it changes the expansion status of the item, the next callback is called (either expanded or contracted, depending on whether it was an expand,request or contract,request event). A minimal implementation of these callbacks is therefore:

          -
          -static void
          -_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_item_class_update(it, app->itc2);
          -
          -   elm_genlist_item_expanded_set(it, EINA_TRUE);
          -}
          -
          - - - - - - - - - - -
          Note
          The example above has an extra line: the call to elm_genlist_item_item_class_update(). It changes the item style and is explained in the Changing the item class of an item after its creation section.
          - -
          -static void
          -_tree_item_contract_request(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_item_class_update(it, app->itc);
          -
          -   elm_genlist_item_expanded_set(it, EINA_FALSE);
          -}
          -
          - -

          As said above, once the genlist item status is set to expanded, the expanded event is triggered and it is the duty of a callback for that event to populate the list with the item's children. This relies on the parent parameter of functions like elm_genlist_item_append(), like for the group mode.

          -

          The function below is a callback implementation for the expanded event. It adds items that are built similarly to previous items, the only change is the parent parameter which is not NULL. Conveniently, the parent Elm_Object_Item pointer that is passes to the elm_genlist_item_append() function is given in the event_info callback and needs to be cast.

          -
          static void
          -_tree_item_expanded(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
          -   int i_parent = (int)(uintptr_t) data;
          -   int i;
          -
          -   for (i = 0; i < 10; i++) 
          -   {
          -      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (i + i_parent), it_parent,
          -                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
          -   }
          -}
          -
          - -

          The following code has the callback function for the contracted event. It imply calls elm_genlist_item_subitems_clear() to clear all children (including their own children if they have any) of the given item. Again, the item that is being contracted is available through the event_info parameter to the callback.

          -
          static void
          -_tree_item_contracted(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
          -
          -   elm_genlist_item_subitems_clear(it_parent);
          -}
          -
          - -

          Mixing Group and Tree Modes

          -

          A common UI design is to mix group and tree modes. It allows for a tree behavior while also keeping the group header item. The EFLs do not do any magic here and the way to get such a behavior is to create an item of type group, an item of type tree which parent is the group item. Then add the callbacks to populate the children of the tree item in the regular way.

          - -

          Using Other APIs

          - -

          Homogeneous Item Size

          -

          Because of the scroller, the actual height and/or width of the genlist must be computed. This means summing the sizes of all the items, the sizes must be computed. This obviously has a cost and slows down adding items to the genlist.

          -

          The elm_genlist_homogeneous_set() function alleviates this issue by assuming all the items are the same size as the first one of the list. It speeds up large insertions. However, it may lead to serious graphical issues if the items are not actually the same size. Use with care.

          - -

          Changing the Item Class of an Item After Its Creation

          -

          Changing the item class of a UI component is an easy way to change its appearance upon selection or other actions of the user. This is done by calling elm_genlist_item_class_update():

          -
          static void
          -_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
          -{
          -   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
          -
          -   // Change the appearance and possibly content of the item being expanded.
          -   elm_genlist_item_item_class_update(it, app->itc2);
          -
          -   elm_genlist_item_expanded_set(it, EINA_TRUE);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/graphical_objects_n.htm b/org.tizen.ui.guides/html/native/efl/graphical_objects_n.htm deleted file mode 100755 index 6f3c87f..0000000 --- a/org.tizen.ui.guides/html/native/efl/graphical_objects_n.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - Graphical Objects: Managing and Rendering Evas Objects - - - - - -
          - -

          Graphical Objects: Managing and Rendering Evas Objects

          - -

          Evas is a clean display canvas API for several target display systems that can draw anti-aliased text, smooth super and sub-sampled scaled images, alpha-blend objects and much more.

          -

          It abstracts any need to know much about what the characteristics of your display system are, what graphics calls are used to draw them, and how. It deals on an object level where all you do is create and manipulate objects in a canvas and set their properties.

          -

          Evas optimizes the rendering pipeline to minimize effort in redrawing changes made to the canvas and so takes this work out of the programmers hand, saving a lot of time and energy.

          -

          It is designed to work on embedded systems all the way to large and powerful multi-cpu workstations. It can be compiled to only have the features you need for your target platform if you so wish. It has several display back-ends, allowing it display on several display systems, making it portable for cross-device and cross-platform development.

          - -

          Evas is not a UI component set or a UI component toolkit, but it is their base. See Elementary for a toolkit based on Evas, Edje, Ecore and other Enlightenment technologies.

          -

          It is not dependent or aware of main loops, input or output systems. Input must be polled from various sources and fed to Evas. It does not create windows or report windows updates to your system, but draws the pixels and reports to the user the areas that are changed. These operations are ready to be used in Ecore, particularly in Ecore_Evas wrapper/helper set of functions.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/guides_efl_n.htm b/org.tizen.ui.guides/html/native/efl/guides_efl_n.htm deleted file mode 100755 index 2e2ae38..0000000 --- a/org.tizen.ui.guides/html/native/efl/guides_efl_n.htm +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - EFL - - - - - - -
          -

          EFL

          - -

          EFL is an open-source UI toolkit that provides a set of libraries that offer useful features to applications. EFL covers a number of areas from UI component sets to data structures. EFL is one of the Tizen native UI modules and is available in various Tizen profiles. In Tizen, EFL is commonly used for UI applications, although you can also use it for non-UI applications.

          - -

          When creating an EFL application, make sure you understand the following main features:

          - - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/hw_input_n.htm b/org.tizen.ui.guides/html/native/efl/hw_input_n.htm deleted file mode 100755 index 27f1a9f..0000000 --- a/org.tizen.ui.guides/html/native/efl/hw_input_n.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - Hardware Input Handling: Managing Hardware Events with EFL Extension - - - - - -
          - -

          Hardware Input Handling: Managing Hardware Events with EFL Extension

          - -

          The Tizen platform offers the Menu, Back, and Home keys as physical hardware keys for mobile devices and rotary component parts for wearable devices.

          - -

          Basically, EFL does not depend on any specific hardware input methods, such as hardware keys, to generate back and home events, or rotary component parts to generate rotary events. Instead these hardware input events have tightly related to the Tizen UX. As a result, EFL has created the EFL extension library to support common UX behavior between applications and hardware events.

          - -

          When the user presses the Menu or Back key, the key generates a signal with its key property. The Ecore library receives the signal and propagates it to application layers as an event. The EFL extension library consumes the events and handles the views of the application according to key properties. Otherwise, EFL extension manages the rotary events, which are generated from rotary components in wearable devices and delivered to application layers by defining an event callback or a handler function, and registering it.

          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/layout_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/layout_tutorial_n.htm deleted file mode 100755 index 5478634..0000000 --- a/org.tizen.ui.guides/html/native/efl/layout_tutorial_n.htm +++ /dev/null @@ -1,751 +0,0 @@ - - - - - - - - - - - - - - Creating UI Screen Layouts - - - - - - -
          - -

          Creating UI Screen Layouts

          - - -

          This tutorial demonstrates how you can compose a UI screen using the layout classes available in the EFL UI component library. It also highlights the capabilities of the EFL layout classes in free style layouting as well as layouting in a particular sequence (such as linear or grid).

          - - -

          Creating the UI Layout

          - -

          The sample application uses UI components, such as elm_naviframe and elm_toolbar for the view management, layout classes, such as elm_table, elm_box, and elm_grid for the composition of the screen, and UI components, such as elm_label and elm_image for the content inside the view.

          - -

          The create_base_gui() function creates the application layout. It starts by creating a window, then adds the elm_conformant component to it to decorate the window with an indicator. It then adds the elm_naviframe component which acts as a view manager for the window and provides the window title functionality. After this it creates the toolbar using the create_toolbar() function and adds it to naviframe.

          -
          -static void
          -create_base_gui(appdata_s *ad)
          -{
          -   Elm_Object_Item *nf_it, *tabbar_it;
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -
          -   // Conformant
          -   ad->conform = elm_conformant_add(ad->win);
          -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->conform);
          -   evas_object_show(ad->conform);
          -
          -   // Naviframe
          -   ad->nf = elm_naviframe_add(ad->conform);
          -   elm_object_content_set(ad->conform, ad->nf);
          -   evas_object_show(ad->nf);
          -   nf_it = elm_naviframe_item_push(ad->nf, "UiLayout", NULL, NULL, NULL, "tabbar/icon/notitle");
          -
          -   // Tabbar
          -   ad->tabbar = create_toolbar(ad);
          -   elm_object_item_part_content_set(nf_it, "tabbar", ad->tabbar);
          -
          -   // Set the first view
          -   tabbar_it = elm_toolbar_first_item_get(ad->tabbar);
          -   elm_toolbar_item_selected_set(tabbar_it, EINA_TRUE);
          -
          -   // Show the window after the base GUI is set up
          -   evas_object_show(ad->win);
          -
          -   ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, NULL);
          -}
          -
          - -

          The create_toolbar() function creates the toolbar which is then added to the naviframe.

          -
          -static Evas_Object*
          -create_toolbar(appdata_s *ad)
          -{
          -   Evas_Object *tabbar;
          -
          -   tabbar = elm_toolbar_add(ad->nf);
          -   elm_object_style_set(tabbar, "tabbar");
          -   elm_toolbar_shrink_mode_set(tabbar, ELM_TOOLBAR_SHRINK_EXPAND);
          -   elm_toolbar_transverse_expanded_set(tabbar, EINA_TRUE);
          -
          -   elm_toolbar_item_append(tabbar, NULL, "Box", tabbar_item_cb, ad);
          -   elm_toolbar_item_append(tabbar, NULL, "Grid", tabbar_item_cb, ad);
          -   elm_toolbar_item_append(tabbar, NULL, "Table", tabbar_item_cb, ad);
          -
          -   return tabbar;
          -}
          -
          - -

          The following figure illustrates the UI Layout.

          - -

          Figure: UI Layout screen

          -

          UI Layout screen

          - -

          Adding Content to the Screen

          - -

          The create_box_view() function creates the screen using a recursive composition of the box layout.

          - -
          static Evas_Object*
          -create_box_view(Evas_Object *parent)
          -{
          -   Evas_Object *box, *box1, *box2, *box3;
          -
          -   box = elm_box_add(parent);
          -   elm_box_padding_set(box, 10, 10);
          -   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          -   box1 = elm_box_add(box);
          -   elm_box_horizontal_set(box1, EINA_TRUE);
          -   elm_box_padding_set(box1, 8, 8);
          -   evas_object_size_hint_weight_set(box1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(box1, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_show(box1);
          -
          -   box2 = elm_box_add(box);
          -   elm_box_padding_set(box2, 6, 6);
          -   evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_show(box2);
          -
          -   box3 = elm_box_add(box);
          -   elm_box_padding_set(box3, 5, 5);
          -   evas_object_size_hint_weight_set(box3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(box3, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   elm_box_homogeneous_set(box3, EINA_FALSE);
          -   evas_object_show(box3);
          -} 
          -
          - -

          Once the box layout is created, content or another box layout is added to the box. Box implements the size policy during the size calculation.

          - -
          // Add an item to the box
          -Evas_Object *item1 = create_content(box, "Item 1");
          -evas_object_size_hint_min_set(item1, 0, 40);
          -elm_box_pack_end(box, item1);
          -elm_box_pack_end(box, box1);
          -elm_box_pack_end(box, box3);
          -elm_box_pack_end(box, create_content(box, "Item 4"));
          -
          -// Add an item to the box1
          -elm_box_pack_end(box1, create_content(box1, "Item 2.1"));
          -elm_box_pack_end(box1, box2);
          -elm_box_pack_end(box1, create_content(box1, "Item 2.3"));
          -
          -// Add an item to the box2
          -elm_box_pack_end(box2, create_content(box2, "Item 2.2.1"));
          -elm_box_pack_end(box2, create_content(box2, "Item 2.2.2"));
          -
          -// Add an item to the box3
          -elm_box_pack_end(box3, create_content(box3, "Item 3.1"));
          -elm_box_pack_end(box3, create_content(box3, "Item 3.2"));
          -
          - -

          The create_table_view() function creates the screen by composing table layout with content and grid view.

          - -
          static Evas_Object*
          -create_table_view(Evas_Object *parent)
          -{
          -   Evas_Object *table, *item;
          -
          -   table = elm_table_add(parent);
          -   elm_table_padding_set(table, 10, 10);
          -   elm_table_homogeneous_set(table, EINA_TRUE);
          -   evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          -   item = create_content(table, "Item 1");
          -   elm_table_pack(table, item, 0, 0, 2, 1);
          -
          -   item = create_content(table, "Item 2");
          -   elm_table_pack(table, item, 2, 0, 1, 1);
          -
          -   item = create_content(table, "Item 3");
          -   elm_table_pack(table, item, 0, 1, 3, 1);
          -
          -   // Add a grid view item
          -   item = create_grid_view(table);
          -   evas_object_show(item);
          -   elm_table_pack(table, item, 0, 2, 3, 10);
          -
          -   return table;
          -}
          -
          - -

          The table layout can be used for freestyle layouting, and for standard layouts, such as lists and grids. It does not consider the size policy of the child item during size calculation.

          -

          The create_grid_view() function composes a screen using the grid layout and also uses box and table layout as a child item to pack inside a grid. It uses free style layouting, and during size evaluation of the child item, it does not take the size policy of the child item into consideration.

          - -
          static Evas_Object*
          -create_grid_view(Evas_Object *parent)
          -{
          -   Evas_Object *grid, *item;
          -
          -   grid = elm_grid_add(parent);
          -   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          -   // Red background for the grid
          -   item = create_bg(grid, 255, 0, 0);
          -   elm_grid_pack(grid, item, 0, 0, 100, 100);
          -
          -   // Add the item to the grid
          -   item = create_content(grid, "Item1");
          -   elm_grid_pack(grid, item, 1, 1, 98, 98);
          -
          -   item = create_content(grid, "Item2");
          -   elm_grid_pack(grid, item, 2, 5, 20, 20);
          -
          -   item = create_content(grid, "Item3");
          -   elm_grid_pack(grid, item, 23, 5, 76, 94);
          -
          -   item = create_content(grid, "Item4");
          -   elm_grid_pack(grid, item, 2, 27, 20, 70);
          -
          -   // Black background for the box view item
          -   item = create_bg(grid, 40, 40, 40);
          -   elm_grid_pack(grid, item, 25, 10, 73, 87);
          -
          -   // Add the box view item to the grid
          -   item = create_box_view(grid);
          -   evas_object_show(item);
          -   elm_grid_pack(grid, item, 26, 11, 71, 85);
          -
          -   return grid;
          -}
          -
          - -

          Using the Base Layout

          - -

          When developing a Tizen native application, it is recommended that you base your application layout on the base layout. The base layout supports the indicator and view management. The following figure shows the wireframe and UI component hierarchy of the base layout:

          - -

          Figure: Base layout wireframe and UI component hierarchy

          -

          Base layout wireframe and UI component hierarchy

          - -

          The UI components have the following roles:

          - -
            -
          • Window (Elm_win): Every UI component from Elementary is rendered in a Window.
          • -
          • Conformant (Elm_Conformant): The Conformant supports the indicator area and resizing the application due to rotation or the ISF (keypad).
          • -
          • Naviframe (Elm_Naviframe): The Naviframe acts as a view manager and optionally provides the application title. The main layout of the application is added to the Naviframe's view area.
          • -
          - - -

          Sample Applications with the Base Layout

          - -

          Setting

          - -

          The Setting application consists of a list to show as a menu. For organizing the application, create the application layout with a screen-size-list and place the layout into the Naviframe's view area.

          - -

          Figure: Setting UI and layout

          -

          Settings UI and layout

          - -

          For more information, see the Setting sample application.

          - -

          Application Store

          - -

          For organizing the Application Store application, you need to add a scroller to the base layout, since the total height of the layout will be greater than the screen size, and you will therefore need to scroll the screen contents up and down. If the layout is larger than the screen, the scroller makes the view itself scrollable.

          - -

          You can use a list or grid if the same objects are shown repeatedly. In this sample application, however, the various items are shown in a layout.

          - -

          Figure: Application Store UI and layout

          -

          Application Store UI and layout

          - -

          For more information, see the Application Store sample application.

          - -

          Sample Applications with a Custom Layout

          - -

          Calculator - No Naviframe

          - -

          The Calculator is a good example of an exception to the base layout. The application has no view changes and no application title. As these are the two reasons why you should use a Naviframe, you do not need to add a Naviframe to the Calculator.

          - -

          You can organize the application layout with container components. Container components are used for arranging UI components, both basic UI components and other container components.

          - -

          Figure: Calculator UI and layout

          -

          Calculator UI and layout

          - -

          For more information, see the Calculator sample application.

          - -

          Email - Drawer

          - -

          The Email application shows information using a list. The main view is the same as in the Setting application, consisting of a screen-size-list for displaying emails. However, the Email application has an additional feature: the Drawer, which is used for displaying the menu with a hierarchy.

          - -

          To develop the application as a Tizen native application, add a layout on the Conformant, and add a Naviframe to the layout. This layout has a content area for the Drawer and Naviframe, and its style name is "layout/drawer/panel". To use this layout, use the following code:

          - -
          -layout = elm_layout_add(parent);
          -elm_layout_theme_set(layout, "layout", "drawer", "panel");
          -
          - -

          The style includes parts for locating the Drawer and the main view. In the Drawer area, you can add a list to indicate the menu. In the main view, you can add a Naviframe to organize the view of the layout.

          - -

          Figure: Email UI and layout

          -

          Email UI and layout

          - -

          For more information, see the Email sample application.

          - -

          Creating a Simple Clock View

          - -

          This sample creates a basic clock view that shows the time, current city, and date. This sample demonstrates how to use a box, container component, and label to create a basic layout. The application includes the following UI components:

          - -
            -
          • Elm_window: Basic canvas for rendering the screen
          • -
          • Elm_conformant: Support indicator area
          • -
          • Elm_naviframe: View manager component
          • -
          • Elm_box: Container component for layouting other UI components
          • -
          • Elm_label: Basic UI component for showing text with a tag
          • -
          - -

          The following figure illustrates the main view of the simple clock sample application and its wireframe structure.

          - -

          Figure: Simple clock screen

          -

          Simple clock screen

          - -

          The basic clock is implemented in the world_clock.c file. In this application, the data structure for application is following:

          - -
          typedef struct appdata
          -{
          -   // Save the window
          -   Evas_Object *win;
          -} 
          -appdata_s;
          -
          - -

          The information in appdata is used for the entire system. In this sample application, the information is related to handling the HW back key.

          - -

          The single callback function for application handling is app_create, and it only creates the basic GUI:

          - -
          int
          -main(int argc, char *argv[])
          -{
          -   appdata_s *ad = {0,};
          -   app_event_callback_s event_callback = {0,};
          -   int ret = 0;
          -
          -   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;
          -
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
          -   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
          -
          -   ret = ui_app_main(argc, argv, &event_callback, &ad);
          -   if (ret != APP_ERROR_NONE) 
          -   {
          -      dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
          -   }
          -
          -   return ret;
          -}
          -
          -static bool
          -app_create(void *data)
          -{
          -   appdata_s *ad = data;
          -   create_base_gui(ad);
          -
          -   return true;
          -}
          -
          - -

          Use the create_base_gui() function to create a basic layout with a window, conformant and naviframe. This is the basic layout in the Tizen mobile environment.

          - -
          ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -// Conformant
          -conform = elm_conformant_add(ad->win);
          -elm_win_conformant_set(ad->win, EINA_TRUE);
          -evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(ad->win, conform);
          -evas_object_show(conform);
          -
          -// Naviframe
          -nf = elm_naviframe_add(conform);
          -elm_object_content_set(conform, nf);
          -evas_object_show(nf);
          -
          - -

          After creating a basic layout, create the main layout for the application. In this sample, it contains a box with 3 labels. The labels show the time, city and date. To add the labels to the box, use the elm_box_pack_end() function.

          - -

          After adding the labels, you must set their text. You can set or decorate the text in the labels using the elm_object_text_set() function. You can modify the text size (font_size), color (color), and thickness (b).

          - -
          -// Add the box
          -box = elm_box_add(nf);
          -// Create a label
          -label1 = elm_label_add(box);
          -// Set text to the label with a tag
          -elm_object_text_set(label1, "<font_size=110><color=#000000>07:26</color></font_size>");
          -// Add the label to the box
          -elm_box_pack_end(box, label1);
          -// Change label visibility
          -evas_object_show(label1);
          -
          -// Repeat with other labels
          -
          -evas_object_show(box);
          -
          - -

          After creating the box with labels, set the box as a new view. You can also set the title of the application. These operations are handled by the naviframe using the elm_naviframe_item_push() function:

          - -
          elm_naviframe_item_push(nf, _("World Clock"), NULL, NULL, box, "basic");
          - -

          The parameters include the title, the name of the UI component added as a new view, and the naviframe style. The basic style is used for a simple view with normal title.

          - -

          The following figure illustrates the UI component hierarchy of the application.

          - -

          Figure: Simple clock components

          -

          Simple clock components

          - -

          Set the HW key handler. The Tizen mobile environment supports the More and back keys, but only the back key is handled in this sample.

          -
          eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          -
          - -

          After setting the callback function, the win_back_cb callback is invokes when a back key is pressed. The win_back_cb callback will hide the window:

          -
          static void
          -win_back_cb(void *data , int type , void *event)
          -{
          -   appdata_s *ad = data;
          -   elm_win_lower(ad->win);
          -}
          -
          - -

          Creating a Complex Clock View

          - -

          This sample creates a complex clock view. The sample demonstrates how to organize a basic layout using boxes. The application includes the following UI components:

          - - -
            -
          • Elm_window: Basic canvas for rendering the screen
          • -
          • Elm_conformant: Support indicator area
          • -
          • Elm_naviframe: View manager component
          • -
          • Elm_box: Container component for layouting other UI components
          • -
          • Elm_label: Basic UI component for showing text with a tag
          • -
          • Elm_genlist: List component
          • -
          • Elm_button: Simple push button
          • -
          - -

          The following figure illustrates the main view of the complex clock sample application and its wireframe structure.

          - -

          Figure: Complex clock screen

          -

          Complex clock screen

          - -

          Basic GUI

          - -

          The basic clock is implemented in the world_clock.c file. In this application, the data structure for application is following:

          - -
          typedef struct appdata
          -{
          -   // Save the window
          -   Evas_Object *win;
          -} 
          -appdata_s;
          -
          - -

          The information in appdata is used for the entire system. In this sample application, the information is related to handling the HW back key.

          - -

          The single callback function for application handling is app_create, and it only creates the basic GUI:

          - -
          int
          -main(int argc, char *argv[])
          -{
          -   appdata_s *ad = {0,};
          -   app_event_callback_s event_callback = {0,};
          -   int ret = 0;
          -
          -   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;
          -
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
          -   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
          -
          -   ret = ui_app_main(argc, argv, &event_callback, &ad);
          -   if (ret != APP_ERROR_NONE) 
          -   {
          -      dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
          -   }
          -
          -   return ret;
          -}
          -
          -static bool
          -app_create(void *data)
          -{
          -   appdata_s *ad = data;
          -   create_base_gui(ad);
          -
          -   return true;
          -}
          -
          - -

          The base GUI of the application contains the following elements:

          - -
            -
          • Clock
          • -
          • List
          • -
          • Main layout with buttons
          • -
          - -

          Clock

          - -

          The clock element contains 3 labels. The labels are packed as a single box component, which is part of the main layout.

          -
          static Evas_Object *
          -create_clock(Evas_Object *nf)
          -{
          -   Evas_Object *box, *label1, *label2, *label3;
          -
          -   // Box
          -   box = elm_box_add(nf);
          -
          -   label1 = elm_label_add(box);
          -   elm_object_text_set(label1, "<font_size=110><color=#000000>07:26</color></font_size>");
          -   elm_box_pack_end(box, label1);
          -   evas_object_show(label1);
          -
          -   evas_object_show(box);
          -
          -   return box;
          -}
          -
          - -

          List

          - -

          This element contains a list of cities. The UI component used is genlist, which is a complex list able to show information with various styles.

          -
          static Evas_Object *
          -create_list(Evas_Object *nf)
          -{
          -   Evas_Object* list;
          -   Elm_Genlist_Item_Class *itc = NULL;
          -   int i, num_of_item;
          -   Elm_Object_Item *it;
          -   
          -   list = elm_genlist_add(nf);
          -
          - -

          To add items to the list, use the Elm_Genlist_Item_Class class. After adding a new class, set callback function to detect, when the item is rendered.

          -
          itc = elm_genlist_item_class_new();
          -   itc->item_style = "2line.top.4";
          -   itc->func.text_get = gl_text_get_cb;
          -   itc->func.content_get = NULL;
          -   itc->func.del = NULL;
          -
          - -

          In this application, all the list items are similar and use the same callback function (gl_text_get_cb()) for setting text, so only 1 item class is created:

          -
          static char*
          -gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
          -{
          -   item_data_s *id = data;
          -   char buf[1024];
          -
          -   if (id->index == 0) 
          -   {
          -      if (!strcmp(part, "elm.text.main.left.top")) 
          -      {
          -         snprintf(buf, 1023, "%s", "07:26");
          -
          -         return strdup(buf);
          -      }
          -      else if (!strcmp(part, "elm.text.sub.right.top")) 
          -      {
          -         snprintf(buf, 1023, "%s", "Cardiff");
          -
          -         return strdup(buf);
          -      }
          -      else if (!strcmp(part, "elm.text.sub.left.bottom")) 
          -      {
          -         snprintf(buf, 1023, "%s", "Wen, Jan 1");
          -
          -         return strdup(buf);
          -      }
          -      else if (!strcmp(part, "elm.text.sub.right.bottom")) 
          -      {
          -         snprintf(buf, 1023, "%s", "wales");
          -
          -         return strdup(buf);
          -      }
          -   }
          -
          -   return NULL;
          -}
          -
          - -

          Append items using the elm_genlist_item_append() function. In this application, 3 items are added:

          -
          num_of_item = 3;
          -
          -   for (i = 0; i < num_of_item; i++) 
          -   {
          -      item_data_s *id = calloc(sizeof(item_data_s), 1);
          -      id->index = i;
          -      it = elm_genlist_item_append(list,
          -                                   itc,
          -                                   id,
          -                                   NULL,
          -                                   ELM_GENLIST_ITEM_NONE,
          -                                   NULL,
          -                                   id);
          -      id->item = it;
          -   }
          -
          - -

          Main Layout with a Button

          - -

          In the main layout, the other layout elements are merged together and a button added. The following example describes handling the main layout:

          - -
          static void
          -create_base_gui(appdata_s *ad)
          -{
          -   Evas_Object *conform, *nf, *box, *clock, *layout, *rect, *button;
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   // Conformant
          -   conform = elm_conformant_add(ad->win);
          -   elm_win_conformant_set(ad->win, EINA_TRUE);
          -   evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, conform);
          -   evas_object_show(conform);
          -
          -   // Naviframe
          -   nf = elm_naviframe_add(conform);
          -   elm_object_content_set(conform, nf);
          -   evas_object_show(nf);
          -}
          -
          - -

          The box component is used to organize the main layout. The box is expanded as much as possible to fill the entire view.

          -
             // Box
          -   box = elm_box_add(nf);
          -   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -
          - -

          The box contains the following elements:

          - -
            - -
          • The clock element contains 3 labels. The parameter for the evas_object_size_hint_weight_set() function is 0.1 meaning that the height of the clock box occupies 30% of the available area.

            -
               clock = create_clock(nf);
            -   evas_object_size_hint_weight_set(clock, EVAS_HINT_EXPAND, 0.3);
            -   evas_object_size_hint_align_set(clock, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   elm_box_pack_end(box, clock);
            -
            -
          • - -
          • The list element is packed into the box. As the genlist elements does not have a determined size, its size depends on the layout parameter.

            -
            -   layout = elm_layout_add(box);
            -   elm_layout_theme_set(layout, "layout", "application", "default");
            -   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -   evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   rect = create_list(nf);
            -   elm_layout_content_set(layout, "elm.swallow.content", rect);
            -   evas_object_show(rect);
            -   evas_object_show(layout);
            -   elm_box_pack_end(box, layout);
            -
            -
          • - -
          • The button element has a callback function to detect, when the button is clicked.

            -
            button = elm_button_add(box);
            -   evas_object_smart_callback_add(button, "clicked", btn_clicked_cb, NULL);
            -   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0.1);
            -   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            -   elm_object_text_set(button, "Terminate");
            -   evas_object_show(button);
            -   elm_box_pack_end(box, button);
            -
            -
          • -
          - -

          The following figure illustrates the UI component hierarchy of the application.

          - -

          Figure: Complex clock components

          -

          Complex clock components

          - -

          Add the main layout to the naviframe, and set the HW key handler:

          -
          eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          -
          - -

          After setting the callback function, the win_back_cb callback is invokes when a back key is pressed. The win_back_cb callback will hide the window:

          -
          static void
          -win_back_cb(void *data , int type , void *event)
          -{
          -   appdata_s *ad = data;
          -   elm_win_lower(ad->win);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/main_loop_n.htm b/org.tizen.ui.guides/html/native/efl/main_loop_n.htm deleted file mode 100755 index 0b1eb5e..0000000 --- a/org.tizen.ui.guides/html/native/efl/main_loop_n.htm +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - - - - - - - - Handling the Main Loop - - - - - -
          - -

          Handling the Main Loop

          - -

          The EFL is event-driven. This means that the application polls for data, and listens for events to interact with it.

          - -

          The Ecore library provides the main loop abstraction. It gets data when data is available and sends the events so that costly polling threads are not needed. Ecore manages polling, timers, events, and file descriptors. When there is no ongoing event, the main loop automatically enters an idle mode, minimizing the power consumption. The loop wakes up when needed.

          - -

          Starting the Main Loop

          - -

          To start the Ecore main loop and move your application into the running state, call the ui_app_main() function. The Ecore main loop handles all general events, such as touch, mouse, key, and network events.

          - -
          -int
          -main(int argc, char *argv[])
          -{
          -   ret = ui_app_main(argc, argv, &event_callback, &ad);
          -
          -   return ret;
          -}
          -
          - -

          When your application is running:

          -
          1. Create a window and organize the UI components inside the window.
          2. -
          3. Create the application logic code to be called when callbacks or timed events occurs (for example, animators for animations and timers for timeouts).
          - - -

          Timers

          - -

          Ecore provides timers, which schedule events that are executed later at a specific time. The event can occur once or several times at specific intervals.

          - -

          A timer callback prototype looks like the my_timed_cb() callback function. This function receives data from the application, and returns a Boolean value to specify whether it is called again or completed. The following macros are also provided:

          - -
            -
          • ECORE_CALLBACK_RENEW: the function is called again after the timeout.
          • -
          • ECORE_CALLBACK_CANCEL: the function is not called again, Ecore destroys automatically everything associated with the timer.
          • -
          - -

          To create and destroy a timer:

          - -
            -
          • To create a timer, use the ecore_timer_add() function. The interval, specified in seconds, indicates when the given function is called, and receives the specified data as a parameter. It returns an Ecore_Timer object. -

            In the following example, the my_timed_cb() function is run after 2 seconds and it receives my_data. It is renewed while its count variable value is under 5, and stops after that.

            -
            -Eina_Bool my_timed_cb(void *data)
            -{
            -   static int count = 0;
            -   count++;
            -
            -   if (count < 5) 
            -      return ECORE_CALLBACK_RENEW;
            -
            -   return ECORE_CALLBACK_CANCEL;
            -}
            -ecore_timer_add(2.0, my_timed_cb, my_data);
            -
            -
          • - -
          • To delete the timer, use the ecore_timer_del() function. The timer to delete must still be running, that is, it has not returned a false value. If the timer is not running, the function cannot be called.
          • -
          - -

          To manage a timer:

          -
            -
          • To change the timer's interval, use the ecore_timer_interval_set() function. The interval is specified in seconds. If set during a timer call, this affects the next interval. Use the ecore_timer_interval_get() function to get the timer's current interval.
          • - -
          • To get the timer's pending time, use the ecore_timer_pending_get() function.
          • - -
          • To delay the timer's next occurrence, use the ecore_timer_delay() function. The function adds the specified time to the current interval. It does not change the future occurrences' interval. You can also reset the current interval to its full value by using the ecore_timer_reset() function.
          • - -
          • To pause the currently running timer, use the ecore_timer_freeze() function. The remaining time is saved and used again when the timer is resumed with the ecore_timer_thaw() function.
          • - -
          • To query the current value of the defined timer infrastructure precision, use the ecore_timer_precision_get() function. A higher delay means that more timers can be run together. It diminishes the need to use system wake-ups and thus lowers the power consumption. -

            To set the precision, use the ecore_timer_precision_set() function. This sets the precision for all timers. For example, there are 2 timers, one that expires in 2.0 seconds and another that expires in 2.1 seconds. If the precision is set to 0.1 seconds, Ecore requests the next expiration to happen in 2.1 seconds and runs both callbacks at once, instead of one at 2.0 seconds and the other one 0.1 seconds later. However, if there is no timer expiring in 2.1 seconds, the timeout is at the minimum interval, 2 seconds.

          • -
          - -

          Animators

          - -

          Animators are a specific type of timer, specially designed for on-screen animation purposes:

          - -
            -
          • The time interval is usually known when they are created.
          • -
          • They are called at each screen refresh and their interval can vary. The interval can depend on the system load, the target power consumption, and other factors. The exact interval is not relevant.
          • -
          - -

          To implement animators, Ecore provides the Ecore animator subsystem.

          - -

          Forever-running Animator

          - -

          To create an animation that runs for an indefinite time:

          - -
          -Eina_Bool my_anim_cb(void *data)
          -{
          -   static int count = 0;
          -   count++;
          -   if (count < 5) 
          -      return ECORE_CALLBACK_RENEW;
          -
          -   return ECORE_CALLBACK_CANCEL;
          -}
          -ecore_animator_add(my_anim_cb, my_data);
          -
          - -

          This example looks the same as the one using an Ecore timer. The ecore_animator_add() function takes the callback function and data to pass to it, and returns an Ecore_Animator object. The function is called at a system-defined interval until it returns ECORE_CALLBACK_CANCEL instead of ECORE_CALLBACK_RENEW.

          - -

          Specific-duration Animator

          - -

          An animator callback for an animator running a specific time has a different prototype than the forever running animator.

          - -

          This callback function receives both data and a position which represents the current time among the full timeline, 0 meaning the beginning of the animation, and 1 meaning the end of the animation, returning ECORE_CALLBACK_CANCEL to abort, or ECORE_CALLBACK_RENEW to continue.

          - -

          To create and destroy the animator:

          -
            -
          • To create the animator, use the ecore_animator_timeline_add() function. The first parameter specifies the animator duration, the second parameter is the callback function, and the third parameter is the data to pass to the callback. The data parameter is optional. -
            -Eina_Bool my_anim_cb(void *data, double position)
            -{
            -   if (position < .5) 
            -      return ECORE_CALLBACK_RENEW;
            -
            -   return ECORE_CALLBACK_CANCEL;
            -}
            -ecore_animator_timeline_add(5., my_anim_cb, my_data);
            -
            - -

            In this example, the animator is specified to run for five seconds. The function returns ECORE_CALLBACK_CANCEL as soon as the position among the timeline passes half of the duration, 2.5 seconds.

            - -

            Ecore can generate a virtual position from the original one using ecore_animator_pos_map(position, map, v1, v2). Several maps are available:

            - -
              -
            • ECORE_POS_MAP_LINEAR: linear from 0.0 to 1.0.
            • -
            • ECORE_POS_MAP_ACCELERATE: start slow, then speed up.
            • -
            • ECORE_POS_MAP_DECELERATE: start fast, then slow down.
            • -
            • ECORE_POS_MAP_SINUSOIDAL: start slow, speed up, then slow down at the end.
            • -
            • ECORE_POS_MAP_ACCELERATE_FACTOR: start slow, then speed up, v1 being a power factor: 0.0 is linear, 1.0 is standard acceleration, 2.0 is a much more pronounced acceleration (squared), and 3.0 is cubed.
            • -
            • ECORE_POS_MAP_DECELERATE_FACTOR: start fast, then slow down, v1 being a power factor: 0.0 is linear, 1.0 is standard deceleration, 2.0 is a much more pronounced deceleration (squared), and 3.0 is cubed.
            • -
            • ECORE_POS_MAP_SINUSOIDAL_FACTOR: start slow, speed up, then slow down at the end, v1 being a power factor: 0.0 is linear, 1.0 is a standard sinusoidal, 2.0 is a much more pronounced sinusoidal (squared), and 3.0 is cubed.
            • -
            • ECORE_POS_MAP_DIVISOR_INTERP: start at gradient * v1, interpolated with the power of v2 curve.
            • -
            • ECORE_POS_MAP_BOUNCE: start at 0.0, then drop like a ball bouncing to the ground at 1.0, and bounce v2 times, with a decay factor of v1.
            • -
            • ECORE_POS_MAP_SPRING: start at 0.0, then wobble like a spring to the rest position 1.0, and wobble v2 times, with a decay factor of v1.
            • -
            - -

            Figure: Position maps

            -

            Position maps

            -
          • - -
          • To destroy the animator, use the ecore_animator_del() function. The animator to destroy must be running, that is, it has not returned a false value. If the animator is not running, the function cannot be called.
          • -
          - -

          To manage the animator:

          -
            -
          • To pause the currently running animator, use the ecore_animator_freeze() function. Note that time continues ticking even if the animator is frozen, and that resuming the animation using the ecore_animator_thaw() function does not actually resume, if the full runtime has been passed in the meanwhile.
          • - -
          • To query Ecore for the interval between 2 animator calls, use the ecore_animator_frametime_get() function.
          • - -
          • To change the interval, use the ecore_animator_frametime_set(interval) function. Note that too small a value causes performance and power consumption issues, and too high a value makes the animation jerky.
          • -
          - -

          File Descriptors

          - -

          Ecore provides an infrastructure to monitor file descriptors, so that files do not have to be blocked or polled to read or write on them. Instead, monitor sockets, pipes, or other streams are used to get a file descriptor.

          - -

          To manage the file descriptors:

          -
            -
          • To set a callback, use the _my_cb_func() function. Its first parameter is the data passed to it (optional), and the second one is the Ecore file descriptor handler. Its return value is, as in most Ecore callbacks, ECORE_CALLBACK_RENEW or ECORE_CALLBACK_CANCEL. It tells Ecore whether it wants to be called again or whether its treatment is finished.
          • - -
          • To listen to events, use the ecore_main_fd_handler_add() function.
          • - -
          • To wait for incoming data (that is, to read data) on the my_fd file descriptor, passing my_data: - -
            -Eina_Bool my_fd_cb(void *data, Ecore_Fd_Handler *handler)
            -{
            -   int fd;
            -   fd = ecore_main_fd_handler_fd_get(handler);
            -   count = read(fd, buf, sizeof(buf)); // This is guaranteed not to block
            -
            -   return ECORE_CALLBACK_RENEW;
            -}
            -ecore_main_fd_handler_add(my_fd, ECORE_FD_READ, my_fd_cb, my_data, NULL, NULL);
            -
            -
          • - -
          • To delete a file descriptor handler, use the ecore_main_fd_handler_del() function. This does not close the file descriptor. Always delete the handlers before closing the actual file descriptors.
          • - -
          • To get the handler's file descriptor, use the ecore_main_fd_handler_fd_get() function.
          • - -
          • To select whether a flag is active on a handler, use the ecore_main_fd_handler_active_get() function. For example, the handler is set to monitor both ECORE_FD_READ and ECORE_FD_ERROR. The following example finds out whether the function was called because of an error: - -
            -Eina_Bool my_fd_cb(void *data, Ecore_Fd_Handler *handler)
            -{
            -   int fd;
            -   fd = ecore_main_fd_handler_fd_get(handler);
            -   if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR) == EINA_TRUE) 
            -   {
            -      // We have an error!
            -
            -      return ECORE_CALLBACK_CANCEL;
            -   }
            -   count = read(fd, buf, sizeof(buf)); // This is guaranteed not to block
            -
            -   return ECORE_CALLBACK_RENEW;
            -}
            -ecore_main_fd_handler_add(my_fd, ECORE_FD_READ | ECORE_FD_ERROR, my_fd_cb, my_data, NULL, NULL);
            -
            -
          • - -
          • To change the flags the handler is monitoring, use the ecore_main_fd_handler_active_set() function.
          • -
          - -

          Threads

          - -

          EFL is not entirely thread-safe. This means that if a task is running in another thread and, for example, an Evas object shows the status progress of this task, the object cannot be updated from within the thread. Updating can only be done from the main thread that runs the main loop.

          - -

          Ecore provides a facility to perform tasks on separate worker threads. It is not a simple wrapper around standard threads provided by the operating system. With Ecore threads, it is easier to dispatch a worker function to perform some heavy tasks and get the result once it completes. It does not block the application UI. It is also easy to cancel and reschedule threads. Several threads can be launched simultaneously, since Ecore schedules them according to the number of processors the system has and the maximum amount of concurrent threads set for the application.

          - -

          Ecore has 2 kinds of threads:

          -
            -
          • Short jobs do not give any kind of information on their status to the parent. They are best used for short computing-intensive snippets of code.
          • -
          • Feedback jobs give information on their status to the parent. They are best used for longer snippets requiring a feedback loop, such as an ongoing file download.
          • -
          - -

          Ecore creates a pool of worker threads. The exact count is computed from the number of CPUs or cores, or it can be specified by the application itself.

          - -

          When a worker thread is idle, it picks a job to execute from the waiting list until there is none left. In the following example, there are 2 threads defined by my_short_job() and my_feedback_job(). Both threads take 2 parameters: some data passed to them, and the actual thread running. Call a callback when the jobs end, whether they are cancelled (my_job_cancel()) or end normally (my_job_end()).

          - -
          -struct feedback_msg
          -{
          -   int pos;
          -};
          -
          -void my_short_job(void *data, Ecore_Thread *thread)
          -{
          -   usleep(200000);
          -}
          -
          -void my_feedback_job(void *data, Ecore_Thread *thread)
          -{
          -   int i;
          -   for (i = 0; i < 100; i++) 
          -   {
          -      usleep(50000); // You can have some real computation done
          -      struct feedback_msg *message = malloc(sizeof(struct feedback_msg));
          -      if (message) 
          -      {
          -         message->pos = i;
          -         ecore_thread_feedback(thread, message);
          -      }
          -      if (ecore_thread_check(thread))
          -         return;
          -   }
          -}
          -
          -void my_feedback_job_notify(void *data, Ecore_Thread *thread, void *msg)
          -{
          -   struct feedback_msg *message = msg;
          -   free(message);
          -}
          -
          -void my_job_end(void *data, Ecore_Thread *thread)
          -{
          -   dlog_print(DLOG_INFO, LOG_TAG, "Thread has normally ended.\n");
          -}
          -
          -void my_job_cancel(void *data, Ecore_Thread *thread)
          -{
          -   dlog_print(DLOG_INFO, LOG_TAG, "Thread has been cancelled.\n");
          -}
          -
          -ecore_thread_run(my_short_job, my_job_end, my_job_cancel, my_data);
          -ecore_thread_feedback_run(my_feedback_job, my_feedback_job_notify, my_job_end, 
          -                          my_job_cancel, my_data, EINA_FALSE);
          -
          - -

          To manage threads:

          - -
            -
          • To cancel a thread, use the ecore_thread_cancel() function. However, note that this is done cooperatively: the thread continues to run until it exists. Call the ecore_thread_check() function regularly to check whether the thread has been marked for cancellation and exit if true.
          • - -
          • To run threads that are not accounted for in the worker thread pool, use the ecore_thread_feedback_run() function with the last parameter set to EINA_TRUE. - -

            The feedback message a thread sends as notification can be any kind of data. In the above example, it is a simple integer, but it can be as complex as needed.

            -
          • - -
          • To execute a thread later, use the ecore_thread_reschedule() function. This function is added to the end of the pending tasks.
          • - -
          • To get the maximum number of concurrent threads, use the ecore_thread_max_get() function. If needed, set it by using the ecore_thread_max_set() function, or reset the default value using the ecore_thread_max_reset() function.
          • - -
          • To query the number of active threads, use the ecore_thread_active_get() function. To query the number of available worker threads, use the ecore_thread_available_get() function, which is basically the same as the ecore_thread_max_get() - ecore_thread_active_get().
          • -
          - -

          Idlers

          - -

          When the rendering is done and all work is finished, the main loop enters its idle state until the next loop. You can get the functions of your application called back before the main loop enters or exits the idle state, or when it is in the idle state. They are respectively called Ecore_Idle_Enterer, Ecore_Idle_Exiter, and Ecore_Idler.

          - -

          Figure: Idle loop

          -

          Idle loop

          - -

          The idle enterers, exiters, and idlers all have the same prototype, my_idler(), which receives data and returns ECORE_CALLBACK_RENEW or ECORE_CALLBACK_CANCEL to tell Ecore whether it wants to be called again or is finished.

          - -

          To manage the idlers:

          -
            -
          • To add an idler, use the ecore_idler_add() function.
          • -
          • To delete an idler, use the ecore_idler_del() function.
          • - -
          • To add and delete idle exiters, use the ecore_idle_exiter_add() and ecore_idle_exiter_del() functions.
          • - -
          • To add and delete idle enterers, use the ecore_idle_enterer_add() and ecore_idle_enterer_del() functions. The ecore_idle_enterer_before_add() function is also available, if you want your function to be added at the top of the list so that it is called before the others.
          • -
          - -
          -Eina_Bool my_idle_enterer_cb(void *data)
          -{
          -   return ECORE_CALLBACK_RENEW;
          -}
          -
          -Eina_Bool my_idle_exiter_cb(void *data)
          -{
          -   return ECORE_CALLBACK_CANCEL;
          -}
          -
          -Eina_Bool my_idler(void *data)
          -{
          -   return ECORE_CALLBACK_RENEW;
          -}
          -
          -ecore_idle_enterer_add(my_idle_enterer_cb, my_data);
          -ecore_idle_exiter_add(my_idle_exiter_cb, my_data);
          -ecore_idler_add(my_idler_cb, my_data);
          -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/menu_tutorial_mn.htm b/org.tizen.ui.guides/html/native/efl/menu_tutorial_mn.htm deleted file mode 100755 index 2ea5471..0000000 --- a/org.tizen.ui.guides/html/native/efl/menu_tutorial_mn.htm +++ /dev/null @@ -1,541 +0,0 @@ - - - - - - - - - - - - - - Creating Mobile Menus - - - - - - -
          -

          Creating Mobile Menus

          - - -

          This tutorial shows how to add menus to the application. The example code creates an application with 3 views, these views are showed by an interaction with a menu bar, placed on the top of the application. The application has also a hidden menu that appears only when the menu button is pressed.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - - -

          Defining the Application "Structure"

          - -

          Define the structure of the application:

          -
          typedef struct appdata
          -{
          -   Evas_Object* win; // The main window
          -   Evas_Object* layout; // The Edje layout
          -   Evas_Object* conform; // The conform
          -   Evas_Object *nf; // The Naviframe to handle the views
          -   appmenu_s *menu; // The main menu
          -   appmenu_s *sidemenu; // The side menu
          -   mainview_s *main_view; // The main view (dayselector)
          -   calview_s *cal_view; // The calendar view
          -   dateview_s *date_view; // The date and time view
          -   settview_s *settings_view; // The settings view
          -   Eina_Bool sdmenu_up; // A Boolean variable to keep the side menu status
          -} appdata_s;
          -
          -

          This structure contains some specific variables for the views and the menus.

          -

          Define the main view by using the structure mainview, it is composed of a box (the main container), a dayselector, an image img, and a label lb_main.

          -
          typedef struct mainview
          -{
          -   Evas_Object *box; // The main container of the view
          -   Evas_Object *colorselector; // A color selector
          -   Evas_Object *img; // An image 
          -   Evas_Object *lb_day; // A label
          -} mainview_s;
          -
          -

          The date view is very similar, it contains a box, a datetime component and a label lb_date.

          -
          typedef struct dateview
          -{
          -   Evas_Object *box; // The main container of the view 
          -   Evas_Object *datetime; // A datetime component 
          -   Evas_Object *lb_date; // A label 
          -} dateview_s;
          -
          -

          The last view is the calendar, it contains a box, a calendar and a label lb_cal.

          -
          typedef struct calview
          -{
          -   Evas_Object *box; // The main container of the view 
          -   Evas_Object *calendar; // A calendar component  
          -   Evas_Object *lb_cal; // A label component
          -} calview_s;
          -
          -

          The last members of the application structure are the 2 menus. The main menu is fixed and visible, and the side menu is hidden on application starts. These menus are represented by the appmenu structure.

          -
          typedef struct appmenu
          -{
          -   Evas_Object *tb; // The toolbar
          -   Elm_Object_Item *submenu; // The submenu item
          -} appmenu_s;
          -
          - -

          Defining the Application Theme

          - -

          After the structure is defined, define the UI. In this tutorial, Basic EDC UI Application is used.

          -

          This application structure is based on this skeleton:

          - -

          Figure: Menu skeleton

          -

          Menu skeleton

          - - -

          The window, the conformant and the layout are set by the Basic EDC UI Application skeleton. Setup the containers for UI components and views.

          -

          Create the main_menu SWALLOW part in the .edc file.

          -
          -part
          -{
          -   name: "menu/main";
          -   type: SWALLOW;            
          -   description 
          -   {
          -      state: "default" 0.0;
          -      rel1.relative: 0.0 1.0;
          -      rel2.relative: 1.0 1.0;
          -   }
          -   description 
          -   {
          -      state: "up" 0.0;
          -      rel1.relative: 0.0 0.01;
          -      rel2.relative: 1.0 0.18;
          -      
          -   }
          -} // End menu/main
          -
          -

          This part has two descriptions, one for the real position named up and another out of the screen as the default position. Create these states to animate the menu on application start. The animation is run by animation,menu_main.

          -
          program
          -{ 
          -   name: "animation,menu_main";
          -   source: "";
          -   signal: "load";
          -   action: STATE_SET "up" 1.0;
          -   target: "menu/main";
          -   transition: LINEAR 0.5;
          -} // END animation,menu_main
          -
          -

          For more information about animations, see the Effects tutorial.

          -

          Create another container for the views. This container is also a "SWALLOW" part.

          -
          part 
          -{
          -   name: "view/main";
          -   type: SWALLOW;            
          -   description 
          -   {
          -      state: "default" 0.0;
          -      rel1.relative: 0.0 1.0;
          -      rel2.relative: 1.0 1.0;
          -   }
          -   description 
          -   {
          -      state: "up" 0.0;
          -      rel1.relative: 0.0 1.1;
          -      rel1.to: "menu/main";
          -      rel2.relative: 1.0 1.0;
          -      color: 0 255 0 255; 
          -   }
          -} // END view/main 
          -
          -

          This part has also two descriptions for animation purpose, like the main_menu part.

          -

          The program:

          -
          program 
          -{ 
          -   name: "animation,view_main";
          -   source: "";
          -   signal: "load";
          -   action: STATE_SET "up" 1.0;
          -   target: "view/main";
          -   transition: LINEAR 0.2;
          -} // END animation,view_main
          -
          -

          The last container is the side menu called menu/side.

          -
          -part 
          -{ 
          -   name: "menu/side";
          -   type: SWALLOW;
          -   description 
          -   { 
          -      state: "default" 0.0;
          -      rel1.relative: -0.3 0.0;
          -      rel2.relative: -0.3 1.0;
          -      color: 255 0 0 255; 
          -   }
          -   description 
          -   {
          -      state: "up" 0.0;
          -      rel1.relative: 0.0 0.01;
          -      rel2.relative: 0.3 1.0;
          -     color: 255 0 0 255;
          -   }
          -} // END menu/side
          -
          -

          By default, this container is hidden. Clicking menu button makes it appear. The second description places the container on the left of the screen. Here is the program to run animation:

          -
          - program 
          -{ 
          -   name: "animation,menu_side";
          -   source: "MenuButton";
          -   signal: "show,sidemenu";
          -   action: STATE_SET "up" 1.0;
          -   target: "menu/side";
          -   transition: LINEAR 0.2;
          -} // END animation,menu_side
          -
          -

          This program runs when it receives an event called show,sidemenu from MenuButton source.

          -

          Create a program that does the opposite and starts when it receives a signal called hide,menu_side from MenuButton source.

          -
          -program 
          -{ 
          -   name: "animation,menu_side,hide";
          -   source: "MenuButton";
          -   signal: "hide,sidemenu";
          -   action: STATE_SET "default" 1.0;
          -   target: "menu/side";
          -   transition: LINEAR 0.2;
          -} // END animation,menu_side,hide
          -
          -program 
          -{ 
          -   name: "animation,menu_side";
          -   source: "MenuButton";
          -   signal: "show,sidemenu";
          -   action: STATE_SET "up" 1.0;
          -   target: "menu/side";
          -   transition: LINEAR 0.2;
          -} // END animation,menu_side
          -
          - -

          Creating the Basic UI

          - -

          The view container view/main is structured like this:

          - - -

          Figure: Main view

          -

          Main view

          - -

          The naviframe contains and manages the boxes. For more information, see the Container programming guide. This UI component handle views. In this example each view is contained in a box and the box is contained in the naviframe.

          -

          Create the naviframe in the create_base_gui function and allocate the memory to handle the views and menus of the application.

          -
          -// Memory allocation
          -ad->main_view = calloc(1, sizeof(mainview_s)); // Allocating memory for the main view 
          -ad->cal_view = calloc(1, sizeof(calview_s));   // Allocating memory for the calendar view 
          -ad->date_view = calloc(1, sizeof(dateview_s)); // allocating memory for the date view 
          -ad->settings_view = calloc(1, sizeof(settview_s)); // allocating memory for the Settings view
          -// END of Memory allocation
          -
          -

          Use app_terminate function to free the memory:

          -
          app_terminate(void *data)
          -{
          -   // Release all resources
          -   appdata_s *ad = data;
          -
          -   free(ad->menu);
          -   free(ad->sidemenu);
          -   free(ad->main_view);
          -   free(ad->cal_view);
          -   free(ad->settings_view);
          -} // END of app_terminate
          -
          -

          Create the naviframe:

          - -

          Create the main menu after most of the containers are created. First create a new _build_main_menu function, it takes an appdata_s as a parameter. This function is called by create_base_gui.

          -
          static void _build_main_menu(appdata_s *ad)
          -{
          -   // Memory allocation for the main menu function
          -   appmenu_s *menu = calloc(1, sizeof(appmenu_s));
          -   // Putting the "main" menu in the application data
          -   ad->menu = menu;
          -
          -   // Creation of the "Menu" toolbar
          -   menu->tb = elm_toolbar_add(ad->win);
          -
          -   // Setting the "Menu" Toolbar properties
          -   elm_toolbar_shrink_mode_set(menu->tb, ELM_TOOLBAR_SHRINK_NONE);
          -   elm_toolbar_transverse_expanded_set(menu->tb, EINA_TRUE);
          -   elm_toolbar_homogeneous_set(menu->tb, EINA_FALSE);
          -
          -   // Adding menu items to the "Menu" toolbar
          -   elm_toolbar_item_append(menu->tb, ICON_DIR"/home.png", "Home", _menu_item_selected_cb, ad);
          -   elm_toolbar_item_append(menu->tb, ICON_DIR"/calendar.png", "Calendar", _menu_item_selected_cb, ad);
          -   elm_toolbar_item_append(menu->tb, ICON_DIR"/clock.png", "Date", _menu_item_selected_cb, ad);
          -   elm_toolbar_item_append(menu->tb, ICON_DIR"/settings.png", "Settings", _menu_item_selected_cb, ad);
          -
          -   // Showing the UI component
          -   evas_object_show(menu->tb);
          -
          -   // Adding the UI component to the "menu/main" SWALLOW container defined in the .edc theme file.
          -   elm_object_part_content_set(ad->layout, "menu/main", menu->tb);
          -
          -   // Set the default view 
          -   elm_toolbar_item_selected_set(elm_toolbar_first_item_get(menu->tb), EINA_TRUE);
          -}
          -
          -

          Create a toolbar with elm_toolbar_add. This toolbar is a child of the main window so set ad->win as parameter.

          -

          Setup the behavior of the toolbar, the display mode is set by using elm_toolbar_shrink_mode_set. The toolbar does not scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but it enforces a minimum size, so that all the items fit inside it. It does not scroll or show the items that do not fit under #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it scrolls under #ELM_TOOLBAR_SHRINK_SCROLL mode, and it creates a button to aggregate items which did not fit with the #ELM_TOOLBAR_SHRINK_MENU mode.

          - -

          In this example, there is only a limited number of menu elements and thus ELM_TOOLBAR_SHRINK_NONE is used.

          - -

          Expand the transverse length of the item according the transverse length of the toolbar, giving EINA_TRUE as second parameter of elm_toolbar_transverse_expanded_set.

          - -

          Make the menu items have the same size by setting EINA_TRUE to elm_toolbar_homogeneous_set. This activates the homogeneous mode of the toolbar.

          -

          Add menu items to the toolbar using elm_toolbar_item_append. This function takes 4 parameters:

          -
            -
          • the target toolbar
          • -
          • the icon path for the menu item
          • -
          • the item label
          • -
          • the function to call when the item is clicked
          • -
          • the data to associate with the item for related callbacks.
          • -
          -

          For the icons, add some images in the resource directory of the application res/images and define a macro to contain this path in the application .h file. In this example it is inc/menututorial.h.

          - -
          #define ICON_DIR "/opt/usr/apps/"PACKAGE"/res/images"
          -
          -

          Use the PACKAGE macro to setup this ICON_DIR macro. This way you can add items to the toolbar using icon images placed in the resource directory of the application.

          - -

          The item label is very important, it is used in the item callback function.

          - -

          In this example, only one callback is created to manage all the items but there can be several callback functions. Pass the application data to the callback.

          - -

          This callback is an Evas_Smart_Cb, it must have this prototype:

          -
          -_mycallback(void *data, Evas_Object *obj, void *ev)
          -
          - -

          In this example, the aim of the callback is to create the view which the user has requested. It is named _menu_item_selected_cb, and in this function we recover the calling object text to call the correct view creation function.

          -
          -it = ev;
          -
          -// Get the menu item text
          -str = elm_object_item_text_get(it);
          -
          -// Comparing with the possible view names
          -if (!strcmp(str, "Calendar")) 
          -{
          -   // Build the "Calendar View"
          -   _build_calendar_view(ad);
          -   // Set the view from the application data
          -   view = ad->cal_view->box;
          -}
          -else if (!strcmp(str, "Date")) 
          -{
          -   // Build the "Date View"
          -   _build_date_view(ad);
          -   // Set the view from the application data
          -   view = ad->date_view->box;
          -}
          -else if (!strcmp(str, "Home")) 
          -{
          -   // Build the "Home or main View"
          -   _build_main_view(ad);
          -   // Set the view from the application data
          -   view = ad->main_view->box;
          -}
          -else if (!strcmp(str, "Settings")) 
          -{
          -   // Build the "Settings" view
          -   _build_settings_view(ad);
          -   // Set the view from the application data
          -   view = ad->settings_view->box;
          -}
          -else if (!strcmp(str, "Clock")) 
          -{
          -   // Build the "Date View" 
          -   _build_date_view(ad);
          -   // Set the view from the application data
          -   view = ad->date_view->box;
          -}
          -
          -// Show the view in the naviframe 
          -elm_object_content_set(ad->nf, view);
          -
          -

          The menu has views, Calendar, Date, Settings, and Home (main view). The view names are stored in the menu item label, to get the label compare the returned string with the view names. When the name matches, the view is built by calling the correct function. Store the view in the application data and set up a new content to the naviframe before exit.

          -

          This way when the user clicks a menu item, the view changes. The naviframe component destroys its content on each call of elm_object_content_set. That is why the content must be built again on each item click.

          -

          Create the functions which create the views.

          -
          static void _build_main_view(appdata_s *ad)
          -{
          -   mainview_s *view = ad->main_view;
          -   char buf[PATH_MAX];
          -
          -   // Main box
          -   view->box = elm_box_add(ad->nf);
          -   elm_box_horizontal_set(view->box, EINA_FALSE);
          -   elm_box_homogeneous_set(view->box, EINA_TRUE);
          -
          -   view->colorselector = elm_colorselector_add(view->box);
          -   elm_colorselector_mode_set(view->colorselector, ELM_COLORSELECTOR_PALETTE);
          -   elm_box_pack_start(view->box, view->colorselector);
          -   evas_object_show(view->colorselector);
          -
          -   view->img = elm_image_add(view->box);
          -   evas_object_size_hint_weight_set(view->img, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_size_hint_align_set(view->img, 0.5, 0.5);
          -   evas_object_size_hint_min_set(view->img, 256, 256);
          -   ;snprintf(buf, sizeof(buf), "%s/%s", ICON_DIR, "tizen-logo.png");
          -   if (!elm_image_file_set(view->img, buf, NULL))
          -      elm_object_text_set(view->lb_day, "Problem loading image");
          -   elm_box_pack_start(view->box, view->img);
          -   evas_object_show(view->img);
          -
          -   view->lb_day = elm_label_add(view->box);
          -   elm_object_text_set(view->lb_day, "Main view");
          -   evas_object_size_hint_weight_set(view->lb_day, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_box_pack_end(view->box, view->lb_day);
          -   evas_object_show(view->lb_day);
          -}
          -
          -static void
          -_build_calendar_view(appdata_s *ad)
          -{
          -   calview_s *view = ad->cal_view;
          -
          -   // Main box image = elm_image_add(win);
          -
          -   view->box = elm_box_add(ad->nf);
          -   elm_box_horizontal_set(view->box, EINA_FALSE);
          -   elm_box_homogeneous_set(view->box, EINA_TRUE);
          -
          -   view->calendar = elm_image_add(ad->nf);
          -   evas_object_size_hint_weight_set(view->calendar, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_size_hint_align_set(view->calendar, 0.5, 0.5);
          -   evas_object_size_hint_min_set(view->calendar, 256, 256);
          -   elm_image_file_set(view->calendar, ICON_DIR"/calendar.png", NULL);
          -   elm_box_pack_start(view->box, view->calendar);
          -   evas_object_show(view->calendar);
          -
          -   view->lb_cal = elm_label_add(view->box);
          -   elm_object_text_set(view->lb_cal, "The calendar view");
          -   evas_object_size_hint_weight_set(view->lb_cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_box_pack_end(view->box, view->lb_cal);
          -   evas_object_show(view->lb_cal);
          -} // End of_build_calendar_view
          -
          -

          Each function creates a view and stores it in the application data.

          - -

          Creating a Hidden Menu

          - -

          Add a new function called _build_side_menu to create the side Menu toolbar and add some items to it. This function takes the application data as parameter and stores the built menu in the sidemenu attribute of the structure.

          -
          static void _build_side_menu(appdata_s *ad)
          -{
          -   appmenu_s *sidemenu = calloc(1, sizeof(appmenu_s));
          -   ad->sidemenu = sidemenu;
          -
          -   sidemenu->tb = elm_toolbar_add(ad->win);
          -
          -   elm_toolbar_shrink_mode_set(sidemenu->tb, ELM_TOOLBAR_SHRINK_EXPAND);
          -   elm_toolbar_transverse_expanded_set(sidemenu->tb, EINA_TRUE);
          -
          -   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/home.png", "Home", _menu_item_selected_cb, ad);
          -   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/account.png", "Account", NULL, NULL);
          -   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/contacts.png", "Friends", NULL, NULL);
          -   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/clock.png", "Clock", _menu_item_selected_cb, ad);
          -   elm_toolbar_homogeneous_set(sidemenu->tb, EINA_FALSE);
          -   evas_object_show(sidemenu->tb);
          -   elm_object_part_content_set(ad->layout, "menu/side", sidemenu->tb);
          -   elm_toolbar_horizontal_set(sidemenu->tb, EINA_FALSE);
          -   elm_toolbar_item_selected_set(elm_toolbar_first_item_get(sidemenu->tb), EINA_TRUE);
          -}
          -
          -

          The side menu is created but hidden by default, to make it appear the use must click Home button.

          - -

          By default the Basic EDC UI application creates a function keydown_cb to handle the key down events. In the create_base_gui function an ecore_event_handler_add function is called with the ECORE_EVENT_KEY_DOWN macro and with keydown_cb as callback. In this callback, the KEY_END event puts the window on the lower state.

          -
          keydown_cb(void *data , int type , void *event)
          -{
          -   appdata_s *ad = data;
          -   Ecore_Event_Key *ev = event;
          -   if (!strcmp(ev->keyname, KEY_END)) 
          -   {
          -      // Let window go to hide state
          -      elm_win_lower(ad->win);
          -   }
          -
          -   return ECORE_CALLBACK_DONE;
          -}
          -
          -

          The key name of menu button is XF86Send. Add the menu button key press handling to the keydown_cb. The menu is shown on the first press and hidden it on the second press. Use Eina_Bool sdmenu_up on the application data to store the menu status during the application execution. If ad->sdmenu_up is EINA_TRUE the menu is visible.

          - -

          A program animation,menu_side is defined in the .edc theme file. This program is run when the signal show,sidemenu is received with the source MenuButton. Also the program who hides the side menu is defined and is called animation,menu_side,hide which start on signal hide,sidemenu.

          - -

          Test side menu status by sending the signals using elm_object_signal_emit

          -
          -if (!strcmp(ev->keyname, "XF86Send")) 
          -{
          -   if (ad->sdmenu_up == EINA_TRUE) 
          -   {
          -      // If the menu is visible send a "hide,sidemenu" signal
          -      elm_object_signal_emit(ad->layout, "hide,sidemenu", "MenuButton");
          -      // Store the new menu status (hidden)
          -      ad->sdmenu_up = EINA_FALSE;
          -   }
          -}
          -
          -

          Now the menu appears and disappears when the menu button is pressed.

          -

          The first side menu button sends back to the main view:

          -
          -// Hide the side menu if it's visible
          -if (ad->sdmenu_up == EINA_TRUE) 
          -{
          -   elm_object_signal_emit(ad->layout, "hide,sidemenu", "MenuButton");
          -      ad->sdmenu_up = EINA_FALSE;
          -}
          -
          -

          This way the menu disappears when the view is selected by the user.

          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/multiple_screens_n.htm b/org.tizen.ui.guides/html/native/efl/multiple_screens_n.htm deleted file mode 100755 index 5a93e29..0000000 --- a/org.tizen.ui.guides/html/native/efl/multiple_screens_n.htm +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - - - Multiple Screen Support - - - - - -
          - -

          Multiple Screen Support

          - -

          Tizen is available in various devices which support different screen sizes and resolutions. When developing Tizen applications, you must take this into account if you want your application to function well in various device models.

          -

          Before implementing multiple screen support, make sure you are familiar with the key concepts of multiple screen support.

          - -

          Key Concepts

          -

          Before building a native application for multiple resolutions using Tizen native UI framework, make sure you are familiar with the following concepts:

          - - -

          Multi-scale in Tizen Native UI Framework

          -

          Tizen native UI framework supports multiple scaling. If the application is implemented considering scalability, it is enough to change the elm_scale value in different device environments without modifying the application code.

          - -

          Scale 1.0 in Tizen native UI framework means that the application is displayed in a set size and is not scaled. Scale 1.0 is used in a display environment, such as a desktop. In the desktop environment, the monitor has a resolution between 1280 x 800 and 1920 x 1080, with a size between 20 and 27 inch, and the dpi between 80 and 100.

          - -

          If an application is scaled up or down after implementing it in a desktop environment, it can be used in another device without modifying the code. Each device has a proper scale value for adjusting the application size. Edje, which handles layout and themes in Tizen native UI framework, gets the size of an object by multiplying the size specified by an application using the scale value.

          - -

          The following figure illustrates a 50 px wide object in a 1280 px wide monitor. If the same object is displayed with not scaling in mobile environment, it looks very small. To show the object in mobile environment in the similar size as in the monitor, define the scale is 2.0, so that the object size is 100 px instead of 50 px.

          - -

          Figure: Scaling from desktop to mobile

          -

          Scaling from desktop to mobile

          - -

          Base Scale

          -

          The object scaling must be defined in the config.xml file of this application to show the application in a proper size in other devices. However, the scaling must be based on scale 1.0 or, if the application is based on another scale, this scale must be defined in the config.xml file. This predefined scale is called the "base scale".

          - -

          The size of a scalable object is multiplied with the device scale value, as illustrated in the following figure. If the scalable object (on the left) with the size 10 is created in a device with scale 1.0, the size of the object is 20 in a device with scale 2.0, and 40 in a device with scale 4.0.

          - -

          Figure: Base scale

          -

          Base scale

          - -

          The middle object has a base scale 2.0. The following example shows its scaling in a device with scale 4.0:

          - - - - - - - -
          Scale = Device scale (information in the target) / Base scale (information in the application) -

          For example: 2.0 = 4.0 / 2.0

          -
          - -

          Applying the Base Scale

          -

          To create an application that supports multiple screen sizes, you must learn how to set the base scale in:

          - - -

          Calculating the Base Scale

          - -

          To get the base scale value of your own display, you must know the DPI of the display. Based on the display DPI, you can calculate the base scale, since it is basically proportional to the display DPI with the following formula:

          - -
          -base_scale = (DPI / 90) * profile_factor
          - -

          The profile factor is the value for fitting the object size as a profile. The distance between the user eye and the display differs for each profile. This means that the object size must be different if the device display is changed.

          - -

          The following table lists the profile factors for various profiles.

          - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Profile factors
          ProfileProfile factor
          Wearable0.4
          Mobile - Small Screen (~ 4.4 inch)0.7
          Mobile - Normal Screen (4.5 inch ~)0.8
          Desktop1.0
          - -

          For example, if your display has 233 dpi and the platform uses the mobile profile(small screen), the base scale is calculated like this:

          -
          -1.8 = (233 / 90) * 0.7
          - -

          The base scale of the device is 1.8. If the application is made in the environment using 233 dpi and mobile profile, its base scale must be set to 1.8. For a desktop, the DPI is 90, and its base scale is 1.0.

          - - -

          Setting the Base Scale in EDC

          -

          The application must specify the scale its base scale. The edje objects are scaled properly if the base scale is set in the collection of the edc file, as in the following example:

          - - - - - - - - -
          Note
          The base scale for WVGA is 1.8, and for HD application, 2.4.
          -
          collections 
          -{
          -   base_scale: 1.8; // This value is for WVGA application
          -   parts 
          -   {
          -      part 
          -      {
          -         name: "box"; 
          -         type: RECT;
          -         min: 100 100;
          -         scale: 1;
          -      }
          -   }
          -}
          -
          -

          Setting the Base Scale in C

          -

          The size of the object must be specified in EDC. However, sometimes it is better for an application to the object size in a C file. If the size is defined with no scaling in the C file, the application is displayed in the same size even if the scale changes. To avoid this, use the ELM_SCALE_SIZE macro, as in the following example:

          - -
          #define ELM_SCALE_SIZE(x) x / elm_app_base_scale_get() * elm_config_scale_get()
          - -

          in the definition, the size (x) is changed to a size based on 1.0 (x/elm_app_base_scale_get()) and it is multiplied with the scale of the current target (elm_config_scale_get()).

          - -

          Set the base scale using the elm_app_base_scale_set() function:

          - -
          int app_create(void *data)
          -{
          -   elm_app_base_scale_set(1.8); // This value is for WVGA application
          -}
          -
          -

          After setting the base scale, use the ELM_SCALE_SIZE macro to set the size of an object in the application:

          - -
          evas_object_size_hint_min_set(object, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(100));
          -evas_object_resize(object, ELM_SCALE_SIZE(50), ELM_SCALE_SIZE(50));
          -
          - -

          You can use ELM_SCALE_SIZE macro in any API related with setting objects sizes in Tizen native applications.

          - -

          Scaling without the Base Scale

          - -

          In Tizen, each device has a scale value in proportion to the display. If scaling is enabled, the objects are drawn on the display by multiplying with the user-defined object size and the device scale. If the base scale is set, the objects are drawn by dividing the user-defined object size with the base scale and multiplying it by the device scale.

          - -

          If you use the scale feature without setting the base scale, the result is the same as if you set the base scale to 1.0. Then you do not need to care about the base scale variables, because the pixels roll like a virtual pixel. For example, if you set 1 pixel in 129 dpi without setting the base scale value, the 1 pixel before scaling is equivalent to 1 real physical pixel after scaling. In case of 233 dpi, it is the same with 1.8 pixels after scaling.

          - -

          Always consider the pixel before scaling when defining the application UI, in order to ensure a proper UI display on the screen with a diversity of densities.

          - -
          int app_create(void *data)
          -[ Conversion Formula ]
          -Real physical pixel = (a pixel before scaling) x (dpi / 90) x 0.7
          -
          -

          Where 90 is the default DPI on a desktop and 0.7 is the mobile profile factor.

          - -

          The following table shows some examples.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Pixel conversions
          BaseLow-density device (such as WVGA, 4 inch)High-density device (such as HD, 5 inch)
          DPI129233294
          A pixel before scaling100100100
          Real physical pixel100180260
          Actual base scale1.01.82.6
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/multipoint_touch_n.htm b/org.tizen.ui.guides/html/native/efl/multipoint_touch_n.htm deleted file mode 100755 index 3b15f01..0000000 --- a/org.tizen.ui.guides/html/native/efl/multipoint_touch_n.htm +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - - Tracking Multi-point Touch Events - - - - - - -
          -

          Tracking Multi-point Touch Events

          - - -

          This tutorial demonstrates how you can use the Evas_Object to paint on a canvas and track touch events.

          - -

          Initializing Multi-point Touch

          - -

          This sample is a fully functional application able to track multiple simultaneous clicks. For every click, a black rectangle spot is drawn on the screen. This way it is easy to test the multi-point touch operation with the application.

          - -

          Initialization is implemented in the multitouch.c file.

          -

          The appdata structure includes Evas_Object pointers, a list, and a Boolean flag.

          -
          -typedef struct appdata 
          -{
          -   Evas_Object *win;
          -   Evas_Object *conform;
          -   Evas_Object *nf;
          -   Evas_Object *button;
          -   Evas_Object *box;
          -   Evas_Object *rect;
          -   Evas_Object *label;
          -
          -   // List of mouse spots
          -   Eina_List *spots;
          -
          -   // Flag for checking the mouse down event
          -   Eina_Bool down; 
          -} 
          -appdata_s;
          -
          - -

          The main() function initializes event callbacks and calls the ui_app_main() function to start the EFL application.

          -
          -int
          -main(int argc, char *argv[])
          -{
          -   appdata_s *ad = {0,};
          -   int ret = 0;
          -
          -   ui_app_lifecycle_callback_s event_callback = {0,};
          -   app_event_handler_h handlers[5] = {NULL,};
          -
          -   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;
          -
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
          -   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
          -
          -   ret = ui_app_main(argc, argv, &event_callback, &ad);
          -
          -   return ret;
          -}
          -
          - - -

          The following figure illustrates the Multi-point Touch.

          - -

          Figure: Multi-point Touch screens

          -

          Multi-point Touch screens

          - -

          Handling the Canvas

          - -

          The create_base_gui() function creates base GUI elements including Naviframe and the Naviframe button. Naviframe includes each view screen as an item, which in turn includes the title and a button which clears spots when clicked.

          - -
          static void
          -create_base_gui(appdata_s *ad)
          -{
          -   Elm_Object_Item *nf_it;
          -
          -   // Naviframe
          -   ad->nf = elm_naviframe_add(ad->conform);
          -   elm_object_content_set(ad->conform, ad->nf);
          -   evas_object_show(ad->nf);
          -
          -   // Button
          -   ad->button = elm_button_add(ad->nf);
          -   elm_object_text_set(ad->button, "Clear");
          -   evas_object_smart_callback_add(ad->button, "clicked", button_clicked_cb, ad);
          -
          -   // Create main view
          -   ad->box = create_main_view(ad);
          -   nf_it = elm_naviframe_item_push(ad->nf, "Multi-point Touch",
          -                                   NULL, NULL, ad->box, NULL);
          -   elm_object_item_part_content_set(nf_it, "title_right_btn", ad->button);
          -} 
          -
          - -

          The create_main_view() function creates the main view including the label and an event rectangle.

          -

          The label displays information on mouse event status and coordinates (x, y positions). The event rectangle is received completely through mouse (touch) events. To show 2 elements in a Naviframe content area, a container combining those elements is necessary. A box container functions in that role. The label and rectangle pack end the box and the box is embedded into the Naviframe content area.

          - -
          static Evas_Object *
          -create_main_view(appdata_s *ad)
          -{
          -   Evas_Object *box;
          -
          -   // Box
          -   box = elm_box_add(ad->nf);
          -   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_show(box);
          -
          -   // Label
          -   ad->label = elm_label_add(box);
          -   elm_object_text_set(ad->label, "None");
          -   evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, 0);
          -   evas_object_size_hint_align_set(ad->label, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_repeat_events_set(ad->label, EINA_TRUE);
          -   elm_box_pack_end(box, ad->label);
          -   evas_object_show(ad->label);
          -
          -   // Event Rect
          -   ad->rect = evas_object_rectangle_add(evas_object_evas_get(box));
          -   evas_object_size_hint_weight_set(ad->rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(ad->rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_color_set(ad->rect, 204, 204, 204, 255);
          -   evas_object_repeat_events_set(ad->rect, EINA_TRUE);
          -   elm_box_pack_end(box, ad->rect);
          -   evas_object_show(ad->rect);
          -}
          -
          - -

          The create_spot() function creates a rectangle, resizes the rectangle according to received size input, and moves the rectangle according to received coordinates (x, y positions) input.

          - -
          Evas_Object *
          -create_spot(Evas_Object *parent, Evas_Coord x, Evas_Coord y, int size)
          -{
          -   Evas_Object *spot;
          -   spot = evas_object_rectangle_add(evas_object_evas_get(parent));
          -   evas_object_resize(spot, size, size);
          -   // Adjust x, y positions to be center of object
          -   evas_object_move(spot, x - (size/2), y - (size/2));
          -   evas_object_show(spot);
          -
          -   return spot;
          -}
          -
          - -

          The rectangle object is stored in Eina_List (ad->spots) for managing other functions. The button_clicked_cb() function removes all evas_objects into the ad->spots list, meaning all spot rectangles are cleared.

          - -
          static void
          -button_clicked_cb(void *data, Evas *evas, Evas_Object *object, void *event_info)
          -{
          -   appdata_s *ad = data;
          -   Evas_Object *spot;
          -
          -   EINA_LIST_FREE(ad->spots, spot)
          -   {
          -      evas_object_del(spot);
          -      spot = NULL;
          -   }
          -   elm_object_text_set(ad->label, "Clear");
          -}
          -
          - -

          Managing Touch Events

          - -

          On the bottom of the create_main_view() function, event callbacks are added to the event rectangle. An event callback is added using the evas_object_event_callback_add() function.

          - -

          The following touch event types are supported:

          -
            -
          • EVAS_CALLBACK_MOUSE_DOWN: This event is called when the given object receives the mouse down event.
          • -
          • EVAS_CALLBACK_MOUSE_UP: This event is called when the given object receives the mouse up event.
          • -
          • EVAS_CALLBACK_MOUSE_MOVE: This event is called when the given object receives the mouse move event.
          • -
          • EVAS_CALLBACK_MULTI_DOWN: This event is called when the given object has already received the mouse down event and receives the multi-mouse down event.
          • -
          • EVAS_CALLBACK_MULTI_UP: This event is called when the given object receives the multi-mouse up event.
          • -
          • EVAS_CALLBACK_MULTI_MOVE: This event is called when the given object receives the multi-mouse move event.
          • -
          -

          If the given object receives a mouse event, a callback function is called, and event information, such as coordinates (x, y positions) is passed. The mousemove_cb() function sets the mouse status, positions text in the label, and draws a spot rectangle. To distinguish down and up positions, set different colors for the down and up rectangles.

          - -
          -static void
          -mousemove_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
          -{
          -   appdata_s *ad = data;
          -   Evas_Object *spot;
          -   char buf[1024];
          -   Evas_Event_Mouse_Move *ev = event_info;
          -   Evas_Coord x = ev->cur.canvas.x;
          -   Evas_Coord y = ev->cur.canvas.y;
          -   int size = (int) 5 * elm_config_scale_get();
          -
          -   if (!ad->down)
          -      return;
          -
          -   snprintf(buf, sizeof(buf), "Mouse Move, %d, %d", x, y);
          -   elm_object_text_set(ad->label, buf);
          -
          -   // Draw spot on event position
          -   spot = create_spot(ad->rect, x, y, size);
          -   evas_object_color_set(spot, 0, 0, 0, 255);
          -   ad->spots= eina_list_append(ad->spots, spot);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/naviframe_tutorial_n.htm b/org.tizen.ui.guides/html/native/efl/naviframe_tutorial_n.htm deleted file mode 100755 index 206759b..0000000 --- a/org.tizen.ui.guides/html/native/efl/naviframe_tutorial_n.htm +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - Creating a Naviframe for Navigation - - - - - - -
          -

          Creating a Naviframe for Navigation

          - - -

          Naviframes are containers useful for implementing interfaces with several screens having a previous/next relationship.

          - - -

          Creating Naviframes

          - -

          Naviframes are containers useful for implementing interfaces with several screens having a previous/next relationship.

          - -

          This tutorial shows a UI with three naviframes. Each naviframe is made of 20 screens, each made up of a label with the text "label -<n>", a title with the same text, and previous and next buttons, which are used to navigate between the screens.

          -

          TODO: screenshots of the staged interface

          -

          The naviframe is "one-way": elements are added, and when the user clicks on the "previous" button, they are removed; there is no "next" button by default. To add it, we define a structure that holds the naviframe object along with a stack of the elements that the user has popped by using the "previous" button.

          -

          Note that it is possible to create the elements on-the-fly each time the "next" button is pressed. Both approaches are valid.

          -
          // NOTE: A zipper is a datastructure for an ordered set of elements and a
          -// cursor in this set, meaning there are elements before the cursor (which are
          -// stored inside the naviframe) and after (which are stored in the "popped"
          -// list.
          -struct naviframe_zipper 
          -{
          -   Evas_Object *naviframe;
          -   Eina_List *popped;
          -};
          -
          - -

          To add several naviframes, create a function that factors their creation and initializes the naviframe_zipper structure defined above.

          -
          static struct naviframe_zipper *
          -_naviframe_add(Evas_Object *parent)
          -{
          -   struct naviframe_zipper *z = malloc(sizeof(struct naviframe_zipper));
          -   z->naviframe = elm_naviframe_add(parent);
          -   z->popped = NULL;
          -
          -   evas_object_size_hint_weight_set(z->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(z->naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_show(z->naviframe);
          -   // By default, objects are destroyed when they are popped from the naviframe
          -   // To save and re-use them, enable "preserve_on_pop"
          -   elm_naviframe_content_preserve_on_pop_set(z->naviframe, EINA_TRUE);
          -
          -   return z;
          -}
          -
          -

          Create buttons that are at the top of the naviframe and allow the user to go back and forth between the screens. The naviframe component builds a button for "previous" by default, but allows the programmers to provide their own buttons. It has a specific slot for the "next" button.

          -
          // Save the element that is popped from the naviframe
          -static void
          -_naviframe_prev(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
          -{
          -   struct naviframe_zipper *z = data;
          -   z->popped = eina_list_prepend(z->popped, elm_naviframe_item_pop(z->naviframe));
          -}
          -
          -// Set the first element after the current one available and push it to the
          -// naviframe
          -static void
          -_naviframe_next(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
          -{
          -   struct naviframe_zipper *z = data;
          -   Evas_Object *label, *prev, *next;
          -   const char *text;
          -   Elm_Object_Item *it;
          -
          -   label = eina_list_data_get(z->popped);
          -   z->popped = eina_list_remove_list(z->popped, z->popped);
          -   if (label != NULL) 
          -   {
          -      // The UI component is saved inside the naviframe but nothing more; we need
          -      // to create new buttons and set the title text again (copy the one
          -      // from the label that is saved).
          -      text = elm_object_text_get(label);
          -      // The _button function creates a button which is either "Previous" (-1) or
          -      // "Next" (1)
          -      prev = _button(z, -1);
          -      next = _button(z, 1);
          -      it = elm_naviframe_item_push(z->naviframe, text, prev, next, label, NULL);
          -   }
          -}
          -
          -

          When a naviframe and the pages that go inside it are built, populate it.

          -

          Remember that three naviframes are created, each populated in a different way. The common bits have been factored out as a function and the specific parts are executed through a callback. The generic function is shown below.

          -
          // Generic naviframe-populate function:
          -// Its third (and last) parameter is a callback for customization, i.e. pushes
          -// the new items to a specific position; it returns a "context" value that is
          -// used between its calls and enables behaviors such as "push after the
          -// previously-pushed item" 
          -static struct naviframe_zipper*
          -_naviframe_populate_gen(Evas_Object *parent, const char *id,
          -      void * (*populate_cb) (Evas_Object *nav, const char *title, Evas_Object
          -         *prev, Evas_Object *next, Evas_Object *label, Elm_Object_Item *context)
          -      )
          -{
          -   struct naviframe_zipper *z;
          -   Evas_Object *label, *prev, *next;
          -   Elm_Object_Item *context = NULL;
          -   char buf[256];
          -   int i;
          -
          -   z = _naviframe_add(parent);
          -
          -   for (i = 0; i < 20; i++) 
          -   {
          -      label = elm_label_add(z->naviframe);
          -      snprintf(buf, sizeof(buf), "%s [%d]", id, i);
          -      elm_object_text_set(label, buf);
          -      evas_object_show(label);
          -      evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -      evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -      // The _button function creates a button which is either "Previous" (-1) or
          -      // "Next" (1)
          -      prev = _button(z, -1);
          -      next = _button(z, 1);
          -      // Use the populate_cb callback to provide the customization of the way the
          -      // elements are added inside the naviframe
          -      context = populate_cb(z->naviframe, buf, prev, next, label, context);
          -   }
          -
          -   return z;
          -}
          -
          -

          The prototype of the callbacks is fairly large, but that is because of the syntax for callbacks in C.

          -
          // Push items one after the other
          -static Elm_Object_Item *
          -_populate_cb__push(Evas_Object *nav, const char *title,
          -      Evas_Object *prev, Evas_Object *next, Evas_Object *label,
          -      Elm_Object_Item *context)
          -{
          -   return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
          -}
          -
          -// Push items one after the other but use insert_after for it
          -static Elm_Object_Item *
          -_populate_cb__push_then_insert_after(Evas_Object *nav, const char *title,
          -      Evas_Object *prev, Evas_Object *next, Evas_Object *label,
          -      Elm_Object_Item *context)
          -{
          -   if (context == NULL) 
          -   {
          -      return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
          -   }
          -   else 
          -   {
          -      return elm_naviframe_item_insert_after(nav, context, title, prev, next, label, NULL);
          -   }
          -}
          -
          -// Push one item and repeatedly insert new items before the last inserted
          -// item
          -static Elm_Object_Item *
          -_populate_cb__push_then_insert_before(Evas_Object *nav, const char *title,
          -      Evas_Object *prev, Evas_Object *next, Evas_Object *label,
          -      Elm_Object_Item *context)
          -{
          -   if (context == NULL) 
          -   {
          -      return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
          -   }
          -   else 
          -   {
          -      return elm_naviframe_item_insert_before(nav, context, title, prev, next, label, NULL);
          -   }
          -}
          -
          -

          Create a window with a vertical box, which holds the three naviframes from the Appcore's app_create callback.

          - -
          static bool
          -_app_create(void *data)
          -{
          -   Evas_Object *w, *box;
          -   struct naviframe_zipper *z;
          -
          -   w = elm_win_util_standard_add("Naviframe Test", "Naviframe Test");
          -
          -   box = elm_box_add(w);
          -   elm_box_horizontal_set(box, EINA_FALSE);
          -   elm_box_homogeneous_set(box, EINA_TRUE);
          -   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_show(box);
          -   elm_win_resize_object_add(w, box);
          -
          -   z = _naviframe_populate_gen(w, "Before", _populate_cb__push_then_insert_before);
          -   elm_box_pack_end(box, z->naviframe);
          -
          -   z = _naviframe_populate_gen(w, "After", _populate_cb__push_then_insert_after);
          -   elm_box_pack_end(box, z->naviframe);
          -
          -   z = _naviframe_populate_gen(w, "Push", _populate_cb__push);
          -   elm_box_pack_end(box, z->naviframe);
          -
          -   evas_object_show(w);
          -}
          -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/notification_window_n.htm b/org.tizen.ui.guides/html/native/efl/notification_window_n.htm deleted file mode 100755 index 4e26221..0000000 --- a/org.tizen.ui.guides/html/native/efl/notification_window_n.htm +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - - - - - - - Notification Windows: Supporting Notification Levels, Screenshots, and Input Generators - - - - - -
          - -

          Notification Windows: Supporting Notification Levels, Screenshots, and Input Generators

          - -

          The EFL UTIL utility package supports the following EFL functionalities:

          - - - - -

          Notification Window and Level

          - -

          The EFL UTIL API allows you to set and get the notification level of the notification window (which is of the EFL window type):

          - -
          • efl_util_set_notification_window_level()
          • -
          • efl_util_get_notification_window_level()
          - -

          To understand notification levels, you must first learn about the Tizen window layer hierarchy. Window layers are logical containers used to control the window stack order. Each window belongs to 1 layer and can change the stack order in the layer. Windows in same layer are always placed on or under a window in another layer. In addition to the default "normal layer", there exists a "notification layer", which is always placed above the normal layer.

          - - -

          Figure: Window layers

          -

          Window layers

          - - -

          Each window is set to a specific layer according to its type or properties. Most application windows belong to the normal layer. However, in case of an important alarm or other information crucial to the user, you can set the window to belong to the notification layer. This ensures that the user notices the information immediately, because the window belonging to the notification layer is always shown above the windows in the normal layer.

          - -

          Using the Notification Windows

          - -

          A window that belongs to the notification layer is called a "notification window". To make a notification window:

          - -
          1. Set the window type to NOTIFICATION, by calling the elm_win_add() function with the third parameter set to ELM_WIN_NOTIFICATION.
          2. -
          3. Set the notification level by calling the efl_util_set_notification_window_level() function. -

            The notification level defines the priority of the window, and the notification layer contains 3 levels (EFL_UTIL_NOTIFICATION_LEVEL_1, EFL_UTIL_NOTIFICATION_LEVEL_2, and EFL_UTIL_NOTIFICATION_LEVEL_3).

            -

            The default notification window level is EFL_UTIL_NOTIFICATION_LEVEL_1. Most of notification windows can be set to this level. The EFL_UTIL_NOTIFICATION_LEVEL_2 is a higher level than EFL_UTIL_NOTIFICATION_LEVEL_1, which means that the window set to EFL_UTIL_NOTIFICATION_LEVEL_2 is always on the EFL_UTIL_NOTIFICATION_LEVEL_1 level window. The EFL_UTIL_NOTIFICATION_LEVEL_3 is the highest level in notification windows. Very few applications can use this level.

            - -

            If there are notification windows that have the same level, the most recently created notification window is placed on top of the other window.

            - -
          - -

          Figure: Notification levels

          -

          Notification levels

          - - -

          The following code snippets shown how to make a notification window with a higher level.

          - -
          -#include <Elementary.h>
          -#include <efl_util.h>
          -#include <dlog.h>
          -
          -static Evas_Object *create_win(const char *name)
          -{
          -   Evas_Object *eo;
          -   efl_util_error_e error;
          -   // Create the NOTIFICATION window object
          -   eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
          -
          -   if (!eo) return NULL;
          -
          -   // Set the NOTIFICATION level
          -   error = efl_util_set_notification_window_level(eo, EFL_UTIL_NOTIFICATION_LEVEL_1);
          -
          -   elm_win_title_set(eo, name);
          -   elm_win_autodel_set(eo, EINA_TRUE); 
          -   evas_object_smart_callback_add(eo, "delete,request", _quit_cb, NULL); 
          -	
          -   return eo;
          -}
          - -

          Use the efl_util_get_notification_window_level() function to get the currently set notification level of a window. If the window is not of the notification type, the function returns the -EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE error.

          -
          -#include <Elementary.h>
          -#include <efl_util.h>
          -#include <dlog.h>
          -
          -void get_notification_level (Evas_Object *eo)
          -{
          -   efl_util_error_e error;
          -   efl_util_notification_level_e  notification_level;
          -
          -   if (!eo) return;
          -
          -   // Get the window notification level
          -   error = efl_util_get_notification_window_level (eo, &notification_level);
          -
          -   // Check the return value
          -   if (error== EFL_UTIL_ERROR_NONE)
          -   {
          -      switch (notification_level)
          -      {
          -         case EFL_UTIL_NOTIFICATION_LEVEL_1:
          -            // Do something for level 1
          -            break;
          -
          -         case EFL_UTIL_NOTIFICATION_LEVEL_2:
          -            // Do something for level 2
          -            break;
          -      }
          -   }
          -   else
          -   {
          -      // Error handling
          -   }
          -}
          - -

          Screenshot

          - -

          The EFL UTIL SCREENSHOT API (in mobile and wearable applications) allows you to get the screen image to the user.

          - -

          First you must make the efl_util_screenshot_h structure and initialize the structure members with the efl_util_screenshot_initialize() function. To take the actual screenshot, create screen capture data and return it to the tbm_surface handler with the efl_util_screenshot_take_tbm_surface() function.

          -

          When no longer needed, remember to free the efl_util_screenshot_h structure with the efl_util_screenshot_deinitialize() function.

          - - -

          Input Generator

          - -

          The EFL UTIL INPUT API (in mobile and wearable applications) allows you to generate input events (such as key and touch events).

          - -

          First you must create the efl_util_inputgen_h structure and initialize the structure members with the efl_util_input_initialize_generator() function. To generate actual key or touch events, use the efl_util_input_generate_key() or efl_util_input_generate_touch() function.

          -

          When no longer needed, remember to free the efl_util_inputgen_h structure with the efl_util_input_deinitialize_generator() function.

          - - - - -

          Initializing EFL Utility

          - -

          To use the EFL UTIL API, the following header file has to be included:

          -
          #include <efl_util.h>
          - -

          Creating a Notification Window and Setting a Notification Window Level

          - -

          To create a notification window and set the window level, use the efl_util_set_notification_window_level() function. If the window type is not notification type, the function returns an error.

          -
          #include <Elementary.h>
          -#include <dlog.h>
          -
          -void create_win() 
          -{
          -   Evas_Object *eo;
          -   efl_util_error_e error;
          -   char *name = "Notification window";
          -   
          -   // Create notification window
          -   eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
          -   if (!eo) return;
          -   
          -   // Set notification level
          -   error = efl_util_set_notification_window_level
          -           (eo, EFL_UTIL_NOTIFICATION_LEVEL_1);
          -   if (error != EFL_UTIL_ERROR_NONE)
          -   {
          -      // Do error handling
          -   }
          -}
          -
          - -

          Getting the Notification Window Level

          - -

          To get the notification window level, use the efl_util_get_notification_window_level() function:

          - -
          void create_win() 
          -{
          -   Evas_Object *eo;
          -   efl_util_error_e error;
          -   efl_util_notification_level_e notification_level;
          -   char *name = "Notification window";
          -   
          -   // Create notification window
          -   eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
          -   if (!eo) return;
          -   
          -   // Get notification level
          -   error = efl_util_get_notification_window_level
          -           (eo, &notification_level);
          -   if (error == EFL_UTIL_ERROR_NONE) 
          -   {
          -      switch (notification_level) 
          -      {
          -         case EFL_UTIL_NOTIFICATION_LEVEL_1:
          -            // Do something for notification level 1
          -            break;
          -         case EFL_UTIL_NOTIFICATION_LEVEL_2:
          -            // Do something for notification level 2
          -            break;
          -      }
          -   }
          -}
          - -

          Getting a Screenshot

          - -

          To get a screenshot:

          - -
          1. Initialize with the efl_util_screenshot_initialize() function: -
            -#include <tbm_surface.h>
            -#include <X11/Xlib.h>
            -
            -void capture()
            -{
            -   efl_util_screenshot_h screenshot = NULL;
            -   tbm_surface_h tbm_surface = NULL;
            -   tbm_surface_info_s tsuri;
            -
            -   screenshot = efl_util_screenshot_initialize(width, height);
            -
          2. - -
          3. After getting the efl_util_screenshot_h structure, execute the efl_util_screenshot_take_tbm_surface() function to get the tbm_surface handler which has the screenshot data. -
            -   if (screenshot) 
            -   {
            -      tbm_surface = efl_util_screenshot_take_tbm_surface(screenshot);
            -      if (tbm_surface) 
            -      {
            -         // Treat tbm_surface handler (screenshot data)
            -      }
            -
          4. - -
          5. Free the resources with the efl_util_screenshot_deinitialize() function: -
            -      efl_util_screenshot_deinitialize(screenshot);
            -   }
            -}
          - -

          Generating a Key Input Event

          - -

          To generate key input events:

          - -
          1. Execute the efl_util_input_initialize_generator() function: -
            -void key_event_generator()
            -{
            -   int ret = EFL_UTIL_ERROR_NONE;
            -   efl_util_inputgen_h inputgen = NULL;
            -
            -   inputgen = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD);
            -   if (!inputgen)
            -   {
            -      // Failed to initialize the input generator system
            -
            -      return;
            -   }
            -
            -
          2. - -
          3. After setting input device type, execute the efl_util_input_generate_key() function to generate key input events: -
            -   ret = efl_util_input_generate_key(inputgen, "XF86Menu", 1);
            -   if (ret != EFL_UTIL_ERROR_NONE) 
            -   {
            -      // Failed to generate a "XF86Menu" key press event
            -      ret = efl_util_input_deinitialize_generator(inputgen);
            -      if (ret != EFL_UTIL_ERROR_NONE)
            -      {
            -         // Failed to deinitialize the input generator system
            -      }
            -      return;
            -   }
            -
            -   ret = efl_util_input_generate_key(inputgen, "XF86Menu", 0);
            -   if (ret != EFL_UTIL_ERROR_NONE) 
            -   {
            -      // Failed to generate a "XF86Menu" key release event
            -      ret = efl_util_input_deinitialize_generator(inputgen);
            -      if (ret != EFL_UTIL_ERROR_NONE)
            -      {
            -         // Failed to deinitialize the input generator system
            -      }
            -      return;
            -   }
            -
          4. - -
          5. Free the resources with the efl_util_input_deinitialize_generator() function: -
            -   ret = efl_util_input_deinitialize_generator(inputgen);
            -   if (ret != EFL_UTIL_ERROR_NONE)
            -   {
            -      // Failed to deinitialize the input generator system
            -   }
            -}
            -
          - - - -

          Generating a Touch Input Event

          - -

          To generate touch input events:

          - -
          1. Execute the efl_util_input_initialize_generator() function: -
            -void touch_event_generator()
            -{
            -   int ret = EFL_UTIL_ERROR_NONE;
            -   efl_util_inputgen_h inputgen = NULL;
            -
            -   inputgen = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN);
            -   if (!inputgen)
            -   {
            -      // Failed to initialize the input generator system
            -
            -      return;
            -   }
            -
          2. -
          3. After setting input device type, execute the efl_util_input_generate_touch() function to generate touch input events: -
            -   ret = efl_util_input_generate_touch(inputgen, 0, EFL_UTIL_INPUT_TOUCH_BEGIN, 100, 100);
            -   if (ret != EFL_UTIL_ERROR_NONE) 
            -   {
            -      // Failed to generate a first finger touch press event on (100, 100)
            -      ret = efl_util_input_deinitialize_generator(inputgen);
            -      if (ret != EFL_UTIL_ERROR_NONE)
            -      {
            -         // Failed to deinitialize the input generator system
            -      }
            -      return;
            -   }
            -   ret = efl_util_input_generate_touch(inputgen, 0, EFL_UTIL_INPUT_TOUCH_UPDATE, 110, 110);
            -   if (ret != EFL_UTIL_ERROR_NONE) 
            -   {
            -      // Failed to generate a first finger touch move event to (110, 110)
            -      ret = efl_util_input_deinitialize_generator(inputgen);
            -      if (ret != EFL_UTIL_ERROR_NONE)
            -      {
            -         // Failed to deinitialize the input generator system
            -      }
            -
            -      return;
            -   }
            -   ret = efl_util_input_generate_touch(inputgen, 0, EFL_UTIL_INPUT_TOUCH_END, 110, 110);
            -   if (ret != EFL_UTIL_ERROR_NONE) 
            -   {
            -      // Failed to generate a first finger touch release event to (110, 110)
            -      ret = efl_util_input_deinitialize_generator(inputgen);
            -      if (ret != EFL_UTIL_ERROR_NONE)
            -      {
            -         // Failed to deinitialize the input generator system
            -      }
            -
            -      return;
            -   }
            -
          4. -
          5. Free the resources with the efl_util_input_deinitialize_generator() function: -
            -   ret = efl_util_input_deinitialize_generator(inputgen);
            -   if (ret != EFL_UTIL_ERROR_NONE)
            -   {
            -      // Failed to deinitialize the input generator system
            -   }
            -}
            -
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/panes_tutorial_mn.htm b/org.tizen.ui.guides/html/native/efl/panes_tutorial_mn.htm deleted file mode 100755 index f53dd1f..0000000 --- a/org.tizen.ui.guides/html/native/efl/panes_tutorial_mn.htm +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - - - - - - - - Creating Panes - - - - - - -
          -

          Creating Panes

          - - -

          This tutorial explains how to use Panes in the application.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          Initializing the Application

          - -

          This is how to start an Appcore application.

          -
          #include <Elementary.h>
          -#include <app.h>
          -
          -struct _appdata 
          -{
          -   const char *name;
          -   Evas_Object *win;
          -};
          -
          -static void app_terminate(void *user_data)
          -{
          -   struct _appdata *ad;
          -
          -   if (!user_data)
          -      return;
          -
          -   ad = user_data;
          -
          -   if (ad->win)
          -      evas_object_del(ad->win);
          -}
          -
          -static bool app_create(void *user_data)
          -{
          -   struct _appdata *ad;
          -   Evas_Object *win, *conformant, *naviframe, *panes, *panes_h, *nav_it, *bt;
          -
          -   if (!user_data)
          -      return false;
          -
          -   ad = user_data;
          -
          -   // Create window 
          -   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
          -   win = elm_win_util_standard_add("panes", "Panes tutorial");
          -   elm_win_autodel_set(win, EINA_TRUE);
          -
          -   if (!win)
          -      return false;
          -
          -   ad->win = win;
          -
          -   // Add elm_conformant 
          -   conformant = elm_conformant_add(win);
          -   elm_win_resize_object_add(win, conformant);
          -   evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   evas_object_show(conformant);
          -
          -   // Add naviframe to conformant 
          -   naviframe = elm_naviframe_add(conformant);
          -   elm_object_content_set(conformant, naviframe);
          -   evas_object_show(naviframe);
          -
          -   evas_object_resize(win, 320, 400);
          -   evas_object_show(win);
          -
          -   return true;
          -}
          -
          -int main(int argc, char **argv)
          -{
          -   appdata_s *ad = {0,};
          -   int ret = 0;
          -
          -   ui_app_lifecycle_callback_s event_callback = {0,};
          -   app_event_handler_h handlers[5] = {NULL,};
          -
          -   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;
          -
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
          -   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
          -   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
          -
          -   ret = ui_app_main(argc, argv, &event_callback, &ad);
          -
          -   return ret;
          -}
          -
          -

          The code above creates a window entitled "Panes tutorial", composed of a conformant component that contains a naviframe component. To add a new Panes object, use the _create() function.

          - -

          Creating a Panes Component

          - -

          The elm_panes component adds a draggable bar between two contents. When dragged, this bar resizes the contents' size. To create a new Panes into an Elementary object, use the elm_panes_add() function:

          -
          // Add an elm_panes 
          -panes = elm_panes_add(naviframe);
          -evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -elm_win_resize_object_add(win, panes);
          -evas_object_show(panes);
          -
          -nav_it = elm_naviframe_item_push (naviframe, "Panes view", NULL, NULL, panes, NULL);
          -
          -

          Here the Panes is created and added in the naviframe.

          - -

          Configuring the Panes

          - -

          By default, the orientation of the Panes is vertical. To modify the orientation, use the elm_panes_horizontal_set() function.

          -
          // Add a horizontal elm_panes 
          -panes_h = elm_panes_add(naviframe);
          -elm_panes_horizontal_set(panes_h, EINA_TRUE);
          -
          -

          The code above creates another Panes object and sets the horizontal orientation. To add content in a panes, use the elm_object_part_content_set() function. Here we add the horizontal Panes (panes_h) to the "left" part of the first created Panes (panes).

          -
          elm_object_part_content_set(panes, "left", panes_h);
          -
          - -

          This is how to set a button object to the "right" side of our vertical Panes component.

          -
          // Create a button object 
          -bt = elm_button_add(naviframe);
          -elm_object_text_set(bt, "Right");
          -evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(bt);
          -
          -// and set it to the "right" part of the vertical Panes 
          -elm_object_part_content_set(panes, "right", bt);
          -
          - -

          The content of the horizontal Panes is set with two button objects (up and down). When populating a vertically displayed Panes, the left content is placed at the top, and the right content is placed at the bottom.

          -
          // Create a "Up" button 
          -bt = elm_button_add(naviframe);
          -elm_object_text_set(bt, "Up");
          -evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(bt);
          -elm_object_part_content_set(panes_h, "left", bt);
          -
          -// Create a "Down" button 
          -bt = elm_button_add(naviframe);
          -elm_object_text_set(bt, "Down");
          -evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -evas_object_show(bt);
          -elm_object_part_content_set(panes_h, "right", bt);
          -
          - -

          The elm_panes can be dragged with the mouse but the proportion can also be set with the elm_panes_content_left_size_set() and elm_panes_content_right_size_set() functions. As an example, this is how to set the left size of both panes to 80%.

          -
          // Set the proportion of the panes to 80% 
          -elm_panes_content_left_size_set(panes, 0.8);
          -elm_panes_content_left_size_set(panes_h, 0.8);
          -
          - -

          The Panes proportions can also be fixed so that the user is not able to drag them. To do this, use the elm_panes_fixed_set() function.

          -
          // Fix the Panes proportion 
          -elm_panes_fixed_set(panes_h, EINA_TRUE);
          -
          - -

          Handling Signals

          - -

          The Panes components emit four different signals, depending on the users' interaction with the draggable bar.

          -
            -
          • "press" - The pane is pressed.
          • -
          • "unpressed" - The pane is released after being pressed.
          • -
          • "clicked" - The pane is clicked.
          • -
          • "clicked,double" - The pane is double clicked.
          • -
          -

          We add a callback function for each of them.

          - -

          "clicked" Signal

          - -

          The callback function for the clicked signal prints "Clicked" to standard output.

          -
          // clicked callback 
          -static void
          -_clicked_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   dlog_print(DLOG_INFO, PANES_TAG, "Clicked\n");
          -}
          -
          - -

          This is how to register this callback function to the vertical panes.

          -
          evas_object_smart_callback_add(panes, "clicked", _clicked_cb, panes);
          -
          - -

          "press" Signal

          - -

          The callback function for the "press" signal prints "Pressed" to the standard output.

          -
          // press callback 
          -static void
          -_press_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   dlog_print(DLOG_INFO, PANES_TAG, "Pressed\n");
          -}
          -
          - -

          This is how to register this callback function to the vertical panes.

          -
          evas_object_smart_callback_add(panes, "press", _press_cb, panes);
          -
          - -

          "unpress" Signal

          - -

          For the "unpress" signal, the proportion size of the left content of the Panes component is printed to the standard output. To do this, use the elm_panes_content_left_size_get() function.

          -
          // unpress callback 
          -static void
          -_unpress_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   dlog_print(DLOG_INFO, PANES_TAG, "Unpressed, size : %f\n",
          -      elm_panes_content_left_size_get(obj));
          -}
          -
          -

          This is how to register this callback function to the Panes.

          -
          evas_object_smart_callback_add(panes, "unpress", _unpress_cb, panes);
          -
          - -

          "clicked,double" Signal

          - -

          Hide the left part of the Panes component on the "clicked,double" signal and set the left proportion to 0.0. To restore the left part proportion with a double click on the hidden part of the Panes component, use the elm_panes_content_left_size_get() and elm_panes_content_left_size_set() functions, and a variable to store the value of the current proportion.

          - -
          // double clicked callback 
          -static void
          -_clicked_double_cb(void *data, Evas_Object *obj, void *event_info)
          -{
          -   static double size = 0.0;
          -   double tmp_size = 0.0;
          -   tmp_size = elm_panes_content_left_size_get(obj);
          -   if (tmp_size > 0)
          -   {
          -      elm_panes_content_left_size_set(obj, 0.0);
          -      dlog_print(DLOG_INFO, PANES_TAG, "Double clicked, hidden.\n");
          -   }
          -   else
          -   {
          -      elm_panes_content_left_size_set(obj, size);
          -      dlog_print(DLOG_INFO, PANES_TAG,
          -            "Double clicked, restoring size.\n");
          -   }
          -   size = tmp_size;
          -}
          -
          - -

          This is how to register this callback function to the Panes.

          -
          evas_object_smart_callback_add(panes, "clicked,double", _clicked_double_cb,
          -            panes);
          -
          - -

          Figure: Panes tutorial in action

          -

          Panes tutorial in action

          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/popup_tutorial_wn.htm b/org.tizen.ui.guides/html/native/efl/popup_tutorial_wn.htm deleted file mode 100755 index 37b4ad8..0000000 --- a/org.tizen.ui.guides/html/native/efl/popup_tutorial_wn.htm +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - Creating Wearable Popups - - - - - - -
          -

          Creating Wearable Popups

          - - -

          This tutorial teaches the basics of the popup component interactions.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          Initializing the Popup Application

          - -

          This use case creates an application with a window entitled "Popup Basic Tutorial". The window consists of a conformant component, and a popup is placed inside the conformant.

          - -

          To create a typical elementary application:

          - -
          -static void
          -create_base_gui(appdata_s *ad)
          -{
          -   // Window
          -   ad->win = elm_win_util_standard_add("main", "Popup Basic Tutorial");
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          -
          -   // Conformant
          -   ad->conform = elm_conformant_add(ad->win);
          -   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
          -   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
          -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->conform);
          -   evas_object_show(ad->conform);
          -
          -   create_popup(ad->conform);
          -
          -   // Show the window after the base GUI is set up
          -   evas_object_show(ad->win);
          -}
          -
          -static bool
          -app_create(void *data)
          -{
          -   appdata_s *ad = data;
          -   create_base_gui(ad);
          -
          -   return true;
          -}
          -
          -int
          -main(int argc, char **argv)
          -{
          -   struct app_data ad = {0,};
          -   ui_app_lifecycle_callback_s event_callback = {0,};
          -
          -   event_callback.create = app_create;
          -
          -   return ui_app_main(&argc, &argv, &event_callback, &ad);
          -}
          - -

          Using Popup Styles

          - -

          To create popups using various styles:

          - -
          • Create a basic text-only popup: - -
            -Evas_Object *popup;
            -struct appdata *ad;
            -ad = (struct appdata *) data;
            -
            -popup = elm_popup_add(ad->win_main);
            -evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            -eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            -elm_object_text_set(popup, "This has only texts");
            -evas_object_show(popup);
            -
          • - -
          • Create a popup with a title and text. The title,text attribute is the title area text part that defines the title label. -
            -Evas_Object *popup;
            -struct appdata *ad;
            -ad = (struct appdata *) data;
            -
            -popup = elm_popup_add(ad->win_main);
            -evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            -elm_object_part_text_set(popup, "title,text", "Title");
            -elm_object_text_set(popup,"This Popup has title area and text");
            -eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            -evas_object_show(popup);
            -
          • - -
          • Create a popup with a title, text, and 2 buttons: -
            -Evas_Object *popup;
            -Evas_Object *btn;
            -struct appdata *ad = (struct appdata *) data;
            -
            -popup = elm_popup_add(ad->win_main);
            -evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            -elm_object_part_text_set(popup, "title,text", "Title");
            -eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            -elm_object_text_set(popup, "This is title text 2button popup");
            -
            -btn = elm_button_add(popup);
            -elm_object_style_set(btn, "popup");
            -evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_object_text_set(btn, "Cancel");
            -elm_object_part_content_set(popup, "button1", btn);
            -evas_object_smart_callback_add(btn, "clicked", _response_cb, popup);
            -
            -btn = elm_button_add(popup);
            -elm_object_style_set(btn, "popup");
            -evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_object_text_set(btn, "OK");
            -elm_object_part_content_set(popup, "button2", btn);
            -evas_object_smart_callback_add(btn, "clicked", _response_cb, popup);
            -
            -evas_object_show(popup);
            -
          • - -
          • Create a toast popup: -
            -Evas_Object *popup;
            -struct appdata *ad = (struct appdata *) data;
            -
            -popup = elm_popup_add(ad->win_main);
            -elm_object_style_set(popup, "toast");
            -elm_popup_orient_set(popup, ELM_POPUP_ORIENT_BOTTOM);
            -evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            -elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            -eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            -elm_object_part_text_set(popup,"elm.text", "Saving Contacts to sim");
            -
            -evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL);
            -elm_popup_timeout_set(popup, 2.0);
            -evas_object_smart_callback_add(popup, "timeout", _timeout_cb, NULL);
            -
            -evas_object_show(popup);
            -
          • -
          - -

          Managing Popup Events

          -

          The Elementary popups respond to user interactions with several events.

          -

          To manage popup events:

          - -
            -
          • Handle timeout events: -

            The "timeout" event is triggered whenever a popup is closed as a result of timeout.

            -
            -static void _timeout_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   evas_object_del(obj);
            -}
            -elm_popup_timeout_set(popup, 3.0);
            -evas_object_smart_callback_add(popup, "timeout", _timeout_cb, NULL);
            -
          • - -
          • Handle the block,clicked events: -

            The "block,clicked" event is triggered whenever the user taps on a blocked event area.

            -
            -static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
            -{
            -   evas_object_del(obj);
            -}
            -evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL);
            -
          • - -
          - - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/scalability_n.htm b/org.tizen.ui.guides/html/native/efl/scalability_n.htm deleted file mode 100755 index de81e0a..0000000 --- a/org.tizen.ui.guides/html/native/efl/scalability_n.htm +++ /dev/null @@ -1,762 +0,0 @@ - - - - - - - - - - - - - Scalability Support - - - - - -
          - -

          Scalability Support

          -

          To ensure that your application works well in diverse devices, you must consider scalability when designing the application layout:

          - - -

          Key Concepts

          - -

          When designing the application layout to be scalable, you must pay attention to the following key concepts:

          - -
          • Understand the character of the relative position and the fixed position - -

            In the relative position, the size is determined in proportion to the size of the referred object. For example, if an orange rectangle occupies 30% of the green rectangle, and the green rectangle is expanded, the orange rectangle is expanded accordingly. However, if the scaling value is changed and the green rectangle is not scaled, the orange rectangle remains unchanged too.

            - -

            Figure: Relative position

            -

            Relative position

            - -

            In the fixed position, the size is determined by a value set for the object. For example, the orange rectangle set to the size of 10. If the green rectangle is expanded, the orange rectangle does not change. However, if the scaling value is, for example, doubled, the size of the orange rectangle grows to 20.

            - -

            Figure: Fixed position

            -

            Fixed position

          • - -
          • Use the relative position -

            If you set the object size as a percentage, the ratio remains fixed regardless of the changes in the screen size or resolution. If you want the object size changed in proportion of the window size, use the relative position.

            - -

            Figure: Scaling relative position

            -

            Scaling relative position

          • - -
          • Multiply the scaling value, if you use the fixed size -

            If you use the EDC file to set up the layout, you can set the scale in the part element:

            -
            -parts 
            -{
            -   part 
            -   { 
            -      name: "box"; 
            -      type: RECT;
            -      scale: 1;
            -   }
            -}
            -
            - -

            If you set the fixed size in C code, you can use the ELM_SCALE_SIZE macro:

            -
            evas_object_size_hint_min_set(object, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(100));
            - -

            For more information see Applying the Base Scale.

          • - -
          • Do not fill the width or height out with a fixed size only -

            If you fill the entire height out with a fixed size only and it is scaled, the end result can be larger than the screen size.

            - -

            Figure: Height filled with a fixed size

            -

            Height filled with a fixed size

            - -

            If you set a partial width or height with a fixed size and leave the remaining area flexible, the layout does not expand outside the screen.

            - -

            Figure: Height with a flexible area

            -

            Height with a flexible area

          - - - -

          Scalability Using Elementary UI Components

          - -

          The Tizen platform provides a UI component toolkit library, called Elementary, that includes an extensive set of UI components. You can use elementary UI components to compose your application user interface (UI). While creating the UI, you can set specific properties for the UI components to control the scalable behavior of the UI. Before you try to create a scalable UI using elementary UI components, make sure you understand the following core concepts on how scalability works with elementary UI components.

          - - - - - - - - - - -
          Note
          The Elementary library provides 3 groups of APIs: -
          • Infrastructure: to control the behavior of elementary.
          • -
          • Container: UI components that can contain other UI components.
          • -
          • UI components: elementary UI components, such as buttons, lists, and check and radio boxes.
          - -

          Using Containers for Effective Layouts

          - -

          The Elementary library provides several containers to display UI components in an effective layout. The containers have no visual identity of their own.

          - -
          • Box - -

            The box container makes a layout where child UI components are stacked in either horizontal or vertical direction. The box size is the sum of its child UI components' size:

            -
            • A vertical box calculates its height as the sum of its children's height and its width as the width of the widest child.
            • -
            • A horizontal box calculates its width as the sum of its children's width and its height as the height of the tallest child.
            - -

            Figure: Box layout

            -

            Box layout

            - -

            The box-based linear layout is the best solution to ensure a minimum size for the child UI components in any device or any orientation.

          • - -
          • Grid - -

            The grid container makes a layout where child UI components set their position and size relative to the container position and size. You can define the virtual width and height of the grid (by default: 100 x 100). You then packs the child UI components into the grid while setting their position and size based on the virtual size of the grid.

            - -

            Figure: Grid layout

            -

            Grid layout

            - -

            The grid-based relative layout can always fill the full screen in any device or any orientation. However, the size of the child UI components is changed based on the screen size.

          - - -

          Using Weight and Align Properties

          - -

          To make a layout scalable with UI components, the UI components must be packed into a container using only the weight and align properties based on their minimum size. Do not resize the UI components directly using pixels.

          - -

          The weight and align properties are associated with every elementary UI component, and they serve as hints for the container they are in. They tell the container how the UI component wants to occupy the space and pack itself with other UI components in the container.

          - -

          Weight

          - -

          You can set the weight property with the evas_object_size_hint_weight_set(x_weight, y_weight) function:

          - -
          • Containers use the weights of the child UI components by normalizing them across all child UI components along both X and Y directions.
          • -
          • The parameter values can be 0 or positive values (default: 0.0). -

            0.0 means that the container allocates a minimum size of the UI component area.

            -

            1.0 (EVAS_HINT_EXPAND) means that the container allocates all of the remaining area to the UI component.

          • -
          • If the container has several UI components, it allocates the UI component area relative to the weights of other UI components.
          - -

          Figure: Weight hint

          -

          Weight hint

          - -

          Figure: Weight hint across multiple child UI components

          -

          Weight hint across multiple child UI components

          - -

          Align

          - -

          You can set the align property with the evas_object_size_hint_align_set(x_align, y_align) function:

          - -
          • UI components use the alignment for their position or size along both X and Y directions.
          • -
          • The parameter values can be from 0.0 to 1.0 or -1.0 (default: 0.5).
          • -
          • The values define positions as follows: left is (x=0.0), right is (x=1.0), top is (y=0.0), and bottom is (y=1.0). The center is (x=0.5, y=0.5). -

            -1.0 (EVAS_HINT_FILL) means that the UI component fills all of the allocated area.

          - -

          Figure: Alignment hint

          -

          Alignment hint

          - -

          Scalability Using Edje

          - -

          The Tizen platform provides a complex graphical design and layout library called Edje, which provides an abstraction layer between the application code and the interface. You can use Edje in your Tizen applications to create visual elements and control the layout, look, and feel.

          -

          Internally, Edje holds a geometry state machine and a state graph that defines, for example, what is visible, where, at what size, and with what colors. These details are described to Edje using an Edje .edj file. The file can be produced by using Edje_cc to take a text file (a .edc file) and "compile" an output .edj file that contains the state graph information, images, and any other needed data.

          - -

          While creating Edje, you set specific element properties to control the scalable behavior of the UI. Before creating a scalable UI using Edje, you must be familiar with the following scalability properties and part types.

          - -

          Part

          -

          Parts are used to represent the most basic layout elements, such as a line in a border or a text on an image.

          -

          The parts can have the following property:

          -
          • scale: 0-1 -

            Specifies whether the part scales its size with the scaling factor (Tizen has a scaling factor to resize the application layout and object). This property is used to scale properties, such as font size or min/max size of the part.

            -

            The default value is 0 (off) and the default scaling factor is 1.0. To make a part scalable, set the property to 1 (on).

            -
          - -

          Description

          -

          Every part can have one or more description blocks to define the layout properties of the part.

          -

          The descriptions can have the following properties:

          - -
          • min/max: width height -

            Specifies the minimum or maximum size of the part in pixels. It has no effect on the container size.

            -

            When the scale property of the part is set to 1 (on), the size is multiplied by the scaling factor.

          • - -
          • fixed: 0-1 0-1 -

            When the min or max property is set, this property sets a boolean value for each dimension (horizontal and vertical, respectively) that tells the application whether it must be scaled when resized.

            -

            The default value is 0 0. To fix a part size to its min or max, set the value to 1.

          • - -
          • align: X-axis Y-axis -

            When the displayed object size is smaller than its container, this property moves it along both axes using the relative position.

            -

            To move the property, use x = 0.0 to move to left, x = 1.0 to move to right, y = 0.0 to move to the top, and y = 1.0 to move to the bottom. The x = 0.5, y = 0.5 value sets the object at the center of its container.

            -

            The default value is 0.5 0.5.

          • - -
          • rel1/rel2 -

            Specifies the position of the left-top and bottom-right corners of the part's container.

            -
            • relative: X-axis Y-axis -

              Specifies the relative position of the part's container.

              -

              The default value is 0.0 0.0 for rel1.relative and 1.0 1.0 for rel2.relative.

            • -
            • to/to_x/to_y -

              Specified that a corner must be positioned relatively to another part's container.

              -

              By default, the corners of a part are placed to the whole interface.

            - - - - - - - - -
            Table: Edje part property example
            -
            -collections 
            -{
            -   group 
            -   {
            -      name: "property_test";
            -                                                                 
            -      images 
            -      {
            -         image: "panorama.png" COMP;
            -      }  
            -                                                                 
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "rect1";
            -            type: RECT;
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.3 0.4;}
            -               rel2 {relative: 0.7 0.6;}
            -               color: 0 127 255 255;
            -            }
            -         }
            -         part 
            -         {
            -            name: "rect2";
            -            type: RECT;
            -            // Affected by scaling factor
            -            scale: 1; 
            -            description 
            -            {
            -               state: "default" 0.0;
            -               fixed: 0 1;
            -               // Height: 100 pixels (when the scaling factor is 1.0)
            -               min: 0 100;
            -               rel1 {relative: 0.0 1.0;}
            -               rel2 {relative: 1.0 1.0;}
            -               // Bottom-aligned
            -               align: 0.5 1.0;
            -               color: 255 127 0 255;
            -            }
            -         }
            -         part 
            -         {
            -            name: "image";
            -            // Affected by scaling factor
            -            scale: 1;
            -            description 
            -            {
            -               state: "default" 0.0;
            -               fixed: 1 1;
            -               // Image size: 720 x 180 pixels (when the scaling factor is 1.0)
            -               min: 720 180;
            -               // Y-axis is positioned relative to "rect2" part
            -               rel1 {relative: 0.5 0.0; to_y: "rect2";}
            -               rel2 {relative: 0.5 0.0; to_y: "rect2";}
            -               // Bottom-aligned
            -               align: 0.5 1.0;
            -               image.normal: "panorama.png";
            -            }
            -         }
            -      }
            -   }
            -}
            -

            Part example

            -
          • - -
          • aspect: min max -

            Specifies the width to height ratio to keep when the part is resized. When both values are the same, the ratio is fixed. When they differ, the part is forced to keep the ratio between the min and max properties when resized.

            -

            The default value is 0.0 0.0.

          • - -
          • aspect_preference: dimension -

            Specifies the scope of the aspect property to a given dimension.

            -

            The possible values are BOTH, VERTICAL, HORIZONTAL, and NONE. The default is NONE.

            - - - - - - - - -
            Table: Edje part property aspect example
            -
            -collections 
            -{
            -   group 
            -   {
            -      name: "property_test";
            -
            -      images 
            -      {
            -         image: "island.png" COMP;
            -      }
            -   
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "image";
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.0;}
            -               rel2 {relative: 1.0 1.0;}
            -               image.normal: "island.png";
            -               aspect: 8/5 8/5;
            -               // Keep the aspect ratio based on the part width
            -               aspect_preference: HORIZONTAL;
            -            }
            -         }
            -      }
            -   }
            -}
            -

            Part aspect example

            -
          - -

          Text

          -

          The text elements are used to display text on the screen.

          -

          The texts can have the following properties:

          - -
          • size: font-size -

            Specifies the font size for the text. When the scale property of the part is set to 1 (on), the size is multiplied by the scaling factor.

          • - -
          • min: horizontal vertical -

            Specifies a pair of boolean values that define whether the container can be reduced further than the text size. The property is used to prevent the container from chopping the text.

            -

            When min is set horizontally or vertically, the minimum height or width of the part is decided by the text size.

            -

            The default value is 0 0.

          • - -
          • max: horizontal vertical -

            Specifies a pair of boolean values that define whether the container can be expanded further than the text size.

            -

            When max is set horizontally or vertically, the maximum height or width of the part is decided by the text size.

            -

            The default value is 0 0.

            - - - - - - - - -
            Table: Edje text property example
            -
            -collections 
            -{
            -   group 
            -   {
            -      name: "property_test";
            -
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "text";
            -            type: TEXT;
            -            scale: 1;
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.0;}
            -               rel2 {relative: 1.0 0.0;}
            -               align: 0.5 0.0;
            -               color: 108 108 108 255;
            -               text 
            -               {
            -                  font: "TIZEN";
            -                  // Affected by scaling factor
            -                  size: 80;
            -                  // Minimum height of the part container is decided by the text size
            -                  min: 0 1;
            -                  text: "Test properties!!";
            -               }
            -            }
            -         }
            -      }
            -   }
            -}
            -

            Text example

            - -
          • -
          • fit: horizontal vertical -

            Specifies a pair of values that define whether the text is scaled to fill its container horizontally and/or vertically.

            -

            The default value is 0 0.

            - - - - - - - - -
            Table: Edje text property fit example
            -
            -collections 
            -{
            -   group 
            -   {
            -      name: "property_test";
            -
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "text";
            -            type: TEXT;
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.0;}
            -               rel2 {relative: 1.0 0.1;}
            -               color: 108 108 108 255;
            -               text 
            -               {
            -                  font: "TIZEN";
            -                  // Resize text to fill the container height
            -                  fit: 0 1;
            -                  text: "Test properties!!";
            -               }
            -            }
            -         }
            -      }
            -   }
            -}
            -

            Text fit example

          - - -

          Image

          -

          The image elements are used to display images on the screen.

          -

          The images can have the following properties:

          - -
          • border: left right top bottom -

            Specifies the border size of the image in pixels. This property sets the area of each side of the image to be displayed as a fixed size border, preventing the corners from being changed on a resize.

          • - -
          • border_scale -

            Specifies whether the border scales its size according to the scaling factor.

            -

            The default value is 0 (off). To make the border scalable, the value must be set to 1 (on).

            - - - - - - - - -
            Table: Edje image property example
            -
            -collections 
            -{
            -   group 
            -   {
            -      name: "property_test";
            -
            -      images 
            -      {
            -         image: "00_button_01_normal.png" COMP;
            -      }
            -
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "image";
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.6;}
            -               rel2 {relative: 1.0 0.7;}
            -               image.normal: "00_button_01_normal.png";
            -            }
            -         }
            -         part 
            -         {
            -            name: "ninepatch_image";
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.8;}
            -               rel2 {relative: 1.0 0.9;}
            -               image 
            -               {
            -                  normal: "00_button_01_normal.png";
            -                  border: 4 4 0 0;
            -                  // Affected by scaling factor
            -                  border_scale: 1;
            -               }
            -            }
            -         }
            -      }
            -   }
            -}
            -

            Image example

            - -
          -

          Image Set

          -

          The image set elements are used to display a specific image on the screen based on the container size.

          -

          The image sets can have the following properties:

          - -
          • name: image-name -

            Specifies the name of the image file.

          • - -
          • size: minw minh maxw maxh -

            Specifies the minimum and maximum size that causes a specified image to be selected and shown.

            -

            The image set is used to control resource quality when the image part is scaled to multiple devices. According to the size of the part's container, an appropriate image is loaded.

            - - - - - - - - -
            Table: Edje image set property example
            -
            -collections 
            -{
            -   group 
            -   {
            -      name: "property_test";
            -
            -      images 
            -      {
            -         set 
            -         {
            -            name: "alternative_animal";
            -            image 
            -            {
            -               image: "pig.png" COMP;
            -               size: 640 800 1200 1500;
            -            }
            -            image 
            -            {
            -               image: "monkey.png" COMP;
            -               size: 400 500 639 799;
            -            }
            -            image 
            -            {
            -               image: "cat.png" COMP;
            -               size: 240 300 399 499;
            -            }
            -            image 
            -            {
            -               image: "mouse.png" COMP;
            -               size: 80 100 239 299;
            -            }
            -            image 
            -            {
            -               image: "snail.png" COMP;
            -               size: 0 0 79 99;
            -            }
            -         }
            -      }
            -
            -      parts 
            -      {
            -         part 
            -         {
            -            name: "image1";
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.0;}
            -               rel2 {relative: 1.0 0.45;}
            -               image.normal: "alternative_animal";
            -               aspect: 4/5 4/5;
            -               aspect_preference: BOTH;
            -            }
            -         }
            -         part 
            -         {
            -            name: "image2";
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.5;}
            -               rel2 {relative: 1.0 0.75;}
            -               image.normal: "alternative_animal";
            -               aspect: 4/5 4/5;
            -               aspect_preference: BOTH;
            -            }
            -         }
            -         part 
            -         {
            -            name: "image3";
            -            description 
            -            {
            -               state: "default" 0.0;
            -               rel1 {relative: 0.0 0.8;}
            -               rel2 {relative: 1.0 1.0;}
            -               image.normal: "alternative_animal";
            -               aspect: 4/5 4/5;
            -               aspect_preference: BOTH;
            -            }
            -         }
            -      }
            -   }
            -}
            -

            Image set example

            -
          - -

          Part Types

          -

          You can use fixed and flexible parts:

          - -
          • Fixed parts - -
            • Fixed parts have a minimum size (at least width or height).
            • -
            • When the part scale property is set to 1 (on), the scaling factor has an effect on the minimum size.
            • -
            • Fixed parts are used when the parts must keep a fixed size in any device or any orientation.
          • -
          • Flexible parts -
            • Flexible parts resize according to the container size and other fixed parts' size.
            • -
            • Flexible parts are used when the parts can be resized in any device or any orientation.
          - -

          Figure: Fixed and flexible parts

          -

          Fixed and flexible parts

          - - -

          Aspect Ratio

          - -

          In Tizen, the application generally fills out the screen. However, sometimes you want the application to be shown in a specific aspect ratio, regardless of the screen size.

          -

          As images are scaled in different devices, they are resized based on the container size. The images have specific properties that define the area to be shown when resized.

          - -

          For example, the following table illustrates what happens to the parts marked with yellow rectangles in the following figures, when scaling properties are applied.

          - -

          Figure: Original image [1920x1280 (8:5)]

          -

          Original image [1920x1280 (8:5)]

          - - - - - - - - - - - -
          Note
          To set the required aspect ratio, use the evas_object_size_hint_aspect_set() function or the aspect_preference attribute in the EDC.
          - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Image resizing effects with a specific aspect ratio
          AspectContainer area
          720x384 (15:8)720x640 (9:8)
          HORIZONTAL -

          Resizing based on the container width while keeping the image aspect ratio.

          -

          Extra height goes outside the image area and is clipped.

          Scaling effect

          Scaling effect

          VERTICAL -

          Resizing based on the container height while keeping the image aspect ratio.

          -

          Extra width goes outside the image area and is clipped.

          Scaling effect

          Scaling effect

          BOTH -

          Resizing based on the container area while keeping the image aspect ratio.

          -

          No extra width or height goes outside the image area, so the entire image is always shown.

          Scaling effect

          Scaling effect

          NONE -

          Resizing to fill the available area while keeping the image aspect ratio.

          -

          Extra width or height goes outside the image area and is clipped.

          Scaling effect

          Scaling effect

          - -

          Setting the Image Aspect Ratio

          -

          In case of an image object, you can set its aspect ratio with additional APIs:

          - -
          • elm_image_fill_outside_set() -

            If the function is set to TRUE, the image resizes to fill the entire area while keeping its aspect ratio. It lets the extra width or height go outside of the area (same result as with the aspect NONE in the above table).

          • - -
          • elm_image_aspect_fixed_set() - -

            If the function is set to FALSE, the image resizes to fill the entire area without keeping its original aspect ratio. The image can be distorted to fit the area.

            - - - - - - - - - - - - - - -
            Table: Image resizing without keeping the aspect ratio
            Container area
            720x384 (15:8)720x640 (9:8)

            Scaling effect

            Scaling effect

            -
          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/theme_n.htm b/org.tizen.ui.guides/html/native/efl/theme_n.htm deleted file mode 100755 index 00ac2ce..0000000 --- a/org.tizen.ui.guides/html/native/efl/theme_n.htm +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - Themes: Specifying the UI Look and Feel - - - - - -
          - -

          Themes: Specifying the UI Look and Feel

          - - -

          Tizen provides powerful theme features you can use to easily change your applications' UI look and feel. A theme is a collection of visual identities, which provide the graphical appearance of applications. A theme comprises a layout, shapes, fonts, and colors for the UI components.

          - -

          The Tizen platform provides a default theme for UI components implemented based on the Tizen UX design concept (AIR – light and simple). To change the current look and feel, you can replace the default theme with a customized theme package.

          - -

          The Edje library used by Elementary provides themes. You can also use Edje to create your own objects to modify the application appearance with a unique GUI. The UI components are customizable so that each application can have its own customized theme to overlay the default theme.

          - -

          Edje supports separation between layout and logic. While it is possible to implement both GUI and logic in the C code, a loose coupling of GUI and logic is more convenient when you want to revise, add, or delete application UI components. In EFL, the GUI is handled by Edje, while application logic is handled in the C code.

          - -

          Edje was designed as a theme layer for moving the look, feel, and animation of objects into separate data files loaded at runtime. Using a plain text EDC file you can create your application's layout without writing a single line of code. EFL can even change the theme of application at runtime without restarting the application.

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/threads_n.htm b/org.tizen.ui.guides/html/native/efl/threads_n.htm deleted file mode 100755 index 0e837b2..0000000 --- a/org.tizen.ui.guides/html/native/efl/threads_n.htm +++ /dev/null @@ -1,507 +0,0 @@ - - - - - - - - - - - - - Using Threads - - - - - -
          - -

          Using Threads

          - -

          Threads are concurrent execution environments that are lighter than full-blown processes because they share some operating system resources. Threads make it possible to do several things at the same time while using less resources and offering simpler synchronization and data exchange compared to processes.

          - -

          If you move a blocking operation to a separate thread, it cannot block the event loop and keeps the user interface reactive. Blocking the event loop and using long-running callbacks means the application cannot update its graphical user interface.

          - -

          While threads can be useful, they are not always the best choice:

          - -
          • The first rule to using threads is to avoid them as much as possible, as there are often better tools and approaches. For example, to do network transfers, use Ecore_Con that integrates with the event loop to use a function based on callbacks. Being able to use such a function means that specific support work has been done in libraries. In some cases, using a function and libraries is impossible, and in those situations threads are required.
          • -
          • Use threads in CPU-intensive tasks and disk IOs. For example, a thread is the appropriate way to apply filters to an image or to a video without blocking the interface.
          • -
          • Use threads to take advantage of multiple available CPU cores, if the workload can be split into several units of work and spread across the cores. A typical example for an image processing application on a quad-core CPU is to process 4 images at once, each on 1 thread. For such tasks, the thread pool helps with the creation and scheduling of the threads, handling all the grunt work.
          - -

          Thread Safety

          - -

          If several strings have to work on the same resources, conflicts can happen as the threads are run in parallel. For example, if thread A modifies several values while thread B is reading them, it is likely that some of the values read by B are outdated. Similar issues can happen if both threads are modifying data concurrently.

          - -

          These kinds of conflicts are called race-conditions: depending on which thread is faster, the output changes and can be incorrect. Avoiding such issues is called thread safety. Thread safety involves critical sections, which are blocks of code that operate on shared resources and must not be accessed concurrently by another thread.

          - -

          The usual solution for ensuring exclusive access to shared resources is mutual exclusion: only 1 thread can operate on the data at any given time. Mutual exclusion is often implemented through locks. Before attempting to operate on a shared resource, the thread waits until it can lock something called a mutex (stands for mutual exclusion), then operates on the resource, and unlocks the mutex. Operating systems guarantee that only 1 thread can lock a mutex at a given time: this ensures that only 1 thread operates on the shared resource at one time.

          - -

          For more information on thread safety, see Low-level Functions.

          - -

          Thread Pools

          - -

          Threads are operating system resources: while much lighter than processes, they still have a cost. Moreover, spawning a thousand threads means that each of them only gets 1/1000th of the total CPU time: each thread is progressed slowly and, in the worst case, the system wastes all of its time switching between threads without doing any actual work.

          - -

          Thread pools solve this problem. In thread pools, upto a maximum number of threads are created on-demand and used to execute tasks. When the tasks are finished, they are kept alive but sleeping. This avoids the cost of creating and destroying them.

          - -

          In EFL, the thread pool is controlled by a thread_max parameter, which defines the maximum number of threads running at the same time. Another control feature is the func_end() callback that runs from the main loop thread after a task has completed and is typically used to extract the data from the finished task and make it available to the main loop.

          - -

          To manage the maximum number of threads:

          - -
            -
          • To retrieve the current value, use the ecore_thread_max_get() function. -
          • - -
          • To set the value, use the ecore_thread_max_set() function. The value has a maximum of 16 times the CPU count. -
          • - -
          • To reset the maximum number of threads, use the ecore_thread_max_reset() function. - -
          • - -
          • To get the number of available threads in the pool, use the ecore_thread_available_get() function. The function returns the current maximum number of threads minus the number of running threads. The number can be a negative value, if the maximum number of threads has been lowered. -
          • -
          - -

          The following figures illustrate the thread pool. The first figure shows the occupancy of a hypothetical thread pool. There are several tasks, of which 4 are running. The thread_max parameter of the pool is 4, and the other tasks are waiting. There is no thread with its func_end() callback currently called.

          - -

          Figure: Thread pool, step 1

          -

          Thread pool, step 1

          - -

          When a task, applying the sepia filter on image1, finishes, the corresponding func_end() function is invoked from the main loop.

          - -

          Figure: Thread pool, step 2

          -

          Thread pool, step 2

          - -

          With the task done, one of the threads from the pool becomes available, and another thread, adding the reverberation effect on audio3, can run in it.

          - -

          Figure: Thread pool, step 3

          -

          Thread pool, step 3

          - -

          As long as there are tasks to be done, the thread pool continues the same way, running tasks in its threads whenever a thread is available.

          - - -

          Thread Management with Ecore

          - -

          Ecore offers a simplified API for managing threads in EFL applications. The Ecore API applies to a typical scenario where the main thread creates another thread, which in turn sends data back to the main thread or calls GUI-related functions. GUI-related functions are not thread-safe.

          - -

          Creating Threads with Ecore

          - -

          The threads created with Ecore are by default integrated with the thread pool and offer simple callback-based ways to interact with the main loop. New threads are created as needed until the maximum capacity of the thread pool is reached.

          - -
          • To return values to the main thread: -

            Use the ecore_thread_feedback_run() function to send intermediate feedback from the thread to the main loop.

          • - -
          • To return only the final value to the main thread: -

            To create and run a thread, use the ecore_thread_run() function. It runs a function inside a thread from the thread pool and takes care of all the low-level work. It returns the corresponding thread handler or NULL on failure.

            - -

            The most common way to return data from one thread to the main thread is to put a pointer to it in the data. When the thread is aborted or finishes, either func_cancel() or func_end() is called from the main loop. The functions are running in the simpler context of a single thread running at once and therefore avoid race-conditions.

            - -

            The data pointer approach can only be used when the data is shared between the one thread and the main thread only. However, this does not prevent you from using the func_end() callback to merge the results into a single data structure. For example, you can add all the values computed by the threads to an Eina_List, as all the operations on the list happen from a single thread and therefore one after the other and not concurrently.

          - - -

          Running Callbacks from the Main Loop

          - -

          If you are performing operations in another thread and want to update a progress bar, the update operation must be done from the main thread. The simplest way is to use the ecore_main_loop_thread_safe_call_async() function, which takes a function and some data as parameters and instructs the main loop to execute the given function with the given data.

          - -

          Depending on the kind of thread the function is called from, the process differs:

          -
            -
          • If the function is called from a thread that is not the main one, the function sends a message to the main loop and returns quickly. The message is processed in order, similarly to others.
          • - -
          • If the function is called from the main thread, the function is called immediately as if it were a direct call.
          • -
          - -

          If you want to wait until the callback is called and returns, use the ecore_main_loop_thread_safe_call_sync() function, which is similar but synchronous. Since it is synchronous, it can also return the value returned by the callback.

          - -

          Low-level Functions

          - -

          Eina offers low-level functions that are portable across the operating system, such as locks, conditions, semaphores, barriers, and spinlocks. The functions follow closely the logic of pthreads.

          - -

          While these functions are useful, they are building blocks and not usually useful in EFL applications considering the higher-level functions that are available in Ecore.

          - -

          For an introduction to threads and pthreads in particular, see:

          - - - -

          If you are already familiar with threads, see the standard pthreads documentation and the Eina reference documentation, or the following function lists. Remember that the Eina functions map very closely to the pthreads functions.

          - - - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Locks (mutual exclusions)
          pthreads functionEina equivalent
          pthread_mutex_new()eina_lock_new()
          pthread_mutex_destroy()eina_lock_free()
          pthread_mutex_lock()eina_lock_take()
          pthread_mutex_trylock()eina_lock_take_try()
          pthread_mutex_unlock()eina_lock_release()
          none (prints debug information on the lock)eina_lock_debug()
          - - - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Conditions (notifications when condition objects change)
          pthreads functionEina equivalent
          pthread_cond_init()eina_condition_new()
          pthread_cond_destroy eina_condition_free()
          pthread_cond_wait()eina_condition_wait()
          pthread_cond_timedwait()eina_condition_timedwait()
          pthread_cond_broadcast()eina_condition_broadcast()
          pthread_cond_signal()eina_condition_signal()
          - - - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - -
          RWLocks (Read-write locks, for multiple-readers/single-writer scenarios)
          pthreads functionEina equivalent
          pthread_rwlock_init() -eina_rwlock_new()
          pthread_rwlock_destroy()eina_rwlock_free()
          pthread_rwlock_rwlock_rdlock() -eina_rwlock_take_read()
          pthread_rwlock_rwlock_wrlock() -eina_rwlock_take_write()
          pthread_rwlock_unlock() -eina_rwlock_release()
          - - - ---- - - - - - - - - - - - - - - - - - - - - - - -
          TLS (Thread-Local Storage)
          pthreads functionEina equivalent
          pthread_key_create()eina_tls_new()
          pthread_key_delete()eina_tls_free()
          pthread_getspecific()eina_tls_get()
          pthread_setspecificeina_tls_set()
          - - - ---- - - - - - - - - - - - - - - - - - - - - - - -
          Semaphores (access restrictions for a set of resources)
          pthreads functionEina equivalent
          sem_init()eina_semaphore_new()
          sem_destroy()eina_semaphore_free()
          sem_wait()eina_semaphore_lock()
          sem_post()eina_semaphore_release()
          - - - ---- - - - - - - - - - - - - - - - - - - -
          Barriers
          pthreads functionEina equivalent
          pthread_barrier_init()eina_barrier_new()
          pthread_barrier_destroy()eina_barrier_free()
          pthread_barrier_wait()eina_barrier_wait()
          - -

          Thread Use Examples

          - -

          The following examples display a window with a label. An auxiliary thread semi-regularly changes the text of the label. If you want to display a regular animation, use the Ecore animators described in the Main Loop guide.

          - -

          To use the ecore_thread_feedback() function:

          - -
            - -
          1. Implement the GUI function that sets the text of a label and can be called from the main thread. - -
            -static void
            -_set_label_text(void *data, Ecore_Thread *thread __UNUSED__, void *msgdata)
            -{
            -   char buf[64];
            -   appdata_s *ad = data;
            -   snprintf(buf, sizeof(buf), "Tick %d", (int)(uintptr_t)msgdata);
            -   elm_object_text_set(ad->label, buf);
            -}
            -
            -
          2. -
          3. Send the feedback from the other thread using the ecore_thread_feedback() function. The following function does nothing besides sending the feedback and sleeping. - -
            -static void
            -_long_function(void *data __UNUSED__, Ecore_Thread *thread)
            -{
            -   int iteration;
            -   // Change the text roughly every 1 second. This is only an example; if you
            -   // want regular animations, use Ecore animators!
            -   for (iteration = 0; ; iteration++) 
            -   {
            -      // Since you are running from another thread, you need to take special
            -      // care and instead send data to the main thread and have it run the
            -      // feedback function given when creating the thread
            -      ecore_thread_feedback(thread, (void*)(uintptr_t)iteration);
            -      // Sleep for roughly one second
            -      sleep(1);
            -   }
            -}
            -
            -
          4. - -
          5. Create an end function that is called when the thread exits. In this example, the end function is called only right before the application exits. However, if the blocking function is more complex, it can trigger the end function. - -
            -static void
            -_end_func(void *data, Ecore_Thread *thread __UNUSED__)
            -{
            -   appdata_s *ad = data;
            -   elm_object_text_set(ad->label, "Ticks over");
            -}
            -
            -
          6. - -
          7. Call the ecore_thread_feedback_run() function to start the thread: - -
            -ecore_thread_feedback_run(_long_function, _set_label_text, _end_func, NULL, ad, EINA_FALSE);
            -
            -
          8. -
          - -

          To use the ecore_main_loop_thread_safe_call_sync() function:

          - -
            -
          1. Implement the GUI function that sets the text of a label and can be called from the main thread. The function receives data as a structure and alternatively displays "Tick d" or "Tock d". - -
            -struct thd 
            -{
            -   appdata_s *ad;
            -   Eina_Bool tick_not_tock;
            -   int iteration;
            -};
            -static void *
            -_set_label_text_tick_tock(void *data)
            -{
            -   char buf[64];
            -   struct thd *thd = data;
            -   snprintf(buf, sizeof(buf), "%s %d", (thd->tick_not_tock ? "Tick" : "Tock"), thd->iteration);
            -   elm_object_text_set(thd->ad->label, buf);
            -
            -   return NULL;
            -}
            -
            -
          2. - -
          3. Use the ecore_main_loop_thread_safe_call_sync() function call the GUI function. Differentiate between the ticks and the tocks: - -
            -static void
            -_long_function_tick_tock(void *data, Ecore_Thread *thread __UNUSED__)
            -{
            -   struct thd *thd = malloc(sizeof(struct thd));
            -   thd->ad = data;
            -   for (thd->iteration = 0; ; (thd->iteration)++) 
            -   {
            -      thd->tick_not_tock = EINA_TRUE;
            -      ecore_main_loop_thread_safe_call_sync(_set_label_text_tick_tock, thd);
            -      sleep(1);
            -      thd->tick_not_tock = EINA_FALSE;
            -      ecore_main_loop_thread_safe_call_sync(_set_label_text_tick_tock, thd);
            -      sleep(1);
            -   }
            -   free(thd);
            -}
            -
            -
          4. - -
          5. Start the thread through the ecore_thread_run() function: - -
            -ecore_thread_run(_long_function_tick_tock, _end_func, NULL, ad);
            -
            -
          6. -
          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/tools_n.htm b/org.tizen.ui.guides/html/native/efl/tools_n.htm deleted file mode 100755 index eba7d01..0000000 --- a/org.tizen.ui.guides/html/native/efl/tools_n.htm +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - Tools - - - -
          -
          -

          Mobile native Wearable native

          -
          - - -
          - -
          - -

          Tools

          -

          Eina provides a number of tools, such as string manipulation, that make your life easier when coding applications:

          - -
            -
          • Convert fast: conversion from, for example, strings to integers and double
          • -
          • Counter: measures the number of calls and their time
          • -
          • Error: error identifiers
          • -
          • File: file list and path split
          • -
          • Lazy allocator: lazy allocator
          • -
          • Log: full-featured logging system
          • -
          • Magic: provides runtime type checking
          • -
          • Memory Pool: abstraction for various memory allocators
          • -
          • Module lists: loads and shares modules using the Eina_Module standard
          • -
          • Rectangle: rectangle structure and standard manipulation methods
          • -
          • Safety Checks: extra checks that report unexpected conditions and can be disabled during compilation
          • -
          • String: set of functions that manage C strings
          • -
          - -

          String

          - -

          When creating applications, you always need to manipulate strings. Eina provides a very useful API for manipulating C strings:

          - -
          • - -

            The most common string manipulation is the "split". If you have a string, such as "Rasterman:Bluebugs:Tasn:Illogict:billiob:Puppet_Master", and you want to print it in an easily readable format, you can use the eina_str_split() function to split the string using a delimiter. The first parameter is the string to split, the second determines where to split the string, and the final parameter is the maximum number of strings to split the string into. If you set a number less than 1, it splits the string as many times as possible.

            -

            The function returns a newly-allocated NULL-terminated array of strings, or NULL, if it fails to allocate the array. Always remember to free the memory allocated by the eina_str_split() function.

            - -
            -char *nicks = "Rasterman:Bluebugs:Tasn:Illogict:billiob:Puppet_Master";
            -char **result_arr;
            -int i;
            -
            -// Splitting the string with ':' delimiter
            -result_arr = eina_str_split(names, ":", 0);
            -// Printing the result
            -for (i = 0; result_arr[i]; i++)
            -   printf("Nick : %s\n", result_arr[i]);
            -// Remember to free memory
            -free(arr[0]);
            -free(arr);
            -
          • - - -
          • To change the string to lowercase or uppercase, use the eina_str_tolower() and eina_str_toupper() functions. They change the case for all characters of the given string. These functions modify the original strings.

            - -
            -char *str;
            -// Initialize the string
            -str = malloc(sizeof(char) * 4);
            -strcpy(str, "bsd");
            -// Change the string to uppercase
            -eina_str_toupper((char **)&str);
            -printf("%s\n", str);
            -// Change the string to lowercase
            -eina_str_tolower(&str);
            -printf("%s\n", str);
            -// Free the allocated memory
            -free(str);
            -
          • -
          • If you need to "join" 2 strings of known length, use the eina_str_join() function. The fist parameter is the buffer to store the result, the second is the size of the buffer, the third is the separator between the 2 strings, and the 2 final parameters are the stings to be joined.

            - -
            -char *part1 = "Tizen powered by";
            -char *part2 = "Enlightenment Foundation Libraries";
            -char *res;
            -size_t size;
            -// Calculate the string size + 1 for the delimiter
            -size = strlen(part1) + strlen(part2) + 1
            -// Allocate memory for the result
            -res = malloc(sizeof(char) * size);
            -// Join the strings
            -eina_str_join(res, size, ' ', part1, part2);
            -printf("%s\n", res);
            -// Free the allocated memory
            -free(res):
            -
          • -
          • To check whether a string starts or ends with another string, use the eina_str_has_prefix() or eina_str_has_suffix() function. You can also check whether a string has a particular extension with the eina_str_has_extension() function.

            - -

            These functions return EINA_TRUE if the given string contains the specified prefix, suffix, or extension, and EINA_FALSE if it does not.

            - -
            -char *names = "Carsten;Cedric;Tom;Chidambar;Boris;Philippe"
            -if (eina_str_has_prefix(names, "Carsten"))
            -   printf("String starts with 'Carsten'")
            -if (eina_str_has_suffix(names, "Philippe"))
            -   printf("String ends with 'Philippe'")
            -if (eina_str_has_extension(names, "philippe"))
            -   printf("String has extension 'philippe'")
            -else
            -   printf("String does not have extension "philippe)
            -
          - -

          Memory Pool

          - -

          The Eina_Mempool tool provides memory pool functionality. With a memory pool, you can preallocate fixed-size memory spaces for easy memory management.

          - -

          The following mempools are available:

          -
            -
          • buddy
          • -
          • chained_pool
          • -
          • ememoa_fixed and ememoa_unknown
          • -
          • fixed_bitmap
          • -
          • pass_through
          • -
          • one_big
          • -
          - -

          Safety Checks

          - -

          Eina safety checks are a set of macros that can be used to check for parameters or values that must never occur. The concept is similar to the assert() function, but safety checks log the parameter or value and return instead of aborting your program.

          - -

          The following safety checks are available:

          -
            -
          • EINA_SAFETY_ON_NULL_RETURN(exp)
          • -
          • EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val)
          • -
          • EINA_SAFETY_ON_NULL_GOTO(exp, label)
          • -
          • EINA_SAFETY_ON_TRUE_RETURN(exp)
          • -
          • EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val)
          • -
          • EINA_SAFETY_ON_TRUE_GOTO(exp, label)
          • -
          • EINA_SAFETY_ON_FALSE_RETURN(exp)
          • -
          • EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val)
          • -
          • EINA_SAFETY_ON_FALSE_GOTO(exp, label)
          • -
          • EINA_ARG_NONNULL(...)
          • -
          - -

          To return if a variable is NULL, use the EINA_SAFETY_ON_NULL_RETURN() function. This macro calls return if the given parameter is NULL.

          - -
          -Eina_Bool myfunction(char *param) 
          -{
          -   // If my param is NULL, EINA_SAFETY_ON_NULL_RETURN calls "return"
          -   EINA_SAFETY_ON_NULL_RETURN(param);
          -
          -   printf("My pram is : %s\n", param);
          -
          -   return EINA_TRUE;
          -} 
          -
          - -

          To return a specific value, use the EINA_SAFETY_ON_NULL_RETURN_VAL() function instead of the EINA_SAFETY_ON_NULL_RETURN() function. This macro returns the given value.

          - -
          -Eina_Bool void myfunction(char *param)
          -{
          -   // If the parameter is NULL, return EINA_FALSE;
          -   EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
          -   printf("My pram is : %s\n", param);
          -
          -   return EINA_TRUE;
          -}
          -
          - -

          To call another function if a parameter is NULL, use the EINA_SAFETY_ON_NULL_GOTO() function. This macro works similarly to the EINA_SAFETY_ON_NULL_RETURN() function except that it calls goto with the given function instead of return.

          - -
          -static void isnullcb()
          -{
          -   printf("The parameter is NULL\n");
          -}
          -Eina_Bool void myfunction(char *param)
          -{
          -   // If the parameter is NULL we return EINA_FALSE;
          -   EINA_SAFETY_ON_NULL_GOTO(param, isnullcb);
          -   printf("My pram is : %s\n", param);
          -
          -   return EINA_TRUE;
          -}
          -
          - -

          Eina also provides macros that check whether a given value is TRUE or FALSE. For example, to call return if a given value is TRUE, use the EINA_SAFETY_ON_TRUE_RETURN() function. To call "goto" in a given function if a given value is TRUE, use the EINA_SAFETY_ON_NULL_GOTO() function.

          - - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/touch_gesture_n.htm b/org.tizen.ui.guides/html/native/efl/touch_gesture_n.htm deleted file mode 100755 index e295894..0000000 --- a/org.tizen.ui.guides/html/native/efl/touch_gesture_n.htm +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - - - - - - - - - Handling Component Touch Gestures - - - - - - -
          -

          Handling Component Touch Gestures

          - - -

          This tutorial demonstrates how you can implement different types of gestures provided by the EFL library and instructions on how to use them.

          - -

          Initializing Touch Gestures

          - -

          The EFL library provides a wide range of touch gestures, such as tap, double tap, triple tap, long tap, momentum, line, zoom and rotate, which can be used by the application to build a dynamic user interface interaction which is simple to use as well as intuitive.

          -

          The create_base_gui function creates the application layout. It starts by creating a window, then adds the elm_conformant component to it to decorate the window with an indicator. It then adds the elm_naviframe component which acts as a view manager for the window and provides the window title functionality. After this it creates a gesture view by using the create_main_view() function and adds it to naviframe.

          -
          -static void
          -create_base_gui(appdata_s *ad)
          -{
          -   Elm_Object_Item *nf_it, *tabbar_it;
          -   // Window
          -   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          -   elm_win_autodel_set(ad->win, EINA_TRUE);
          -   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          -   // Conformant
          -   ad->conform = elm_conformant_add(ad->win);
          -   elm_win_conformant_set(ad->win, EINA_TRUE);
          -   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          -   elm_win_resize_object_add(ad->win, ad->conform);
          -   evas_object_show(ad->conform);
          -   // Naviframe
          -   ad->nf = elm_naviframe_add(ad->layout);
          -   // Calendar View
          -   create_main_view(ad);
          -   elm_naviframe_item_push(ad->nf, "Calendar", NULL, NULL, ad->calendar, NULL);
          -   elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf);
          -   // Show window after the base GUI is set up
          -   evas_object_show(ad->win);
          -}
          -
          - -

          The create_main_view function creates the application layout by arranging the labels and rectangles by using recursive composition of the box layout:

          -
          -static void
          -create_main_view(appdata_s *ad)
          -{
          -   // Box
          -   ad->box = elm_box_add(ad->nf);
          -   evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, VAS_HINT_EXPAND);
          -   elm_box_padding_set(ad->box, 0, 5 * elm_config_scale_get());
          -   evas_object_show(ad->box);
          -   // Event Rect
          -   ad->rect = evas_object_rectangle_add(evas_object_evas_get(ad->box));
          -   evas_object_size_hint_weight_set(ad->rect, EVAS_HINT_EXPAND, VAS_HINT_EXPAND);
          -   evas_object_size_hint_align_set(ad->rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
          -   evas_object_color_set(ad->rect, 204, 204, 204, 255);
          -   evas_object_repeat_events_set(ad->rect, EINA_TRUE);
          -
          -   ad->gl = create_gesture_layer(ad);
          -
          -   elm_box_pack_end(ad->box, ad->rect);
          -   evas_object_show(ad->rect);
          -}
          -
          - -

          A gesture layer is added to the rectangle object. This layer is able to receive the gesture event:

          -
          -static Evas_Object *
          -create_gesture_layer(appdata_s *ad)
          -{
          -   Evas_Object *g = elm_gesture_layer_add(ad->win);
          -   elm_gesture_layer_attach(g, ad->rect);
          -}
          -
          - -

          The following figure illustrates the Gesture Detector.

          - -

          Figure: Gesture Detector screen

          -

          Gesture Detector screen

          - -

          Implementing Touch Gestures

          - -

          The elm_gesture_layer_attach() is the function to which a gesture layer for a particular object is attached.

          -

          A gesture can have 4 different states:

          -
            -
          • ELM_GESTURE_STATE_START
          • -
          • ELM_GESTURE_STATE_MOVE
          • -
          • ELM_GESTURE_STATE_ABORT
          • -
          • ELM_GESTURE_STATE_END
          -

          Every gesture starts with the ELM_GESTURE_STATE_START state and finishes with either the ELM_GESTURE_STATE_END or ELM_GESTURE_STATE_ABORT state depending on whether the gesture is completed or aborted on that object.

          -

          If an application only needs to track a finished gesture, it can listen for the finished state only. For a more complete control of the gesture, an application can listen for all state changes for that particular gesture.

          -

          The elm_gesture_layer_cb_set() function is used for registering state change callback for a particular gesture.

          -

          For more information about the gestures, see the gesture documentation.

          - -

          To detect touch gestures:

          -
            -
          • The following example adds callbacks for listening to the tap gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS,
            -   ELM_GESTURE_STATE_START, n_finger_tap_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS,
            -   ELM_GESTURE_STATE_END, n_finger_tap_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS,
            -   ELM_GESTURE_STATE_ABORT, n_finger_tap_abort, ad);
            -
          • -
          • The following example adds callbacks for listening to the double tap gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            -   ELM_GESTURE_STATE_START, dbl_click_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            -   ELM_GESTURE_STATE_MOVE, dbl_click_move, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            -   ELM_GESTURE_STATE_END, dbl_click_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            -   ELM_GESTURE_STATE_ABORT, dbl_click_abort, ad);
            -
          • - -
          • The following example adds callbacks for listening to the triple tap gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            -   ELM_GESTURE_STATE_START, triple_click_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            -   ELM_GESTURE_STATE_MOVE, triple_click_move, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            -   ELM_GESTURE_STATE_END, triple_click_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            -   ELM_GESTURE_STATE_ABORT, triple_click_abort, ad);
            -
          • -
          • The following example adds callbacks for listening to the long tap gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_START, momentum_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_END, momentum_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_ABORT, momentum_abort, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_MOVE, momentum_move, ad);
            -
          • - -
          • The following example adds callbacks for listening to the momentum gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_START, momentum_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_END, momentum_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_ABORT, momentum_abort, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            -   ELM_GESTURE_STATE_MOVE, momentum_move, ad);
            -
          • - -
          • The following example adds callbacks for listening to the line gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            -   ELM_GESTURE_STATE_START, line_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            -   ELM_GESTURE_STATE_MOVE, line_move, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            -   ELM_GESTURE_STATE_END, line_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            -   ELM_GESTURE_STATE_ABORT, line_abort, ad);
            -
          • - -
          • The following examples add callbacks for listening to the flick gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_FLICKS,
            -   ELM_GESTURE_STATE_START, flick_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_FLICKS,
            -   ELM_GESTURE_STATE_END, flick_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_N_FLICKS,
            -   ELM_GESTURE_STATE_ABORT, flick_abort, ad);
            -
          • - -
          • The following examples add callbacks for listening to the zoom gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            -   ELM_GESTURE_STATE_START, zoom_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            -   ELM_GESTURE_STATE_END, zoom_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            -   ELM_GESTURE_STATE_ABORT, zoom_abort, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            -   ELM_GESTURE_STATE_MOVE, zoom_move, ad);
            -
          • - -
          • The following example adds callbacks for listening to the rotate gesture:

            -
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            -   ELM_GESTURE_STATE_START, rotate_start, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            -   ELM_GESTURE_STATE_END, rotate_end, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            -   ELM_GESTURE_STATE_ABORT, rotate_abort, ad);
            -elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            -   ELM_GESTURE_STATE_MOVE, rotate_move, ad);
            -
          • - -
          • The following example adds a callback for getting the tap gesture finishing notification:

            -
            -static Evas_Event_Flags
            -n_finger_tap_end(void *data, void *event_info)
            -{
            -   appdata_s *ad = data;
            -   Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info;
            -   return EVAS_EVENT_FLAG_ON_HOLD;
            -}
            -
          • -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/ui_components_mn.htm b/org.tizen.ui.guides/html/native/efl/ui_components_mn.htm deleted file mode 100755 index 4137e3d..0000000 --- a/org.tizen.ui.guides/html/native/efl/ui_components_mn.htm +++ /dev/null @@ -1,1092 +0,0 @@ - - - - - - - - - - - - - Mobile UI Components - - - -
          -
          -

          Mobile native

          -
          - - -
          - -
          - -

          Mobile UI Components

          - -

          The EFL Elementary is a set of fast, finger-friendly, scalable, and themeable UI component libraries. The number of supported UI components is around 80, including both containers and non-containers. Originally, the Elementary was developed as part of the Window Manager development on Desktop devices. For the mobile profile, Tizen reused the proper UI components and created new ones, and then enhanced and adjusted all of them for Tizen native applications.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          The UI components are mobile-friendly: for example, the Naviframe component supports view-managing for multiple views, the Entry component supports many modes (such as Password, Single/Multi-line, Edit/No-Edit), the Index component supports fast access to another group of UI items, and the Toolbar component shows a menu when an item is selected.

          -

          The mobile UI components were designed to allow the user to interact with touch screen-equipped mobile devices. Therefore, when developing mobile applications, you can easily use them through the mobile-related infrastructure in company with view managing and when reacting to touch events and the user finger size.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Available UI components -
          Component nameDescription
          BackgroundThe background component can be used to set a solid background decoration to a window or a container object. It works like an image, but has some background specific properties, such as setting it to tiled, centered, scaled, or stretched.
          ButtonThe button component is a simple push button. It is composed of a label icon and an icon object, and has an auto-repeat feature.
          CheckThe check component toggles the value of a Boolean between true and false.
          ColorselectorThe colorselector component provides a color selection solution to the user. It has different modes available, each of them showing a different configuration of the color selection.
          CtxpopupThe ctxpopup component is a contextual popup that can show a list of items.
          DatetimeThe datetime component can display and input date and time values.
          EntryThe entry component is a box to which the user can enter text.
          FlipThe flip component can hold two Evas objects and let the user flip between these objects using a variety of predefined animations.
          GengridThe gengrid component displays objects on a grid layout and renders only the visible objects.
          GenlistThe genlist component displays a scrollable list of items. It can hold a lot of items while still being fast and memory-efficient (only the visible items are allocated memory).
          GLViewThe GLView component can render OpenGL in an Elementary object, hiding EvasGL complexity.
          IconThe icon component inherits from the image component. It is used to display images in an icon context.
          ImageThe image component can load and display an image from a file or from memory.
          IndexThe index component provides an index for fast access to another group of UI items.
          LabelThe label component displays text with simple HTML-like markup.
          ListThe list component is a very simple list for managing a small number of items. If you need to manage a lot of items, use the genlist component instead.
          MapThe map component can display a geographic map. The default map data is provided by the OpenStreetMap project (http://www.openstreetmap.org/).
          NotifyThe notify component displays a container in a specific region of the parent object. It can receive some content, and it can be automatically hidden after a certain amount of time.
          PanelThe panel component is an animated object that can contain child objects. It can be expanded or contracted by clicking on the button on its edge.
          PhotoThe photo component can be used to display a photo, such as a contact image. If no photo is set, the UI component displays a person icon to show that it is a photo placeholder.
          PhotocamThe photocam component is designed to display high-resolution photos taken with a digital camera. It allows you to zoom photos, load photos fast, and fit photos. It is optimized for JPEG images and has a low memory footprint.
          PlugThe plug component allows you to show an Evas object created by another process. It can be used anywhere like any other Elementary UI component.
          PopupThe popup component shows a pop-up area that can contain a title area, a content area, and an action area.
          ProgressbarThe progressbar component can be used to display the progress status of a given job.
          RadioThe radio component can display 1 or more options, but the user can only select one of them. The UI component is composed of an indicator (selected/unselected), an optional icon, and an optional label. Even though it is usually grouped with 2 or more other radio components, it can also be used alone.
          SegmentcontrolThe segmentcontrol component is a horizontal control made of multiple segment items, each segment item functioning similar to discrete two state button.
          SliderThe slider component is a draggable bar that is used to select a value from a range of values.
          SpinnerThe spinner component enables the user to increase or decrease a numeric value by using arrow buttons.
          ToolbarThe toolbar component is a scrollable list of items. It can also show a menu when an item is selected. Only one item can be selected at a time.
          TooltipThe tooltip component is a smart object used to show tips or information about a parent object when the mouse hovers over the parent object.
          TransitThe transit component can apply several transition effects to an Evas object, such as translations and rotations.
          WinThe win component is the root window component that will be often used in an application. It allows you to create some content in it, and it is handled by the window manager.
          - -

          Mobile UI Component Styles

          - -

          EFL can separate the GUI and logic of each UI component, resulting in each component having a different style of look. To change the styles of UI components, use the elm_object_style_get() and elm_object_style_set() functions to get and apply the style for a specific UI component.

          - -

          The following tables list the styles for each winset, including the names of the styles, and the name of the part where to set text or some other Evas_Object in the UI component. For more detailed information, see the Themes.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Button styles
          StyleSampleText partSwallow partNotes
          elm/button/base/default elm.textelm.swallow.content
          elm/button/base/anchorelm.textelm.swallow.content
          elm/button/base/bottomelm.textelm.swallow.contentThis style is used widely at the bottom of the screen.
          elm/button/base/circleelm.textelm.swallow.content
          elm/button/base/dropdownelm.text
          elm/button/base/hoversel_horizontal/defaultelm.textelm.swallow.content
          elm/button/base/hoversel_horizontal_entry/defaultelm.textelm.swallow.content
          elm/button/base/hoversel_vertical/defaultelm.textelm.swallow.content
          elm/button/base/hoversel_vertical_entry/defaultelm.textelm.swallow.content
          elm/button/base/icon_reorder
          elm/button/base/naviframe/drawers
          elm/button/base/naviframe/title_cancel
          elm/button/base/naviframe/title_done
          elm/button/base/option
          - - - --- - - - - - - - - - - - - - - - - - -
          Table: Check styles
          StyleSample
          elm/check/base/default
          elm/check/base/favorite
          elm/check/base/on&off
          - - - - - - - - - - - - - - - -
          Table: Colorselector styles
          StyleSampleNotes
          elm/colorselector/item/color/colorplaneUse the following command: elm_colorselector_mode_set(colorselector, ELM_COLORSELECTOR_PALETTE);
          - - - - - - - - - - - - - - - - - -
          Table: Progressbar styles
          StyleSample
          default
          wheel
          - - - --- - - - - - - - - - -
          Table: Radio styles
          StyleSample
          default
          - - - - - - - - - - - - - - - - - -
          Table: List styles
          StyleSampleText partSwallow part
          defaultelm.textelm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          - - - - - - - - - - - - - - - - - -
          Table: Multi Button Entry styles
          StyleSampleText partNotes
          elm/multibuttonentry/base/defaultelm.text, guideThe guide text part is used when there is no item in the Multi Button Entry. It is removed automatically when an item is appended in the Multi Button Entry.
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Toolbar styles
          StyleSampleText partSwallow partNotes
          elm/toolbar/base/default
          elm/toolbar/base/navigationbar
          elm/toolbar/base/tabbar_with_title
          elm/toolbar/item/defaultelm.textelm.swallow.iconThis style is for the toolbar's item. Check the elm_toolbar_item_append() function to set the text and the icon.
          elm/toolbar/item/navigationbarelm.textThis style is for the toolbar's item. Check the elm_toolbar_item_append() function to set the text and the icon.
          - - - --- - - - - - - - - - -
          Table: Flipselector styles
          StyleSample
          default
          - -

          The style of the genlist's item is not set by external APIs. Check the guide of Genlist to check how to use the item class to set the item's style.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Genlist styles
          StyleSampleText partSwallow partNotes
          defaultelm.textelm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          default_styleelm.textelm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          double_labelelm.text: for the main text. -

          elm.text.sub: for the sub text.

          elm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          end_iconelm.textelm.swallow.icon
          fullelm.swallow.contentThe swallow part is the full size of the item. There is no padding in the item.
          group_indexelm.textelm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          one_iconelm.textelm.swallow.icon
          messageelm.text: for the text on the top. -

          elm.title.1: for the text in the middle.

          -

          elm.title.2: for the text on the bottom.

          - -

          The style of the gengrid's item is not set by external APIs. For more information on using the item class to set the item's style, see the guide of gengrid.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Gengrid styles
          StyleSampleText partSwallow partNotes
          defaultelm.swallow.icon
          album-previewelm.textelm.swallow.icon
          blockThis style is used to show an empty area.
          group_indexelm.textelm.swallow.icon
          default_gridelm.swallow.icon
          default_gridtext2elm.textelm.swallow.icon
          default_gridtextelm.textelm.swallow.icon
          default_styleelm.textelm.swallow.icon
          - - - - - - - - - - - - - -
          Table: Segmentation Control styles
          StyleSample
          default
          - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Index styles
          StyleSampleNotes
          defaultThis style is for supporting the vertical style.
          defaultThis style is for supporting the horizontal style. To set a horizontal index, use the elm_index_horizontal_set.
          pagecontrolThis style is used for the "page control" layout. For more information, refer to the Core Control sample application.
          - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Contextual Popup (Ctxpopup) styles
          StyleSampleNotes
          default
          dropdown/listThe size of the item and the ctxpopup follow the size of the screen.
          dropdown/labelThe size of the item and the ctxpopup follow the maximum length of the item.
          - - - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Icon styles
          StyleSample
          apps
          arrow_down
          arrow_left
          arrow_right
          arrow_up
          chat
          clock
          close
          delete
          edit
          file
          home
          media_player/forward
          media_player/info
          media_player/next
          media_player/pause
          media_player/play
          media_player/prev
          media_player/rewind
          media_player/stop
          menu/apps
          menu/arrow_down
          menu/arrow_left
          menu/arrow_right
          menu/arrow_up
          menu/chat
          menu/clock
          menu/close
          menu/delete
          menu/edit
          menu/file
          menu/folder
          menu/home
          menu/refresh
          no_photo
          photo/no_photo
          refresh
          toolbar/apps
          toolbar/arrow_down
          toolbar/arrow_left
          toolbar/arrow_right
          toolbar/arrow_up
          toolbar/chat
          toolbar/clock
          toolbar/close
          toolbar/delete
          toolbar/edit
          toolbar/file
          toolbar/folder
          toolbar/home
          toolbar/more_menu
          toolbar/refresh
          - - - - - - - - - - - - - - - - - - - -
          Table: Entry styles
          StyleSampleText partSwallow partNotes
          defaultelm.guide: for the guide text. -

          elm.text: for the main text.

          The guide text is automatically erased when the main text is entered.
          - - - --- - - - - - - - - - - - - - - - - - -
          Table: Datetime styles
          StyleSample
          date_layout
          time_layout
          time_layout_24hr
          - - - - - - - - - - - - - - - - - -
          Table: Panel (drawer) styles
          StyleSampleSwallow partNotes
          defaultelm.swallow.contentFor more information on the drawer, see the [UI Sample] Core Control guide.
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Slider styles
          StyleSampleSwallow part
          horizontal/defaultelm.swallow.icon
          horizontal/center_pointelm.swallow.icon
          vertical/center_point
          vertical/default
          - - - --- - - - - - - - - - - - - - -
          Table: Popup styles
          StyleSample
          default
          toast
          - - - --- - - - - - - - - - - - - - -
          Table: Spinner styles
          StyleSample
          horizontal
          vertical
          - -

          For more details about customizing the look and feel of the UI components with custom styles which are not provided as defaults, see the ThemeExtension sample.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/ui_components_n.htm b/org.tizen.ui.guides/html/native/efl/ui_components_n.htm deleted file mode 100755 index c1a5317..0000000 --- a/org.tizen.ui.guides/html/native/efl/ui_components_n.htm +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - - - - - - - - UI Components: Handling Elementary UI Component Libraries - - - - - -
          - -

          UI Components: Handling Elementary UI Component Libraries

          - -

          Before writing an application, you should already have an answer to the following question: What is an application? An application is a process launched by the user. Every application has at least one window for presenting its content. Users can interact with the content through events. Different sources of events can modify the life cycle of the application. The application may receive data from a network connection, and it may also receive touch and key events. From the computer's point of view, an application is a collection of code that reacts to events and displays content on the screen. Elementary bridges this divide between the user and the code.

          - -

          Elementary provides a variety of pre-built UI components, such as layout objects and components, that allow you to build rich graphical user interfaces for your applications. Every Elementary application has at least one window for presenting its content. The window provides the area in which to display the content and where the Evas canvas is placed.

          - -

          There are three main groups of objects provided by Elementary:

          - -
            -
          • UI components: These are the components with which you build your application UI.
          • -
          • Containers: These are the containers that hold the components.
          • -
          • Infrastructure: These are the modules that deal with Elementary as a whole.
          • -
          - -

          Using UI Components

          - -

          The Elementary library is a simple toolkit. It provides several UI components than can be used to compose the user interface of your application. UI components allow you to build your application without having to reinvent basic objects, such as buttons, lists, or text entries. UI components will often generate signals that can be caught in the application when the user interacts with the UI components. This guide teaches you the basics of Elementary, describes selected concepts of the Elementary configuration framework, and describes the most common UI components.

          - -

          Figure: Elementary

          -

          Elementary

          - - -

          Getting Started with the Elementary Library

          - - -

          Elementary UI components are built in a hierarchical fashion. The idea is to factorize as much code as possible between UI components that behave in a similar manner to facilitate the creation of new UI components. The Elementary UI components inherit a lot of their code from the container UI components and the layout component (a container component that takes a standard Edje design file and wraps it very thinly). You can use the container and layout functions on the Elementary UI components, as well as the Elementary object functions, such as elm_object_part_content_set(), elm_object_part_content_get(), and elm_object_part_content_unset().

          - -

          To use the Elementary library:

          - -
          1. Initialize the Elementary library with the elm_init() function.
          2. -
          3. Start the Elementary main loop with the elm_run() function. -

            The function does not return, instead, it constantly loops and runs the event and the processing tasks.

          4. -
          5. Add Elementary UI components in the main loop. -

            Generally, an Elementary UI component can be added with the elm_<UI component name>_add() function, which returns an Evas object (Evas_Object*). The Evas object is passed to the functions that are used to configure the UI component.

          6. -
          7. Stop the main loop and return to the main() function with the elm_exit() function.
          8. -
          9. When your application terminates, shut down the Elementary library with the elm_shutdown() function. -

            The function frees the Elementary objects that were allocated in the main loop, so you do not need to separately deallocate them.

          - - -

          The following code snippet shows the main() function of a minimal Elementary application:

          - -
          -#include <Elementary.h>
          -int main(int argc, char **argv)
          -{
          -   elm_init(argc, argv);
          -   elm_run();
          -   elm_shutdown();
          -
          -   return 0;
          -}
          - - -

          Elementary Objects

          - -

          All objects created using Elementary are of the Evas_Object* type. This means that both Evas and Elementary functions can be used on an Elementary object. However, use Elementary functions on Elementary objects only when you do not know which API to use.

          - -

          Since an Elementary object can take up a lot of memory, the Elm_Object_Item type has been created for situations where you need to use a lot of items, such as in a genlist or gengrid component, and to save memory. Using the Elm_Object_Item type, an Elementary UI component can, in theory, contain a lot of items while maintaining a small memory footprint. In practice, the Elm_Object_Item instance is bigger than expected, but can still help in saving memory.

          - -

          For more information, see Evas Objects.

          - -

          Elementary Callbacks

          - -

          Several callbacks can be registered to handle Elementary object events:

          - -
            -
          • Evas event callback -

            Use the evas_object_event_callback_add() function to add a callback for input events (key up, key down, mouse wheel) on an Evas object. In case of an Elementary object, the callback is registered on the underlying Evas object without considering the Elementary object infrastructure (no event propagation).

            -
          • - -
          • Evas smart callback -

            Use the evas_object_smart_callback_add() function to add a callback for a smart event emitted by an Elementary object. Smart callbacks can only be registered on smart objects, and the "smart event" to register must be implemented by the corresponding smart object. Otherwise, the callback does nothing. The callback does not apply to input events (keyboard or mouse).

            -
          • - -
          • Edje signal callback -

            Use the edje_object_signal_callback_add() function to add a callback for a signal coming from an Edje object (a theme object).

            -
          • - -
          • Elementary signal callback -

            Use the elm_object_signal_callback_add() function to add a callback for a signal coming from an Elementary UI component's theme. The callback does not apply to input events (keyboard or mouse).

            -
          • - -
          • Elementary event callback -

            Use the elm_object_event_callback_add() function to add a callback for an input event (keyboard or mouse) coming from an Elementary object. In contrast to the Evas event callback, the Elementary event callback takes the hierarchy of the object into account: the event can be propagated to the parents of the object, and the parents can process the event.

            -
          • -
          - -

          For more information about events related to Elementary objects, see Event Handling. For more information about Evas objects and smart objects, see Evas Rendering Concept and Method.

          - -

          Managing Elementary Profiles

          - -

          An Elementary profile is a set of preconfigured options that affects the entire look and feel of an application. The options linked to a specific profile form an Elementary configuration, which can be used to store the desired set of options for use in multiple sessions. Once loaded, the Elementary profile configures all the options and sets the look and feel of your Elementary application.

          - -

          To manage Elementary profiles:

          -
            -
          • List the existing profiles: -
            -Eina_List *list = elm_config_profile_list_get();
            -
            -
          • -
          • Set a particular profile: -
            -elm_config_profile_set("myprofile");
            -
            -
          • -
          • Get the current profile: -
            -char *profile = elm_config_profile_get();
            -
            -
          • -
          • To save the current option values as an Elementary configuration for later use, use the Elementary Configuration Save function: -
          • -
          • To reload the Elementary configuration saved for the current profile: -
            -elm_config_reload();
            -
            -
          • -
          - -

          Configuring Elementary Options

          - -

          You can set the following options in the Elementary configuration. In addition, you can customize themes and manage focus.

          -
            - -
          • To scale UI components: -

            You can configure UI component scaling in terms of both interactive and readable areas.

            -
              -
            • Set the global scaling factor (for example, setting it to 2.0 doubles the size of all scalable UI components): -
              -elm_config_scale_set(2.0);
              -
              -
            • - -
            • Set the finger size: -
              -elm_config_finger_size_set(1.5);
              -
              -
            • -
            -
          • - -
          • To manage caches: -
              -
            • Enable the globally configured cache flush, and set the flush interval (in this example, to 60 seconds): -
              -elm_config_cache_flush_enabled_set(EINA_TRUE);
              -elm_config_cache_flush_interval_set(60);
              -
              -
            • - -
            • Configure the font and image cache sizes (to 500 and 5 000 000 bytes, respectively): -
              -elm_config_cache_font_cache_size_set(500);
              -elm_config_cache_image_cache_size_set(5000000);
              -
              -
            • - -
            • Set the Edje collection and Edje file cache sizes: -
              -elm_config_cache_edje_file_cache_size_set(500);
              -elm_config_cache_edje_collection_cache_size_set(500);
              -
              -
            • -
            -
          • - - -
          • To configure the gesture layer: -

            You can set the duration of the long tap and double tap events on the gesture layer objects. The following example sets the duration to 500 ms.

            - -
            -elm_config_glayer_long_tap_start_timeout_set(0.5);
            -elm_config_glayer_double_tap_timeout_set(0.5);
            -
            -
          • -
          • To manage scrolling: -
              -
            • Make the scroller bounce when it reaches its viewport's edge during scrolling by using the elm_config_scroll_bounce_enabled_set() function: -
              -elm_config_scroll_bounce_enabled_set(EINA_TRUE);
              -
              -
            • - -
            • Control the inertia of the bounce animation by using the elm_config_scroll_bounce_friction_set() function: -
              -elm_config_scroll_bounce_friction_set(0.5);
              -
              -

              You can also set the friction for a page scroll, include animations, and zoom animations.

              -
            • - -
            • Set the scroller to be draggable by using the elm_config_scroll_thumbscroll_enabled_set() function. You can configure several drag options, such as friction, sensitivity, acceleration, and momentum. - -

              The following example sets the scroller to be draggable, defines that the number of pixels one must travel while dragging the scroller view to actually trigger scrolling is 20 pixels.

              -
              -elm_config_scroll_thumbscroll_enabled_set(EINA_TRUE);
              -elm_config_scroll_thumbscroll_threshold_set(20);
              -
              -
            • -
            -
          • - -
          • To configure long press events: -

            Get the current timeout before a long press event is retrieved, and modify it. The following example increases the timeout by 1 second.

            -
            -double lp_timeout = elm_config_longpress_timeout_get();
            -elm_config_longpress_timeout_set(lp_timeout + 1.0);
            -
            -
          • - -
          • To configure tooltips: -

            Set the duration after which a tooltip is shown. The following example sets the delay to 2 seconds.

            - -
            -elm_config_tooltip_delay_set(2.0);
            -
            -
          • - -
          • To configure the password show last feature: -

            The password show last feature enables the user to view the last input entered for a few seconds before it is masked.

            - -
              -
            • Enable the password show last feature: -
              -elm_config_password_show_last_set(EINA_TRUE);
              -
              -
            • -
            • Set the visibility timeout (how many seconds the input is visible): -
              -elm_config_password_show_last_timeout_set(5.0);
              -
              -
            • -
            -
          • -
          • To set the Elementary engine: -

            You can define the rendering engine that Elementary uses to draw the windows. The following rendering engines are supported:

            - -
              -
            • "software_x11"
            • -
            • "fb"
            • -
            • "directfb"
            • -
            • "software_16_x11"
            • -
            • "software_8_x11"
            • -
            • "xrender_x11"
            • -
            • "opengl_x11"
            • -
            • "software_gdi"
            • -
            • "software_16_wince_gdi"
            • -
            • "sdl"
            • -
            • "software_16_sdl"
            • -
            • "opengl_sdl"
            • -
            • "buffer"
            • -
            • "ews"
            • -
            • "opengl_cocoa"
            • -
            • "psl1ght"
            • -
            - -
            -elm_config_engine_set("opengl_x11");
            -
            -
          • - -
          • To activate the access mode: -

            Set the access mode as active, so that information about an Elementary object is read when the object receives an EVAS_CALLBACK_MOUSE_IN event:

            - -
          • - -
          • To configure the selection mode: -

            Set the selection mode so that the selection is cleared when the entry component is unfocused:

            -
            -elm_config_selection_unfocused_clear_set(EINA_TRUE);
            -
            -
          • - -
          • To enable mirroring: -

            Elementary allows UI mirroring both on a single object and on the entire UI. If mirroring is enabled, an Elementary UI component displays as if there was a vertical mirror in the middle of it. Only the controls and the disposition of the UI component are mirrored. Text is not mirrored.

            - -
            -elm_config_mirrored_set(EINA_TRUE);
            -
            -
          • - -
          • To set the frame rate: -

            Define the frames per second (FPS) value for the ecore_animator_frametime and edje_frametime calculations. This example sets the FPS 60.

            - -
            -elm_config_fps_set(60.0);
            -
            -
          • -
          - -

          Customizing Themes

          - -

          Elementary uses Edje to theme its UI components. Edje provides a default theme for each UI component in an application. You can change the theme using the ELM_THEME environment variable. You can also modify the theme globally with the elementary_config utility.

          - -

          For custom styles, use extensions. Extensions allow you to write styles for specific UI components. Add a new extension to the list of Elementary themes with the elm_theme_extension_add() function, and apply the new style to the UI component with the elm_object_style_set() function. Once set, the extension replaces the default theme of the UI component.

          - - - - - - - - - - -
          Note
          When developing an extension, to respect the signals emitted and the elements that need to be in place, you must know how the UI component is themed. If something is missing from the extension, it can break the UI component's behavior.
          - -

          To modify Elementary themes, you can also use overlays. An overlay can replace the look of all UI components by overriding the default styles. As with extensions, you must write the correct overlay theme for a UI component. When looking for a theme to apply, Elementary first checks the list of overlays, then the set theme, and finally the list of extensions. To add or remove an overlay, use the elm_theme_overlay_add() and elm_theme_overlay_del() functions.

          - - - - - - - - - - -
          Note
          With overlays, you can replace the default view and affect every UI component. This is very similar to setting the theme for the whole application, and probably clashes with end user options. Using overlays also runs the risk of non-matching styles across the application. Unless you have a very good reason to use them, avoid overlays.
          - -

          Managing Focus

          - -

          When an Elementary object has the focus, input events are directly passed to that object in the application window. The focused object can also change its decoration to show the user where the focus is. In an Elementary application, only one object can have the focus at a time.

          - -

          To set the focus to a new Elementary object and take the focus away from the previous focused object, use the elm_object_focus_set() function. You can make an object unfocusable with the elm_object_focus_allow_set() function.

          - - - - - - - - - - -
          Note
          Only visible objects can have the focus.
          - -

          Elementary supports focus chains that allow you to cycle through all the focusable objects in a window. By default, the focus chain is defined by the order in which the UI components are added to the code. It is also possible to define custom focus chains, when needed.

          - -

          For more information on focus, see Component Focus.

          - -

          To manage the focus:

          - -
            -
          • To define a custom focus chain, create an Eina_List, and add the Elementary objects to it in the desired focus order. Use the elm_object_focus_custom_chain_set() function to set the final list as the custom focus chain of the parent object (in the following example, container_object is the parent object). - -
            Eina_List *obj_list = NULL;
            -
            -list = eina_list_append(list, obj1); 
            -list = eina_list_append(list, obj4);
            -list = eina_list_append(list, obj2); 
            -list = eina_list_append(list, obj3);
            -
            -elm_object_focus_custom_chain_set(container_object, list);
            -
          • - -
          • To remove the custom focus chain and use the default focus chain instead, use the elm_object_focus_custom_chain_unset() function. -
          • - -
          • To programmatically cycle through the focus chain, use the elm_object_focus_next() function. -
          • - -
          • To show a highlight on the focused object: - -
            -elm_config_focus_highlight_enabled_set(EINA_TRUE);
            -
            -
          • - -
          • To activate an animation when the focus shifts from one object to another: - -
            -elm_config_focus_highlight_animate_set(EINA_TRUE);
            -
            -
          • -
          - -

          Scaling UI Components

          - -

          Elementary, through its configuration API (elm_config), provides a way to scale UI components with two different parameters. Finger size parameter is used when the interactive zones (clickable, editable) of the UI components need to be scaled in order to be comfortably used with a finger. Scale parameter is responsible for scaling readable parts of a UI component (text or icons for example), so that it is more visible in the user interface.

          - -

          Finger Size

          - -

          Finger size parameter scales UI components based on the user's finger size. This is useful when using a touchscreen with a finger rather than with a stylus. The finger size parameter is in pixels and determines the minimum size of a square on the screen that is reliably hittable with a finger. This parameter scales the input and interactive areas.

          - -

          The global finger size is set with the elm_config_finger_size_set() function. This adjusts the size and hit area of UI components so they are easy to hit with a finger. The current value is retrieved with the elm_config_finger_size_get() call. The finger size is always in pixel.

          - -

          To increase the current global finger size by 20px:

          - -
          -Evas_Coord finger_size;
          -
          -// Get the current finger size
          -finger_size = elm_config_finger_size_get();
          -
          -// Add 20px to finger size parameter and set it 
          -// to the global Elementary configuration
          -elm_config_finger_size_set(finger_size + 20);
          -
          - -

          Scale

          - -

          This parameter only scales the readable areas of the UI component (text, icons). Parts that must stay pixel-perfect like the highlights, shading, textures and decorations stay as they are.

          - -

          elm_config_scale_set() function is used to set the global scaling factor, that affects to all the UI components. It is also possible to use elm_object_scale_set() to set the scaling factor on a given Elementary UI component and all its children.

          - - - - - - - - - - -
          Note
          The scaling factor is multiplicative, if a child already has a scale size set, it is multiplied by its parent's scale size.
          - -

          The following example sets the global scaling factor to 2.0. Then, the scaling factor of an existing Elementary object is set to 2.0, meaning that this object appears as if it had a 4.0 scale factor, the rest of the application is displayed with a 2.0 scaling factor:

          - -
          -Evas_Object *button;
          -
          -// The button object is created and configured
          -
          -// Set the global scale factor to 2.0
          -elm_config_scale_set(2.0);
          -
          -// Set the scaling factor of the button component to 2.0, this component
          -// appears 4 times bigger than its initial size
          -elm_object_scale_set(button, 2.0);
          -
          - -

          Example

          - -

          This chapter shows the visual result of finger size and scaling factors modification.

          - -

          Figure: elementary_config application

          -

          elementary_config application

          - -

          The previous picture shows the elementary_config application that enables the user to set global scale factor and finger size parameter. As the user drags the sliders, the UI is updated, directly showing the result of the new parameter value.

          - -

          The next picture shows the behavior when the finger size parameter has been increased to 1.30. The text of the sliders and the text of the items in the toolbar are bigger.

          - -

          Figure: Scale increased (1.30)

          -

          Scale increased (1.30)

          - -

          A finger size increase is showed in the image below (increase from 50px to 90 px). Now, the buttons in the toolbar are bigger, so the user can more reliably hit them with a big finger.

          - -

          Figure: Finger size increased (90px)

          -

          Finger size increased (90px)

          - - - - - - - - - - -
          Note
          It is up to the theme (Edje file) to set the parts that are scalable. This is something that needs to be taken into account when developing a new Edje theme. This can be done in EDC with the scale parameter. For more information on how to do that, see Introduction to EDC Programming.
          - -

          Creating Scalable EDC Objects

          - -

          Scale Parameter

          - -

          This chapter explains how to make a scalable Edje object and give hints how to write an EDC file that is scalable. The example shows a basic button that is composed of a background image part and a swallow part that can receive some content.

          - -
          -group 
          -{ 
          -   name: "button";
          -   images 
          -   {
          -      image: "bg.png" COMP;
          -   }
          -   parts 
          -   {
          -      part 
          -      { 
          -         name: "bg";
          -         type: IMAGE;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            image.normal: "bg.png";
          -         }
          -      }
          -      part 
          -      { 
          -         name: "elm.swallow.content";
          -         type: SWALLOW;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            visible: 0;
          -         }
          -         description 
          -         { 
          -            state: "visible" 0.0;
          -            visible:1;
          -         }
          -      }
          -   }
          -}
          -
          - -

          To have a scalable object, set the scale parameter to 1 on the parts you want to be scalable. Here the bg and elm.swallow.content parts must be scalable.

          - -
          -group 
          -{ 
          -   name: "button";
          -   images 
          -   {
          -      image: "bg.png" COMP;
          -   }
          -   parts
          -   {
          -      part 
          -      { 
          -         name: "bg";
          -         type: IMAGE;
          -         scale: 1;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            image.normal: "bg.png";
          -         }
          -      }
          -      part 
          -      { 
          -         name: "elm.swallow.content";
          -         type: SWALLOW;
          -         scale: 1;
          -         description 
          -         { 
          -            state: "default" 0.0;
          -            visible: 0;
          -         }
          -         description 
          -         { 
          -            state: "visible" 0.0;
          -            visible:1;
          -         }
          -      }
          -   }
          -}
          -
          - -

          Image Set

          - -

          If your application needs to be used at different resolutions it is recommended to have 2 images for the background image bg.png. Here the bg_low.png is added to the application. It is used when the size of the image is under 500 px, and a bg_high.png image is for higher resolutions. Use a set on the bg.png image.

          - -
          -group 
          -{ 
          -   name: "button";
          -   images 
          -   {
          -      set 
          -      {
          -         name: "bg.png";
          -         image
          -         {
          -            image: "bg_low.png" COMP;
          -            size: 0 0 200 100;
          -         }
          -         image
          -         {
          -            image: "bg_high.png" COMP;
          -            size: 201 101 5000 5000;
          -         }
          -      }
          -   }
          -}
          -
          - -

          The image below shows three buttons with only a background part visible (the SWALLOW part is empty).

          - -

          Figure: Image set example

          -

          Image set example

          - -

          The first button's size is 100x50 pixels, the background image (bg_low.png) is the same size. The second button is twice bigger than the first one (200x100 pixels). The image is scaled and it does not render well, the borders are quite blurry.

          - -

          To prevent this, the image set has a bigger image to use when the size is bigger than 200x100 pixels (bg_high.png). The third button size is 201x101 pixels and it uses the new image, which has a better quality than the scaled image.

          - -

          Image Borders

          - -

          When the button is resized, the image part is also resized because it is marked as scalable. To get the image resized but to keep the image border as it is, use the border parameter. It specifies the border size which is not resized even if the image is.

          - -

          To add a 40 pixel border on the left and right part of the bg image and a 20 pixel border on top and bottom borders:

          - -
          -parts 
          -{
          -   part 
          -   { 
          -      name: "bg";
          -      type: IMAGE;
          -      scale: 1;
          -      description 
          -      { 
          -         state: "default" 0.0;
          -         image.normal: "bg.png";
          -         image.border: 40 40 20 20;
          -      }
          -   }
          -}
          -
          - -

          The image below shows that when resizing the button, the corners keep their initial ratio. Only the middle part of the button is resized.

          - -

          Figure: Border example

          -

          Border example

          - - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/native/efl/ui_components_wn.htm b/org.tizen.ui.guides/html/native/efl/ui_components_wn.htm deleted file mode 100755 index 36d62e9..0000000 --- a/org.tizen.ui.guides/html/native/efl/ui_components_wn.htm +++ /dev/null @@ -1,876 +0,0 @@ - - - - - - - - - - - - - Wearable UI Components - - - - - -
          - -

          Wearable UI Components

          - -

          The EFL Elementary is a set of fast, finger-friendly, scalable, and themeable UI component libraries. The number of supported UI components is around 80, including both containers and non-containers. Originally, the Elementary was developed as part of the Window Manager development on Desktop devices. For the wearable profile, Tizen reused the proper UI components and created new UI styles for rectangular and circular wearable devices, and then enhanced and adjusted all of them for Tizen native applications.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The UI components are wearable-friendly: for example, the Circle Datetime component extends the elm_date_time by visualizing the selected field, the Circle Genlist component provides a scrollbar with circular movement, and the Circle progress bar/scroller/slider components are adjusted to the circular design.

          -

          The wearable UI components were designed to allow the user to interact with small touch screen-equipped wearable devices with rotary component parts. Therefore, when developing wearable applications, you can easily use them through the wearable-related infrastructure in company with full notification and when reacting to touch and rotary events and the user finger size.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Available UI components -
          Component nameDescription
          BackgroundThe background component can be used to set a solid background decoration to a window or a container object. It works like an image, but has some background specific properties, such as setting it to tiled, centered, scaled, or stretched.
          ButtonThe button component is a simple push button. It is composed of a label icon and an icon object, and has an auto-repeat feature.
          CheckThe check component toggles the value of a Boolean between true and false.
          CtxpopupThe ctxpopup component is a contextual popup that can show a list of items.
          DatetimeThe datetime component can display and input date and time values.
          EntryThe entry component is a box to which the user can enter text.
          GenlistThe genlist component displays a scrollable list of items. It can hold a lot of items while still being fast and memory-efficient (only the visible items are allocated memory).
          GLViewThe GLView component can render OpenGL in an Elementary object, hiding EvasGL complexity.
          IconThe icon component inherits from the image component. It is used to display images in an icon context.
          ImageThe image component can load and display an image from a file or from memory.
          IndexThe index component provides an index for fast access to another group of UI items.
          LabelThe label component displays text with simple HTML-like markup.
          ListThe list component is a very simple list for managing a small number of items. If you need to manage a lot of items, use the genlist component instead.
          NotifyThe notify component displays a container in a specific region of the parent object. It can receive some content, and it can be automatically hidden after a certain amount of time.
          PlugThe plug component allows you to show an Evas object created by another process. It can be used anywhere like any other Elementary UI component.
          PopupThe popup component shows a pop-up area that can contain a title area, a content area, and an action area.
          ProgressbarThe progressbar component can be used to display the progress status of a given job.
          RadioThe radio component can display 1 or more options, but the user can only select one of them. The UI component is composed of an indicator (selected/unselected), an optional icon, and an optional label. Even though it is usually grouped with 2 or more other radio components, it can also be used alone.
          SliderThe slider component is a draggable bar that is used to select a value from a range of values.
          TransitThe transit component can apply several transition effects to an Evas object, such as translations and rotations. The use of the transit component is documented in the Creating Animations and Effects guide.
          WinThe win component is the root window component that will be often used in an application. It allows you to create some content in it, and it is handled by the window manager.
          - -

          The following UI components were designed for specific circular wearable devices which have rotary component parts. In a circular device, you can draw round UI components, such as a slider, progressbar, and scroller. Generally, wearable UI components provide compatibility between the rectangular and circular wearable devices. However, use circular UI components for circular wearable devices only, because they have a dependency with the round UX and rotary events. For more information on the compatibility of the UI components between rectangular and circular, see the Wearable Design Guidelines.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Available circular UI components -
          Component nameDescription
          Circle DatetimeThe circle datetime extends elm_datetime by visualizing the selected field.
          Circle GenlistThe circle genlist provides a scrollbar with circular movement. It is also operated with rotary events to move to the next or previous item.
          Circle ObjectThe circle object extends elementary components in a form of circular design. Sometimes a circle object merely provides additional UI features to elementary component, and sometimes it works as an independent component with UI and functionalities.
          Circle ProgressbarThe circle progressbar aims to show the progress status of a given task with circular design. It visualizes the progress status within a range.
          Circle ScrollerThe circle scroller changes corresponding to the rotary events. It shows the whole scrollable area with a circular scroll bar.
          Circle SliderThe circle slider changes corresponding to rotary events. The circle slider not only extends the UI feature of the elm_slider, but also replaces the functionalities of the elm_slider in a circular design.
          Circle SurfaceThe circle surface manages and renders circle objects. Multiple circle objects can be connected to one circle surface as candidates of an object to be rendered.
          - -

          Wearable Rectangular UI Component Styles

          - -

          EFL can separate the GUI and logic of each UI component, resulting in each component having a different style of look. To change the styles of UI components, use the elm_object_style_get() and elm_object_style_set() functions to get and apply the style for a specific UI component.

          - -

          The following tables list the styles for each winset, including the names of the styles, and the name of the part where to set text or some other Evas_Object in the UI component. For more detailed information, see the Themes.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Button styles
          StyleSampleText partSwallow partNotes
          default elm.textelm.swallow.content
          greenelm.textelm.swallow.content
          orangeelm.textelm.swallow.content
          redelm.textelm.swallow.content
          nextdepth
          naviframe/title_iconelm.swallow.contentThe icon can be set with the elm_object_part_content_set(btn, "icon", ic) function.
          - - - --- - - - - - - - - - - - - - -
          Table: Check styles
          StyleSample
          default
          on&off
          - - - - - - - - - - - - - - - -
          Table: Contextual popup (Ctxpopup) styles
          StyleSampleNotes
          defaultUse the elm_ctxpopup_item_append() function to add both text and an icon to the list.
          - - - --- - - - - - - - - - - - - - -
          Table: Datetime styles
          StyleSample
          datepicker_layout
          timepicker_layout
          - - - - - - - - - - - - - - - - - - - -
          Table: Entry styles
          StyleSampleText partSwallow partNotes
          defaultelm.guide: for the guide text. -

          elm.text: for the main text.

          The guide text is automatically erased when the main text is entered.
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Genlist styles
          StyleSampleText partSwallow partNotes
          defaultelm.textelm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          group_indexelm.text: for the main text. -

          elm.text.1: for the sub text.

          elm.icon
          1textelm.text
          1text.1iconelm.textelm.icon
          2textelm.text: for the main text. -

          elm.text.1: for the sub text.

          2text.1elm.text: for the main text. -

          elm.text.1: for the sub text.

          1text.1icon.dividerelm.textelm.icon: for the icon. -

          elm.divider: for the icon divider.

          1text.1icon.1elm.textelm.icon
          2text.1icon.1elm.text: for the main text. -

          elm.text.1: for the sub text.

          elm.icon
          multiline/1textelm.text: for the multi-line text.
          multiline/2textelm.text: for the main text. -

          elm.text.1: for the multi-line sub text.

          - - - - - - - - - - - - - - - - - - -
          Table: Index styles
          StyleSample
          thumbnail
          tab
          - - - --- - - - - - - - - - - - - - -
          Table: Popup styles
          StyleSample
          default
          toast
          - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Progressbar styles
          StyleSample
          default
          pending_list
          process
          process/groupindex
          - - - --- - - - - - - - - - -
          Table: Radio styles
          StyleSample
          default
          - - - - - - - - - - - - - - - - -
          Table: Slider styles
          StyleSampleSwallow part
          horizontal/defaultelm.swallow.icon
          - - -

          Wearable Circular UI Component Styles

          - -

          EFL can separate the GUI and logic of each UI component, resulting in each component having a different style of look. To change the styles of UI components, use the elm_object_style_get() and elm_object_style_set() functions to get and apply the style for a specific UI component.

          - -

          The following tables list the styles for each winset, including the names of the styles, and the name of the part where to set text or some other Evas_Object in the UI component.

          - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Button styles
          StyleSampleText partSwallow partNotes
          default elm.textelm.swallow.content
          bottomelm.textelm.swallow.content
          - - - --- - - - - - - - - - - - - - - - - - -
          Table: Check styles
          StyleSample
          default
          small
          on&off
          - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Contextual popup (Ctxpopup) styles
          StyleSampleNotes
          select_mode
          select_mode/topPair this style with select_mode/bottom.
          select_mode/bottomPair this style with select_mode/top.
          - - - --- - - - - - - - - - - - - - -
          Table: Datetime styles
          StyleSample
          datepicker/circle
          timepicker/circle
          - - - - - - - - - - - - - - - - - - - -
          Table: Entry styles
          StyleSampleText partSwallow partNotes
          defaultelm.guide: for the guide text. -

          elm.text: for the main text.

          The guide text is automatically erased when the main text is entered.
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Genlist styles
          StyleSampleText partSwallow partNotes
          defaultelm.textelm.swallow.icon: for the icon on the left. -

          elm.swallow.end: for the icon on the right.

          titleelm.text
          groupindexelm.text
          1textelm.text
          1text.1iconelm.textelm.icon
          2textelm.text: for the main text. -

          elm.text.1: for the sub text.

          1text.1icon.dividerelm.textelm.icon: for the icon. -

          elm.divider: for the icon divider.

          1text.1icon.1elm.textelm.icon
          2text.1icon.1elm.text: for the main text. -

          elm.text.1: for the sub text.

          elm.icon
          editfieldelm.text
          - - - - - - - - - - - - - - - - - - -
          Table: Index styles
          StyleSample
          thumbnail
          circle
          - - - --- - - - - - - - - - - - - - -
          Table: Popup styles
          StyleSample
          circle
          toast/circle
          - - - - - - - - - - - - - - - - - -
          Table: Progressbar styles
          StyleSample
          process
          process/small
          - - - --- - - - - - - - - - -
          Table: Radio styles
          StyleSample
          default
          - - - - - - - - - - - - - - - - -
          Table: Slider styles
          StyleSampleSwallow part
          horizontal/defaultelm.swallow.icon
          - -

          For more details about customizing the look and feel of the UI components with custom styles which are not provided as defaults, see the ThemeExtension sample.

          - - - - - - - - - - -
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/ui_containers_n.htm b/org.tizen.ui.guides/html/native/efl/ui_containers_n.htm deleted file mode 100755 index 5db93d6..0000000 --- a/org.tizen.ui.guides/html/native/efl/ui_containers_n.htm +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - UI Containers: Creating Layouts Using Container UI Components - - - - - -
          - -

          UI Containers: Creating Layouts Using Container UI Components

          - -

          All applications use containers to create the layout of the UI. The EFL and Elementary support several ways to create this layout. You can use predefined layouts or animated layouts, or you can create your own layouts. It is important to note that container UI components do not have their own visual identity - only logical structures for assignment or placement of the UI components.

          - -

          When you use container components, such as naviframe, conformant, button, and box, you need to understand certain APIs related to alignment, and EDC parts for, for example, the core layout and animated layout. For more information on the containers EDC parts, see Positioning and Laying out Parts Using the EDC File. The use of the container UI components only differs from the use of the UI components through their absence of a visual identity.

          - -

          Most of the time, your application has to manage multiple views. The easiest way to handle them with the EFL is to create a naviframe object. This object is a container. At first, it is used to contain the pages your application is composed of. Every Tizen application can use this top-layer object to facilitate navigation. More details can be found in Creating a Naviframe for Navigation.

          - -

          Another interesting object that has to be present in every application is the conformant object. Conformant is a container component that accounts for the space taken up by the indicator, virtual keyboard, and softkey windows. The conformant content will be resized and positioned based on the space available. When the virtual keyboard is displayed, the content does not change.

          - -

          Figure: Basic EFL application structure

          -

          Basic EFL application structure

          - -

          Container Components

          - -

          The following table lists the available UI container components.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Available container components -
          Container nameDescription
          BoxOne of the most simple containers in the EFL is a box.
          ConformantA conformant is a container component that accounts for the space taken by the indicator, virtual keyboard, and softkey windows.
          GridIn a grid, objects are placed at specific positions along a fixed grid.
          LayoutA layout is a container component that takes a standard Edje design file and wraps it very thinly in a UI component.
          MapbufA mapbuf is a container component that uses an Evas map to hold a content object. This UI component is used to improve the moving and resizing performance of complex UI components.
          NaviframeA naviframe component consists of a stack of views. New views are pushed on top of previous ones, and only the top-most view is displayed.
          Panes
          (in mobile applications only)
          A panes component adds a draggable bar between two sections of content. The sections are resized when the bar is dragged.
          ScrollerA scroller holds (and clips) a single object and allows you to scroll across it.
          TableA table is like a box but with 2 dimensions.
          - - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/ui_scalability_n.htm b/org.tizen.ui.guides/html/native/efl/ui_scalability_n.htm deleted file mode 100755 index 483202a..0000000 --- a/org.tizen.ui.guides/html/native/efl/ui_scalability_n.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - Scaling: Handling Screen and Object Sizes - - - - - -
          - -

          Scaling: Handling Screen and Object Sizes

          - -

          Supporting UI scalability in a user interface toolkit means that container components and UI components are scaled properly when the resolution or screen size changes. The Elementary library allows you to manipulate scaling on a per-UI-component basis using a scale factor based on the screen resolution, size, and profile configurations.

          - -

          Tizen native applications can run on different types of devices, such as wearable, phone, tablets, and TVs. Tizen also supports various resolutions (WVGA - XQXGA) with the same layouts and resources. However, remember that you must always polish your work to create an optimal application for each device.

          - -

          The main scalability features are:

          -
            -
          • Multiple Screen Support

            Enables you to design applications for different kinds of screens.

          • -
          • Scalability Support

            Enables you to design applications so that their UI can be scaled for diverse devices without problems.

          • -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/guides_n.htm b/org.tizen.ui.guides/html/native/guides_n.htm deleted file mode 100755 index b98fee6..0000000 --- a/org.tizen.ui.guides/html/native/guides_n.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - Tizen Native UI Guides - - - - - - -
          -

          Tizen
          -Native UI Guides

          - -

          The UI framework features include various aspects of creating a visual outlook for the user application to ensure the best possible user experience.

          - -

          The UI framework is a universal, reusable software environment that provides the essential building blocks as part of the Tizen platform to facilitate the development of Tizen native applications. The framework provides the window, UI components, and scene-based graphic rendering architecture needed to manage your application user interface. In addition, the framework provides animations and effects needed to make your application more fresh and vivid, event handling and the main loop to interact with the user and system, and more features, such as scalability, and font setting.

          - -

          The Tizen platform provides the following native UI toolkit frameworks for developing a native application:

          - -
            -
          • EFL (Enlightenment Foundation Libraries) -

            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.

            -

            Generally, select 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.

          • -
          • DALi (Dynamic Animation Library) -

            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.

            -

            Select the DALi 3D UI toolkit if you are creating a high-performance rich UI application.

          • -
          - - - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/scripts/common.js b/org.tizen.ui.guides/html/scripts/common.js deleted file mode 100755 index d46479a..0000000 --- a/org.tizen.ui.guides/html/scripts/common.js +++ /dev/null @@ -1,1752 +0,0 @@ -$(document).ready(function(){ - $('#contents table').each(function(){ - if (!$(this).parent().hasClass('table')) { - $(this).wrap('
          '); - } - }); - - // Lnb Menu Initialize - if($('div#contents').find('.lnb').length){ - if($("ul li.events_news").size() > 0) { - $("ul.lnb").after("

          \"Samsung

          "); - } - initLnb(); - initScript(staticURL + "/js/fixednavbar.js", function(){}); - } - - //family site - if($('div#footer').find('dl#familySlider').length){ - fn_rollToEx('familySlider', 'sliderBanner', 1, true); - } - - // Svn Commit Test - - // Language Selection - if($('div#header').find('.util').length){ - var $lang = $('div#header').find('.util'); - $lang.find('a.lang').toggle(function(){ - $(this).css('background-image', $(this).css('background-image').replace('.gif','_.gif')).next('ul.language').show(); - },function(){ - $(this).css('background-image', $(this).css('background-image').replace('_.gif','.gif')).next('ul.language').hide(); - }); - - $lang.bind('mouseleave',function(){ - $(this).find('ul.language').hide(); - $lang.find('a.lang').css('background-image', $lang.find('a.lang').css('background-image').replace('_.gif','.gif')); - }); - - $lang.find('ul.language').children().last().on("keydown", function(e) { - if(e.which == 9 && e.shiftKey) { - return true; - } - - if(e.which == 9) { - e.preventDefault(); - $lang.find('ul.language').hide(); - $lang.find('a.lang').css('background-image', $lang.find('a.lang').css('background-image').replace('_.gif','.gif')); - setTimeout(function() { - $("#searchTop").focus(); - }, 1); - } - }); - } - - // Open the Sitemap - var $open = $('div#header').find('.bt-open'); - $open.bind('click',function(){ - var $self = $(this); - var $sitemap = $('div#wrapper').find('div#sitemap'); - //var source = $sitemap.is(':visible') ? $self.css('background-image').replace('_.gif','.gif') : $self.css('background-image').replace('.gif','_.gif'); - - if($sitemap.is(':visible')){ - var source = $self.css('background-image').replace('_.gif','.gif'); - //if($('body#main').length) $('#header .util').css('border-bottom','3px solid #e4e4e4'); - - $self.attr('title','open sitemap'); - }else{ - var source = $self.css('background-image').replace('.gif','_.gif'); - //if($('body#main').length) $('#header .util').css('border-bottom','3px solid #114196'); - - $self.attr('title','close sitemap'); - } - - $self.css('background-image',source); - $sitemap.slideToggle('fast'); - - $sitemap.find('ul').filter(':last').children().filter(':last').focusout(function(){ - var source = $self.css('background-image').replace('_.gif','.gif'); - $self.css('background-image',source); - $sitemap.slideToggle('fast'); - }); - - }); - - // Search Auto Complete - var $search = $('div#header').find('fieldset.search'); - var $searchList = $search.find('#topAutocomplete>ul'); - - if($search.length){ - $search.find('> input').each(function(){ - $(this).bind({ - keydown : function(e){ - - if(e.type=='keydown'&& $(this).val().length!=0){ - $search.find('#topAutocomplete').show(); - var hei = $searchList.outerHeight(); - if(hei>400){ - $searchList.css({'height':'400px','overflow-y':'auto'}); - } - } - if(e.keyCode==9){ - $search.unbind('focusout.search'); - } - if(e.keyCode==40){ - $search.find('#topAutocomplete>ul').children(':first').find('a').focus(); - //window.scrollTo(0,0); - } - }, - focusin : function(e){ - if($(this).val()==='Search'){ - $(this).val(''); - } - }, - focusout : function(e){ - if($(this).val().length==0) $(this).val('Search'); - } - }); - }); - - //$('#topAutocomplete>ul').children().find('a').bind('focusin',function(e){ - // if(e.keyCode==40){ - // $(this).parent().next().css('border','1px solid red').find('a').focus(); - // } - //}); - - $search.find('#topAutocomplete').bind('mouseleave',function(e){ - if($search.find('> input').val().length==0){ - $search.find('> input').val('Search'); - } - $search.find('#topAutocomplete').hide(); - }); - - $search.find('#topAutocomplete>ul').children().last().focusout(function(){ - $search.find('> input').val('Search'); - $search.find('#topAutocomplete').hide(); - - //$search.bind('focusout.search', function(){ - // $(this).find('> input').val('Search'); - // $(this).find('#topAutocomplete').hide(); - //}); - }); - } -}); - -// 비차단 동적 스크립트 로딩 -function initScript(url, callback){ - var script = document.createElement("script"); - script.type = "text/javascript"; - - if(script.readyState){ // 인터넷 익스플로러 - script.onreadystatechange = function(){ - if(script.readyState=="loaded" || script.readyState=="complete"){ - script.onreadystatechange = null; - callback(); - } - }; - }else{ // 다른 브라우저 - script.onload = function(){ - callback(); - }; - } - - script.src = url; - document.getElementsByTagName("head")[0].appendChild(script); -} - - -// lnb -function initLnb(){ - var sMenu = $('.lnb'); - var sItem = sMenu.find('>li'); - - sItem.each(function(){ - if($(this).find('a').hasClass('more')){ - if($(this).find('ul').is(":visible")) { - $('').insertAfter($(this).find('a').eq(0)); - } else { - $('').insertAfter($(this).find('a').eq(0)); - } - } - }); - - var setIcoArrText = function(obj) { - if(obj.next().is(":visible")) { - obj.text("close submenu"); - } else { - obj.text("open submenu"); - } - } - - sItem.find('.ico-arr').on("click", function() { - var $that = $(this); - var liBox = $that.parent(); - var ulBox = $that.next(); - - sItem.not(liBox).not(".on").find("a.more").next().next().hide(); - sItem.not(liBox).removeClass("active").find("a").removeClass("bov"); - - if(liBox.hasClass("on")) { - if(ulBox.is(":visible")) { - ulBox.hide(); - $that.addClass("ico-on"); - } else { - ulBox.show(); - $that.removeClass("ico-on"); - } - setIcoArrText($that); - return true; - } - - if(liBox.hasClass("active")) { - liBox.removeClass("active").find("a").eq(0).removeClass("bov"); - ulBox.hide(); - } else { - liBox.addClass("active").find("a").eq(0).addClass("bov"); - ulBox.show(); - } - setIcoArrText($that); - }); - - sItem.hover(function(){ - if($(this).hasClass('on')||$(this).hasClass('active')) return false; - $(this).find("a").eq(0).addClass("bov"); - },function(){ - if($(this).hasClass('on')||$(this).hasClass('active')) return false; - $(this).find("a").eq(0).removeClass("bov"); - - }); -} - -//footer rolling banner -function fn_rollToEx(container,objectId,step,auto){ - - // 롤링할 객체를 변수에 담아둔다. - var el = $('#'+container).find('#'+objectId); - var lastChild; - var speed = 3000; - var timer = 0; - var autoplay = false; - - el.data('prev', $('#'+container).find('.prev')); //이전버튼을 data()메서드를 사용하여 저장한다. - el.data('next', $('#'+container).find('.next')); //다음버튼을 data()메서드를 사용하여 저장한다. - el.data('size', el.children().outerWidth()); //롤링객체의 자식요소의 넓이를 저장한다. - el.data('len', el.children().length); //롤링객체의 전체요소 개수 - el.data('animating',false); - el.data('step', step); //매개변수로 받은 step을 저장한다. - el.data('autoStart', false); //매개변수로 받은 step을 저장한다. - - el.css('width',el.data('size')*el.data('len')); //롤링객체의 전체넓이 지정한다. - - if(arguments.length==4){ - el.data('autoStart', auto); - } - - if(el.data('autoStart')){ - if(timer==0){ - timer = setInterval(moveNextSlide, speed); - autoplay = true; - } - } - - el.bind({ - mouseenter:function(){ - if(!autoplay) return false; - - if(timer!=0 && el.data('autoStart')){ - clearInterval(timer); - timer=0; - } - }, - mouseleave:function(){ - if(!autoplay) return false; - - if(timer==0 && el.data('autoStart')){ - timer = setInterval(moveNextSlide, speed); - } - } - }); - - - //el에 첨부된 prev 데이타를 클릭이벤트에 바인드한다. - el.data('prev').bind({ - click:function(e){ - e.preventDefault(); - movePrevSlide(); - }, - mouseenter:function(){ - - $(this).find('img').addClass('btnOn'); - - if(!autoplay) return false; - - if(timer!=0 && el.data('autoStart')){ - clearInterval(timer); - timer=0; - } - }, - mouseleave:function(){ - - $(this).find('img').removeClass('btnOn'); - - if(!autoplay) return false; - - if(timer==0 && el.data('autoStart')){ - timer = setInterval(moveNextSlide, speed); - } - } - }); - - //el에 첨부된 next 데이타를 클릭이벤트에 바인드한다. - el.data('next').bind({ - click:function(e){ - e.preventDefault(); - moveNextSlide(); - }, - mouseenter:function(){ - - $(this).find('img').addClass('btnOn'); - - if(!autoplay) return false; - - if(timer!=0 && el.data('autoStart')){ - clearInterval(timer); - timer=0; - } - }, - mouseleave:function(){ - - $(this).find('img').removeClass('btnOn'); - - if(!autoplay) return false; - - if(timer==0 && el.data('autoStart')){ - timer = setInterval(moveNextSlide, speed); - } - } - }); - - function movePrevSlide(){ - if(!el.data('animating')){ - //전달된 step개수 만큼 롤링객체의 끝에서 요소를 선택하여 복사한후 변수에 저장한다. - var lastItem = el.children().eq(-(el.data('step')+1)).nextAll().clone(true); - lastItem.prependTo(el); //복사된 요소를 롤링객체의 앞에 붙여놓는다. - el.children().eq(-(el.data('step')+1)).nextAll().remove(); //step개수만큼 선택된 요소를 끝에서 제거한다 - el.css('left','-'+(el.data('size')*el.data('step'))+'px'); //롤링객체의 left위치값을 재설정한다. - - el.data('animating',true); //애니메이션 중복을 막기 위해 첨부된 animating 데이타를 true로 설정한다. - - el.animate({'left': '0px'},'normal',function(){ //롤링객체를 left:0만큼 애니메이션 시킨다. - el.data('animating',false); - }); - } - return false; - } - - function moveNextSlide(){ - if(!el.data('animating')){ - el.data('animating',true); - - el.animate({'left':'-'+(el.data('size')*el.data('step'))+'px'},'normal',function(){ //롤링객체를 첨부된 size와 step을 곱한 만큼 애니메이션 시킨다. - //전달된 step개수 만큼 롤링객체의 앞에서 요소를 선택하여 복사한후 변수에 저장한다. - var firstChild = el.children().filter(':lt('+el.data('step')+')').clone(true); - firstChild.appendTo(el); //복사된 요소를 롤링객체의 끝에 붙여놓는다. - el.children().filter(':lt('+el.data('step')+')').remove(); //step개수만큼 선택된 요소를 앞에서 제거한다 - el.css('left','0px'); ////롤링객체의 left위치값을 재설정한다. - - el.data('animating',false); - }); - } - return false; - } - -} - -function fn_slide(options){ - - var opts = jQuery.extend({},options); - - var $bt = $('#'+opts.container).find('#'+opts.bt).children(); //롤링버튼에 대한 선택자 - var $obj = $('#'+opts.container).find('#'+opts.obj); //objectId를 id로 갖는 롤링객체의 선택자 - var $prev = $('#'+opts.container).find('#'+opts.prev).hide(); //이전버튼에 대한 선택자 - var $next = $('#'+opts.container).find('#'+opts.next); //다음버튼에 대한 선택자 - var size = $obj.children().outerWidth(); //롤링객체의 각 이미지 넓이값 - var len = $obj.children().length; //롤링객체의 이미지 갯수 - var effect = false; //슬라이드효과를 위한 boolean변수 - var auto = false; - var current = 0; //현재 보여지는 이미지의 인덱스값을 저장하기 위한 변수 - var time; - - - $obj.css('width',size*len); //롤링객체의 전체넓이 지정 - effect = opts.effect; - auto = opts.auto; - - if(auto){ - time = setTimeout('slideShow()',3000); - } - - slideShow = function(){ - - if(current < len-1){ - current++; - }else{ - current=0; - } - - controllStatus(); - - moveControl('next'); - - time = setTimeout('slideShow()',3000); - } - - controllStatus = function(){ - //이미지의 인덱스값에 따라 이전,다음 버튼 활성여부 지정 - if(current>0||current=len-1){ - $prev.show(); - $next.hide(); - } - } - - moveControl = function(msg){ - if(opts.bt!=null){ - msg=='next'? $bt.eq(current-1).find('img').attr('src', $bt.eq(current-1).find('img').attr('src').replace('_.png','.png')) - :$bt.eq(current+1).find('img').attr('src', $bt.eq(current-1).find('img').attr('src').replace('_.png','.png')); //이전에 활성화된 롤링버튼을 비활성화 - $bt.eq(current).find('img').attr('src', $bt.eq(current).find('img').attr('src').replace('.png','_.png')); //현재 인덱스값을 가지는 롤링버튼을 활성화 - } - - if(effect!=true){ //action변수가 true가 아닐경우 슬라이드 효과없이 현재의 인덱스값을 갖는 이미지를 보여줌. - $obj.children().hide(); - $obj.children().eq(current).show(); - }else{ //action변수가 true일 경우 현재의 인덱스값을 갖는 이미지로 슬라이드됨 - $obj.animate({'left':'-'+size*current},'slow'); - } - } - - $obj.bind({ - mouseenter:function(){ - if(!auto) return false; - clearTimeout(time); - }, - mouseleave:function(){ - if(!auto) return false; - time = setTimeout('slideShow()',3000); - } - }); - - //롤링 버튼 클릭시 - $bt.bind({ - mouseenter:function(){ - if(!auto) return false; - clearTimeout(time); - }, - mouseleave:function(){ - if(!auto) return false; - time = setTimeout('slideShow()',3000); - }, - click:function(){ - var idx = $bt.index(this); //클릭한 롤링버튼의 인덱스값 저장 - - current = idx; //롤링버튼의 인덱스값을 이미지의 인덱스값으로 지정 - - controllStatus(); - - if(effect!=true){ //action변수가 true가 아닐경우 슬라이드 효과없이 현재의 인덱스값을 갖는 이미지를 보여줌. - $obj.children().hide(); - $obj.children().eq(current).show(); - }else{ //action변수가 true일 경우 현재의 인덱스값을 갖는 이미지로 슬라이드됨 - $obj.animate({'left':'-'+size*current},'slow'); - } - - // 모든 롤링 버튼을 비활성화 - $bt.each(function(){ - var source = $(this).find('img').attr('src').replace('_.png','.png'); - $(this).find('img').attr('src',source); - }); - - // 선택한 롤링버튼을 활성화 - var source = $(this).find('img').attr('src').replace('.png','_.png'); - $(this).find('img').attr('src',source); - - return false; - } - }); - - //이전 버튼 클릭시 - $prev.bind({ - mouseenter:function(){ - var source = $(this).find('img').attr('src').replace('.png','_.png'); - $(this).find('img').attr('src',source); - if(!auto) return false; - clearTimeout(time); - }, - mouseleave:function(){ - var source = $(this).find('img').attr('src').replace('_.png','.png'); - $(this).find('img').attr('src',source); - if(!auto) return false; - time = setTimeout('slideShow()',3000); - }, - click:function(){ - if(current==len-1) $next.show(); //이미지 인덱스값이 마지막이 아닐경우 비활성화된 다음버튼을 활성화 - current--; //이미지 인덱스값 1씩 감소 - - moveControl('prev'); - - if(current==0) $(this).hide(); //이미지 인덱스값이 0일 경우, 즉 현재 첫번째 이미지가 활성화될 경우 이전버튼을 비활성화 - - return false; - } - }); - - //다음 버튼 클릭시 - $next.bind({ - mouseenter:function(){ - var source = $(this).find('img').attr('src').replace('.png','_.png'); - $(this).find('img').attr('src',source); - if(!auto) return false; - clearTimeout(time); - }, - mouseleave:function(){ - var source = $(this).find('img').attr('src').replace('_.png','.png'); - $(this).find('img').attr('src',source); - if(!auto) return false; - time = setTimeout('slideShow()',3000); - }, - click:function(){ - current++; //이미지 인덱스값 1씩 증가 - - moveControl('next'); - - if(current>=len-1) $(this).hide(); //이미지인덱스값이 마지막일 경우, 즉 현재 마지막 이미지가 활성화될 경우 다음버튼을 비활성화 - if(current>0) $prev.show(); //이미지인덱스값이 0이 아닌경우 이전버튼 활성화 - - return false; - } - }); - -} - -// main rolling banner -function slideMotion1(){ - var $banner = $('#rolling .motionview'), - //$nav = $('#rolling ul.nav'), - banner = {prev:null, next:null}, - size = $banner.children().length; - index = 1, - speed = 3000, - timer = null, - auto = true, - width = parseInt(100/size), - rest = parseInt(100%size); - - var $nav = $('
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/circle_progressbar_ww.htm b/org.tizen.ui.guides/html/web/tau/circle_progressbar_ww.htm deleted file mode 100755 index a234ab4..0000000 --- a/org.tizen.ui.guides/html/web/tau/circle_progressbar_ww.htm +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - Creating Circle-shaped Progress Bars - - - -
          -
          -

          Wearable Web

          -
          - - -
          - -
          -

          Creating Circle-shaped Progress Bars

          - -

          You can create a circle-shaped progress bar component with the CircleProgressBar API.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the layout of the progress bar in a rectangular and circular UI.

          - -

          Figure: The circle-shaped progress bar in rectangular and circular devices

          -

          Circle-shaped progress bar in a rectangular device Circle-shaped progress bar in a circular device

          - -

          To implement the progress bar:

          - -
            -
          1. Edit the HTML code to add the component to your application screen: - -
            -<div class="ui-page ui-page-active" id="pageCircleProgressBar" data-enable-page-scroll="false">
            -   <header class="ui-header">
            -      <h2 class="ui-title">Circle Progress</h2>
            -   </header>
            -   <div class="ui-content content-padding">
            -      <div class="result" id="result"></div>
            -   </div>
            -   <footer class="ui-footer ui-grid-col-2">
            -      <a href="#" class="ui-btn" id="minus">-10%</a>
            -      <a href="#" class="ui-btn" id="plus">+10%</a>
            -   </footer>
            -   <progress class="ui-circle-progress" id="circleprogress" max="100" value="20"></progress>
            -</div>
            -
            -
          2. - -
          3. Edit the CSS code to set the visual style of the progress bar: - -
            -.ui-progressbar-large 
            -{
            -   position: absolute;
            -   top: 50%;
            -   left: 50%;
            -   -webkit-transform: translate3d(-50%, -50%, 0);
            -}
            -.result 
            -{
            -   font-size:35px;
            -   text-align:center;
            -   top: 33%;
            -   left: 50%;
            -   -webkit-transform: translate3d(-50%, -50%, 0);
            -   position: absolute;
            -}
            -
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   .result 
            -   {
            -      top: 50%;
            -      margin: 0;
            -   }
            -   .ui-footer 
            -   {
            -      display: none;
            -   }
            -}
            -
            -
          4. - -
          5. Edit the JavaScript code to manage the progress bar events and other functionality: - -
            -(function()
            -{
            -   var page = document.getElementById("pageCircleProgressBar"),
            -       progressBar = document.getElementById("circleprogress"),
            -       minusBtn = document.getElementById("minus"),
            -       plusBtn = document.getElementById("plus"),
            -       resultDiv = document.getElementById("result"),
            -       isCircle = tau.support.shape.circle,
            -       progressBarWidget,
            -       resultText,
            -       i;
            -
            -   function printResult() 
            -   {
            -      resultText = progressBarWidget.value();
            -      resultDiv.innerHTML = resultText + "%";
            -   };
            -
            -   function clearVariables() 
            -   {
            -      page = null;
            -      progressBar = null;
            -      minusBtn = null;
            -      plusBtn = null;
            -      resultDiv = null;
            -   };
            -
            -   function unbindEvents() 
            -   {
            -      page.removeEventListener("pageshow", pageBeforeShowHandler);
            -      page.removeEventListener("pagehide", pageHideHandler);
            -      if (isCircle) 
            -      {
            -         document.removeEventListener("rotarydetent", rotaryDetentHandler);
            -      } 
            -      else 
            -      {
            -         minusBtn.removeEventListener("click", minusBtnClickHandler);
            -         plusBtn.removeEventListener("click", plusBtnClickHandler);
            -      }
            -   };
            -
            -   function minusBtnClickHandler() 
            -   {
            -      i = i-10;
            -      if (i < 0) 
            -      {
            -         i=0;
            -      }
            -      progressBarWidget.value(i);
            -      printResult();
            -   };
            -
            -   function plusBtnClickHandler() 
            -   {
            -      i = i+10;
            -      if (i > 100) 
            -      {
            -         i=100;
            -      }
            -      progressBarWidget.value(i);
            -      printResult();
            -   };
            -
            -   function rotaryDetentHandler() 
            -   {
            -      /* Get the rotary direction */
            -      var direction = event.detail.direction,
            -          value = parseInt(progressBarWidget.value());
            -
            -      if (direction === "CW") 
            -      {
            -         /* Right direction */
            -         if (value < 100) 
            -         {
            -            value++;
            -         } 
            -         else 
            -         {
            -            value = 100;
            -         }
            -      } 
            -      else if (direction === "CCW") 
            -      {
            -         /* Left direction */
            -         if (value > 0) 
            -         {
            -            value--;
            -         } 
            -         else 
            -         {
            -            value = 0;
            -         }
            -      }
            -
            -      progressBarWidget.value(value);
            -      printResult();
            -   }
            -
            -   function pageBeforeShowHandler() 
            -   {
            -      if (isCircle) 
            -      {
            -         /* Make the circular progressbar object */
            -         progressBarWidget = new tau.widget.CircleProgressBar(progressBar, {size: "full"});
            -         document.addEventListener("rotarydetent", rotaryDetentHandler);
            -      } 
            -      else 
            -      {
            -         progressBarWidget = new tau.widget.CircleProgressBar(progressBar, {size: "large"});
            -         minusBtn.addEventListener("click", minusBtnClickHandler);
            -         plusBtn.addEventListener("click", plusBtnClickHandler);
            -      }
            -
            -      i = parseInt(progressBarWidget.value());
            -      resultDiv.innerHTML = i + "%";
            -   };
            -
            -   function pageHideHandler() 
            -   {
            -      unbindEvents();
            -      clearVariables();
            -      /* Release the object */
            -      progressBarWidget.destroy();
            -   };
            -
            -   page.addEventListener("pagebeforeshow", pageBeforeShowHandler);
            -   page.addEventListener("pagehide", pageHideHandler);
            -}());
            -
            -
          6. -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/circular_ui_ww.htm b/org.tizen.ui.guides/html/web/tau/circular_ui_ww.htm deleted file mode 100755 index 5be5f3f..0000000 --- a/org.tizen.ui.guides/html/web/tau/circular_ui_ww.htm +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - Applications for Circular UI: Developing UI on Circular Wearable Applications - - - - - -
          -

          Applications for Circular UI: Developing UI on Circular Wearable Applications

          - -

          TAU for Wearable supports different types of wearable devices (rectangle and circle) in the same application. To support the circular UI along with rectangular UI, media query is required.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - - -

          Applying the Circular UI

          - -

          To support the circular UI:

          - -
            -
          1. Include the link tag for the latest tau.css file into the <head> part in HTML. Note that for the compatibility with the rectangular UI, you must use the latest version of TAU library.
          2. - -
          3. Include the link tag for the latest tau.circle.css file with media query feature (-tizen-geometric-shape: circle) next to the link tag for the tau.css. Note that adding the tau.circle.css file following the general tau.css file covers the additional circular UI.
          4. - -
          5. Include the link tag for the latest tau.js script file at the end of <body> part of HTML.
          6. - -
          7. For writing a separate code for Circular UI in JavaScript, you can use the tau.support.shape.circle property for detecting the circular device.
          8. -
          - -
          -<head name="viewport" content="width=device-width, user-scalable=no">
          -   <title>Support for Circular UI</title>
          -   <link rel="stylesheet" href="tau.css">
          -   <!-- CSS media query on a link element -->
          -   <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="tau.circle.css">
          -   <link rel="stylesheet" href="css/stlye.css">
          -</head>
          -<body>
          -   <script type="text/javascript" src="tau.js"></script>
          -   <script>
          -      if (tau.support.shape.circle) 
          -      {
          -         /* Implement your code for the circular UI */
          -      } 
          -      else 
          -      {
          -          /* Implement your code for the rectangular UI */
          -      }
          -   </script>
          -</body>
          -
          - -

          The following figure shows how the media query -tizen-geometric-shape: circle works in a rectangular and circular UI.

          -

          Figure: Media query in a rectangular device and circular device

          -

          - Media query in a rectangular device and circular device -

          - -

          Overriding Circular CSS Style with Media Query

          - -

          For some styles to be applied selectively, you can use the media query feature -tizen-geometric-shape with a rectangle or circle value to distinguish type difference. Note that the -tizen-geometric-shape feature is only available in Tizen devices.

          - - - - - - - - - - - - - - - - - - - - -
          Table: -tizen-geometric-shape feature description
          -tizen-geometric-shape
          Valuerectangle | circle
          Applied toVisual media types
          Accept min/max prefixesNo
          - -
          -.className 
          -{
          -   /* Implement the basic CSS style for all types of devices (rectangular and circular) */
          -}
          -
          -@media screen and (-tizen-geometric-shape: circle) 
          -{
          -   .className
          -   {
          -      /* Implement the CSS style to be overridden in circular */
          -   }
          -}
          -
          - -

          Writing JavaScript Selectively for the Circular UI

          -

          TAU for Wearable provides the tau.support.shape.circle property that checks whether the device screen is a circle or not. If you want implement code selectively for circular UI and rectangular UI, you can use the property with a boolean value. Note that for developing in a browser environment, this property is always set to true when the tau.circle.css file is loaded.

          - -
          -if (tau.support.shape.circle) 
          -{
          -   /* Implement your code for the circular UI */
          -} 
          -else 
          -{
          -   /* Implement your code for the rectangular UI */
          -}
          -
          - -

          Supported UI Components

          -

          The following components can be used in both rectangular and circular devices.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: UI components supported by rectangular and circular UI
          ComponentDescription
          Helper ScriptShows how you to support some application components.
          Snap ListShows how you can create a snap list component.
          Expandable HeaderShows how you can create a header component.
          Circle-shaped Progress BarShows how you can create a circle progress bar component.
          Full Size Processing ComponentShows how you can create a processing component.
          Footer ButtonShows how you can create a footer button component.
          ThumbnailShows how you can create a thumbnail component.
          Popup ButtonShows how you can create a popup component.
          Index Scroll BarShows how you can create an index scroll bar component.
          More OptionsShows how you can create a more options button component.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/event_handling_w.htm b/org.tizen.ui.guides/html/web/tau/event_handling_w.htm deleted file mode 100755 index 7daf215..0000000 --- a/org.tizen.ui.guides/html/web/tau/event_handling_w.htm +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - Event Handling: Handling User Interactions - - - -
          -
          -

          Mobile Web Wearable Web

          -
          - - -
          - -
          -

          Event Handling: Handling User Interactions

          -

          The Tizen platform supports some device events for user interaction. To provide a full user experience for your application users, you must handle various events in your application.

          - -

          Hardware Key Events

          - -

          The Tizen platform supports hardware key events for user interaction on devices.

          -

          The following figures show the hardware keys and events for mobile and wearable devices.

          - -

          Figure: Menu and Back keys on a mobile device

          -

          Menu and Back keys

          -

          Figure: Back key on a wearable device

          -

          Back key

          - - - - - - - - - - - - - - - - -
          Table: hardware key events
          TypeDescriptionAttribute
          tizenhwkeyEvent is triggered when a device detects the user interaction through special point of hardware. - event.keyName -
            -
          • back for wearable
          • -
          • back, menu for mobile
          • -
          -
          -

          To bind an event callback on the tizenhwkey events, use the following code:

          -
          -window.addEventListener("tizenhwkey", function(ev)
          -{
          -   if (ev.keyName == "back") 
          -   {
          -      /* Call window.history.back() to go to previous browser window */
          -      /* Call tizen.application.getCurrentApplication().exit() to exit application */
          -      /* Add script to add another behavior */
          -   }
          -});
          -
          - -

          Exiting the Application with the Back Key

          -

          When application binds a tizenhwkey event, it checks the page ID and decides to go back or exit with several lines of app-side script.

          -

          The Tizen Device APIs provide an application exit method. Even if the application has many pages, it can handle the back/exit process.

          -

          With TAU page, just remember the ID of the main page of main page. In the following example, the ID of the main page is main.

          -
          (function()
          -{
          -   window.addEventListener("tizenhwkey", function(ev);
          -   {
          -      if(ev.keyName === "back")
          -      {
          -         var page = document.getElementsByClassName("ui-page-active")[0],
          -             pageid = page ? page.id: "";
          -         if(pageid === "main")
          -         {
          -            try
          -            {
          -               tizen.application.getCurrentApplication().exit();
          -            }
          -            catch(ignore)
          -            {
          -            }
          -         }
          -         else
          -         {
          -            window.history.back();
          -         }
          -      }
          -   });
          -}());
          - -

          Rotary Events

          - -

          The Tizen platform supports rotary events for user interaction on a wearable rotary device or sensor. The rotary device can rotate clockwise or counter-clockwise, and dispatch an event for each movement. The rotary device has points called detents. If the rotary device detects the detent point while rotating, it dispatches a separate new event about the point. The number of the available detent points depends on the device hardware.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - - -

          Figure: Rotary device

          -

          Rotary device

          -

          Rotary events are used to deliver the rotary device or sensor data to the application. The following table describes the rotary events.

          - - - - - - - - - - - - - - - -
          Table: Rotary events
          TypeDescriptionAttribute
          rotarydetentEvent is triggered when a device detects the detent point.detail.direction: the rotation direction. -

          The available values are CW for clockwise and CCW for counter-clockwise rotation.

          - -

          To bind an event callback on rotary events, use the following code:

          -
          -document.addEventListener("rotarydetent", function(ev)
          -{
          -   var direction = ev.detail.direction;
          -   /* Add behavior for detent detected event with a direction value */
          -});
          -
          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/footerbutton_ww.htm b/org.tizen.ui.guides/html/web/tau/footerbutton_ww.htm deleted file mode 100755 index 94cb2f7..0000000 --- a/org.tizen.ui.guides/html/web/tau/footerbutton_ww.htm +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - Creating Footer Buttons - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          - -

          Creating Footer Buttons

          - -

          You can create a footer button component that is supported in both rectangular and circular UI.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figures show the layout of the footer button components in a rectangular and circular UI.

          -

          Figure: Footer button in a rectangular and circular device

          -

          Footer button in a rectangular device Footer button in a circular device

          - -

          Figure: Multiple footer buttons in a rectangular and circular device

          -

          Multiple footer buttons in a rectangular device Multiple footer buttons in a circular device

          -

          The footer button on the circular UI has the ui-bottom-button class. When there are multiple buttons, the other buttons except for the first button use the drawer component in the circular UI.

          - - -

          To implement footer buttons:

          - -
            -
          • To implement a single footer button: -

            Edit the HTML code to add the footer button component to your application screen.

            - -
            -<div class="ui-page ui-page-active" id="bottomButtonPage" >
            -   <header class="ui-header">
            -      <h2 class="ui-title">Bottom Button</h2>
            -   </header>
            -   <div class="ui-content content-padding">
            -      It was a real pleasure for me to finally get to meet you. My colleagues join me in sending you our holiday greetings.
            -   </div>
            -   <footer class="ui-footer ui-bottom-button">
            -      <a href="#" class="ui-btn">Button</a>
            -   </footer>
            -</div>
            -
            -
          • -
          • To implement multiple footer buttons: - - -
              -
            1. Edit the HTML code to add the footer button components to your application screen. -

              When there are multiple buttons, the buttons except for the first button use drawer in Circular UI.

              - -
              -<div class="ui-page ui-page-active" id="bottomButtonWithMorePage" >
              -   <header class="ui-header">
              -      <h2 class="ui-title">Multiple Buttons</h2>
              -   </header>
              -   <div class="ui-content content-padding">
              -      It was a real pleasure for me to finally get to meet you. My colleagues join me in sending you our holiday greetings.
              -
              -   </div>
              -
              -   <a class="drawer-handler"></a>
              -
              -   <!-- Circle Profile -->
              -   <div id="moreoptionsDrawer" class="ui-drawer drawer-elem" data-drawer-target="#bottomButtonWithMorePage" data-position="right" data-enable="true" data-drag-edge="1">
              -      <div id="selector" class="ui-selector">
              -         <div class="ui-item show-icon" data-title="2"></div>
              -         <div class="ui-item human-icon" data-title="3"></div>
              -      </div>
              -   </div>
              -
              -   <footer class="ui-footer ui-grid-col-3 ui-bottom-button">
              -      <a href="#" class="ui-btn">1</a>
              -      <a href="#" class="ui-btn">2</a>
              -      <a href="#" class="ui-btn">3</a>
              -
              -   </footer>
              -</div>
              -
              -
            2. - -
            3. Edit the CSS code to set the visual style of the buttons: - -
              -.drawer-elem 
              -{
              -   display: none;
              -}
              -
              -@media all and (-tizen-geometric-shape: circle) 
              -{
              -   .drawer-handler 
              -   {
              -      width:24px;
              -      height: 115px;
              -      position: fixed;
              -      top: 122px;
              -      right: 0;
              -      color: transparent;
              -      background-color: #a4a4a4;
              -      -webkit-mask-image: url(/*path of the image*/);
              -      -webkit-mask-size: 18px 36px;
              -      -webkit-mask-repeat: no-repeat;
              -      -webkit-mask-position: 0 40px;
              -   }
              -   .ui-bottom-button a + a 
              -   {
              -       display: none;
              -   }
              -}
              - 
              - -
            4. -
            5. Edit the JavaScript code to manage the footer button events and other functionalities: -
              -(function()
              -{
              -   var page = document.querySelector("#bottomButtonWithMorePage"),
              -      drawer = page.querySelector("#moreoptionsDrawer"),
              -      handler = page.querySelector(".ui-more");
              -   page.addEventListener("pagebeforeshow", function() 
              -   {
              -      if (tau.support.shape.circle) 
              -      {
              -         tau.helper.DrawerMoreStyle.create(drawer, 
              -         {
              -            handler: ".drawer-handler",
              -
              -         });
              -      }
              -   });
              -})();
              -
              -
            6. -
            -
          • -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/globalization_w.htm b/org.tizen.ui.guides/html/web/tau/globalization_w.htm deleted file mode 100755 index 6644ca6..0000000 --- a/org.tizen.ui.guides/html/web/tau/globalization_w.htm +++ /dev/null @@ -1,484 +0,0 @@ - - - - - - - - - - - - - Globalization: Supporting Internationalization and Localization - - - - - - -
          -

          Globalization: Supporting Internationalization and Localization

          - -

          The TAU Globalize utility supports internationalization and localization. It wraps the Globalize functionality for easy access from Tizen Web applications, and it is extended to support the right-to-left (RTL) languages.

          - -

          jQuery and Globalize

          - -

          Globalize is a jQuery JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data. The library works both for the browser and as a Node.js module. jQuery and Globalize have dependencies with cldr.js, which is a CLDR low-level manipulation tool.

          - -

          Globalize:

          -
            -
          • Leverages the Unicode CLDR data and follows its UTS#35 specification.
          • -
          • Keeps the code separate from the i18n content. Does not host or embed any locale data in the library. Empowers you to control the loading mechanism of your choice.
          • -
          • Allows you to load as much or as little data as you need. Avoids duplicating data if using multiple i18n libraries that leverage CLDR.
          • -
          • Keeps the code modular. Allows you to load the i18n functionalities you need.
          • -
          • Runs in browsers and Node.js, and consistently across all of them.
          • -
          • Makes globalization as easy to use as jQuery.
          • -
          - -

          CLDR Data

          - -

          The Unicode CLDR provides the key building blocks for software to support the world's languages. It includes:

          -
            -
          • Locale-specific patterns for formatting and parsing dates, times, time zones, numbers, and currency values
          • -
          • Translations of names: languages, scripts, countries and regions, currencies, eras, months, weekdays, day periods, time zones, cities, and time units
          • -
          • Language and script information: characters used, plural cases, gender of lists, capitalization, rules for sorting and searching, writing direction, transliteration rules, rules for spelling out numbers, and rules for segmenting text into graphemes, words, and sentences
          • -
          • Country information: language usage, currency information, calendar preference and week conventions, and postal and telephone codes
          • -
          • ISO and BCP 47 code support (such as cross-mappings) and keyboard layouts
          • -
          - -

          CLDR uses the XML format provided by UTS #35: Unicode Locale Data Markup Language (LDML). LDML is a format used not only for CLDR, but also for the general interchange of locale data. For more information about CLDR, see CLDR release notes, and to download the JSON format file , see JSON Data from the Unicode CLDR Project.

          -

          The TAU Globalize utility uses the CLDR 26 release, and when you create a Tizen Web application project, you find CLDR in the <project>/lib/tau/<profile>js/cldr-data folder.

          - -

          Using the Globalize Utility

          - -

          To use the TAU Globalize utility in your application:

          -
            -
          1. Download the following dependency files for your application: - -
          2. -
          3. Create a folder structure, as shown in the following table. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            - Table: Globalize folder structure -
            Folder structureDescription

            -

            Globalize folder structure

            -

            Globalize main folder

            cldr/: Copy the cldr.js library in this folder.
            cldr-data/: Copy the cldr-data files in this folder. -

            cldr-data/main: Copy the languages to be supported in this folder.

            - - - - - - - - - -
            Note
            Do not copy all languages, just the ones you need.
            globalize/: Copy the Globalize library in this folder.
            locale/: Make the custom locale string in this folder.
            script/: JavaScript files.
            style/: CSS, image, and other style related files.
            view/: HTML files
            -
          4. -
          5. Set the locale using the following example code: -
            -var globalize = tau.util.globalize,
            -   localeId  = "ko-KR";
            -
            -document.addEventListener('pageshow', function()
            -{
            -   globalize.setLocale(localeId)
            -   .done(function(ko)
            -   {
            -      /* "ko" is the Globalize utility instance */
            -      console.log(ko.getLocale()) /* "ko" */
            -   })
            -})
            -
            - -

            The setLocale() method is not synchronous, and it returns the deferred object with the methods then(), done(), and fail(). Use these methods to receive the Globalize utility instance.

            -

            You can specify locales in 2 ways using IETF language tags, such as en, pt-BR, or zh-Hant-TW:

            -
              -
            • Specify the locale ID in the lang attribute of the body element, such as <body lang="ko-KR">.
            • -
            • Use a string variable as an input argument of the setLocale() method (for example ko.setLocale("en")) to overwrite the body element setting.
            • -
            -

            If no lang attribute or setLocale() input argument is defined, the Globalize utility finds the locale by checking the window.navigator.language property. If the check result is false, the utility uses the default locale "en".

            -

            The following table illustrates the locale setting method order.

            - - - - - - - - - - - - - - - - - - - - - - - - -
            - Table: Locale setting methods -
            OrderLocale setting methods
            1setLocale(LocaleId)
            2<body lang="ko-KR">
            3window.navigator.language
            4Default locale "en"
            -
          6. -
          7. Make sure that you have all required CLDR files. -

            The setLocale() method automatically loads the basic CLDR data files which are match the given locale by local AJAX. During the method call, the Globalize utility also loads the basic CLDR JSON files:

            -
              -
            • cldr/main/locale/ca-gregorian.json
            • -
            • cldr/main/locale/numbers.json
            • -
            • cldr/main/locale/currencies.json
            • -
            • cldr/supplemental/likelySubtags.json
            • -
            • cldr/supplemental/scriptMetaData.json
            • -
            • cldr/supplemental/timeData.json
            • -
            • cldr/supplemental/weekData.json
            • -
            • cldr/supplemental/numberingSystems.json
            • -
            • cldr/supplemental/plurals.json (for cardinals)
            • -
            • cldr/supplemental/ordinals.json (for ordinals)
            • -
            -

            In addition to the basic files, each Globalize method requires a special set of CLDR portions. Determine which Globalize module functionalities you need, and make sure you have the required files, as defined in the following table.

            - - - - - - - - - - - - - - - - - - - - - - - - - -
            - Table: CLDR requirements -
            ModuleRequired CLDR JSON files
            Core modulecldr/supplemental/likelySubtags.json
            Date modulecldr/main/locale/ca-gregorian.json -

            cldr/main/locale/timeZoneNames.json

            -

            cldr/supplemental/timeData.json

            -

            cldr/supplemental/weekData.json

            -

            CLDR JSON files from the number module

            Number modulecldr/main/locale/numbers.json -

            cldr/supplemental/numberingSystems.json

            Plural modulecldr/supplemental/plurals.json (for cardinals) -

            cldr/supplemental/ordinals.json (for ordinals)

            -
            -
          8. -
          - -

          Using the Globalize Utility Methods

          -

          The following code snippets show how to use the TAU Globalize utility methods:

          -
            -
          • formatCurrency(): -
            -var globalize = tau.util.globalize,
            -    localeId  = "ko-KR",
            -    currency_unit = "KRW"; /* ISO 4217 */
            -
            -document.addEventListener('pageshow', function()
            -{
            -   globalize.setLocale(localeId)
            -   .done(function(ko)
            -   {
            -      console.log(ko.formatCurrency(69000, currency_unit)); /* ₩69,900 */
            -   })
            -})
            -
            -

            For more information, see the currency unit standard in ISO 4217.

            -
          • - -
          • formatDate(): -
            -var globalize = tau.util.globalize,
            -    localeId  = "ko-KR",
            -    currency_unit = "KRW"; /* ISO 4217 */
            -
            -document.addEventListener('pageshow', function()
            -{
            -   globalize.setLocale(localeId)
            -   .done(function(ko)
            -   {
            -      console.log(ko.formatDate(new Date(), {datetime:"medium"});
            -   })
            -})
            -
            -

            For more information, see date-formatter.

            -
          • - -
          • getCalendar(): -
            -var globalize = tau.util.globalize,
            -    localeId  = "ko-KR";
            -
            -document.addEventListener('pageshow', function()
            -{
            -   globalize.setLocale(localeId)
            -   .done(function(ko)
            -   {
            -      console.log(ko.getCalendar().months.format.wide, undefined, 4));
            -   })
            -})
            -
            -

            The calendar format is specified in the gregorian.json file in the CLDR data.

            -
          • - -
          • formatMessage(): -

            This method supports custom locale data.

            -
              -
            1. Create a directory for each locale that has localized content under the locales directory in the project root. The locale names are defined in the W3C IANA language subtag registry. -
              -index.html
              -locale
              -   en.json
              -   ko.json
              -
              -
            2. -
            3. Create a JSON file for the formatMessage strings (custom locale strings) in locales paths: -
              -{
              -   "en":
              -   {
              -      "like":
              -      [
              -         "{0, plural, offset:1",
              -         "=0 {Be the first to like this}",
              -         "=1 {You liked this}",
              -         "one {You and someone else liked this}",
              -         "other {You and # others liked this}",
              -         "}"
              -      ],
              -      "greeting":
              -      {
              -         "hello":"hello",
              -         "bye":"bye"
              -      },
              -      "longText":
              -      [
              -         "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non",
              -         "quis exercitationem culpa nesciunt nihil aut nostrum explicabo",
              -         "reprehenderit optio amet ab temporibus asperiores quasi cupiditate.",
              -         "Voluptatum ducimus voluptates voluptas?"
              -      ]
              -   }
              -}
              -
              -
            4. - -
            5. Call the setLocale() method to load the custom locale files automatically: -
              -var globalize = tau.util.globalize,
              -    localeId  = "ko-KR";
              -
              -document.addEventListener('pageshow', function()
              -{
              -   globalize.setLocale(localeId)
              -   .done(function(ko)
              -   {
              -      console.log(ko.formatMessage("greeting/hello"));
              -      console.log(ko.formatMessage("greeting/bye"));
              -      console.log(ko.formatMessage("longText"));
              -   })
              -})
              -
              -
            6. -
            -
          • - -
          • messageFormatter(): -

            This method returns a function that formats a message using the ICU message format pattern. For more information, see message-formatter.

            -
              -
            1. Create a locale resource in the locales path: -
              -{
              -   "en":
              -   {
              -      "formatter":
              -      {
              -         "welcome":"Hello Mr. {0}",
              -         "thankyou":"Bye Mr. {custom}."
              -      }
              -   }
              -}
              -
              -
            2. - -
            3. Use the messageFormatter() method: -
              -var globalize = tau.util.globalize,
              -    localeId  = "en-US";
              -
              -document.addEventListener('pageshow', function()
              -{
              -   globalize.setLocale(localeId)
              -   .done(function(en)
              -   {
              -      var welcomeFormatter = en.messageFormatter('formatter/welcome'),
              -          thankyouFormatter  = en.messageFormatter('formatter/thankyou'),
              -          welcomeMessageList = ["Tom"],
              -          thankyouMessageList = {custom:"Tom"};
              -
              -      console.log(welcomeFormatter(welcomeMessageList));
              -      console.log(thankyouFormatter(thankyouMessageList));
              -   })
              -})
              -
              -
            4. -
            -
          • -
          - -

          Right-to-left (RTL) Language Support

          - -

          TAU offers 2 ways to handle right-to-left (RTL) languages:

          -
            -
          • Locale-specific CSS
          • -
          • RTL property in a locale object
          • -
          -

          When the setLocale() method is called, it automatically applies a CSS class to the body element of your DOM if the given locale has an RTL direction.

          -

          The following examples show how to use the locale-specific CSS:

          - -
            -
          • The following example has ar-EG as the given locale, and the language has an RTL direction: -
            -var globalize = tau.util.globalize,
            -    localeId  = "ar-EG";
            -
            -document.addEventListener('pageshow', function()
            -{
            -   globalize.setLocale(localeId)
            -   .done(function(ar)
            -   {
            -      ...
            -   })
            -})
            -
            -
          • - -
          • The following example has a DOM of body with a locale-specific CSS named ui-script-direction-rtl: -
            -<body class="ui-script-direction-rtl">
            -
            -
          • - -
          • The following example uses the locale-specific CSS to switch on the RTL feature for a UI component: -
            -.ui-script-direction-rtl .ui-listview
            -{
            -   direction: rtl;
            -}
            -.ui-script-direction-rtl .ui-li.ui-li-static
            -{
            -   text-align: right;
            -   unicode-bidi: bidi-override;
            -}
            -
            -
          • -
          - -

          The following example shows how to use the RTL property in a locale object (the rtl variable). If a given locale has an RTL direction, the variable is true.

          -
          -var globalize = tau.util.globalize,
          -    localeId  = "ar-EG";
          -
          -document.addEventListener('pageshow', function()
          -{
          -   globalize.setLocale(localeId)
          -   .done(function(ar)
          -   {
          -      console.log(ar.rtl) /* true */
          -   })
          -})
          -
          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/guides_tau_w.htm b/org.tizen.ui.guides/html/web/tau/guides_tau_w.htm deleted file mode 100755 index e7e2247..0000000 --- a/org.tizen.ui.guides/html/web/tau/guides_tau_w.htm +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - TAU - - - -
          -
          -

          Mobile Web Wearable Web

          -
          - -
          - -

          Related Info

          - -
          -
          - -
          -

          TAU

          - - - - - - - - - - -
          Note
          Tizen Advaced UI framework(TAU) is optional, but recommended for making web applications for Tizen. -
          - -

          The Tizen Advanced UI Framework components allow you to create and manage various kinds of UI components. The components represent a visual UI element, such as a button or slider, which gives you interaction with and manipulation features.

          -

          TAU is the standard Web UI library for Tizen platform, originated from the Tizen Web UI Framework Library (standard library for Tizen 2.2.1), which was mainly an extension to jQuery Mobile. The key features of Web UI Framework Library were coding simplification and application creation speed. The purpose of TAU is to be the "framework advanced to the next level".

          - - -

          With TAU you can take advantage of the following benefits in your code:

          -
            -
          • TAU is a standalone library, so no additional libraries are needed.
          • -
          • TAU can be used with jQuery, as it exposes a special API to the jQuery object identical to jQuery Mobile. Migration is painless.
          • -
          • TAU has been written with speed in mind, and all the code is tweaked for maximum performance.
          • -
          • Applications can be built to dramatically improve startup performance.
          • -
          • TAU is ECMAScript5- and HTML5-compliant.
          • -
          • TAU has a large and open API, TAU methods and core functions (event utility functions) are available and not hidden.
          • -
          • TAU is customizable and easy to extend (to create new UI components).
          • -
          • TAU is optimized for wearable, mobile, and TV devices.
          • -
          • TAU supports various profiles (mobile, wearable, and TV).
          • -
          - - - - - - - - - - - - - -
          Note
          TAU (Tizen Advanced UI) is the new name of the tizen-web-ui-fw. -
          Since 2.3, tizen-web-ui-fw has been deprecated (including tizen-web-ui-fw.js, tizen-web-ui-fw-libs.js, and tizen-web-ui-fw.css). -

          In all documents and source code, TAU is used instead of tizen-web-ui-fw.

          -

          Since 2.4, tizen-web-ui-fw is fully deleted and not supported anymore.

          -
          - -

          To learn to use the TAU features in your application UI, see the following topics:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/header_ww.htm b/org.tizen.ui.guides/html/web/tau/header_ww.htm deleted file mode 100755 index 83fea43..0000000 --- a/org.tizen.ui.guides/html/web/tau/header_ww.htm +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - Creating Expandable Headers - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Creating Expandable Headers

          - -

          You can create an expandable header component for your application. The expandable header offers events to support interactivity with other components.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the layout of the header component in a rectangular and circular UI.

          - -

          Figure: Header component in rectangular and circular devices

          -

          Header component in a rectangular device Header component in a circular device

          - -

          To implement the header component, edit the HTML code to add the header component to your application screen:

          -
          -<div class="ui-page ui-page-active" id="headerPage" >
          -   <header class="ui-header" id="myHeader">
          -      <h2 class="ui-title">Long title with ExpandableHeader</h2>
          -   </header>
          -   <div class="ui-content content-padding">
          -      Header is expandable in Circular UI.
          -   </div>
          -</div>
          -
          - - -

          The header component supports the following events.

          - - - - - - - - - - - - - - - - - - - - -
          Event nameDescription
          headerexpandTriggered when the header starts to expand.
          headerexpandcompleteTriggered after the header has fully expanded.
          headercollapseTriggered when the header returns to the state before expanding.
          - -

          You can use events headerexpand and headercollapse if you need to do something when the header expands and collapses.

          -

          The following examples show header events with Marquee.

          - -
          -var page = document.querySelector("#myPage");
          -
          -page.addEventListener("pagebeforeshow", function() 
          -{
          -   var textElement = page.querySelector(".ui-title"),
          -       marquee = new tau.widget.Marquee(textElement);
          -}, false);
          -
          -page.addEventListener("headercollapse", function() 
          -{
          -   if (marquee) 
          -   {
          -      marquee.reset();
          -   }
          -}, false);
          -
          -page.addEventListener("headerexpandcomplete", function() 
          -{
          -   if (marquee) 
          -   {
          -      marquee.start();
          -   }
          -}, false);
          -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/helloworld_w.htm b/org.tizen.ui.guides/html/web/tau/helloworld_w.htm deleted file mode 100755 index ad9d9af..0000000 --- a/org.tizen.ui.guides/html/web/tau/helloworld_w.htm +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - Hello World: Creating a Basic Hello World Page - - - - - -
          -

          Hello World: Creating a Basic Hello World Page

          - -

          You can import TAU into your application and create a basic Hello World page with TAU.

          - -

          The following example shows a basic TAU template:

          -
          -<!DOCTYPE html>
          -<html>
          -   <head>
          -      <meta name="viewport" content="width=device-width, user-scalable=no"/>
          -      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
          -      <link rel="stylesheet" href="myapp.css" />
          -      <title>Hello TAU</title>
          -   </head>
          -   <body>
          -      <!-- HTML BODY CONTENT -->
          -      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
          -      <script src="myapp.js"></script>
          -   </body>
          -</html>
          -
          - - -

          Scaling the UI

          -

          The Tizen Advanced UI (TAU) based template provides 2 scaling methods: device-width and fixed-width.

          -
            -
          • Device-width scaling -

            This scaling mode is suited for most mobile devices, such as Tizen, iPhone® and Android®. In this mode, the viewport width is set to device-width, enabling rem scaling using the Rem and Em units. These units calculate the size of a source element automatically based on the container font size (Em) or the base font size (Rem). In Tizen Web applications, a 320 px screen width is assumed.

            -
            <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
            -
          • -
          • Fixed-width scaling -

            This scaling mode is best suited for Tizen devices, since the entire screen can be scaled on the viewport level. In the viewport scaling mode, set the size of all resources to fit the 360 px screen width.

            -

            You can also use fixed-width scaling if you do not want to scale your application or if you want to set your own scale. In this case, declare a viewport but note that the default viewport scaling is overridden by the declared viewport. In the Tizen Web UI components, viewport scaling is set automatically to device-width as follows:

            -
            <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
            -

            To enable fixed-width scaling, the header must contain the <meta name="viewport"> element:

            -
            <meta name="viewport" content="width=360, initial-scale=1, user-scalable=no">
            -
          • -
          - -

          Importing TAU

          -

          You can import TAU with HTML. For better performance, all CSS files must be included in header and all scripts tags must be put before the body element's close tag:

          -
          -<!DOCTYPE html>
          -<html>
          -   <head>
          -      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
          -   </head>
          -   <body>
          -      <!-- HTML BODY CONTENT -->
          -      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
          -   </body>
          -</html>
          -
          -

          In HTML, use the <script> and <link> elements. These default elements are used to load the basic Tizen Advanced UI (TAU) libraries that must be included in Tizen Web applications. The loaded libraries are:

          -
            -
          • TAU library: tau(.min).js

            This element is mandatory, as it imports the TAU library, which you need to use the TAU JavaScript Interface.

          • -
          • TAU theme: tau(.min).css

            This element is also mandatory, as it imports the TAU theme.

          • -
          - -

          Running Custom JavaScript and CSS

          -

          You can add an additional <script src="<CUSTOM_LIBRARY>"> or <link rel="stylesheet" src="<CUSTOM_CSS>"> element to include your own scripts and style sheets. However, place them after the default <script> elements, as you can use any TAU APIs provided by the default libraries.

          -

          To load your JavaScript file, include the file in the <script> element in the HTML header. Since the TAU files are already loaded, you can use any APIs from these libraries as well.

          -
          <script src="{YOUR_SCRIPT_PATH}"></script>
          - -

          Creating a Page in the Body

          - -

          The body section of the HTML file contains 1 or more pages.

          -

          To create a page in <body>, you can use the "ui-page" class with the <div> element:

          -
          -<body>
          -   <div class="ui-page" id="main">
          -   </div>
          -</body>
          -
          - -

          Each pages has a header, mandatory content, and a footer:

          -
          -<body>
          -   <div class="ui-page" id="main">
          -      <div class="ui-header">
          -         <h1>Hello World</h1>
          -      </div>
          -      <div class="ui-content">
          -         <p>Hello TAU!</p>  
          -      </div>
          -      <div class="ui-footer">
          -         <button>OK</button>  
          -      </div>
          -   </div>
          -</body>
          -
          - -

          The following example shows a basic sample code for Hello World :

          -
          -<!DOCTYPE html>
          -<html>
          -   <head>
          -      <meta name="viewport" content="width=device-width, user-scalable=no"/>
          -      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
          -      <link rel="stylesheet" href="myapp.css" />
          -      <title>Hello TAU</title>
          -   </head>
          -   <body>
          -      <div class="ui-page" id="main">
          -         <div class="ui-header">
          -            <h1>Hello World</h1>
          -         </div>
          -         <div class="ui-content">
          -            <p>Hello TAU!</p>  
          -         </div>
          -         <div class="ui-footer">
          -            <button>OK</button>  
          -         </div>
          -      </div>
          -      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
          -      <script src="myapp.js"></script>
          -   </body>
          -</html>
          -
          - - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/helper_ww.htm b/org.tizen.ui.guides/html/web/tau/helper_ww.htm deleted file mode 100755 index f856ea7..0000000 --- a/org.tizen.ui.guides/html/web/tau/helper_ww.htm +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - Using Helper Script - - - - -
          -

          Using Helper Script

          - -

          You can use the TAU helper script to support some components for the Web applications. SnapListMarqueeStyle provides creating marquee-able and expandable list style with SnapListview.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          You can use the helper script as follows:

          - -
          -<script>
          -   var helperInstance = tau.helper.NameSpace
          -</script>
          -
          - -

          The SnapListMarqueeStyle helper provides a helper script to support some creating usable components for list style. It supports making the list view more effective using the SnapListview and Marquee components.

          - - - - - - - - - - -
          Note
          This helper script is supported since Tizen 2.3.
          - -

          The following example shows how to create your own style listview with SnapListMarqueeStyle. In the example, text of list item scrolls horizontally and the sub text appears if the list item is placed in the middle of the screen.

          - -

          To create a SnapListMarqueeStyle:

          - -
            -
          1. Edit the HTML code to add the SnapListMarqueeStyle component to your application screen. -

            You can add a multiline style listview as follows.

            - -
            -<div class="ui-page ui-page-active" id="snaplistTest">
            -   <header class="ui-header">
            -      <h2 class="ui-title">Bottom Button</h2>
            -   </header>
            -   <div class="ui-content">
            -      <ul class="ui-listview ui-snap-listview expand-list" id="snapList">
            -         <li class="li-has-2line">
            -            <div class="ui-marquee ui-marquee-gradient">1.SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-2line">
            -            <div class="ui-marquee ui-marquee-gradient">2.SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-2line">
            -            <div class="ui-marquee ui-marquee-gradient">3.SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-2line">
            -            <div class="ui-marquee ui-marquee-gradient">4.SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -      </ul>
            -   </div>
            -</div>
            -
            -
          2. - -
          3. Edit the CSS code to set your list animation style: -
            .ui-listview.expand-list li.li-has-2line .ui-marquee
            -{
            -   -webkit-transform: translate3d(0, 16px, 0);
            -   -webkit-transition: all ease .5s;
            -}
            -.ui-listview.expand-list li.li-has-2line.ui-snap-listview-selected .ui-marquee
            -{
            -   -webkit-transform: translate3d(0, 0, 0);
            -   -webkit-transition: all ease 1s;
            -}
            -
            -.ui-listview.expand-list li.li-has-2line .ui-li-sub-text
            -{
            -   -webkit-transform: translate3d(0, -20px, 0);
            -   opacity: 0;
            -   -webkit-transition: all ease .5s;
            -}
            -.ui-listview.expand-list li.li-has-2line.ui-snap-listview-selected .ui-li-sub-text
            -{
            -   -webkit-transform: translate3d(0, 0, 0);
            -   opacity: 1;
            -   -webkit-transition: all ease 1s;
            -}
            -
            -
          4. - -
          5. Edit the JavaScript code to make your list into a SnapListMarqueeStyle component and manage the list events: -
            -<script>
            -var page = document.getElementById("snaplistTest"),
            -    list = document.getElementById("snapList"),
            -    listHelper;
            -
            -page.addEventListener("pageshow", function() 
            -{
            -   listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
            -});
            -
            -page.addEventListener("pagehide", function() 
            -{
            -   listHelper.destroy();
            -});
            -</script>
            -
            -
          6. -
          - -

          The following table shows the options you have in creating your SnapListMarqueeStyle component.

          - - - - - - - - - - - - - - - - - - -
          OptionInput typeDefault valueDescription
          marqueeDelaynumber0Sets the delay time for marquee component. The unit of time is millisecond.
          - -

          You can use the following methods with the SnapListMarqueeStyle:

          - -
            -
          • create -

            Creates the related components for SnapListMarqueeStyle.

            -

            This method is supported since Tizen 2.3.

            -

            The following code example shows the use of the method:

            -
            -<ul class="ui-listview ui-snap-listview" id="snapList">
            -   <li>some element or text</li>
            -</ul>
            -
            -<script>
            -   var list = document.getElementById("snapList"),
            -       listHelper;
            -
            -   /* Create the helper */
            -   listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
            -</script>
            -
            -
          • -
          • destroy -

            Destroys the related components for SnapListMarqueeStyle.

            -

            This method is supported since Tizen 2.3. It has no return value.

            -

            The following code example shows the use of the method:

            -
            -<ul class="ui-listview ui-snap-listview" id="snapList">
            -   <li>some element or text</li>
            -</ul>
            -
            -<script>
            -   var list = document.getElementById("snapList"),
            -       listHelper;
            -
            -   /* Create the helper */
            -   listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
            -
            -   /* Destroy the helper */
            -   listHelper.destroy();
            -</script>
            -
            -
          • -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/indexscrollbar_ww.htm b/org.tizen.ui.guides/html/web/tau/indexscrollbar_ww.htm deleted file mode 100755 index 604c0ab..0000000 --- a/org.tizen.ui.guides/html/web/tau/indexscrollbar_ww.htm +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - Creating Index Scroll Bars - - - - - -
          -

          Creating Index Scroll Bars

          - -

          You can create a circle or rectangle shaped index scroll bar component with the CircularIndexScrollBar and IndexScrollBar API.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the layout of the index scroll bar in a rectangular and circular UI.

          - -

          Figure: The circle-shaped progress bar in rectangular and circular devices

          -

          index scroll bar in a rectangular device Circle-shaped index scroll bar in a circular device

          - - - -

          Implementation

          -

          To implement the index scroll bar:

          - -
            -
          1. Edit the HTML code to add the component to your application screen: -
            <div class="ui-page ui-page-active" id="pageIndexScrollbar" >
            -   <header class="ui-header ui-header-small">
            -      <h2 class="ui-title ui-title-text-fadeout">Index Scroll Bar</h2>
            -   </header>
            -   <div id="indexscrollbar"></div>
            -   <section class="ui-content">
            -      <ul class="ui-listview ui-snap-listview" id="list1">
            -         <li class="ui-listview-divider">A</li>
            -    <li>Anton</li>
            -    <li class="ui-listview-divider">B</li>
            -    <li>Barry</li>
            -    <li>Bob</li>
            -    <li class="ui-listview-divider">C</li>
            -    <li>Carry</li>
            -    <li class="ui-listview-divider">D</li>
            -    <li>Daisy</li>
            -    <li class="ui-listview-divider">E</li>
            -    <li>Eric</li>
            -    <li class="ui-listview-divider">F</li>
            -    <li>Fay</li>
            -    <li class="ui-listview-divider">G</li>
            -    <li>Garry</li>
            -     </ul>
            -   </section>
            -</div>
            -
            -
          2. - -
          3. Edit the JavaScript code to manage the progress bar events and other functionality: -

            How to create a component selectively

            -
            -var indexScrollbarElement = document.getElementById("indexscrollbar");
            -
            -if (!tau.support.shape.circle) 
            -{
            -   // Create IndexScrollbar
            -   indexScrollbar = new tau.widget.IndexScrollbar(indexScrollbarElement);
            -} 
            -else 
            -{
            -   // Create CircularIndexScrollbar
            -   indexScrollbar = new tau.widget.CircularIndexScrollbar(indexScrollbarElement);
            -}
            -
            - -

            To use the callback:

            -
            -indexScrollbarElement.addEventListener("select", function( event ) 
            -{
            -   var index = event.detail.index;
            -   // Do something using the index
            -   console.log(index);
            -});
            -
            - -

            In the following example, the list scrolls to the position of the list item defined using the ui-listview-divider class, selected by the index scroll bar.

            -

            Note that in a rectangular UI, touching the index generates the selection, but in a round UI, the selection occurs when using the rotary.

            - -
            -(function() 
            -{
            -   var page = document.getElementById("pageIndexScrollbar"),
            -       listviewElement = document.getElementById("list1"),
            -       isCircle = tau.support.shape.circle,
            -       scroller,
            -       indexScrollbar;
            -
            -   page.addEventListener("pageshow", function(ev) 
            -   {
            -      var indexScrollbarElement = document.getElementById("indexscrollbar"),
            -          listDividers = listviewElement.getElementsByClassName("ui-listview-divider"), // List dividers
            -          dividers = {}, // Collection of list dividers
            -          indices = [],	// Index list
            -          divider,
            -          i, idx;
            -
            -      // For all list dividers,
            -      for(i = 0; i < listDividers.length; i++) 
            -      {
            -         // Add the list divider elements to the collection
            -         divider = listDividers[i];
            -         idx = divider.innerText;
            -         dividers[idx] = divider;
            -
            -         // Add the index to the index list
            -         indices.push(idx);
            -      }
            -
            -      scroller = tau.util.selectors.getScrollableParent(listviewElement);
            -
            -      if (!isCircle) 
            -      {
            -         indexScrollbar = new tau.widget.IndexScrollbar(indexScrollbarElement, {index: indices, container: scroller});
            -      }
            -      else 
            -      {
            -         // Create IndexScrollbar
            -         indexScrollbar = new tau.widget.CircularIndexScrollbar(indexScrollbarElement, {index: indices});
            -
            -         // Add SnapListview item "selected" event handler.
            -         listviewElement.addEventListener("selected", function (ev) 
            -         {
            -            var indexValue = ev.target.textContent[0];
            -            indexScrollbar.value(indexValue);
            -         });
            -      }
            -
            -      // Add IndexScrollbar index "select" event handler.
            -      indexScrollbarElement.addEventListener("select", function (ev) 
            -      {
            -         var divider,
            -             idx = ev.detail.index;
            -
            -         divider = dividers[idx];
            -         if (divider && scroller) 
            -         {
            -            // Scroll to the ui-listview-divider element
            -            scroller.scrollTop = divider.offsetTop - scroller.offsetTop;
            -         }
            -      });
            -   });
            -
            -   page.addEventListener("pagehide", function(ev) 
            -   {
            -      indexScrollbar.destroy();
            -   });
            -} ());
            -
            -
          4. -
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/list_ww.htm b/org.tizen.ui.guides/html/web/tau/list_ww.htm deleted file mode 100755 index c29d705..0000000 --- a/org.tizen.ui.guides/html/web/tau/list_ww.htm +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - Creating Snap Lists - - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Creating Snap Lists

          - -

          You can create a snap list component with the marquee component using the SnapListview API and the helper script.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the layout of the list component in a rectangular and circular UI.

          -

          Figure: List component in rectangular and circular devices

          -

          List component in a rectangular device List component in a circular device

          - -

          To implement the list component:

          - -
            -
          1. Edit the HTML code to add the list component to your application screen: -
            -<div class="ui-page ui-page-active" id="snapListPage" >
            -   <header class="ui-header">
            -      <h2 class="ui-title">Snap List</h2>
            -   </header>
            -   <div class="ui-content">
            -      <ul class="ui-listview ui-snap-listview expand-list" id="snapList">
            -         <li class="li-has-3line">
            -         <div class="ui-marquee ui-marquee-gradient">1.3line SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-3line">
            -            <div class="ui-marquee ui-marquee-gradient">2.3line SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-3line">
            -            <div class="ui-marquee ui-marquee-gradient">3.3line SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-3line">
            -            <div class="ui-marquee ui-marquee-gradient">4.3line SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -         <li class="li-has-3line">
            -            <div class="ui-marquee ui-marquee-gradient">5.3line SnapListview with Marquee SnapListview with Marquee</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -            <div class="li-text-sub ui-li-sub-text">sub-text</div>
            -         </li>
            -      </ul>
            -   </div>
            -</div>
            -
            -
          2. - -
          3. Edit the CSS code to set the visual style of the list: -
            -.ui-listview li .li-text-sub 
            -{
            -   display: block;
            -   text-overflow: ellipsis;
            -   overflow: hidden;
            -   line-height: 32px;
            -   color: rgb(51, 51, 51);
            -}
            -
            -.ui-listview li.li-has-3line 
            -{
            -   padding-top: 0;
            -   padding-bottom: 0;
            -   height: 115px;
            -}
            -
            -.ui-listview.expand-list li.li-has-3line .ui-marquee
            -{
            -   -webkit-transform: translate3d(0, 30px, 0);
            -}
            -
            -.ui-listview.expand-list li.li-has-3line.ui-snap-listview-selected .ui-marquee
            -{
            -   -webkit-transform: translate3d(0, 0, 0);
            -   -webkit-transition: all ease 1s;
            -}
            -
            -.ui-listview.expand-list li.li-has-3line .ui-li-sub-text:nth-child(2)
            -{
            -   -webkit-transform: translate3d(0, -10px, 0);
            -   opacity: 0;
            -}
            -
            -.ui-listview.expand-list li.li-has-3line.ui-snap-listview-selected .ui-li-sub-text:nth-child(2)
            -{
            -   -webkit-transform: translate3d(0, 0, 0);
            -   opacity: 1;
            -   -webkit-transition: all ease 1s;
            -}
            -
            -.ui-listview.expand-list li.li-has-3line .ui-li-sub-text:last-child
            -{
            -   -webkit-transform: translate3d(0, -42px, 0);
            -   opacity: 0;
            -}
            -
            -.ui-listview.expand-list li.li-has-3line.ui-snap-listview-selected .ui-li-sub-text:last-child
            -{
            -   -webkit-transform: translate3d(0, 0, 0);
            -   opacity: 1;
            -   -webkit-transition: all ease 1s;
            -}
            -
            -
          4. - -
          5. Edit the JavaScript code to manage the list events and other functionality: -
            -var page = document.querySelector("#snapListPage"),
            -    listHelper;
            -
            -page.addEventListener( "pagebeforeshow", function() 
            -{
            -   var list = document.getElementById("snapList");
            -
            -   if (tau.support.shape.circle) 
            -   {
            -      listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
            -   }
            -});
            -
            -page.addEventListener( "pagehide", function() 
            -{
            -   if (tau.support.shape.circle) 
            -   {
            -      if (listHelper) 
            -      {
            -         listHelper.destroy();
            -      }
            -   }
            -});
            -
            -
          6. -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/managing_page_w.htm b/org.tizen.ui.guides/html/web/tau/managing_page_w.htm deleted file mode 100755 index 44dde0a..0000000 --- a/org.tizen.ui.guides/html/web/tau/managing_page_w.htm +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - Managing Page: Creating and Routing a Page - - - - - -
          -

          Managing Page: Creating and Routing a Page

          - -

          The basic building block of an application UI in the TAU library is the Page element, which includes all other elements. The element is optional and extendable, so you can have any element for grouping controls you want.

          - -

          Page Structure

          -

          The page consist of:

          -
            -
          • Header area -

            Shows the user which page is currently open. The header can contain buttons, menus, and toolbars. The header is optional.

          • -
          • Content area -

            Contains the main application content. The content area has an optional scroll bar.

          • -
          • Footer area -

            Contains a status line or buttons. The footer is optional.

          • -
          -

          All the page areas are specified by a corresponding class attribute.

          - -

          Figure: Page content

          -

          Application UI Schema

          - -

          If there is no Page element in the markup, TAU creates one. For example, if no Page element exists:

          -
          <span>I have no page</span>
          -

          TAU creates a page:

          -
          <div class="ui-page"><span>I have no page</span></div>
          -
          - - -

          Creating a Single Page

          - - -

          To create a page:

          -
            -
          1. Create a single page with the following code:

            -
            <div class="ui-page">
            -   Simple page
            -</div>
            -
            - -

            To create a page for your application, use the class attribute with the ui-page value. TAU uses that information to properly acquire the div element and bind the DOM element to its JavaScript component implementation.

            -
          2. -
          3. Create a header area by using the class="ui-header" attribute:

            -
            <div class="ui-page">
            -   <div class="ui-header">This is a header</div>
            -</div>
            -
          4. -
          5. Create a footer area by using the class="ui-footer" attribute:

            -
            <div class="ui-page">
            -   <div class="ui-footer">This is a footer</div>
            -</div>
            -
          6. - -
          7. Create the main content area by using the class="ui-content" attribute:

            -
            <div class="ui-page">
            -   <div class="ui-header">MyApplication header</div>
            -   <div class="ui-content">
            -      Hello world!
            -   </div>
            -   <div class="ui-footer">Application status line</div>
            -</div>
            -
          8. -
          9. The previous example shows a full page structure. The header and footer areas can contain multiple UI components, such as buttons or images.

            -

            The following example shows a title bar with a More Options button and an icon:

            -
            <div class="ui-page">
            -   <div class="ui-header">
            -      <h2 class="ui-title ui-icon" style="background-image: url(image.png);">Title</h2>
            -      <button type="button" class="ui-more ui-icon-overflow">More Options</button>
            -   </div>
            -   <div class="ui-content">MyApplication content</div>
            -</div>
            -
            -
          10. -
          11. -

            You can also create a popup for your page:

            -
            <div class="ui-page">
            -   <div class="ui-header">Popup Open Page</div>
            -   <div class="ui-content">
            -      <a href="#popup" class="ui-btn" data-rel="popup">Popup Open</a>
            -   </div>
            -
            -   <div id="popup" class="ui-popup">
            -      <div class="ui-popup-header">Popup Page</div>
            -      <div class="ui-popup-content">Popup Content</div>
            -   </div>
            -</div>
            -
            -

            The popup works because TAU opens (makes visible) the page whose id attribute corresponds to the #hashtag page. This is basic page routing; for more information see Page Routing.

            -
          12. -
          - -

          Creating Multiple Pages in One HTML Code

          - - -

          You can implement a template containing multiple page containers in the application's index.html file.

          -

          In a multi-page layout, the main page is defined with the ui-page-active class. If no page has the ui-page-active class, the framework automatically sets up the first page in the source order as the main page. You can improve the launch performance by explicitly defining the main page to be displayed first. If the application has to wait for the framework to set up the main page, the page is displayed with some delay only after the framework is fully loaded.

          -
          -<body>
          -   <div class="ui-page ui-page-active" id="first">
          -      <div class="ui-content">
          -         <!--CONTENT-->
          -      </div>
          -   </div>
          -
          -   <div class="ui-page" id="two">
          -      <div class="ui-content">
          -         <!--CONTENT-->
          -      </div>
          -   </div>
          -</body>
          -
          - -

          Page Routing

          - -

          TAU is basically a UI framework, but since its purpose is to ease application building, it also provides basic functionality for changing pages in multi-page applications. The mechanics behind page routing are simple, and works without any additional JavaScript code. You can use the JavaScript API to get more powerful page routing functionalities.

          - -

          To manage page routing:

          - -
            -
          • To route without JavaScript: -

            TAU routing is based on URL hash changes, and it has a built-in mechanism for history tracking. The framework responds to #hashtag changes and tries to display the page that has the id attribute equal to the hashtag value. This approach works for pages defined inside the same HTML document.

            -

            TAU uses every <a> element in the page and binds routing methods for them. In addition, all button instances that are based on that tag and have a proper href attribute work with the framework router. The active page has a ui-page-active class assigned. Set that class yourself to be sure the correct page is displayed.

            -
            <!--pageOne.html-->
            -<div class="ui-page ui-page-active" id="first">
            -   <div class="ui-content">
            -      <a href="pageTwo.html">Go to page two</a>
            -   </div>
            -</div>
            -
            -<!--pageTwo.html-->
            -<div class="ui-page" id="two">
            -   <div class="ui-content">
            -      <a href="pageOne.html">Go to page one</a>
            -   </div>
            -</div>
            -
            -

            With multiple pages in one HTML code, you can use only the ID of the page in the href attribute:

            -
            -<div class="ui-page ui-page-active" id="first">
            -   <div class="ui-content">
            -      <a href="#two">Go to page two</a>
            -   </div>
            -</div>
            -
            -<div class="ui-page" id="two">
            -   <div class="ui-content">
            -      <a href="#first">Go to page one</a>
            -   </div>
            -</div>
            -
            -
          • -
          • To route using the API: -

            You can change pages through the TAU API by using the tau.changePage() method:

            -
            <!--pageTwo.html-->
            -<div class="ui-page ui-page-active" id="first">
            -   <div class="ui-content">
            -      You are viewing the first page of the example.
            -      <button id="first-button">Click here to change to page two</button>
            -   </div>
            -   <script>
            -      var el1 = document.getElementById("first-button");
            -      el1.addEventListener("click", function ()
            -      {
            -         tau.changePage("pageTwo.html");
            -      });
            -   </script>
            -</div>
            -
            -<!--pageTwo.html-->
            -<div class="ui-page" id="second">
            -   <div class="ui-content">
            -      This is the second page of the example.
            -      <button id="second-button">Click here to change to page one</button>
            -   </div>
            -   <script>
            -      var el2 = document.getElementById("second-button");
            -      el2.addEventListener("click", function ()
            -      {
            -         tau.changePage("pageOne.html");
            -      });
            -   </script>
            -</div>
            -
            -
          • - -
          • To load pages from external resources: -

            When an external page is supplied to the routing engine, TAU fetches that page and appends it to the current document, while changing the base element's href attribute to that page path. This ensures that all other resources, such as CSS, JS, or images, are loaded from the correct path without no real page reloads. Instead, TAU simply switches the current page to the new page.

            -

            To load pages from external resources, define the proper local address in the href attribute of the link:

            -
            <div class="ui-page">
            -   <div class="ui-content">
            -      <a href="external_text.html">Change to external</a>
            -   </div>
            -</div>
            -
            -

            To create an external link that is not supposed to be handled by the TAU router, use the rel="external", data-ajax="false", or target="_self" attribute:

            -
            <div class="ui-page">
            -   <div class="ui-content">
            -      <a href="external_text.html" target="_self">Change to external</a>
            -   </div>
            -</div>
            -
            -
          • -
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/moreoptions_ww.htm b/org.tizen.ui.guides/html/web/tau/moreoptions_ww.htm deleted file mode 100755 index 34aa90b..0000000 --- a/org.tizen.ui.guides/html/web/tau/moreoptions_ww.htm +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - Implementing More Options - - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Implementing More Options

          - - -

          In rectangular UI, you can implement more options using button and popup components. In the circular UI, the Selector component provides the more options button. This sample shows how to create a more options button for the circular UI.

          - - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the more options components in a rectangular and circular UI.

          -

          Figure: More options component in rectangular and circular devices

          -

          More options component in a rectangular device More options component in a circular device

          - -

          To implement the more options components:

          -
            - -
          1. Edit the HTML code to add the more options component to your application screen: -
            <div id="moreoptionsPage" class="ui-page">
            -   <link rel="stylesheet"  href="./moreoptions.css">
            -   <header class="ui-header ui-has-more">
            -        <h2 class="ui-title">More Options</h2>
            -        <button type="button" class="ui-more ui-icon-overflow">More Options</button>
            -   </header>
            -   <div class="ui-content content-padding">
            -        It was a real pleasure for me to finally get to meet you. My colleagues join me in sending you our holiday greetings.
            -
            -   </div>
            -
            -   <!-- Rectangular Profile -->
            -   <div id="moreoptionsPopup" class="ui-popup" data-transition="slideup">
            -        <div class="ui-popup-header">Options</div>
            -        <div class="ui-popup-content">
            -            <ul class="ui-listview">
            -               <li><a href="#">1</a></li>
            -               <li><a href="#">2</a></li>
            -               <li><a href="#">3</a></li>
            -            </ul>
            -        </div>
            -   </div>
            -
            -   <!-- Circular Profile -->
            -   <div id="moreoptionsDrawer" class="ui-drawer" data-drawer-target="#moreoptionsPage" data-position="right" data-enable="true" data-drag-edge="1">
            -      <div id="selector" class="ui-selector">
            -         <div class="ui-item show-icon" data-title="Show"></div>
            -         <div class="ui-item human-icon" data-title="Human"></div>
            -         <div class="ui-item delete-icon" data-title="Delete"></div>
            -         <div class="ui-item show-icon" data-title="Show"></div>
            -         <div class="ui-item human-icon" data-title="Human"></div>
            -         <div class="ui-item delete-icon" data-title="Delete"></div>
            -         <div class="ui-item x-icon" data-title="X Icon"></div>
            -         <div class="ui-item fail-icon" data-title="Fail"></div>
            -         <div class="ui-item show-icon" data-title="Show"></div>
            -         <div class="ui-item human-icon" data-title="Human"></div>
            -         <div class="ui-item delete-icon" data-title="Delete"></div>
            -         <div class="ui-item show-icon" data-title="Show"></div>
            -         <div class="ui-item human-icon" data-title="Human"></div>
            -      </div>
            -   </div>
            -</div>
            -
            -
          2. - -
          3. Edit the CSS code to set the visual style of the buttons: - -
            -#moreoptionsDrawer
            -{
            -   display: none;
            -}
            -
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   #moreoptionsDrawer
            -   {
            -      display: block;
            -      background-color: rgba(255, 255, 255, 0.1);
            -      border-radius: 100%;
            -   }
            -   #moreoptionsPopup
            -   {
            -      display: none;
            -   }
            -}
            -
            - -
          4. -
          5. Edit the JavaScript code to manage the option button events and other functionality: - -
            -(function()
            -{
            -   var page = document.querySelector("#moreoptionsPage"),
            -      popup = page.querySelector("#moreoptionsPopup"),
            -      handler = page.querySelector(".ui-more"),
            -      drawer = page.querySelector("#moreoptionsDrawer"),
            -      selector = page.querySelector("#selector"),
            -      helper,
            -      clickHandlerBound;
            -
            -   function clickHandler(event)
            -   {
            -      tau.openPopup(popup);
            -   }
            -   page.addEventListener( "pagebeforeshow", function()
            -   {
            -      if (tau.support.shape.circle)
            -      {
            -         helper = tau.helper.DrawerMoreStyle.create(drawer,
            -         {
            -            handler: ".drawer-handler"
            -         });
            -      }
            -      else
            -      {
            -         // Shape is square
            -         clickHandlerBound = clickHandler.bind(null);
            -         handler.addEventListener("click", clickHandlerBound);
            -
            -      }
            -
            -   });
            -
            -   page.addEventListener( "pagebeforehide", function() 
            -   {
            -      if (tau.support.shape.circle)
            -      {
            -         handler.removeEventListener("click", clickHandlerBound);
            -         helper.destroy();
            -      }
            -   });
            -})();
            -
            -
          6. -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/notepad_w.htm b/org.tizen.ui.guides/html/web/tau/notepad_w.htm deleted file mode 100755 index 9719b18..0000000 --- a/org.tizen.ui.guides/html/web/tau/notepad_w.htm +++ /dev/null @@ -1,448 +0,0 @@ - - - - - - - - - - - - - Creating a Notepad UI Application - - - -
          -
          -

          Mobile Web Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Creating a Notepad UI Application

          - -

          The notepad application shows all the notes in the main page, and allows the user to add new notes, edit existing notes, and delete notes by swiping them. The notes on the main page can be scrolled and edited, and a button is provided for adding a new note. After you click a note, it is displayed in the edit page for editing.

          - -

          To create a simple notepad application using the TAU library:

          - -
            -
          1. Generate an application from the Tizen SDK. -

            Create a simple basic application that can be used for further development:

            -
            1. In the IDE menu, go to - File > New > Tizen Web Project > WEARABLE-2.4 > Wearable UI > Basic Application.
            2. -
            3. Enter the application name as Notes and click Finish.
            -

            The IDE creates the application with a default file structure.

            -
          2. -
          3. Edit the section header for the index.html file. -

            Because the application runs on mobile or wearable devices, make sure that you have the correct tau.css styles for the corresponding profile:

            -
            • Mobile: -
              <link rel="stylesheet" type="text/css" href="lib/tau/mobile/theme/default/tau.min.css"/>
            • -
            • Wearable: -
              <link rel="stylesheet" type="text/css" href="lib/tau/wearable/theme/default/tau.min.css"/>
              -
            -

            Add also your own styles for the application:

            -
            <link rel="stylesheet" type="text/css" href="css/style.css"/>
            -
            - -

            The following example shows how the section header looks after editing:

            -
            -<head>
            -   <meta charset="utf-8" />
            -   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
            -   <meta name="description" content="Tizen basic template generated by Tizen Web IDE"/>
            -
            -   <title>Notepad</title>
            -
            -   <!--Use 'mobile' or 'wearable' to choose the device TAU profile-->
            -   <link rel="stylesheet" type="text/css" href="lib/tau/mobile/theme/default/tau.css"/>
            -   <link rel="stylesheet" type="text/css" href="css/style.css"/>
            -</head>
            -
          4. -
          5. Create the pages: the main page for displaying the notes and the editing page for adding and editing notes. -
              -
            1. The main page is the first page, defined with the div block with the ui-page class and main id. -
              1. Add the title header (Notes) for the page: -
                -<div id="main" class="ui-page">
                -   <header class="ui-header">
                -      <h1>Notes</h1>
                -   </header>
                -</div>
                -
              2. -
              3. Add content for the main page by adding a div element with - the _ui-content class. Add to this a ul element, which creates the list of notes. -

                Set the data-scroll="y" and data-handler="true" attributes.

                -

                The item in the list is represented as a li element. When a note on the main page is clicked, the application triggers the changepage event to the editor page and shows the item.

                -
                -<div class="ui-content" data-scroll="y" data-handler="true">
                -   <ul class="ui-listview" id="notesList"></ul>
                -</div>
                -
              4. -
              5. Add a navigation button to the application to change to the editor page. The button is placed in the footer, and it is created from an a element, - which has the id="newBtn" attribute. -
                -<div class="ui-footer">
                -   <a class="ui-btn" href="javascript:void()" id="newBtn">New note</a>
                -</div>
                -
              -

              The above examples apply to a wearable application. The following example shows the full code for the main page in a mobile application:

              -
              -<div class="ui-page" id="main">
              -   <div class"ui-header" data-position="fixed">
              -      <h1>Notes</h1>
              -   </div>
              -   <div class="ui-content" data-scroll="y" data-handler="true">
              -      <ul class="ui-listview" id="notesList"></ul>
              -   </div>
              -   <div class="ui-footer">
              -      <a class="ui-btn" href="javascript:void()" id="newBtn">New note</a>
              -   </div>
              -</div>
              -
              - - - - - - - - - -
              Note
              In mobile applications, pages are constructed using the data-role attribute, while the wearable applications use the class attribute. In addition, the value of the data-role attribute in mobile applications differs from the class attribute value in the wearable applications.
              -
            2. - -
            3. On the editing page, the header and footer are similar to main page. -

              The only difference is that the action triggered after pressing the button adds an item to the items array and adds the item to the top of the visible list. The editing page is defined with a div block with the id="editor" and class="ui-page" attributes.

              -

              The editing page is needed for adding or editing a selected note. It has a textarea element to allow the user to edit the selected note.

              - -
              -<!--This code applies to wearable applications-->
              -<div class="ui-page" id="editor">
              -   <div class="ui-header">
              -      <h1>Editor</h1>
              -   </div>
              -   <div class="ui-content">
              -      <textarea id="editorField" placeholder="enter note"></textarea>
              -   </div>
              -   <div class="ui-footer">
              -      <a href="javascript:void()" id="saveBtn">Save</a>
              -   </div>
              -</div>
              -
          6. - -
          7. Link to the TAU library sources and add the script to the application: -
            -<script src="lib/jquery.js"></script>
            -<script type="text/javascript" src="lib/tau/mobile/js/tau.js" data-build-remove="false"></script>
            -<script src="js/main.js"></script>
            -
            - -

            The index.html file is now ready.

            -
          8. - -
          9. Add styles for the content: -
            -a
            -{
            -   color: #FFF;
            -}
            -
            -#notesList.ui-listview
            -{
            -   width: 100%;
            -}
            -
            -#notesList.ui-listview li
            -{
            -   margin: 0;
            -   white-space: nowrap;
            -}
            -
            -#notesList.ui-listview li .ui-inline
            -{
            -   position: absolute;
            -   right: 5px;
            -   top: 5px;
            -}
            -
            -#notesList.ui-listview li .ui-swipe-item-cover-inner
            -{
            -   text-overflow: ellipsis;
            -   overflow: hidden;
            -}
            -
            -#editor .ui-scrollview-view
            -{
            -   height: 100%;
            -}
            -
            -#editor textarea
            -{
            -   height: 95%;
            -   width: 100%;
            -}
            -
            -
          10. -
          11. Create the main.js file and create a function to close the application. -

            The application is started when the HTML content is ready.

            -
            -document.addEventListener("DOMContentLoaded", function ()
            -   {
            -      'use strict';
            -
            -      var newBtn = document.getElementById('newBtn'),
            -          saveBtn = document.getElementById('saveBtn'),
            -          editorField = document.getElementById('editorField'),
            -          notesList = document.getElementById('notesList'),
            -          editorPage = document.getElementById('editor'),
            -
            -          mainPageId = '#main',
            -          editorPageId = '#editor',
            -
            -          currentIndex = null,
            -
            -          EMPTY_CONTENT = '(empty)',
            -          STORAGE_KEY = 'notepad';
            -
            -      /**
            -      * Get data from local storage
            -      * @return {Array}
            -      */
            -      function getStorage(key)
            -      {
            -         return JSON.parse(window.localStorage.getItem(key)) || false;
            -      }
            -
            -      /**
            -      * Add data to local storage
            -      * @param {Array} data
            -      */
            -      function addStorage(data)
            -      {
            -         window.localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
            -      }
            -
            -      /**
            -      * Return current page ID
            -      * @returns
            -      */
            -      function getCurrentPageId()
            -      {
            -         return $('.ui-page:visible')[0].id;
            -      }
            -
            -      /* Refresh current page */
            -      function refreshCurrentPage()
            -      {
            -         $('#' + getCurrentPageId()).trigger('create');
            -      }
            -
            -      /**
            -      * Get notes from storage
            -      * @return {Array}
            -      */
            -      function getNotes()
            -      {
            -         return getStorage(STORAGE_KEY) || [];
            -      }
            -
            -      /* Clear list with notes */
            -      function clearNotesList()
            -      {
            -         notesList.innerHTML = '';
            -      }
            -
            -      /* Delete note from storage */
            -      function deleteNote(index)
            -      {
            -         var notes = getNotes();
            -
            -         if (notes[index] !== undefined)
            -         {
            -            notes.splice(index, 1);
            -            addStorage(notes);
            -         }
            -         else
            -         {
            -            console.error('deleteNote: note not found');
            -         }
            -
            -         showNotes();
            -         refreshCurrentPage();
            -         event.stopPropagation();
            -      }
            -
            -      /**
            -      * Edit note using array index
            -      * @param index
            -      */
            -      function editNote(index)
            -      {
            -         var notes = getNotes();
            -
            -         if (notes[index] !== undefined)
            -         {
            -            currentIndex = index;
            -            editorField.value = getNotes()[index];
            -            tau.changePage(editorPageId);
            -         }
            -         else
            -         {
            -            console.error('editNote: note not found');
            -            showNotes();
            -            refreshCurrentPage();
            -         }
            -      }
            -
            -      /* Show all notes extracted from local storage */
            -      function showNotes()
            -      {
            -         var notes = getNotes(),
            -             notesLen = notes.length,
            -             li = {},
            -             swipeCover = {},
            -             swipeItem = {},
            -             deleteBtn = {},
            -             i = 0,
            -             notesListInst;
            -
            -         clearNotesList();
            -
            -         for (i; i < notesLen; i += 1)
            -         {
            -            li = document.createElement('li');
            -            li.addEventListener('click', editNote.bind(this, i), false);
            -
            -            deleteBtn = document.createElement('button');
            -            deleteBtn.className('ui-btn');
            -            deleteBtn.setAttribute('data-inline', 'true');
            -            deleteBtn.innerText = 'Delete';
            -
            -            deleteBtn.addEventListener('click', deleteNote.bind(this, i), false);
            -
            -            li.innerText = notes[i].replace(/\n/g, ' ') || EMPTY_CONTENT;
            -            li.appendChild(deleteBtn);
            -            notesList.appendChild(li);
            -            notesListInst = tau.widget.getInstance(notesList);
            -            tau.widget.Button(deleteBtn);
            -            notesListInst.refresh();
            -         }
            -      }
            -
            -      /* Clear editor textarea */
            -      function clearEditor()
            -      {
            -         editorField.value = '';
            -      }
            -
            -      /* Save note to storage */
            -      function saveNote()
            -      {
            -         var notes = getNotes();
            -
            -         if (currentIndex !== null)
            -         {
            -            notes[currentIndex] = editorField.value;
            -         }
            -         else
            -         {
            -            notes.push(editorField.value);
            -         }
            -
            -         addStorage(notes);
            -
            -         clearEditor();
            -         showNotes();
            -         tau.changePage(mainPageId);
            -      }
            -
            -      /* New note button handler */
            -      function newNote()
            -      {
            -         currentIndex = null;
            -         clearEditor();
            -
            -         tau.changePage(editorPageId);
            -      }
            -
            -      /* On editor page show handler */
            -      function onEditorPageShow()
            -      {
            -         editorField.focus();
            -      }
            -
            -      /* Attach events */
            -      function events()
            -      {
            -         newBtn.addEventListener('click', newNote);
            -         saveBtn.addEventListener('click', saveNote);
            -
            -         editorPage.addEventListener('pageshow', onEditorPageShow);
            -
            -         window.addEventListener('tizenhwkey', function (e)
            -         {
            -            if (e.keyName === "back"
            -               && window.tizen
            -               && window.tizen.application)
            -            {
            -               switch (getCurrentPageId())
            -               {
            -                  case 'main':
            -                     window.tizen.application.getCurrentApplication().exit();
            -                     break;
            -                  default:
            -                     window.history.back();
            -                     break;
            -               }
            -               return false;
            -            }
            -         }, false);
            -      }
            -
            -      /* Initialize */
            -      function init()
            -      {
            -         showNotes();
            -         events();
            -      }
            -
            -      init();
            -   }, false);
            -
            -

            Now the application is ready and you can deploy it to a device or Emulator.

            -
          12. -
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/popup_ww.htm b/org.tizen.ui.guides/html/web/tau/popup_ww.htm deleted file mode 100755 index 406406e..0000000 --- a/org.tizen.ui.guides/html/web/tau/popup_ww.htm +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - Creating Popup Buttons - - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Creating Popup Buttons

          - -

          You can create bottom and side popup button components with the Popup API.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figures show the layout of the popup component in a rectangular and circular UI.

          - -

          Figure: Bottom popup component in rectangular and circular devices

          - -

          Bottom popup in a rectangular device Bottom popup in a circular device

          - -

          Figure: Side popup component in rectangular and circular devices

          - -

          Side popup component in a rectangular device Side popup component in a circular device

          - -

          To implement the popup button component:

          - -
            -
          • To implement a bottom popup button component: - -

            Edit the HTML code to add the bottom popup button component to your application screen. To add the bottom button to the circular UI, you must add the ui-bottom-button class to the popup footer. The popup can have only 1 bottom button.

            -
            -<div id="bottomBtnPopup" class="ui-popup">
            -   <div class="ui-popup-content">
            -      Turning on Power
            -      saving mode will
            -      limit the maximum
            -      power
            -   </div>
            -   <div class="ui-popup-footer ui-bottom-button">
            -      <button id="bottomBtn" class="ui-btn">Check</button>
            -   </div>
            -</div>
            -
            -
          • - -
          • To implement a side popup button component: -

            Edit the HTML code to add the side popup button component to your application screen. To add side buttons for the circular UI, you must add the ui-side-button class to the popup footer. The popup can have only 2 side buttons.

            -
            -<style>
            -   .btn-icon-cancel::before {-webkit-mask-image: url(./cancel.png)}
            -   .btn-icon-ok::before {-webkit-mask-image: url(./ok.png)}
            -</style>
            -<div id="sideBtnPopup" class="ui-popup">
            -   <div class="ui-popup-content">
            -      Turning on Power
            -      saving mode will
            -      limit the maximum
            -      power
            -   </div>
            -   <div class="ui-popup-footer ui-grid-col-2 ui-side-button">
            -      <button id="sideBtn-1" class="ui-btn btn-icon-cancel">Cancel</button>
            -      <button id="sideBtn-2" class="ui-btn btn-icon-ok">OK</button>
            -   </div>
            -</div>
            -
            -
          • -
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/processing_ww.htm b/org.tizen.ui.guides/html/web/tau/processing_ww.htm deleted file mode 100755 index 51696b3..0000000 --- a/org.tizen.ui.guides/html/web/tau/processing_ww.htm +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - Creating Full Size Processing Components - - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Creating Full Size Processing Components

          - -

          You can create a full size processing component with the Processing API.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the layout of the processing component in a rectangular and circular UI.

          -

          Figure: The processing component in rectangular and circular device

          - -

          Processing component in a rectangular device Processing component in a circular device

          - -

          To implement the processing component:

          -
            -
          1. Edit the HTML code to add the processing component to your application screen: -
            -<div class="ui-page ui-page-active" id="pageProcessing" data-enable-page-scroll="false">
            -   <header class="ui-header">
            -      <h2 class="ui-title">Processing</h2>
            -   </header>
            -   <div class="ui-content content-padding">
            -      <div class="ui-processing"></div>
            -      <div class="ui-processing-text">
            -         Description about progress
            -      </div>
            -   </div>
            -   <div class="ui-processing ui-processing-full-size"></div>
            -</div>
            -
            -
          2. - -
          3. Edit the CSS code to set the visual style of the processing component: -
            -.ui-processing-full-size 
            -{
            -   display: none;
            -}
            -
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   .ui-processing 
            -   {
            -      display: none;
            -   }
            -   .ui-processing.ui-processing-full-size 
            -   {
            -      display: block;
            -   }
            -}
            -
            -
          4. -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/thumbnail_ww.htm b/org.tizen.ui.guides/html/web/tau/thumbnail_ww.htm deleted file mode 100755 index dfa05f3..0000000 --- a/org.tizen.ui.guides/html/web/tau/thumbnail_ww.htm +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - Creating Thumbnails - - - -
          -
          -

          Wearable Web

          -
          - -
          -

          Related Info

          - -
          -
          - -
          -

          Creating Thumbnails

          - -

          You can create thumbnail component with the SectionChanger API.

          - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          The following figure shows the layout of the thumbnail component in a rectangular and circular UI.

          - -

          Figure: Thumbnail in rectangular and circular devices

          - -

          Thumbnail in a rectangular device Thumbnail in a circular device

          - - -

          To implement the thumbnail component:

          -
            -
          1. Edit the HTML code to add the thumbnail component to your application screen: -
            -<div class="ui-page ui-page-active" id="sectionChangerPage" data-enable-page-scroll="false" >
            -   <div id="sectionChanger" class="ui-content ui-section-changer">
            -      <div id="scroller">
            -         <section class="ui-section-active">
            -            <div class="thumbnail">1</div>
            -         </section>
            -         <section>
            -            <div class="thumbnail">2</div>
            -         </section>
            -         <section>
            -            <div class="thumbnail">3</div>
            -         </section>
            -      </div>
            -   </div>
            -</div>
            -
            -
          2. - -
          3. Edit the CSS code to set the visual style of the thumbnail: -
            -section 
            -{
            -   padding: 0 10px 0 10px;
            -   height: 100%;
            -}
            -.thumbnail 
            -{
            -   height: 300px;
            -   width: 200px;
            -   background-color: #80482f;
            -   top: 50%;
            -   transform: translate3d(0, -50%, 0);
            -   position: relative;
            -   text-align: center;
            -   line-height: 300px;
            -}
            -.ui-section-active .thumbnail
            -{
            -   background-color: #000000;
            -   border: 1px solid #a06322;
            -}
            -
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   section 
            -   {
            -      padding: 0;
            -   }
            -   .thumbnail 
            -   {
            -      height: 200px;
            -      width: 200px;
            -      border-radius: 50%;
            -      background-color: #802532;
            -      top: 50%;
            -      position: relative;
            -      text-align: center;
            -      line-height: 200px;
            -      transform: scale(0.8) translate3d(0, -60%, 0);
            -      transition: transform 300ms;
            -   }
            -   .ui-section-active .thumbnail'
            -   {
            -      transform: scale(1) translate3d(0, -50%, 0);
            -   }
            -}
            -
            -
          4. -
          5. Edit the JavaScript code to manage the thumbnail events and other functionalities: -
            -(function()
            -{
            -   var page = document.getElementById("sectionChangerPage"),
            -       sectionChanger = document.getElementById("sectionChanger");
            -
            -   page.addEventListener("pagebeforeshow", function() 
            -   {
            -      tau.widget.SectionChanger(sectionChanger, 
            -      {
            -         orientation: "horizontal",
            -         fillContent: false
            -      });
            -   });
            -})();
            -
            -
          6. -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/tau/ui_component_w.htm b/org.tizen.ui.guides/html/web/tau/ui_component_w.htm deleted file mode 100755 index 2e52d9f..0000000 --- a/org.tizen.ui.guides/html/web/tau/ui_component_w.htm +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - UI Components: Managing UI Components - - - - - -
          -

          UI Components: Managing UI Components

          - - -

          Each UI component in TAU has its own selector for auto detecting in a HTML file. The most popular selectors are classes. The old style of selectors is the data-role, which is deprecated. Some UI components have also simple HTML selectors such as button (button component), or input[type=checkbox] (CheckboxRadio component).

          - - -

          Defining UI Components

          - -

          You can define UI components in 2 different ways using selectors:

          -
            -
          • With a class selector -

            It is recommended to use the class selector for each component. Class selectors in TAU are composed with ui-prefix and <COMPONENT_NAME>.

            -

            The following example shows the creation of some components with a class selector:

            -
            -<!-- Create Expandable component -->
            -<div class="ui-expandable" id="expandable-test">
            -   <h1>Expandable head</h1>
            -   <div>Content</div>
            -</div>
            -
            -<!-- Create ToggleSwitch component -->
            -<select class="ui-toggleswitch">
            -   <option value="off"></option>
            -   <option value="on"></option>
            -</select>
            -
          • -
          • With a data-role selector -

            The data-role selector in TAU composed with <COMPONENT_NAME> in lowercase.

            -

            The following example shows the creation of some components with a data-role selector:

            -
            -<!-- Create TextEnveloper component -->
            -<div data-role="textenveloper"></div>
            -
            -<!-- Create Drawer component -->
            -<div data-role="drawer">
            -   <ul data-role="listview">
            -      <li><a href="#">List item 1</a></li>
            -   </ul>
            -</div>
            -
          • -
          - -

          Setting UI Component Options

          - -

          TAU supports several ways of setting options for a UI component. For more information, see Mobile UI Components and Wearable UI Components.

          -

          You have the following options for setting the options:

          -
            -
          • Initializing options with the data- attribute -

            Various options can be set with data- attribute when the component is being created. This type of setting options is called only when the component is created. After creating the component, changing the data attributes on the HTML element do not change the component options.

            -

            The following example shows a SectionChanger code with a data- option:

            -
            <div id="hasSectionchangerPage" class="ui-page">
            -   <header class="ui-header">
            -      <h2 class="ui-title">SectionChanger</h2>
            -   </header>
            -   <div class="ui-section-changer" data-orientation="horizontal" data-circular="true" data-use-tab="true">
            -      <div>
            -         <section>
            -            <h3>LEFT1 PAGE</h3>
            -         </section>
            -         <section class="ui-section-active">
            -            <h3>MAIN PAGE</h3>
            -         </section>
            -         <section>
            -      </div>
            -   </div>
            -</div>
            -

            data-circular and data-use-tab are the initial options for creating a SectionChanger.

            -
          • - - -
          • Setting options with a manual constructor -

            Options can be also set as argument to component constructor. When using options as argument you must use the camelCase name.

            -

            The following example shows the use of manual constructor:

            -
            <div id="hasSectionchangerPage" class="ui-page">
            -   <header class="ui-header">
            -      <h2 class="ui-title">SectionChanger</h2>
            -   </header>
            -   <div class="ui-section-changer" id="sectionchanger">
            -      <div>
            -         <section>
            -            <h3>LEFT1 PAGE</h3>
            -         </section>
            -         <section class="ui-section-active">
            -            <h3>MAIN PAGE</h3>
            -         </section>
            -      </div>
            -   </div>
            -</div>
            -<script>
            -   var sectionEl = document.getElementById("sectionchanger"),
            -       sectionChangerWidget = tau.widget.SectionChanger(sectionEl, 
            -   { 
            -      orientation: "horizontal",
            -      circular: true
            -      useTab: true
            -   });
            -</script>
            -
            -
          • - -
          • Setting options with a method call -

            To set options dynamically, use the option() method.

            -
            <div id="hasSectionchangerPage" class="ui-page">
            -   <header class="ui-header">
            -      <h2 class="ui-title">SectionChanger</h2>
            -   </header>
            -   <div class="ui-section-changer" data-orientation="horizontal" data-circular="true" data-use-tab="true">
            -      <div>
            -         <section>
            -            <h3>LEFT1 PAGE</h3>
            -         </section>
            -         <section class="ui-section-active">
            -            <h3>MAIN PAGE</h3>
            -         </section>
            -         <section>
            -      </div>
            -   </div>
            -</div>
            -<script>
            -   var sectionEl = document.getElementById("sectionchanger"),
            -       sectionChangerWidget = tau.widget.SectionChanger(sectionEl);
            -
            -   sectionChangerWidget.option("circular", true);
            -</script>
            -
            -
          • -
          - -

          Managing UI Components with jQuery

          -

          You can use jQuery with TAU for convenience. Also for backward compatibility, TAU supports the jQuery interface for UI components. However, it is strongly recommended to use new TAU style.

          -

          To manage the UI components if the jQuery library is loaded:

          -
            -
          1. Create the UI component: -
            <div class="ui-indexscrollbar" id="indexscrollbar"></div>
            -<script>
            -   $("#indexscrollbar").indexscrollbar();
            -</script>
            -
          2. -
          3. Use the call methods: -
            $(".selector").componentName("methodName", argument1, argument2, ...);
            -
            <div class="ui-indexscrollbar" id="indexscrollbar"></div>
            -<script>
            -   /* If the IndexScrollBar component is created */
            -   $("#indexscrollbar").indexscrollbar("destroy");
            -</script>
            -
          4. -
          - - - - -
          - -Go to top - - - - - - - diff --git a/org.tizen.ui.guides/html/web/w3c/animation_w.htm b/org.tizen.ui.guides/html/web/w3c/animation_w.htm deleted file mode 100755 index 3d34691..0000000 --- a/org.tizen.ui.guides/html/web/w3c/animation_w.htm +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - - - - - - - - CSS Animations Module Level 3: Creating Animations - - - - - - -
          -

          CSS Animations Module Level 3: Creating Animations

          - -

          Animations (like transitions) change the presentational value of the CSS properties over time. The principal difference between animations and transitions is that while transitions are triggered implicitly when property values change, animations are explicitly executed when the animation properties are applied. This means that for animations, you must use animation keyframes to define explicit values for the properties being animated.

          - -

          When using the CSS animation properties, the Tizen browser requires the -webkit- prefix.

          - -

          Keyframes

          -

          The CSS animations work based on @-webkit-keyframes rules defined for specific elements. The rules can define various property changes complementing the simple running of a transition.

          -

          If the animation only has one set of changes over its whole iteration, the rule values can be assigned with a from {} to {} rule, where from is the beginning of the animation at 0% and to is the end at 100%. If there are multiple changes required, you can define their exact time periods using multiple <number>% {} rules that together cover the entire animation iteration from 0% to 100%.

          -

          The following code snippet demonstrates how to use keyframes. For a complete source code, see animation_keyframes.html

          -
          -<style type="text/css">
          -
          -   @-webkit-keyframes boxani 
          -   {
          -      from {left: 0; top: 0;}
          -      to {left: 100px; top: 100px;}
          -   }
          -   @-webkit-keyframes boxani_case01 
          -   {
          -      0% {left: 0; top: 0;}
          -      25% {left: 100px; top: 0;}
          -      50% {left: 100px; top: 100px;}
          -      75% {left: 0; top: 100px;}
          -      100% {left: 0; top: 0;}
          -   }
          -
          -</style>
          -
          - -

          Animation Properties

          - -

          You can define various properties for an animation to control how it is played:

          - -
            -
          • animation-name -

            This property uses the name defined in the @-webkit-keyframes rules to play the animation.

          • - -
          • animation-duration -

            This property defines how long one iteration of the animation takes.

          • - -
          • animation-iteration-count -

            This property defines how many times the animation is repeated. If the value is set as infinite, the repetitions are unlimited.

          • - -
          • animation-timing-function -

            This property defines the pace of the animation.

          • - -
          • animation-direction -

            This property defines the replay direction. The reverse value plays the animation from 100% keyframe to 0% keyframe, while the alternate value plays the animation normally during odd iterations, and from 100% keyframe to 0% keyframe during even iterations.

          • - -
          • animation-play-state -

            This property defines the replay status of the animation. The paused value temporarily stops the animation.

          • -
          • animation-delay -

            This property defines the delay time before the start of the animation.

          • - -
          • animation-fill-mode -

            This property defines the state of the animation before or after the animation is played. The forwards value maintains the last value of the keyframe rule when the animation is over, while the backwards value fills up the first value of the keyframe rule when the animation with the animation-delay property is in a standby state. The both value covers both the start and the end of the animation.

          - -

          The following code snippet demonstrates how to use animation properties. For a complete source code, see:

          - - -
          -<head>
          -   <style type="text/css">
          -      .box 
          -      {
          -         -webkit-animation-name: boxani;
          -         -webkit-animation-duration: 5s;
          -         -webkit-animation-iteration-count: infinite;
          -         -webkit-animation-timing-function: linear;
          -         -webkit-animation-direction: normal;
          -         -webkit-animation-delay: 1s;
          -         -webkit-animation-fill-mode: none;
          -      }
          -
          -      .box.case01: hover 
          -      {
          -         -webkit-animation-play-state: paused;
          -         -webkit-animation-fill-mode: forwards;
          -      }
          -   </style>
          -</head>
          -
          -<body>
          -   <h1>animation-name</h1>
          -   <div class="boxarea">
          -      <div class="box">
          -         <p>animate</p>
          -         <p>animation-name: boxani;</p>
          -      </div>
          -   </div>
          -   <div class="boxarea">
          -      <div class="box case01">
          -         <p>animate</p>
          -         <p>animation-name: boxani_case01;</p>
          -      </div>
          -   </div>
          -</body>
          -
          - - - - - - - - - -
          Note
          The hover pseudo class in Tizen maintains a mouseover state when an element is tapped, and becomes a mouseout state when another element is tapped.
          - -

          The animation property allows you to define all the animation properties in a shorthand mode in the order of animation-name | animation-duration | animation-timing-function | animation-delay | animation-iteration-count | animation-direction | animation-fill-mode. If you omit a property value, a default value is used instead.

          - -
          -<style type="text/css">
          -   .box 
          -   {
          -      width: 150px; height: 100px; background: Coral; position: relative;
          -      -webkit-animation: boxani 3s ease 1s infinite alternate backwards;
          -   }
          -</style>
          -
          - -

          Creating a Logo Animation

          - -

          To enhance the user experience of your application, you must learn to create a logo animation, where element properties can be assigned and changed for each element and keyframe. The logo animation is similar to the animation that appears when a Tizen device (or Emulator) is switched on:

          - -
            -
          1. No elements are initially shown on the screen.
          2. -
          3. The Tizen logo gradually appears in the middle of the screen, and as it moves to the right, it becomes smaller.
          4. -
          5. Each letter in the word "TIZEN" consecutively comes in from the left of the screen and moves to the right to its correct location.
          6. -
          -

          Figure: Logo animation (in mobile applications only)

          -

          Logo animation

          -

          To create a logo animation:

          -
            -
          1. Create the HTML layout for the animation. To be able to manage the movement of each animation part separately, you must define individual elements for each part. -
            -<div class="animation-holder">
            -   <span class="tizen-txt t"></span>
            -   <span class="tizen-txt i"></span>
            -   <span class="tizen-txt z"></span>
            -   <span class="tizen-txt e"></span>
            -   <span class="tizen-txt n"></span>
            -   <span class="tizen-txt tm"></span>
            -   <span class="tizen-logo"></span>
            -</div>
            -
            -
          2. -
          3. Define the basic style for the animation: -
            -.example-body {width: 320px; height: 480px; background: #000; margin: 0 auto; 
            -               position: relative; border: 2px solid #fff; overflow: hidden;}
            -.animation-holder {width: 280px; height: 88px; position: absolute; 
            -                   left: 50%; top: 50%; margin: -54px 0 0 -140px;} 
            -
            -.tizen-txt, .tizen-logo {position: absolute; display: block; 
            -                         background-repeat: no-repeat; background-position: 50% 50%}
            -.tizen-txt.t {width: 48px; height: 56px; background-image: url(images/txt_t.png);}
            -.tizen-txt.i {width: 15px; height: 56px; background-image: url(images/txt_i.png);}
            -.tizen-txt.z {width: 46px; height: 56px; background-image: url(images/txt_z.png);}
            -.tizen-txt.e {width: 45px; height: 56px; background-image: url(images/txt_e.png);}
            -.tizen-txt.n {width: 54px; height: 58px; background-image: url(images/txt_n.png);}
            -.tizen-txt.tm {width: 11px; height: 6px; background-image: url(images/txt_tm.png);}
            -.tizen-logo {width: 220px; height: 211px; left: 30px; top: -61px; 
            -             background-image: url(images/logo_tizen.png); background-size: 100% 100%;}
            -
            -
          4. -
          5. Create the animation: -
              -
            1. To ensure that all the animation elements are played within the same time frame, some common properties are defined for the animation. The animation movement time is 7 seconds, and the animation repeats infinitely. -

              When an animation that repeats itself is activated, it can look unnatural when it suddenly returns to its initial position after finishing an iteration. To make the repetition move naturally, set the animation-direction property to alternate. The alternate direction means that during the odd iterations the animation proceeds in the normal direction (from the 0% keyframe to the 100% keyframe), while during the even iterations the keyframes are played in the opposite direction from 100% to 0%.

              -
              -.tizen-txt, .tizen-logo 
              -{
              -   -webkit-animation-duration: 7s;
              -   -webkit-animation-iteration-count: infinite;
              -   -webkit-animation-direction: alternate;
              -}
              -
              -
            2. -
            3. Create the keyframes to implement the flow for the Tizen logo: -
                -
              • During the first 25% of the animation total playing time (7 seconds), the transparency disappears and the Tizen logo appears.
              • -
              • During the 25 - 50% of the playing time, the logo size becomes smaller as the width and height values are reduced, and due to the left and top value, the logo is positioned to the top right corner of the screen.
              • -
              • During the 50 - 100% of the playing time, the values do not change, and the logo remains in its new position.
              • -
              -

              -
              -@-webkit-keyframes tizen-logo 
              -{
              -   0% {width: 220px; height: 211px; left: 30px; top: -61px; opacity: 0;}
              -   25% {width: 220px; height: 211px; left: 30px; top: -61px; opacity: 1;}
              -   50% {left: 247px; top: 0px; width: 33px; height: 32px; opacity: 1;}
              -   100% {left: 247px; top: 0px; width: 33px; height: 32px; opacity: 1;}
              -}
              -
              - - - - - - - - - - -
              Note
              If the 100% keyframe is not defined, the animation is executed based on the original properties, and the logo size increases to its original size at the end.
            4. -
            5. Create the keyframes to implement the flow for each letter in the word "TIZEN": -
                -
              • To hide the letter initially, the property has been assigned outside the screen at the 0% keyframe. To allow the Tizen logo to appear first, the first letter is introduced at the 30% keyframe.
              • -
              • To create a slight collision animation, the letter element moves to -10 px of the final value at the 40% keyframe before reaching its final 0 px value at the 45% keyframe.
              • -
              • The animation-timing-function property can be changed for each keyframe point, and is used to determine the pace of the animation. When the letter is actually shown on the screen and moved to its final location, the ease in and out timing functions are used.
              • -
              - -

              To show the letters one at a time, the timing is pushed back a bit more for each consecutive letter:

              -
              -<!--Letter T-->
              -@-webkit-keyframes tizen-txt-t 
              -{
              -   0% {left: 340px; top: 31px;}
              -   30% {left: 340px; top: 31px; animation-timing-function: ease-in;}
              -   40% {left: -10px; top: 31px; animation-timing-function: ease-out;}
              -   45% {left: 0; top: 31px;}
              -   100% {left: 0; top: 31px;}
              -}
              -
              -<!--Letter I-->
              -@-webkit-keyframes tizen-txt-i 
              -{
              -   0% {left: 340px; top: 31px;}
              -   40% {left: 340px; top: 31px; animation-timing-function: ease-in;}
              -   50% {left: 47px; top: 31px; animation-timing-function: ease-out;}
              -   55% {left: 57px; top: 31px;}
              -   100% {left: 57px; top: 31px;}
              -}
              -
              -<!--Remaining letters-->
              -
            6. - -
            7. After creating all the keyframes, define the animation-name property for each element:

              -
              -.tizen-txt.t 
              -{
              -   -webkit-animation-name: tizen-txt-t;
              -}
              -.tizen-txt.i 
              -{
              -   -webkit-animation-name: tizen-txt-i;
              -}
              -
            8. - -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/background_w.htm b/org.tizen.ui.guides/html/web/w3c/background_w.htm deleted file mode 100755 index 609ad9e..0000000 --- a/org.tizen.ui.guides/html/web/w3c/background_w.htm +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - CSS Backgrounds and Borders Module Level 3: Specifying Background and Border Styles - - - - - - -
          -

          CSS Backgrounds and Borders Module Level 3: Specifying Background and Border Styles

          - -

          You can manage the CSS properties for specifying the border style or background of any HTML element.

          - -

          When creating a background for an element, you can use the following properties:

          -
            -
          • background-color -

            Defines the color of the background.

          • -
          • background-image -

            Defines the image to be used. You can add images as separate layers to an element. To add multiple images, separate them by commas to add each image as a separate layer. The images are added in the order they are defined.

          • -
          • background-position -

            Defines the exact position of the image.

          • -
          • background-repeat -

            Defines whether the image is repeated to fill the entire background (in case the image is too small to do it otherwise).

          • -
          • background-origin -

            Defines the position of the initial background for the item.

          • -
          • background-size -

            Defines the size of the image in the background.

          • -
          • background-clip -

            Defines the area of the cropped background element.

          • -
          - -

          The border properties specify the line thickness, style, and color for the element border. You can define the border using 3 separate properties (border-width, border-style, and border-color), or by listing the values for all 3 properties together in 1 border property. To define rounded corners for the border, you can additionally use the border-radius property.

          - -

          To define shading for an element, you can define the horizontal and vertical offset, blur radius, and the spread distance values within the box-shadow property. To switch the shadow from outside to inside the element, add the inset keyword to the property too.

          - -

          The following image shows a simple background color (top left), a background image (top right), multiple images with a solid black border (bottom left), and an element with shading and a solid black border with rounded corners (bottom right). The background image at top right is automatically repeated to cover the entire background, while the images at bottom left are not repeated due to the background-repeat property value.

          - -

          Figure: Background examples

          -

          Background examples

          -

          The following code snippet demonstrates how to set the background color, images, borders, and shadings.

          - -
          -<!--Background color-->
          -#one 
          -{
          -   width: 180px;
          -   height: 40px;
          -   background-color: lightblue;
          -}
          -
          -<!--Background image--> 
          -#one 
          -{
          -   width: 200px;
          -   height: 100px;
          -   background-color: #00F;
          -   background-image: url(t3.png);
          -}
          -
          -<!--Multiple images--> 
          -#multi 
          -{
          -   width: 155px;
          -   height: 100px;
          -   border: 1px solid #000;
          -   background-color: #87CEFA;
          -   background-image: url(t1.png), url(t2.png), url(t3.png);
          -   background-position: center center, 20% 100%, top left;
          -   background-repeat: no-repeat;
          -}
          -
          -<!--Shading and border with rounded corners-->
          -#shading 
          -{
          -   width: 160px;
          -   height: 40px;
          -   border: 1px solid #000;
          -   border-radius: 20px;
          -   background-color: #88f;
          -   box-shadow: #888 10px 10px;
          -}
          -
          - -

          Creating Backgrounds

          - -

          To enhance the user experience of your application, you must learn to create a multilayer background with the parallax effect using the CSS box model. The background consists of 3 images on separate layers, and 2 of the layers can be moved over each other.

          - -

          Figure: Background with the parallax effect

          -

          Background with the parallax effect

          - -
          1. Prepare 3 images (tizen.png, tizen2.png, and dot.png), each with a transparent background. - -

            tizen.png, tizen2.png, and dot.png images

          2. - -
          3. Create a div element with id="parallelexample" and a slider input element with the minimum, maximum, and initial value: -
            -<div id="parallelexample"></div>
            -<input id="position" type="range" min="1" max="200" value="50">
            -
          4. - -
          5. Define the needed styles for the div element in the <head> section using the parallelexample ID. -

            Define a background using the prepared images in the correct order. The images are shown in the order they have been added, with the first image on the topmost layer. Use the same order when defining the background position for each image.

            -
            -#parallelexample
            -{
            -   width: 300px;
            -   height: 300px;
            -   background-image: url(tizen2_32.png), url(tizen3_32.png), url(dot.png);
            -   background-position: 6.25em 8em, 3.125em 4em, center top;
            -   background-repeat: repeat, repeat, repeat;
            -   border: 1px solid black;
            -   margin: 0px auto;
            -}
            -
          6. -
          7. To create the parallax effect, create a method that moves the background layers by changing the horizontal position values of the images in the div element. To determine the position value change, add an onchange event handler for the slider to determine the change based on the slider handle movement. -
            -function moveLayers() 
            -{
            -   /* Get slider value */
            -   var poz = document.getElementById('position');
            -   /* Get the div element */
            -   var example = document.getElementById('ParallaxExamle');
            -   /* Add the event handler */
            -   poz.onchange = function()
            -   {
            -      var layer1 = this.value/8, layer2 = this.value/16;
            -      example.style.backgroundPosition = layer1 +'em 8em, ' 
            -                                         + layer2 + 'em 4em, center top';
            -   }
            -}
            -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/basic_ui_w.htm b/org.tizen.ui.guides/html/web/w3c/basic_ui_w.htm deleted file mode 100755 index 3090acb..0000000 --- a/org.tizen.ui.guides/html/web/w3c/basic_ui_w.htm +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - CSS Basic User Interface Module Level 3 (CSS3 UI): Applying Styles to HTML Documents - - - - - - -
          -

          CSS Basic User Interface Module Level 3 (CSS3 UI): Applying Styles to HTML Documents

          - -

          You can apply styles to HTML documents.

          -

          The CSS3 version has caused changes in the Selector, Color, Web Form, and Fonts CSS modules. In addition, the CSS3 UI API also handles changes related to the following user interface items:

          -
            -
          • User interface selectors -

            The CSS Selector is an essential module for applying a CSS to HTML in order to enable the DOM element selection. The pseudo-element selectors can be used to assign the user interface state. With the selectors, you can change the Web form style according to the user input without using JavaScript.

          • - -
          • Box model properties -

            A box model refers to all DOM elements excluding design elements, such as <br> and <i>. The box model area is set as defined in the following figure.

            -
              -
            • Content: Content area
            • -
            • Padding: Gap between the content and boundary
            • -
            • Border: Boundary
            • -
            • Margin: Overall size of the box model
            • -
            -

            Figure: Box model structure

            -

            Figure: Box model structure

            - -

            You can use the box model properties to assign styles to the selected DOM elements:

            -
              -
            • The box-sizing property assigns the box size range.
            • -
            • The outline properties make the box outstanding.
            • -
            • The text-overflow property handles the text extending outside the box.
            -
          • -
          - -

          Using Pseudo-element Selectors

          - -

          To enhance the user experience of your application, you must learn how to use pseudo-element selectors:

          -
            -
          1. Use the pseudo-classes, such as :enabled and :disabled, to add different styles based on the state of the DOM elements:

            -
            input: enabled {border: 1px solid blue}
            -input: disabled {border: 1px solid red}
            - - - - - - - - - -
            Note
            In the versions prior to CSS3, pseudo-elements, such as :hover, :active, and :focus, were used, and required an attribute selector. Since the :enabled and :disabled classes are not influenced by the display and visibility attributes, they improve the accessibility.
          2. -
          3. To control the state of the HTML5 Web Forms (in mobile or wearable applications), use the :in-range and :out-of-range pseudo-classes. -

            They check for any values that have exceeded the inserted range. (The following figure applies to mobile applications only.)

            -
            -<!--HTML--> 
            -<input type="number" step="10" min="10" max="100">
            -
            -
            -<!--CSS-->
            -input[type="number"]: in-range {border: 3px solid blue; width: 90%}
            -input[type="number"]: out-of-range {border: 3px solid red; width: 90%}
            -
            -

            Element ranges (in mobile applications only)

          4. -
          5. To apply different styles to required input items and option items, use the :required and :optional pseudo-classes. (The following figure applies to mobile applications only.) -
            -<!--HTML-->
            -<fieldset>
            -   <legend>required and optional</legend>
            -   <label>email: <input type="email" required></label>
            -   <label>password: <input type="Password" placeholder="required area" required></label>
            -
            -   <label>date: <input type="date" placeholder="You know what to do, huh?"></label>
            -   <textarea placeholder="Comment"></textarea>
            -</fieldset>
            -
            -<!--CSS-->
            -input: required, textarea: required {border: 1px solid red}
            -input: optional, textarea: optional {border: 1px solid #777}
            -
            -

            Required and optional elements (in mobile applications only)

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - -

          Using Box Model Properties

          - -

          To enhance the user experience of your application, you must learn how to use box model properties:

          - - - - - - - - - -
          Note
          The properties dependent on mouse and keyboard functions are not discussed in this tutorial.
          -
            -
          1. To assign the area that is included in the width and height of the box automatically, use the box-sizing property. To assign the width without a margin, use the box-sizing: border-box property. -
            -div.content-box {box-sizing: content-box} <!--width (height) = content-->
            -div.border-box {box-sizing: border-box} <!--width (height) = content + padding + border-->
            -div.border-box: before {height: 40px}
            -
          2. - -
          3. To draw an outline without using up the area, use the outline property: -
            -.Test-Box {outline: 5px dashed red}
            -.outline: before {outline: 2px dashed red}
            -.outline-offset: before {outline-offset: 35px}
            -
          4. - -
          5. To handle text that exceeds the area of the box model, use the text-overflow property. The text-overflow: ellipsis property is used to indicate the text exceeded the padding area as '...'. -
            div 
            -{
            -   width: 250px;
            -   margin: 20px auto;
            -   padding: 20px 30px;
            -   background-color: #eee;
            -   color: #333;
            -   border: 5px solid #333;
            -   font-weight: bold;
            -   overflow: hidden;
            -   white-space: nowrap;
            -}
            -
            -.clip {text-overflow: clip}
            -.ellipsis {text-overflow: ellipsis}
          6. -
          - -

          The following figure illustrates the box model properties; from left to right, it shows the effects of the box sizing, outline, and text overflow properties.

          -

          Figure: Box model properties (in mobile applications only)

          -

          Box model properties (in mobile applications only)

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/clipboard_mw.htm b/org.tizen.ui.guides/html/web/w3c/clipboard_mw.htm deleted file mode 100755 index aede950..0000000 --- a/org.tizen.ui.guides/html/web/w3c/clipboard_mw.htm +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - Clipboard API and events: Transferring Content Between Applications - - - - - -
          -

          Clipboard API and events: Transferring Content Between Applications

          - - -

          The clipboard and events feature is used for cutting, copying, and pasting content to easily transfer it between Web applications.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          The main features of Clipboard API and events include:

          - - -

          Copying Content

          - -

          To enhance the user experience of your application with clipboard operations, you must learn to use the copy event:

          -
            -
          1. Add an event listener to detect the copy event: -
            -<script>
            -   document.addEventListener("copy", function(e)
            -   {
            -      copyHandler(e);
            -   }, false);
            -
          2. -
          3. When you start copying, the copy event is fired and the copyHandler() method is called.

            -

            Stop the system clipboard basic operation and set the range you want to copy:

            -
               function copyHandler(e) 
            -   {
            -      e.preventDefault();
            -
            -      var range = window.getSelection();
            - - - - - - - - - -
            Note
            If the current selection is not influenced and there is no selected range, the clipboard imports the setData() method. The copied content cannot be edited apart from adding a DataTransferItemList item.
            -
          4. -
          5. Store the data of the selected range: -
                  e.clipboardData.setData("text/plain", range);
            -   };
            -</script>
            -
            -
          6. -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Cutting Content

          - -

          To enhance the user experience of your application with clipboard operations, you must learn to use the cut event:

          -
            -
          1. Add an event listener to detect the cut event: -
            -<script>
            -   document.addEventListener("cut", function(e) 
            -   {
            -      cutHandler(e);
            -   }, false);
            - -
          2. -
          3. When you start cutting, the cut event is fired and the cutHandler() method is called.

            -

            Stop the system clipboard basic operation and set the range you want to cut:

            -
               function cutHandler(e) 
            -   {
            -      e.preventDefault();
            -
            -      var range = window.getSelection();
            - -
          4. -
          5. Store the data of the selected range: -
                  e.clipboardData.setData("text/plain", range);
            -   };   
            -</script>
            -
            - - - - - - - - - -
            Note
            Before the setData() method is imported, the basic motion of the system event must be cancelled using the preventDefault() method. Otherwise, the data to be allocated to the clipboard is overwritten by the system clipboard.
            -
          6. -
          - -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Pasting Content

          - -

          To enhance the user experience of your application with clipboard operations, you must learn to use the paste event:

          -
            -
          1. Add an event listener to detect the paste event: -
            -<script>
            -   document.addEventListener("paste", function(e)
            -   {
            -      pasteHandler(e);
            -   }, false);
            -
          2. -
          3. When you start pasting, the paste event is fired and the pasteHandler() method is called.

            -

            Stop the system clipboard basic operation:

            -
               function pasteHandler(e) 
            -   {
            -      e.preventDefault();
            -
          4. -
          5. Paste the clipboard data to the target using the getData() method: -
            -      pasteTarget.innerHTML = e.clipboardData.getData("text/plain");
            -   };              
            -</script>
            -
            -
          6. -
          - -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Copying and Pasting Content into an Editable Element

          - -

          To enhance the user experience of your application with clipboard operations, you must learn to copy content and paste it in an editable HTML element:

          - -
            -
          1. Define the editable element into which copied data is to be pasted:

            -
            -<head>
            -   <style>
            -      .log {border: 1px solid #d9d9d9; margin: 10px; padding: 5px;}
            -      .target {border: 1px solid #36c; margin: 10px; padding: 5px;}
            -   </style>
            -</head>
            -<body>
            -   <h1>Clipboard API</h1>
            -   <div style="width: 300px; height: 100px; border: 1px solid #d9d9d9" contenteditable>
            -      Edit Section
            -   </div>
            -   <div  class="target">
            -      <h4>Target Element</h4>
            -      <p id="target contenteditable">Paste content</p>
            -   </div>
            -   <div id="ev-log" class="log">Event log</div>
            -   <div contenteditable>
            -      This section is informative
            -      This specification defines the common clipboard operations of cutting, 
            -      copying and pasting, in such a way that they are exposed to Web Applications 
            -      and can be adapted to provide advanced functionalities. 
            -      Its goal is to provide for compatibility where possible with existing implementations.
            -   </div>
            -<body>
            -
            -
          2. - -
          3. Add event listeners to detect the copy and paste events:

            -
            -<script>
            -   var pasteTarget = document.getElementById("target");
            -   var evLogBox = document.getElementById("ev-log");    
            -
            -   document.addEventListener("copy", function(e)
            -   {
            -      copyHandler(e);
            -   }, false);
            -
            -   document.addEventListener("paste", function(e)
            -   {
            -      pasteHandler(e);
            -   }, false);
            -
            -
          4. - -
          5. When the copy event occurs, stop the system clipboard basic operation and set the range you want to copy: -
            -   function copyHandler(e) 
            -   {
            -      e.preventDefault();
            -
            -      var range = window.getSelection();
            -
          6. -
          7. Store the data of the selected range: -
                  e.clipboardData.setData("text/plain", range);
            -      evLogBox.innerHTML = "Event log : copy";
            -   };
            -
          8. -
          9. When the paste event occurs, stop the system clipboard basic operation and paste the clipboard data to the target using the getData() method: -
               function pasteHandler(e) 
            -   {
            -      e.preventDefault();
            -
            -      pasteTarget.innerHTML = e.clipboardData.getData("text/plain");
            -      evLogBox.innerHTML = "Event log : paste";
            -   };  
            -</script>
            -
            -
          10. -
          - -

          Figure: Copying and pasting

          -

          Copying and pasting

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/color_w.htm b/org.tizen.ui.guides/html/web/w3c/color_w.htm deleted file mode 100755 index 1a478a5..0000000 --- a/org.tizen.ui.guides/html/web/w3c/color_w.htm +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - - CSS Color Module Level 3: Specifying Color and Opacity - - - - - - -
          -

          CSS Color Module Level 3: Specifying Color and Opacity

          - -

          You can manage the CSS properties for specifying the color and opacity of an HTML element, and the CSS color value type.

          - - - - - - - - - - -
          Note

          The CSS2 System Color values have been deprecated in favor of the CSS3 UI 'appearance' property.

          - -

          You can specify the color of an element with the following formats:

          -
            -
          • Keyword values -

            You can use basic keywords, such as red, green, blue, or deepskyblue, as defined in Extended color keywords.

            -

            The currentColor keyword can be used with all properties that accept a color value (borders, box shadows, outlines, or backgrounds). The computed value of the currentColor keyword is the computed value of the color property. If the currentColor keyword is set on the color property itself, it is treated as color: inherit. -

            -

            You can use the transparent keyword with all properties that accept a color value (borders, box shadows, outlines, or backgrounds), to turn the element in question transparent (invisible).

            -
          • -
          • RGB values -
              -
            • In hexadecimal notation -

              The format is '#' followed by either 3 or 6 hexadecimal characters. The 3-digit RGB notation (#rgb) is converted into a 6-digit form (#rrggbb) by replicating digits. For example, #fc0 expands to #ffcc00.

            • -
            • In functional notation -

              The format is 'rgb(' followed by a comma-separated list of 3 numerical values (integer or percentage) followed by ')'. The integer value 255 corresponds to 100%, and to F or FF in a hexadecimal notation: rgb(255, 255, 255) = rgb(100%, 100%, 100%) = #FFF. White space characters are allowed around the numerical values. -

            • -
            -
          • -
          • RGBA values -

            The RGB color model is extended to include "alpha" to allow the color opacity to be specified. The RGBA values are defined using functional notation where the final value is the alpha (range from 0.1 to 1). For example: rgba(255, 0, 0, 0.7).

            -
          • -
          • HSL value -

            You can use numerical hue-saturation-lightness (HSL) colors as an alternative to numerical RGB colors. The HSL colors are encoded as a triple (hue, saturation, lightness). The hue is represented as the angle of the color circle, where by definition red=0°=360° and other colors are spread around the circle. The saturation and lightness are represented as percentages, where 100% is full saturation or black lightness, and 0% is a shade of gray or white lightness. 50% lightness is "normal". For example: hsl(0, 100%, 50%). -

          • -
          • HSLA value -

            The HSL color model is extended to include "alpha" to allow the color opacity to be specified. The HSLA values are defined using the HSL notation where a final alpha value is added (range from 0.1 to 1). For example: hsla(120, 100%, 50%, 0.8).

          • -
          -

          The following code snippet demonstrates how to specify a color for an element. For a complete source code, see:

          - -
          -<!--Keywords-->
          -#one
          -{
          -   color: blue;
          -   background: white;
          -   border: 1px solid springgreen;
          -}
          -#one span 
          -{
          -   background: currentColor;
          -}
          -#one span.hide
          -{
          -   color: transparent;
          -}
          -
          -<!--RGB-->
          -#two
          -{
          -    color: #ff0000;
          -}
          -
          -<!--RGBA-->
          -#three
          -{
          -   color: rgba(100%, 0, 0, 0.5);
          -}
          -
          -<!--HSL-->
          -#four
          -{
          -   color: hsl(0, 100%, 50%);
          -}
          -
          -<!--HSLA-->
          -#five
          -{
          -   color: hsla(0, 100%, 50%, 0.5);
          -}
          -
          - -

          Creating a Color Generator

          - -

          To enhance the user experience of your application, you must learn to create a HSLA color generator to set the color value for an element in the HSLA format.

          - -

          Figure: HSLA color generator

          -

          HSLA color generator

          - - - -
          1. To create the color generator, define 2 <div> elements for displaying the HSLA value as text and in a color box. You also need 4 slider inputs for defining the HSLA color: -
              -
            • The first input has a range of 0 - 360 and represents hue.
            • -
            • The second and third inputs have a range of 0 - 100 and represent saturation and lightness.
            • -
            • The last input has a range of 0 - 10 and represents alpha transparency. -

              The range should be 0.1 - 1, but the minimum value of the min attribute is 0 so the value can be divided by 10.

            - -
            -<div id="color-generator">
            -   <div id="text-box"></div>
            -   <div id="color-box"></div>
            -
            -   <label>Hue</label>
            -   <input id="hue" value="0" type="range" min="0" max="360">
            -
            -   <label>Saturation</label>
            -   <input id="saturation" value="100" type="range" min="0" max="100">
            -
            -   <label>Lightness</label>
            -   <input id="lightness" value="50" type="range" min="0" max="100">
            -
            -   <label>Alpha</label>
            -   <input id="alpha" value="10" type="range" min="0" max="10">
            -</div>
            -
          2. -
          3. Obtain the values from the slider inputs with the getElementById method. Remember to divide the alpha value by 10 to reach the correct range of 0.1 - 1. -
            -var h = document.getElementById('hue').value,
            -    s = document.getElementById('saturation').value,
            -    l = document.getElementById('lightness').value,
            -    a = document.getElementById('alpha').value / 10;
            -
          4. -
          5. Set the HSLA text and the color of the color box by defining the color from the inputs in the HSL and HSLA formats. -

            If the alpha is 1, the HSL format is displayed. Otherwise, the HSLA format is used.

            -
            -/* Define formats */
            -hsl = 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
            -hsla = 'hsla(' + h + ', ' + s + '%, ' + l + '%, ' + a + ')';
            -
            -/* Set the color of the box */
            -cBox = document.querySelector('#color-box'),
            -
            -/* Set the text */
            -tBox = document.querySelector('#text-box');
            -
          6. - -
          7. Add an event handler to the input sliders to change the displayed text and color box color when the slider values change. -
            -var inputs = document.querySelectorAll('#color-generator input[type=range]');
            -			
            -for (i = 0; i < inputs.length; i++)
            -{
            -   inputs[i].onchange = function()
            -   {
            -      /* Show color */
            -   }
            -}
            -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/drag_drop_mw.htm b/org.tizen.ui.guides/html/web/w3c/drag_drop_mw.htm deleted file mode 100644 index 86924fd..0000000 --- a/org.tizen.ui.guides/html/web/w3c/drag_drop_mw.htm +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - - - - - - - - HTML5 Drag and drop: Handling Drag and Drop Events - - - - - -
          -

          HTML5 Drag and drop: Handling Drag and Drop Events

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          HTML5 drag and drop activates through event-based JavaScript and added attributes. -

          -

          -The main features of the HTML5 Drag and drop API include: -

          -
            -
          • Using drag and drop -

            To make an element draggable, add the draggable="true" attribute to it. Only elements thus defined as draggable can generate drag and drop events.

            -

            A drag and drop requires a source, target, and data. It is used through the following events:

            -
            • dragstart
            • -
            • drag
            • -
            • dragleave
            • -
            • dragenter
            • -
            • dragover
            • -
            • drop
            • -
            • dragend
            -

            The dragstart and drop events send data through the DataTransfer interface.

            -
          • -
          • Transferring data -

            You can transfer data from the drag source to the drop target. The DataTransfer interface instance receives the dragstart event and fills itself with the data to be transferred. It then receives a drop event, and puts the data into the drop target.

          • -
          - - - - - - - - - - -
          Note
          To use drag and drop in a Tizen device, long-press the draggable element. When the context menu appears, select the Drag menu.
          - -

          Handling Drag and Drop Events

          - -

          Learning how to handle drag and drop events is a basic user interaction skill:

          - - -
            -
          1. Define the draggable elements by adding the draggable="true" attribute to them:

            -
            -<h1>Drag and drop tutorial</h1>
            -<div class="example_body">
            -   <div id="drag-list">
            -      <div class="drag-row" draggable="true">1</div>
            -      <div class="drag-row" draggable="true">2</div>
            -   </div>
            -   <div>Drag state: <span id="log"></span></div>
            -</div>
            -
            -
          2. - -
          3. Add event listeners for the various drag and drop events: -
            -<script>
            -   var cols = document.querySelectorAll('#drag-list_.drag-row');
            -   var colsLength = cols.length;
            -
            -   for (var i = 0; i < colsLength; i++) 
            -   {
            -      cols[i].addEventListener('dragstart', dragStart, false);
            -      cols[i].addEventListener('drag', dragIng, false);
            -      cols[i].addEventListener('dragenter', dragEnter, false);
            -      cols[i].addEventListener('dragover', dragOver, false);
            -      cols[i].addEventListener('dragleave', dragLeave, false);
            -      cols[i].addEventListener('drop', dragDrop, false);
            -      cols[i].addEventListener('dragend', dragEnd, false);
            -   };
            -</script>
            -
            -
          4. - -
          5. Define event handlers for the events. In this case, each event handler displays a text on the screen. -
            -function dragStart(e) 
            -{
            -   log.innerHTML = "dragStart"
            -};
            -
            -function dragIng(e) 
            -{
            -   log.innerHTML = "drag"
            -};
            -
            -function dragOver(e) 
            -{
            -   e.preventDefault();
            -   log.innerHTML = "dragOver"
            -};
            -
            -function dragEnter(e) 
            -{
            -   log.innerHTML = "dragEnter"
            -};	
            -
            -function dragLeave(e) 
            -{
            -   log.innerHTML = "dragLeave"
            -};
            -
            -function dragDrop(e) 
            -{
            -   e.stopPropagation();
            -   log.innerHTML = "dragDrop"	
            -};
            -	
            -function dragEnd(e) 
            -{
            -   log.innerHTML = "dragEnd"
            -};
            -
            -
          6. -
          - -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Transferring Data over Drag and Drop

          - -

          Learning how to transfer data in a simple drag and drop puzzle is a basic user interaction skill:

          - -
            -
          1. Define the draggable elements by adding the draggable="true" attribute to them. -

            In this example, the Tizen logo image has been divided and allocated randomly. Each imager part is defined as draggable, so that the user can rearrange the image parts in the correct order.

            -
            -<h1>Drag and drop tutorial</h1>
            -<div class="example_body">
            -   <div>Drag state: <span id="log"></span></div>
            -   <div class="holder">
            -      <div>
            -         <img src="images/logo.png">
            -         <p class="txt">Complete the puzzle to see a picture</p>
            -      </div>
            -      <ul id="puzzle">
            -         <li class="puzzle-piece" draggable="true">
            -            <img src="images/puzz_06.png">
            -         </li>
            -         <li class="puzzle-piece" draggable="true">
            -            <img src="images/puzz_02.png">
            -         </li>
            -         <li class="puzzle-piece" draggable="true">
            -            <img src="images/puzz_04.png">
            -         </li>
            -         <li class="puzzle-piece" draggable="true">
            -            <img src="images/puzz_05.png">
            -         </li>
            -         <li class="puzzle-piece" draggable="true">
            -            <img src="images/puzz_01.png">
            -         </li>
            -         <li class="puzzle-piece" draggable="true">
            -            <img src="images/puzz_03.png">
            -         </li>
            -      </ul>
            -   </div>
            -</div>
            -
            -
          2. - -
          3. Add event listeners for the dragover, dragleave, dragstart, and drop events: -
            -<script>
            -   var cols = document.querySelectorAll('#puzzle_.puzzle-piece');
            -   var colsLength = cols.length;
            -   for (var i = 0; i < colsLength; i++) 
            -   {
            -      cols[i].addEventListener('dragstart', dragStartHandler, false);
            -      cols[i].addEventListener('dragover', dragOverHandler, false);
            -      cols[i].addEventListener('dragleave', dragLeaveHandler, false);
            -      cols[i].addEventListener('drop', dragDropHandler, false);
            -   };
            -</script>
            -
            -
          4. - -
          5. Transfer data (in this case, image parts): -
              -
            1. Declare the dragElem variable, which is an empty object for the data exchange: -
              -var dragElem = null;
              -
              -
            2. - -
            3. Use the DataTransfer interface in the dragStartHandler() and dragDropHandler() event handlers to exchange image parts: -
              -function dragStartHandler(e) 
              -{
              -   /* Set data */
              -   dragElem = this;
              -   e.dataTransfer.effectAllowed = 'move';
              -   e.dataTransfer.setData('text/html', this.innerHTML);
              -   this.classList.add('over');
              -   for (var i = 0; i < colsLength; i++)
              -   {
              -      cols[i].classList.add('start');
              -   };
              -};
              -function dragDropHandler(e) 
              -{
              -   /* Get data */
              -   dragElem.innerHTML = this.innerHTML;
              -   this.innerHTML = e.dataTransfer.getData('text/html');
              -   for (var i = 0; i < colsLength; i++)
              -   {
              -      cols[i].className = "puzzle-piece";
              -   };
              -   /* Check key */
              -   puzzleCheck();
              -};
              -
              -
            4. - -
            5. Check the completion of the puzzle by making a user key using a simple array, and comparing the user key against the puzzle key (correct answer): -
              -var puzzleKey =  ["01", "02", "03", "04", "05", "06"];
              -var puzzleArray = [];
              -
              -function puzzleCheck() 
              -{
              -   /* Initialize the user key */
              -   puzzleArray = [];
              -   /* Insert the keys in the array */
              -   for (var i = 0; i < colsLength; i++) 
              -   {
              -      puzzleArray.push(cols[i].children[0].getAttribute('src').substring(12, 14));
              -   };
              -   originKey = puzzleKey.join();
              -   userKey = puzzleArray.join();
              -
              -   if (originKey === userKey)
              -   {
              -      alert("Success !");
              -   };
              -};
              -
              -
            6. -
            -
          6. -
          -

          Figure: Drag and drop puzzle

          -

          Drag and drop puzzle

          -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/flexible_w.htm b/org.tizen.ui.guides/html/web/w3c/flexible_w.htm deleted file mode 100755 index 5bd3406..0000000 --- a/org.tizen.ui.guides/html/web/w3c/flexible_w.htm +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - - - - - - - CSS Flexible Box Layout Module: Adjusting the Layout - - - - - -
          -

          CSS Flexible Box Layout Module: Adjusting the Layout

          - -

          CSS attributes, such as float, display, and position, can be used to adjust and align the screen layout according to various resolutions. However, operating the layout accurately among changing screen sizes is difficult.

          - -

          Tizen supports the CSS Flexible Box Layout Module API that enables you to create an easily manageable flexible layout, which fluidly adjusts the layout according to viewport size changes. When you create and use a flexible box layout, the alignment method or object (flex item) size within a specific area (flex container) can be adjusted.

          -

          The main components of the flexible box layout include:

          -
            -
          • Flex container, which refers to flex or inline-flex DOM elements assigned by the display.

            You can use the flex container to assign a flex area and the flex items included in it. The flex container properties are used to assign the indication area and alignment method.

          • -
          • Flex item, which refers to the child nodes of the flex container. -

            The flex item changes its size fluidly according to the area of the flex container. You can define flex item properties to assign the sizes of the respective items and the alignment method.

          • -
          -

          Figure: Flexible box layout

          -

          Flexible box layout

          - -

          Using the Flex Container

          -

          To enhance the user experience of your application, you must learn how to assign size and alignment to the flex container:

          - -
            -
          1. Assign the area (flex container) where the flexible box layout is applied by using the display: flex property: -
            <style>
            -   .flex_container {display: -webkit-flex}
            -</style>
            -
            -<div class="flex_container">
            -   <div class="flex_item">A</div>
            -   <div class="flex_item">B</div>
            -   <div class="flex_item">C</div>
            -   <div class="flex_item">D</div>
            -<div>
            - -

            The child nodes within the assigned flex container become flex items.

            -
          2. -
          3. Define the necessary properties for the flex container to assign the alignment of the flex items within it:

            -
              -
            • flex-direction property sets the alignment direction of the flex items: -
                -
              • row: Align from left to right.
              • -
              • row-reverse: Align from right to left.
              • -
              • column: Align from top to bottom.
              • -
              • column-reverse: Align from bottom to top.
              • -
            • - -
            • flex-wrap property sets the line changing of the flex items: -
                -
              • nowrap: Reduces the size of the flex items without changing lines.
              • -
              • wrap: The flex items reaching beyond the flex container area are divided into multiple lines using the cross axis direction of the current writing mode.
              • -
              • wrap-reverse: The flex items reaching beyond the flex container area are divided into multiple lines using the opposite cross axis direction than in the wrap value.
              • -
            • - -
            • justify-content property sets the handling of gaps between the flex items on the main axis: -
                -
              • flex-start: Gathers the items at the alignment starting point.
              • -
              • flex-end: Gathers the items at the alignment finishing point.
              • -
              • center: Gathers the items in the center.
              • -
              • space-between: Aligns the start and end item at both ends, and creates equal gaps in between the rest of the items.
              • -
              • space-around: Creates equal gaps between all items.
              • -
              - - - - - - - - - -
              Note
              This property is similar to text-align, but the alignment direction and the starting point are based on the flex-direction and flex-wrap properties.
            • - -
            • align-content property sets the handling of gaps between the flex items on the cross axis. It has the same values as the justify-content property, and 1 additional value: -
                -
              • stretch: Extends the size of the flex items and aligns them without gaps.
              • -
            • -
            • align-items property sets the relative location and size between the flex items on the cross axis: -
                -
              • flex-start: Aligns the items vertically to the top.
              • -
              • flex-end: Aligns the items vertically to the bottom.
              • -
              • center: Aligns the items vertically to the middle.
              • -
              • baseline: Aligns the items vertically to the baseline.
              • -
              • stretch: Extends the height of the flex items and aligns them without gaps.
              • -
              - - - - - - - - - -
              Note
              If the flex-wrap property is set to wrap-reverse, the start and end points of the alignment are reversed.
          -

          The following figure shows examples of flex containers and how their flex items have been aligned.

          -

          Figure: Flex container properties (in mobile applications only)

          -

          Flex container properties (in mobile applications only)

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - -

          Using the Flex Items

          - -

          To enhance the user experience of your application, you must learn how to assign size and alignment to the flex items:

          - -
            -
          1. Assign the area (flex container) where the flexible box layout is applied, and define the flex items for it: -
            <style>
            -   .flex_container {display: -webkit-flex}
            -</style>
            -
            -<div class="flex_container">
            -   <div class="flex_item">A</div>
            -   <div class="flex_item">B</div>
            -   <div class="flex_item">C</div>
            -<div>
            -
          2. - -
          3. Define the necessary properties for the flex items:

            -
              -
            • align-self property is similar as the align-items property of the flex container. - - - - - - - - - -
              Note
              If both the align-self and align-items properties are used simultaneously, the align-items property is ignored.
            • - -
            • flex property is a shorthand expression defining the flex item size handling: -
                -
              • flex-grow: Sets whether the spaces between flex items are filled.
              • -
              • flex-shrink: Sets whether the width of the flex items is reduced according to the size of the flex container.
              • -
              • flex-basis: Sets the default width of the relevant flex items.
              • -
          -

          The following figure shows examples of how flex items can be placed and sized within a flex container.

          -

          Figure: Flex items (in mobile applications only)

          -

          Flex items (in mobile applications only)

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - -

          Creating a Flexible Layout with CSS3

          - -

          To enhance the user experience of your application, you must learn how to create flexible box layout:

          -
            -
          1. Define the HTML content for the flexible layout. In this example, create 2 articles areas, 1 for a text list and 1 for an icon list: -
            <div class="container">
            -   <article class="events">
            -      <h2>UPCOMING EVENTS</h2>
            -      <ul>
            -         <li>
            -            <div class="date"><span>APR</span><br> 15</div>
            -            <p class="title">
            -               Linux Foundation Collaboration Summit <span class="local">San Francisco, CA</span>
            -            </p>
            -         </li>
            -         <!--Other text items-->
            -      </ul>
            -   </article>
            -   <article class="schedule">
            -      <h2>SCHEDULE</h2>
            -      <div class="img_list">
            -         <img src="folder.png" alt="folder">
            -         <img src="alert.png" alt="alert">
            -         <!--Other icons-->
            -      </div>
            -   </article>
            -</div>
          2. - -
          3. Define styles to decorate the article areas. (The following figure applies to mobile applications only.) -
            <!--Border for the article areas-->
            -.container article > * {border: 1px solid #ccc;}
            -
            -<!--Font style for the article area titles-->
            -.container .events > h2, .container .schedule > h2 
            -{
            -   padding: 10px 20px;
            -   text-shadow: 1px 1px 2px #fff, -1px -1px 2px #000;
            -}
            -
            -<!--List styles-->
            -.container .events > ul, .container .schedule .img_list  
            -{
            -   height: 100%; 
            -   padding: 10px;
            -}
            -
            -<!--Text style for the text list item title-->
            -.container .events > ul > li .title 
            -{
            -   color: #51809e;
            -   text-shadow: 1px 1px 2px #000;
            -}
            -
            -<!--Text style for the text list item location info-->
            -.container .events > ul > li .title .local 
            -{
            -   text-indent: 10px;
            -   text-shadow: 0 0 0 #fff;
            -}
            -
            -<!--Styles for the text list item date box-->
            -.container .events > ul > li .date 
            -{
            -   text-align: center;
            -}
            -.container .events > ul > li .date 
            -{
            -   background-color: #ddd;
            -   border-radius: 10px;
            -   box-shadow: inset -2px -2px 4px rgba(0, 0, 0, .5);
            -}
            -.container .events > ul > li .date > span 
            -{
            -   background-color: #fff;
            -   border-radius: 5px;
            -}
            -

            Article areas with styles defined (in mobile applications only)

          4. - - -
          5. Define a flexible alignment for the article areas to support screen orientation changes and ensure that the content fills up the entire available screen area regardless of the orientation: -
              -
            1. Define the text list items and the icon list as flex containers using the display: -webkit-flex; property: -
                -
              • For the text list items, align them vertically in the middle, define a 0 margin at the top for the first item, and center-align the text for the date box.
              • -
              • For the icon list, align the icon list so that the first and last icon are placed at the ends and the gaps between the rest of the icons are equal.
              -

              (The following figure applies to mobile applications only.)

              -
              <!--Flexible alignment of text list-->
              -.container .events > ul > li 
              -{
              -   display: -webkit-flex;
              -   -webkit-align-items: center;
              -}
              -.container .events > ul > li: first-child 
              -{
              -   margin-top: 0;
              -}
              -
              -.container .events > ul > li .date 
              -{
              -   -webkit-flex: 0 0 20%;
              -   text-align: center;
              -}
              -
              -<!--Flexible alignment of icon list-->
              -.container .schedule .img_list 
              -{
              -   display: -webkit-flex;
              -   -webkit-justify-content: space-between;
              -}
              -

              Article areas with a flexible box layout defined (in mobile applications only)

            2. - - -
            3. Special consideration can be given for some screen sizes. The following example defines a specific layout for small screens (where the screen width is less than 390 pixels). (The following figure applies to mobile applications only.) -
              -@media screen and (min-width: 390px) 
              -{
              -   .container .schedule .img_list 
              -   {
              -      display: -webkit-flex;
              -      -webkit-flex-wrap: wrap;
              -      -webkit-justify-content: space-between;
              -      -webkit-align-content: space-around;
              -   }
              -
              -   .container {display: -webkit-flex;}
              -   .container > * {-webkit-align-content: center;}
              -   .container article {height: 250px;}
              -}
              -

              Article areas with a flexible box layout for small screens (in mobile applications only)

              -

              For more information on defining screen-size-specific rules, see Media Queries.

              -
          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/font_w.htm b/org.tizen.ui.guides/html/web/w3c/font_w.htm deleted file mode 100755 index 68537ab..0000000 --- a/org.tizen.ui.guides/html/web/w3c/font_w.htm +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - - - CSS Fonts Module Level 3: Manipulating Fonts - - - - - - -
          -

          CSS Fonts Module Level 3: Manipulating Fonts

          - -

          You can change the text fonts easily.

          - -

          The new text features in CSS Fonts Module Level 3 API include:

          -
            -
          • Font properties -

            You can use CSS font properties, such as font-style, font-weight, font-variant, font-size, and font-family, to modify the appearance of text.

          • -
          - - -

          Manipulating Fonts

          - -

          To enhance the user experience of your application, you must learn to handle fonts using CSS font properties:

          - -
            -
          1. Define the font-style property within a <style> element in the <head> section of the Web page to apply different font styles:

            - -
            -<head>
            -   <style>
            -      p:nth-child(1) em{font-style: normal}
            -      p:nth-child(2) em{font-style: italic}
            -      p:nth-child(3) em{font-style: oblique}
            -   </style>
            -</head>
            -<body>
            -   <p>font-style: <em>normal</em></p>
            -   <p>font-style: <em>italic</em></p>
            -   <p>font-style: <em>oblique</em></p>
            -</body>
            -
            - -
          2. - -
          3. Define the font-weight property, -which controls the weight of the text:

            - -
            -<head>
            -   <style>
            -      p:nth-child(1) {font-weight: normal}
            -      p:nth-child(2) {font-weight: bold}
            -      p:nth-child(3) {font-weight: 300}
            -      p:nth-child(4) {font-weight: 500}
            -      p:nth-child(5) {font-weight: 700}
            -   </style>
            -</head>
            -<body>
            -   <p>font-weight: <em>normal</em></p>
            -   <p>font-weight: <em>bold</em></p>
            -   <p>font-weight: <em>300</em></p>
            -   <p>font-weight: <em>500</em></p>
            -   <p>font-weight: <em>700</em></p>
            -</body>
            -
            - -
          4. - -
          5. Define the font-variant property to -change the font to, for example, use small capital letters: -
            -<head>
            -   <style>
            -      p:nth-child(1) {font-variant: normal}
            -      p:nth-child(2) {font-variant: small-caps}
            -   </style>
            -</head>
            -<body>
            -   <p>font-variant: <em>normal</em></p>
            -   <p>font-variant: <em>small-caps</em></p>
            -</body>
            -
            - -
          6. - -
          7. Define the font-size property, which controls the size of the font: -
            -<head>
            -   <style>
            -      p:nth-child(1) {font-size: 150%}
            -      p:nth-child(2) {font-size: 1.2em}
            -   </style>
            -</head>
            -<body>
            -   <p>font-size: <em>150%</em></p>
            -   <p>font-size: <em>1.2em</em></p>
            -</body>
            -</html>
            -
            -
          8. - -
          9. Define the line-height property, which controls the height of a text line: -
            -<head>
            -   <style>
            -      p:nth-child(1) {line-height: 1}
            -      p:nth-child(2) {line-height: 1.5}
            -      p:nth-child(3) {line-height: 5}
            -   </style>
            -</head>
            -<body>
            -   <p>line-height: <em>1</em></p>
            -   <p>line-height: <em>1.5</em></p>
            -   <p>line-height: <em>5</em></p>
            -</body>
            -
            - -
          10. - -
          11. Define the font-family property, which assigns a specific font or its representative to an element. The list order within the <style> element determines the property priority. -

            If the assigned font is not installed on the target, a different font is obtained based on the user system.

            -
            -<head>
            -   <style>
            -      p:nth-child(1) {font-family: serif}
            -      p:nth-child(2) {font-family: sans-serif}
            -      p:nth-child(3) {font-family: monospace}
            -      p:nth-child(4) {font-family: cursive}
            -      p:nth-child(5) {font-family: fantasy}
            -      p:nth-child(6) {font-family: 'Arial Black', sans-serif}
            -      p:nth-child(7) {font-family: Tahoma, sans-serif}
            -      p:nth-child(8) {font-family: Verdana, sans-serif}
            -      p:nth-child(9) {font-family: Arial, sans-serif}
            -   </style>
            -</head>
            -<body>
            -   <p>font-family: <em>serif</em></p>
            -   <p>font-family: <em>sans-serif</em></p>
            -   <p>font-family: <em>monospace</em></p>
            -   <p>font-family: <em>cursive</em></p>
            -   <p>font-family: <em>fantasy</em></p>
            -   <p>font-family: <em>'Arial Black', sans-serif</em></p>
            -   <p>font-family: <em>Tahoma, sans-serif</em></p>
            -   <p>font-family: <em>Verdana, sans-serif</em></p>
            -   <p>font-family: <em>Arial, sans-serif</em></p>
            -</body>
            -</html>
            -
            -
          12. -
          - - -

          The following figure shows examples of manipulating the text font properties.

          -

          Figure: Font properties (in mobile applications only)

          -

          Font properties (in mobile applications only)

          - - - - - - - - - - -
          Note
          For a complete list of CSS Fonts Module Level 3 font properties (in mobile or wearable applications) and their possible values, see the Property index.
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/frame_flattening_mw.htm b/org.tizen.ui.guides/html/web/w3c/frame_flattening_mw.htm deleted file mode 100755 index 2f5d3c9..0000000 --- a/org.tizen.ui.guides/html/web/w3c/frame_flattening_mw.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - Frame Flattening: Expanding Content According to Size - - - - - -
          -
          - -
          -
          -

          Mobile Web

          -
          - -

          Frame Flattening: Expanding Content According to Size

          - -

          In the Tizen WebKit, content placed within the <frame> and <iframe> tags is expanded automatically according to the content size. This enables users to view the whole content at once without scrolling.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          The Tizen WebKit supports this feature since scrolling through small subframes on small screen devices is a tedious task and, occasionally, causes confusion between scrolling subframes and scrolling the Web page itself.

          -

          To implement scrollable content in the Tizen WebKit, use the CSS overflow: scroll or webkit-overflow-scrolling: touch property instead of iframe.

          - - - -
          - -Go to top - - - - - - - - diff --git a/org.tizen.ui.guides/html/web/w3c/guides_w3c_w.htm b/org.tizen.ui.guides/html/web/w3c/guides_w3c_w.htm deleted file mode 100755 index 9083b94..0000000 --- a/org.tizen.ui.guides/html/web/w3c/guides_w3c_w.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - W3C - - - - - - -
          - -

          W3C

          - -

          The W3C specifications provide HTML and CSS, which are the core technologies for building Web pages and Web applications.

          - -

          To learn to use the W3C features in your application UI, see the following topics:

          - - - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/html5forms_w.htm b/org.tizen.ui.guides/html/web/w3c/html5forms_w.htm deleted file mode 100644 index b92cdda..0000000 --- a/org.tizen.ui.guides/html/web/w3c/html5forms_w.htm +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - - - HTML5 Forms: Managing User Input - - - - - -
          - -

          HTML5 Forms: Managing User Input

          - -

          The HTML5 forms provide a convenient way to create consistent screens in your application for accepting user input. In the past, the Web form allowed you to accept user input before transmitting it to a server. With HTML5, you can now improve the user experience without having to use JavaScript by adding simple features, for example, email validity checks and date pickers, and using more advanced functionality, such as security checks and input value pattern definitions.

          - -

          New HTML5 Elements

          -

          The following table lists the new elements available for your forms in HTML5. For a complete source code, see elements.html.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: New HTML5 elements
          ElementDescriptionExample
          datalist

          Defines a set of option elements that represent predefined options for other controls. The element is used together with the input element to predefine its value.

          -

          In Tizen, the value selected in the datalist element can be edited.

          -
          -<input type="text" list="search">
          -<datalist id="search">
          -   <option value="Tomato">Tomato</option>
          -   <option value="banana">banana</option>
          -   <option value="Watermelon">Watermelon</option>
          -</datalist>
          -
          -
          keygen

          Defines a control for generating a public-private key pair and for submitting the public key from that key pair. The element creates an encrypted key with the value of the name attribute, saves it in the user's computer and Web server, and activates the next procedure when the 2 values match.

          -
          -<label>user:<input type="text" name="user_name"></label>
          -<label>keygen:<keygen name="keygen"></label>
          -
          -
          meter

          Represents a scalar measurement within a known range (the distribution of the assigned range), or a fractional value.

          -
          -<meter value="75" min="0" max="100" low="60" high="80" optimum="81">
          -   75/100
          -</meter>
          -
          -
          output

          Represents the result of a calculation. The element generally shows the calculated result of the value that the user has entered, and is used within the form element.

          -
          -<fieldset onsubmit="return false"
          -          oninput="foobar.value = parseInt(foo.value) * parseInt(bar.value)">
          -   <input type="number" id="foo" name="foo"> *
          -   <input type="number" id="bar" name="bar"> =
          -   <output for="foo bar" name="foobar"></output>
          -</fieldset>
          -
          -
          progress

          Represents the progress of a task.

          -
          -<progress value="75" max="100">
          -   75/100
          -</progress>
          -
          - -

          New Input Element Types

          -

          The following table lists the new input element types available for your forms in HTML5. Many of the new elements activate a specific keyboard suitable for the type of value the user is expected to enter (for example, an email or URL). For a complete source code, see types.html.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: New input element types
          TypeDescriptionExample
          color

          Select an HSL color from the color picker. The value format is HEX (#0099ff).

          -
          -
          -<input type="color"
          -       value="#ff0000">
          -<input type="datetime"
          -       value="2012-12-12T03:30Z">
          -<input type="email"
          -       required>
          -<input type="number"
          -       step="3">
          -<input type="range"
          -       min="1" max="10">
          -<input type="tel">
          -<input type="url">
          -
          -
          date

          Enter a date with no time zone (yyyy-mm-dd).

          -
          datetime

          Enter a date and time with the (UTC) time zone (yyyy-mm-ddTtt:mmZ).

          - -
          datetime-local

          Enter a date and time with no time zone (yyyy-mm-ddTtt:mm).

          -
          email

          Enter an email address with the email keyboard.

          -

          If the required attribute is used, the system checks whether the input format is in line with the ABNF regular expression (1*(atext / ".") "@" ldh-str 1*("." ldh-str)).

          -
          month

          Enter a year and month with no time zone (yyyy-mm).

          -
          number

          Enter numbers with the number keyboard.

          -
          range

          Select a value from the slider.

          -
          search

          No specific functionality is defined for this element in the HTML5 specifications.

          -
          tel

          Enter a phone number with the number keyboard.

          -
          time

          Enter a time with no time zone (tt:mm:ss).

          -
          url

          Enter a URL with the URL keyboard.

          -
          week

          Enter a year and week with no time zone (yyyy-week).

          -
          - -

          New Input Element Attributes

          - -

          The following table lists the new input element attributes available for your forms in HTML5. For a complete source code, see attributes.html.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: New input element attributes
          AttributeDescriptionExample
          autocomplete

          Prefilling feature, which helps the users by, for example, prefilling the user's address based on earlier user input.

          -

          The text used by the user before (such as an input element) is listed in a datalist form. The attribute can be used in all form elements, and is activated if the value is "on" and deactivated if the value is "off".

          -
          -
          -<input type="range" min="1" max="10">
          -<input type="tel" pattern="[0-9]+" required>
          -<input placeholder="You know what to do, huh?">
          -<input type="number" step="3">
          -
          -
          min and max

          Allowed range of values for the element.

          -
          pattern

          Regular expression against which the control's value is checked.

          -

          The attribute can be used to check the validity of the form data. During service, a guide requiring the input format from the user is necessary.

          -
          placeholder

          Short hint intended to aid the user with the data entry.

          -

          The attribute can be used in the majority of form elements for various purposes, such as hint text or advertisement.

          -
          required

          Boolean attribute which, when specified, defines that the element is mandatory.

          -
          step

          Granularity expected of the value, limiting the allowed values.

          -
          - -

          Creating a Basic Login Form

          - -

          To create simple user input forms, you must learn to use the HTML5 features in Web forms:

          - -
            -
          1. Create a simple form where the user can enter their login details (email address and password):

            -
            -<form action="" method="">
            -   <label>email: <input type="text"></label>
            -   <label>password: <input type="password"></label>
            -    
            -   <input type="submit" value="Login">
            -</form>
            -
          2. -
          3. To check the validity of the entered email address automatically, add the required attribute to the input element with the email type:

            -
            -<label>email: <input type="email" required></label>
            -
          4. -
          5. Define the password field as mandatory by using the required attribute in that input element too:

            -
            -<label>password: <input type="password" required></label>
            -
          6. -
          7. Because a device has limited space on the screen, remove the field labels and replace them with hint texts using the placeholder attribute:

            -
            -<input type="email" placeholder="e-mail address" required>
            -<input type="password" placeholder="password" required>
            -
          - -

          The final form that checks the email validity and requires the mandatory password input is complete:

          -
          -<form action="" method="">
          -   <fieldset>
          -      <legend>Login</legend>
          -      <input type="email" placeholder="e-mail address" required>
          -      <input type="password" placeholder="password" required>
          -   </fieldset>
          -    
          -   <input type="submit" value="Login">
          -</form>
          -
          - -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Creating an Advanced Login Form

          - -

          To create advanced user input forms, you must learn to use the HTML5 features in Web forms:

          - -
            -
          1. Create a login form that checks the email validity and requires the mandatory password input:

            -
            -<form action="" method="">
            -   <fieldset>
            -      <legend>Login</legend>
            -      <input type="email" placeholder="e-mail address" required>
            -      <input type="password" placeholder="password" required>
            -   </fieldset>
            -    
            -   <input type="submit" value="Login">
            -</form>
            -
          2. - -
          3. When the form page is loaded on the screen, put the focus automatically to the email field by using the autofocus attribute:

            -
            -<input type="email" placeholder="e-mail address" required autofocus>
            -
          4. - -
          5. -

            To spare the user from filling in information that they have given previously, use the autocomplete attribute, which shows the previously successfully inserted entries in a datalist, from which the user can select and use them.

            -

            You can apply the autocomplete attribute to a specific field by adding it to the appropriate input element. If you add it to the form element, it applies to all child elements within the form.

            - -
            -<form action="" method="" autocomplete="on">
            -
            -
          6. -
          7. In general, apply the autocomplete attribute to the form element, and then separately set it to off for those fields that must not use it.

            -

            In the following example, the password field must not use autocomplete, to prevent unauthorized access by any user.

            -
            -<input type="password" placeholder="password" required autocomplete="off">
            -
            -
          8. -
          9. Protect the password with private and public key pair using the keygen element.

            -

            The element is used to transform the data sent from the connected form to a pair of encrypted keys using the RSA (Rivest Shamir Adleman) method. When the input data is sent from the form, the private key is saved in the local computer, and the public key is delivered to the server. Only if the keys match, the login process proceeds forwards.

            - -
            -<keygen name="keyvalue">
            -
          10. - -
          11. Use the pattern attribute to perform a validity check that ensures that the password field value matches the given regular expression. The required attribute is used to ensure that the field value must be entered and then the validity check can be performed.

            -

            In the following example, the password only accepts numbers and letters of the alphabet. If an invalid value is entered, the login cannot proceed.

            - -
            <input type="password" placeholder="password" required
            -       pattern="[a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z]+[a-zA-Z0-9]*" 
            -       autocomplete="off">
            -
          12. -
          13. Define the required length of the password within the pattern attribute.

            -

            In the following example, the password must be 6 to 12 characters long.

            - -
            -<input type="password" placeholder="password" required 
            -       pattern="(?=([a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z]+[a-zA-Z0-9]*)).{6,12}" 
            -       autocomplete="off">
            -
          14. -
          - -

          The final form with autofocus and autocomplete features, strengthened security, and password value requirements is complete:

          - -
          -<form action="" method="" autocomplete="on">
          -   <fieldset>
          -      <legend>Login</legend>
          -      <input type="email" placeholder="e-mail address" required autofocus>
          -      <input type="password" placeholder="password" required 
          -             pattern="(?=([a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z]+[a-zA-Z0-9]*)).{6,12}" 
          -             autocomplete="off">
          -   </fieldset>
          -
          -   <keygen name="keyvalue">
          -    
          -   <input type="submit" value="Login">
          -</form>
          -
          - - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/html_priority_w.htm b/org.tizen.ui.guides/html/web/w3c/html_priority_w.htm deleted file mode 100755 index 4714abf..0000000 --- a/org.tizen.ui.guides/html/web/w3c/html_priority_w.htm +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - - - - - - HTML Priorities: Understanding HTML Behavior - - - - - -
          - -

          HTML Priorities: Understanding HTML Behavior

          - -

          The HTML markup is not as important as before, because JavaScript APIs can be used to create various functionalities. For example, graphics APIs (in mobile or wearable applications) can be used for making games, media APIs (in mobile or wearable applications) for creating video chats, and communication APIs (in mobile or wearable applications) for various types of messaging. However, HTML remains the basis of Web applications, and it is useful to be familiar with its behavior.

          - -

          The structure of the HTML document can be classified into DOCTYPE and HTML DOM (Document Object Model). When an HTML document is loaded, the browser renders the contents in its screen as follows:

          -
            -
          1. HTML is parsed referring to the rules defined in the <!DOCTYPE> element.
          2. -
          3. HTML DOM tree is established.
          4. -
          5. DOM elements, including references to JavaScript, are arranged based on the information defined in the head element. This is called rendering.
          6. -
          7. The elements are painted on the screen based on CSS rules.
          8. -
          - -

          <!DOCTYPE> Element

          - -

          The <!DOCTYPE> element informs the browser of the HTML version and which rules it must follow. It is not a composition element of the HTML.

          - -

          The browser, based on the version defined in the <!DOCTYPE> element and DTD (Document Type Definition), decides how to handle the HTML before interpreting it. Therefore, the <!DOCTYPE> element must be declared at the beginning of an HTML document.

          - -
          <!--HTML5-->
          -<!DOCTYPE html>
          -
          -<!--Prior to HTML5-->
          -<!DOCTYPE html PUBLIC "{HTML Version Information}" "{DTD (Document Type Definition) file link defined by Rule in HTML DOM}">
          -
          - -

          HTML DOM Tree

          - -

          HTML DOM is a structured model to control Web elements. It is an official W3C standard to express the document regardless of platforms or languages, and the foundation of the HTML5 APIs.

          - -

          The <html> element is the top-level element of the HTML DOM tree that wraps the entire document, and it has the <head> and <body> elements as child nodes:

          - -
          <!DOCTYPE html>
          -<html>
          -   <head>
          -      <!--Content-->
          -   </head>
          -   <body>
          -      <!--Content-->
          -   </body>
          -</html>
          - -

          <head> element

          - -

          The <head> element contains the information that the browser refers to when rendering the body element to interpret information, such as the title of HTML document, CSS, JavaScript, and favicon:

          - -
          <!DOCTYPE html>
          -<html>
          -   <head>
          -      <meta charset="utf-8" />
          -      <title> Tizen (in mobile applications) or Tizen Wearable (in wearable applications) </title>
          -      <link rel="stylesheet" href="css/style.css" />
          -      <script src="/common/js/ui.js"></script>
          -   </head>
          -   <body>
          -      <!--Content-->
          -   </body>
          -</html>
          - -

          The <head> contains the following subelements:

          - -
            -
          • <title>: Defines the title of the document.
          • -
          • <meta>: Defines information, such as encoding, creator, and keywords of the document. - - - - - - - - - - -
            Note
            The viewport element, which sets the screen area, is included in the meta information.
          • -
          • <style>, <link>: Sets the styles of the document.
          • -
          • <script>, <noscript>: Adds functions to the document.
          • -
          - -

          <body> element

          - -

          The <body> element defines the area displaying content on the browser screen:

          - -
          <!DOCTYPE html>
          -<html>
          -   <head>
          -      <!--Content-->
          -   </head>
          -   <body>
          -      <section id="tizen_wrap">
          -         <header>
          -            <h1>Tizen Web App (in mobile applications) or Tizen Wearable Wep App (in wearable applications)</h1>
          -         </header>
          -         <section id="contents">
          -            <!--Content-->
          -         </section>
          -         <footer>
          -            <p>&copy; All rights reserved.</p>
          -         </footer>
          -      </section>
          -   </body>
          -</html>
          - -

          CSS Rule Priorities

          -

          The basic rule of HTML, CSS, and JavaScript is that the code is applied from the top to the bottom of the document. Sometimes the lack of understanding of the CSS rule priorities can cause a result you do not expect.

          -

          The following figure illustrates this problem in mobile applications by applying a font color to a black background.

          - -

          Figure: Expected and actual result of applying a font color (in mobile applications only)

          -

          Expected and actual result of applying a font color (in mobile applications only)

          - -

          Basic CSS Rules

          - -

          When creating a CSS document, the following rules apply:

          - -
            -
          • When more than 1 overlapping styles are applied to the same element, only the last style is visible: - -
            p {color: red}
            -p {color: blue}
            -<!--Blue color is applied-->
            -
          • -
          • The style applied in the parent node at the DOM tree is inherited. For more information, see W3C inheritance documentation. -
          • -
          • The style that has the highest CSS specificity is applied. The specificity of different elements is defined as follows: -
              -
            • ID attribute = 100
            • -
            • Class attribute = 10
            • -
            • Element = 1
            • -
            - -
            <body>
            -   <p id="target" class="target">Hello World</p>
            -</body>
            -
            -<style>
            -   p#target {color: black} /* Specificity: 101 */
            -   p#target {color: red} /* Specificity: 101 */
            -   p.target {color: blue} /* Specificity: 11 */
            -   p {color: tomato} /* Specificity: 1 */
            -</style>
            -<!--Red color is applied-->
            -
          • -
          • When the !important attribute is used, it has the highest priority: -
            <body>
            -   <p id="target" class="target">Hello World</p>
            -</body>
            -
            -<style>
            -   p#target {color: black !important}
            -   p#target {color: red}
            -   p.target {color: blue}
            -   p {color: tomato}
            -</style>
            -<!--Black color is applied-->
            -
          • -
          - -

          Keeping these rules in mind, you can use any of the following ways to achieve the expected result illustrated in the figure above:

          -
          .contents {color: #999 !important;}
          -
          -section.contents {color: #999;}
          -
          -body .contents {color: #999;}
          -
          -#container > .contents {color: #999;}
          -
          - -

          Using CSS with HTML

          - -

          There are various ways to connect CSS with HTML. Creating a separate CSS file and managing it separately is convenient when it comes to applying changes in the future. The file is connected to the HTML file using a <link> tag in the <head> element.

          - -

          In the following example, the applied order of the CSS elements is as follows:

          -
            -
          1. <link> tag in the <head> element
          2. -
          3. <style> tag in the <head> element
          4. -
          5. @import attribute in the CSS area
          6. -
          7. style attribute in a HTML element
          8. -
          - -
          <!DOCTYPE html>
          -<html>
          -   <head>
          -      <!--Link in head-->
          -      <link rel="stylesheet" href="css/style.css"/>
          -
          -      <!--Style tag in head-->
          -      <style>
          -         p {color: tomato}
          -      </style>
          -
          -      <!--@import in CSS area-->
          -      <style>
          -         @import url("css/style.css");
          -      </style>
          -   </head>
          -
          -   <body>
          -      <!--Style attribute in HTML element-->
          -      <p style="color: red">Hello World</p>
          -   </body>
          -</html>
          -
          -

          However, the priority order of the elements is as follows:

          -
            -
          1. style attribute in a HTML element
          2. -
          3. <style> tag in the <head> element
          4. -
          5. @import attribute in the CSS area
          6. -
          7. <link> tag in the <head> element
          8. -
          - -

          The style attribute in the HTML element has the highest priority after the !important attribute.

          - -

          Using the order above, if all other color styles are applied to <p> elements, the style attribute is used to apply the red color that has been directly defined in the HTML. This rule differs from the CSS specificity rules.

          - -

          Generally, when the @import attribute is used, connect to the top of CSS file that has been linked externally, as illustrated in the figure below. If the attribute is applied in the middle of the CSS file, it is difficult to know the point where CSS has been applied, and to find the file connected to the source in the future. Therefore, group the CSS file at the top.

          - - - - - - - - - - -
          Note
          Using the @import attribute gives the same result as connecting an external file, but it does not function correctly in older browsers (IE 5.5 and below).
          -

          Figure: Using the @import attribute

          -

          Using the @import attribute

          - -

          The markup in the corresponding files is as follows:

          -
            -
          • In the HTML code: -
            <head>
            -   <link rel="stylesheet" href="css/style.css"/>
            -</head>
            -
          • -
          • In the style.css file: -
            @import url("priorities1.css");
            -
            -p: after {content: " : linked in head"}
            -
            -

            Figure: Result of linking the @import attribute

            -

            Result of linking the @import attribute

          • -
          • In the priorities1.css file: -
            p: after {content: " : Using @import in CSS area"}
            -
            -

            Figure: Result of using the @import attribute in the CSS area

            -

            Result of using the @import attribute in the CSS area

          • -
          - -

          JavaScript Behavior

          -

          With the advent of HTML5, numerous powerful HTML5 APIs have been introduced. Since the usage of JavaScript has increased, it has become important to use it accurately in accordance with optimized JavaScript performance.

          - -

          JavaScript used in Web applications can be divided into the core, ECMAScript, and DOM, which all manipulate HTML. ECMAScript is executed when a method is called, or it can be executed when an event is fired within a HTML document through a linkage with DOM.

          - -

          Using JavaScript with HTML

          -

          Used with HTML, JavaScript works as follows:

          -
            -
          1. During HTML parsing, the content of the <script> tag is parsed to JavaScript Interpreter.
          2. -
          3. The Interpreter parses the received script code.
          4. -
          5. Requests that need not be handled immediately are suspended.
          6. -
          7. The handled result is passed over to the browser, which continues to parse HTML.
          8. -
          - -

          The following example shows how you can use JavaScript with HTML either by linking to a JavaScript file, or embedding it directly in the HTML code:

          -
          /* Linking from HTML */
          -<script src="js/main.js"></script>
          -
          -/* Direct use in HTML */
          -<script>
          -   var obj = document.querySelector(".animated");
          -    
          -   function animate() 
          -   {
          -      /* Execute */
          -   };
          -    
          -   /* Call the animation function when the event is fired */
          -   webkitRequestAnimationFrame(animate);  
          -</script>
          -
          -
          -

          Both ways described above give the same result in behavior. However, the position of the JavaScript code affects the order in which the methods are called.

          - - - - - - - - - -
          Note
          Previously, adding JavaScript code within head tag was recommended because it is easy to maintain. Currently, adding it to the end of the body and executing it after parsing the HTML document is common.
          - -

          JavaScript Events

          - -

          JavaScript generally calls a method when a specific event is fired. More than 70 types of events, such as onload and onclick are available.

          - -

          The following example shows the use of a simple event:

          - -
          <!--HTML-->
          -<body onload="touchEventHandler()">
          -
          -<script>
          -   /* JavaScript */
          -   /* Directly assigning */  
          -   window.onload = touchEventHandler; /* Assigns the name of the subject method */
          -    
          -   /* Event listener (W3C standard) */
          -   document.addEventListener("touchstart", touchEventHandler, false);
          -</script>
          -

          Prefer using W3C standard event listener methods. The inline JavaScript code applied directly to an HTML tag is difficult to maintain. Assigning a method directly to an event is also difficult when passing parameters, as the method needs to be assigned for every event.

          - -

          JavaScript Priorities

          - -

          The rendering order of JavaScript code is based on the following rules:

          -
            -
          • JavaScript within the <head> element is temporarily saved, but not handled.
          • -
          • JavaScript within the <body> element is immediately handled when it is parsed.
          • -
          • When the temporarily saved JavaScript content is executed, the <head> element content is rendered first, and the <body> element content after it.
          • -
          - - -

          Using JavaScript Code within HTML

          - -

          To provide users with JavaScript-based features, you must learn to use JavaScript code within an HTML document:

          - -
            -
          • To use JavaScript code in the <head> element, place the relevant JavaScript content in a <script> tag: -
            -<head>
            -   <script src="js/jquery_1.9.0_min.js"></script>
            -   <script>       
            -      window.onload = function() 
            -      {
            -         testLog('head onload');
            -      };
            -
            -      $(document).ready(function() 
            -      {
            -         testLog('head ready');
            -      });
            -   </script>
            -</head>
            - -

            The JavaScript code within the <head> element is sent to Interpreter. As there are no methods to be handled immediately, its execution is suspended.

            -
          • -
          • To use JavaScript code in the <body> element, place the relevant JavaScript content in a <script> tag: -
            -<body>
            -   <script src="js/jquery_1.9.0_min.js"></script>
            -   <script>
            -      function testLog(txt) 
            -      {
            -         var logText = document.querySelector('.log');
            -         logText.innerHTML += '<li>JavaScript in HTML ' + txt + '</li>';
            -      };
            -    
            -      window.onload = function() 
            -      {
            -         testLog('body onload');
            -      };
            -
            -      $(document).ready(function() 
            -      {
            -         testLog('body ready');
            -      });
            -
            -      testLog('body');
            -
            -      (function() 
            -      {
            -         testLog('body anonymous function');
            -      }();
            -   </script>
            -</body>
            -
            -

            The JavaScript code within the <body> element is sent to Interpreter. The anonymous method is immediately executed, and the HTML DOM structure is set up. The methods in the $(document).ready method and in the onload event are executed in the stored order.

            -
          - - - - - - - - - - - -
          Note
          jQuery has to be called from both the <head> and <body> elements. The logText variable has to be called from the <body> element. The method connected to the onload event in the <head> element is not executed.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/media_query_w.htm b/org.tizen.ui.guides/html/web/w3c/media_query_w.htm deleted file mode 100755 index 64dd6e0..0000000 --- a/org.tizen.ui.guides/html/web/w3c/media_query_w.htm +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - Media Queries: Labeling Output Devices in Style Sheets - - - - - -
          -

          Media Queries: Labeling Output Devices in Style Sheets

          - -

          Media queries allow you to apply the CSS differently according to the media type (type of device) and media features (viewport status). Previously, you were able to use the media type only and create Web services with fixed layouts. However, smart phones, tablets, and other devices with various resolutions require a liquid layout. HTML5 now makes various characteristics and conditional defining possible, and can be used to implement responsive Web design (RWD), which is a liquid layout that mainly reacts according to the device resolution.

          - -

          You can use media queries in 3 ways:

          - -
            -
          • In CSS -

            You can define attribute values depending on given conditions:

            -
            @media only screen and (max-width: 480px) {styles}
            -
            - - - - - - - - - -
            Note
            This approach is popular since it can reduce style overlapping; however, if all the styles are applied to 1 CSS, the maintenance work efficiency decreases.
            -
          • -
          • In an @import rule in CSS -

            You can import from CSS a file that matches the condition:

            -
            @import url(example.css) not screen and (min-width: 480px)
            -
            -
          • -
          • In HTML -

            You can directly import the CSS file that matches the condition:

            -
            <link rel="stylesheet" media="all and (max-width: 480px)" href="example.css">
            - - - - - - - - - -
            Note
            The disadvantage of this approach is that every time the condition is expanded, the HTML file must be edited. However, since this approach only imports the CSS files that match the condition, the file transmission amount can be reduced.
            -
          • -
          - -

          For more information on the CSS priorities when different media queries are used, see Media Query Priorities.

          - -

          Media Query Conditions

          - -

          You can define the following conditions for the media queries:

          - -
            -
          • Combination and relevancy -

            You can combine multiple conditions into 1 Boolean query with the and operator. To define a negative condition (something not being relevant), use the not operator.

            -
            @media not screen and (min-width: 320px), screen and (max-width: 480px) 
            -{
            -   .example: after {content: "width: 320px ~ 480px"}
            -}
            -
            -
          • -
          • Viewport width -

            You can define the query to match to a specific viewport width range using the min-width and max-width attributes.

            -
            @media all and (min-width: 320px) and (max-width: 480px) 
            -{
            -   .example: after {content: "width: 320px ~ 480px"}
            -}
            -
            -
          • -
          • Device and viewport height -

            The height attribute refers to restoring the viewport's height, and the device-height attribute refers to restoring the resolution set in the device.

            -

            The same difference applies to the width and aspect-ratio attributes, which can assign 'device-'.

            -
            @media screen and (min-device-height: 700px) 
            -{
            -   .example: after {content: "min-device-height"}
            -}
            -@media screen and (min-height: 550px) 
            -{
            -   .example: after {content: "min-height"}
            -}
            -
            -

            In the above example, a device with the width-height resolution of 480/720 has the {content: "min-height"} rule applied as a priority in a portrait screen, but the {content "min-device-height"} rule applied in a landscape screen.

            - -
          • -
          • Device aspect ratio -

            You can use the device-aspect-ratio attribute to check the width-length ratio (aspect ratio) of the printing device.

            -
            @media all and (device-aspect-ratio: 9/16) and (orientation: portrait),  
            -       all and (device-aspect-ratio: 2/3) and (orientation: portrait) 
            -{
            -   .example: after {content: "aspect-ratio, portrait"}
            -}
            -
            - - - - - - - - - -
            Note
            The device aspect ratio is a reliable way to distinguish the portrait and landscape modes of a smart phone. However, because the aspect ratio of all the devices has to be specified, a precise rule is hard to define. (Currently wildly used screen ratios are 15:9, 16:10, 16:9, 3:2, and 4:3, but devices with other screen ratios may be added in the future.)
            -
          • -
          - -

          Media Query Priorities

          - -

          When multiple media queries and conditions are defined, CSS is applied with the following priorities:

          -
            -
          • In case of the CSS reiteration declaration, the CSS that has been declared last is applied.
          • -
          • In case of specificity, the CSS with the highest specificity is applied. -

            The specificity is calculated as follows:

            • id attribute = 100
            • -
            • class attribute = 10
            • -
            • element = 1
            -

            Selectors, such as section#content > .title p, carry the specificity of 112.

          • -
          • In case of user override, the user CSS is applied instead of the creator CSS.
          • -
          • CSS is applied first based on the conditions in the @import rule, then based on the conditions in CSS, and finally based on the conditions in HTML.

          • -
          • In media queries, regardless of CSS priority, CSS which has not been imported still exists based on the conditions.

          • -
          - -

          To apply media query, consider an example with the following files:

          -
          -<!--example.html-->
          -<link rel="stylesheet" media="all and (max-width: 768px)" href="c.css">
          -<link rel="stylesheet" media="all and (max-width: 768px)" href="a.css">
          -<link rel="stylesheet" media="all and (min-width: 768px)" href="b.css">
          -<style>
          -   @media all and (max-width: 400px) 
          -   {
          -      .example: after {content: "In HTML head"}
          -   }
          -</style>
          -
          -<!--a.css-->
          -body {background-color: #ccc}
          -
          -@media screen and (max-width: 480px) 
          -{
          -   .example: after {content:"a.css : width: ~ 480px"}
          -}
          -@media screen and (min-width: 480px) and (max-width: 768px) 
          -{
          -   .example: after {content: "a.css : width: 480px ~ 768px"}
          -}
          -
          -<!--b.css-->
          -@import url("c.css");
          -
          -body {background-color: #333; color: #fff}
          -
          -@media screen and (min-width: 768px) and (max-width: 1024px) 
          -{
          -   .example: after {content: "b.css : width: 768px ~ 1024px"}
          -}
          -
          -<!--c.css-->
          -body {background-color: tomato}
          -
          -@media screen and (min-width: 768px) and (max-width: 1024px) 
          -{
          -   .example: after {content: "c.css : width: 768px ~ 1024px"}
          -}
          -@media screen and (min-width: 1024px) and (max-width: 1280px) 
          -{
          -   .example: after {content: "c.css : width: 1024px ~ 1280px"}
          -}
          -
          - -

          The CSS is applied based on the viewport:

          -
            -
          • If the viewport is 320 px: -
              -
            • The a.css file is applied (based on content: "a.css : width: ~ 480px").
            • -
            • The c.css and b.css files are not imported.
            • -
            • CSS is applied instead of the HTML <head> (the a.css file has higher priority than content: "In HTML head").
            • -
          • -
          • If the viewport is 700 px: -
            • The a.css file is applied (based on content: "a.css : width: 480px ~ 768px").

            • -
            • The c.css and b.css files are not imported.
          • -
          • If the viewport is 900 px: -
              -
            • The b.css file is imported.
            • -
            • c.css is applied (based on content: "c.css : width: 768px ~ 1024px").
            • -
            • The a.css file is not imported.
            • -
            • The b.css file is applied (based on content: "b.css : width: 768px ~ 1024px").
            • -
          • -
          - - -

          Creating a Liquid Layout

          -

          To enhance the user experience of your application, you must learn to define media queries to determine the styles to be used in the Web document. This example creates a simple Web document with a liquid layout that organically changes according to the device resolution to show the optimized layout on both portrait and landscape modes.

          - - -
            -
          1. Define a page with title and content elements: -
            -<header>
            -   <h1>Media queries tutorial</h1>
            -   <h1><img src="logo.png" alt="Tizen"></h1>
            -</header>
            -<div class="container">
            -   <section class="contents">
            -      <h2>Section Title</h2>
            -      <p class="desc">
            -         The quick brown fox jumps over a lazy dog.  The quick brown...
            -      </p>
            -   </section>
            -   <aside>
            -      Aside
            -   </aside>
            -</div>
            -
          2. -
          3. Define basic styles for the page, using a flexible box (in mobile or wearable applications) and multi-column (in mobile applications only) layout with 2 columns. (The following figure applies to mobile applications only.) -
            -.container 
            -{
            -   display: -webkit-flex;
            -}
            -.container aside 
            -{
            -   -webkit-flex: 1 0 20%;
            -}
            -.contents 
            -{
            -   -webkit-columns: 5em 3;
            -   -webkit-column-rule: 1px solid #999;
            -   -webkit-column-gap: 2em;
            -   -webkit-flex: 1 1 auto;
            -}
            -.contents h2 
            -{
            -   -webkit-column-span: all;
            -}
            -
            - -

            Fixed layout example (in mobile applications only)

            -

            The page is easy to view as long as the screen width is about 600 px; however, in a smaller screen below 400 px, the legibility rapidly decreases. You can edit the layout by reducing the number of columns to 1 and moving the Aside area at the bottom of the screen, but those changes then decrease legibility on a wider screen.

            - -
          4. -
          5. -

            To solve the problem, use a media query to define a liquid layout that changes according to the screen resolution:

            - -
            -@media all and (max-width: 480px) and (orientation: portrait) 
            -{
            -   .contents {-webkit-columns: 1;}
            -}
            -@media all and (min-width: 480px) and (max-width: 768px) 
            -{
            -   .contents {-webkit-columns: 2;}
            -   .container {display: -webkit-flex;}
            -}
            -
            -

            With the above media query, the normal resolution has 2 columns (shown on the right in the figure), while in a smaller resolution in a portrait mode only 1 column is used (shown on the left). (The following figure applies to mobile applications only.)

            -

            Liquid layout example (in mobile applications only)

            - -
          6. -
          7. If you need to define specific styles for a certain resolution range, simply add more media queries. However, too many conditions make the maintenance harder, so carefully consider what kind of resolution ranges you need. -

            - -

            The following conditions are generally used and cover all possibilities up to a Web browser in a PC:

            -
            -<!--Portrait mode of a smart phone-->
            -@media screen and (max-width: 480px) and (orientation: portrait) {<!--Specific layout-->}
            -
            -<!--Landscape mode of a smart phone and a small tablet-->
            -@media screen and (min-width: 480px) and (max-width: 768px) {<!--Specific layout-->}
            -
            -<!--Tablet and a small laptop-->
            -@media screen and (min-width: 768px) and (max-width: 1024px) {<!--Specific layout-->}
            -
            -<!--PC browser-->
            -@media screen and (min-width: 1024px) {<!--Specific layout-->}
            -@media print {<!--Specific layout-->}
            -
          8. - -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/multi_mw.htm b/org.tizen.ui.guides/html/web/w3c/multi_mw.htm deleted file mode 100755 index 798e73d..0000000 --- a/org.tizen.ui.guides/html/web/w3c/multi_mw.htm +++ /dev/null @@ -1,620 +0,0 @@ - - - - - - - - - - - - - CSS Multi-column Layout Module: Creating Multi-column Layouts - - - - - -
          -

          CSS Multi-column Layout Module: Creating Multi-column Layouts

          - - -

          You can arrange the screen content into columns. Using the CSS column- properties, the content elements can flow between columns when the column height or number changes. You can use the properties alone to create a basic layout, or add JavaScript code to make the layout dynamic.

          - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          You can manage the following column-related features:

          - - - - - - - - - - - -
          Note
          Up to Tizen SDK version 2.2, most CSS properties and values used in Tizen required the -webkit- prefix. To ensure future compatibility, these properties can now be used with or without the prefix.
          - -

          Setting the Column Number and Width

          - -

          When the layout is set to a constant number of columns using the column-count (or -webkit-column-count) property, the column width is set to fill the available horizontal space.

          -

          In the following code snippet and figure, the column number is set to 4. As a result, on a 480 x 800 display (shown on the top), the column width is 116 px, whereas on a 720 x 1280 display (shown on the bottom), the column with is 143 px.

          -

          The following code snippet demonstrates how to use the column-count property. For a complete source code, see multi_column_column_count/renamed_index.html.

          -
          -article
          -{
          -   column-count: 4;
          -   -webkit-column-count: 4;
          -   margin: 10px;
          -}
          -
          - -

          Figure: 4 columns on different resolution displays

          -

          4 columns on different resolution displays

          - -

          The column-width (or -webkit-column-width) property sets the base column width.

          -

          In the following code snippet and figure, the column width is set to 153 px, but the effective column width is 288 px for a 480 x 800 display (shown on the left) and 154 px for a 720 x 1280 display (shown on the right). The parameter sets the column to at least the defined width, but not wider than the available display space or twice the defined width. The actual column width is calculated using a pseudo-algorithm.

          -

          The code snippet shows how the multi-column layout is implemented when the vertical space is limited. If there is more content than fits the available space, the next column is set outside the available space. Using the overflow: scroll property, the column can be scrolled horizontally.

          -

          The following code snippet demonstrates how to use the column-width property. For a complete source code, see multi_column_column_width/renamed_index.html.

          -
          -article
          -{
          -   width: 90vw;
          -   height: 90vh;
          -   column-width: 153px;
          -   -webkit-column-width: 153px;
          -   margin: 5vw;
          -   background: #c3c8ca;
          -   overflow: scroll;
          -}
          -
          - -

          Figure: Column width 153 px on different resolution displays

          -

          Column width 153 px on different resolution displays

          - -

          Setting the Column Gap

          -

          The column-gap (or -webkit-column-gap) property sets the distance between columns. The property affects the column width, as the column width, gap, and margins all take available space. In the following code snippet and figure, the column gap is set to 17 px.

          -

          The following code snippet demonstrates how to use the column-gap property. For a complete source code, see multi_column_column_gap/renamed_index.html.

          -
          -article 
          -{
          -   height: 303px;
          -   column-width: 153px;
          -   -webkit-column-width: 153px;
          -   column-gap: 17px;
          -   -webkit-column-gap: 17px;
          -   margin: 7px;
          -   padding: 3px;
          -   background: #c3c8ca;
          -}
          -
          - -

          Figure: Column gap

          -

          Column gap

          - -

          Setting the Column Rule

          -

          The column-rule (or -webkit-column-rule) property displays a vertical line in the middle of the column gap.

          -

          The rule has analogical parameters, such as width, line style, and color, but its size is not included in the available space, and it is a drawing similar to the background.

          - -

          Rules are only displayed in the content area. If the padding property is set in the same element, the rule appears shorter than the background. In the following code snippet and figure, the rule width is set to 5 px.

          -

          The following code snippet demonstrates how to use the column-rule property. For a complete source code, see multi_column_column_rule/renamed_index.html.

          -
          article 
          -{
          -   -webkit-column-rule-width: 5px;
          -   -webkit-column-rule-color: rgb(92, 203, 246);
          -   -webkit-column-rule-style: solid;
          -}
          -
          - -

          Figure: Column rule

          -

          Column rule

          - - - - - - - - - - -
          Note
          In Tizen SDK version 2.2, to avoid displaying the rules incorrectly, do not use the column-rule (or -webkit-column-rule) property with horizontal scrolling of the columns.
          - -

          Setting the Column Span

          -

          By default, all elements within the columns are no wider than the column width. The column-span (or -webkit-column-span) property can be used to display content across all columns.

          -

          When using this property with column elements which have the column-count or column-width property set, the following restrictions apply:

          -
            -
          • Column element height is not used and elements in columns take more vertical space than is set in height.
          • -
          • If the column element has the overflow property set to hidden, the column-span property is ignored.
          • -
          • An element using the column-span property does not have to be a direct child of the column element.
          • -
          -

          In the figure below, the blue arrow shows the order of the column elements. In the upper header area, the column-span property is not used, and in the lower header area, the column-span property is set to all, as in the following code snippet.

          -

          The following code snippet demonstrates how to use the column-span property. For a complete source code, see multi_column_column_span/renamed_index.html.

          -
          -article.left header 
          -{
          -   column-span: all;
          -   -webkit-column-span: all;
          -}
          -
          - -

          Figure: Column span

          -

          Column span

          - -

          Setting the Column Break

          -

          By default, column elements are broken to balance column height. The break-before (or -webkit-column-break-before), break-after (or -webkit-column-break-after), and break-inside (or -webkit-column-break-inside) properties can be used to define that an element cannot be broken between columns (set to avoid), or that an element must begin or end within a given column.

          - -

          The following code snippet and figure illustrate the use of the break- property. In the upper header area, the break- property is not used, and in the lower header area, the break-before property is set to always.

          -

          The following code snippet demonstrates how to use the column-break property. For a complete source code, see multi_column_column_break/renamed_index.html.

          -
          -article.lower section
          -{
          -   break-before: always;
          -   -webkit-column-break-before: always;
          -}
          -
          - -

          Figure: Column break

          -

          Column break

          - -

          Creating a Basic Layout

          - -

          To enhance the user experience of your application by providing a consistent behavior across a wide range of displays with different resolution and orientation, you must learn to create a basic layout using CSS:

          - -
            -
          1. -

            Create the HTML layout, defining separate sections for the column content and including an image file:

            -
            -<body>
            -   <article id="article">
            -      <section>
            -         <header>
            -            <h1>Section 1</h1>
            -         </header>
            -         <p>Lorem ipsum dolor (...), id.</p>
            -         <img src="images/pinwheel_green.png" alt="">
            -         <p>Maecenas at (...)tortor.</p>
            -      </section>
            -      <section>
            -         <header>
            -            <h1>Section 2</h1>
            -         </header>
            -         <img src="images/Tizen_Pinwheel_Secondary_Confetti.png" alt="">
            -         <p>Nullam bibendum (...) Curabitur.</p>
            -         <img src="images/Tizen_WhiteFold_4.png" alt="">
            -      </section>
            -      <section>
            -         <header>
            -            <h1>Section 3</h1>
            -         </header>
            -         <p>Sed sagittis, (...) Vivamus sed est sit amet.</p>
            -         <img id="figure" src="images/pinwheel_yellow.png" alt="">
            -         <p>Pellentesque habitant (...). Duis lobortis, nibh.</p>
            -      </section>
            -   </article>
            -</body>
            -
          2. - -
          3. Set the CSS column properties: -
              -
            1. -

              The article element acts as a multi-column container. Set the column-width (or -webkit-column-width) property to enable the multi-column layout:

              - -
              -article 
              -{
              -   width: 80vw;
              -   column-width: 119px;
              -   -webkit-column-width: 119px;
              -
              -   margin: 2vh 5vw;
              -   padding: 2vh 5vw;
              -   background: #c3c8ca;
              - -

              The column-width property defines the default column width but the visible width is not always similar. An algorithm calculates the width according to available space. Normally, a column has a different display width from the one set in the property because as the columns are sized to fill all available space.

              -

              For example, on a 480 x 800 display with portrait orientation, the device width is 123 px, whereas on a 720 x 1280 display with a landscape orientation, the width is 120 px. The space available for columns is the width attribute value reduced by padding, in this case 80vw - (2 * 5vw) = 70vw, which means 70/100 width of the device display.

              -
            2. -
            3. -

              Use the column-gap (or -webkit-column-gap) property to set the distance between columns:

              -
              -   column-gap: 10px;
              -   -webkit-column-gap: 10px;
              -
              -
            4. -
            5. - -

              Use the column-rule (or -webkit-column-rule) property to draw a vertical line between columns. Define the width, color, and style of the rule:

              - -
              -   -webkit-column-rule-width: 1px;
              -   -webkit-column-rule-color: #677784;
              -   -webkit-column-rule-style: solid;
              -   column-rule-width: 1px;
              -   column-rule-color: #677784;
              -   column-rule-style: solid;
              -}
              - -

              The rule width does not increase the distance between columns. It is drawn under the column gap and can be even wider than the gap.

              - -
            - -

            The figure below shows the layout with the column-rule width set to 40 px and the column-gap set to 10 px.

            - -

            Figure: Column settings

            -

            Column settings

            -
          4. -
          5. -

            Define the footer element with the display height set to 5/100 and padding set to 2 * 2vh:

            - -
            -footer 
            -{
            -   padding: 2vh;
            -   height: 5vh;
            -   background: rgba(103, 119, 132, 0.2);
            -}
            -
            -
          6. -
          7. -

            Define the section elements setting the border-bottom and vertical padding values. It is not necessary to define horizontal padding, as it has been defined for the article element.

            - -
            -article>section
            -{
            -   border-bottom: 1px solid #d8d9d4;
            -   padding: 4px 0;
            -   text-align: center;
            -}
            -
            -
          8. -
          9. -

            Set image elements to have an automatic margin to center them within the column.

            -

            In case of the image whose id attribute is set to figure, set it to be a floating element with text drawn around it.

            - -
            -img{
            -   display: block;
            -   margin: 4px auto;
            -}
            -
            -#figure
            -{
            -   float: right;	
            -   margin: 4px;
            -}
            -
            -
          - -

          The following figures illustrate the created layout in different display sizes and orientations.

          - -

          Figure: Basic layout on a 480 x 800 display

          -

          Basic layout on a 480 x 800 display

          - -

          Figure: Basic layout on a 720 x 1280 display

          -

          Basic layout on a 720 x 1280 display

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - -

          Creating a Layout with Dynamic Content

          - -

          To enhance the user experience of your application by providing a consistent behavior across a wide range of displays with different resolution and orientation, you must learn to create a layout displaying a varying amount of content using CSS:

          -
            -
          1. -

            Create the HTML layout. The article element displays the columns, and the nav element contains buttons to add and remove content in the columns.

            -
            -<body>
            -   <article id="article">
            -   </article>
            -   <nav>
            -      <a id="addSections" href="#">Add images</a> 
            -      <input type="number" id="howMany" value="3"> 
            -      <a id="removeGroup" href="#">Remove last Group</a>
            -   </nav>
            -   <footer> Multicolumn Layout Tutorial 02</footer>
            -</body>
            -
            -
          2. -
          3. Set the CSS properties: -
              -
            1. -

              Define the CSS display and column properties:

              -
              -body 
              -{
              -   display: flex;
              -   display: -webkit-flex;
              -   flex-direction: column;
              -   -webkit-flex-direction: column;
              -   background: #fefffa;
              -}
              -
              -
            2. -
            3. -

              Set the article, nav and footer elements in one column using the flexible box layout.

              -

              The nav element is also a flexible box layout container to set UI elements in.

              -
              -nav 
              -{
              -   height: 20vh;
              -   padding-left: 20%;
              -   padding-top: 10px;
              -   display: flex;
              -   display: -webkit-flex;
              -   flex-flow: row wrap;
              -   -webkit-flex-flow: row wrap;
              -   flex: none;
              -   -webkit-flex: none;
              -   justify-content: space-around;
              -   -webkit-justify-content: space-around;
              -   align-items: center;
              -   -webkit-align-items: center;
              -   background: url(../images/white_logo.png) no-repeat;
              -   background-position: 2%;
              -   background-size: auto 70%;
              -}
              -
              -
            4. -
            5. -

              Define the styles for the a elements within the nav element to make them appear as buttons:

              -
              -nav a 
              -{
              -   margin: 3px;
              -   border-radius: 5px;
              -   padding: 5px 15px;
              -   background: rgba(103, 119, 132, 0.2);
              -   text-align: center;
              -   font-weight: bold;
              -}
              -
              -

              When the user taps the Add images button, the images and their descriptions are displayed.

              -
            6. -
            7. -

              Define the input element (with the property type set to number) style with an increased height to match the buttons around it:

              -
              -nav input
              -{
              -   width: 50px;
              -   height: 2em;
              -}
              -
              -
            8. -
            9. -

              The article element contains the column properties. Use the -webkit-column-width property to set the column width. The real width is calculated based on available space.

              -
              -article 
              -{
              -   width: 90vw;
              -   column-width: 136px;
              -   -webkit-column-width: 136px;
              -   margin: 1vh 2vh;
              -   padding: 1vh;
              -   background: #c3c8ca;
              -}
              -
              -
            10. -
            11. -

              Set the images within the article element with a block display to separate them from text:

              -
              -article img 
              -{
              -   margin: 0 auto;
              -   display: block;
              -}
              -
              -
            12. -
            13. -

              Define the column-span property as all for the h1 elements:

              -
              -article>h1 
              -{
              -   background: rgba(103, 119, 132, 0.5);
              -   padding: 4px;
              -   text-align: center;
              -   color: #eed484;
              -   column-span: all;
              -   -webkit-column-span: all;
              -}
              -
              -

              As a result, the h1 elements are spread across the columns. When the column-span property is used, you cannot have more columns than can fit in the available horizontal space.

              -
            14. -
            15. -

              Define the break-inside property as avoid to avoid breaking elements between columns:

              -
              -article>section 
              -{
              -   break-inside: avoid;
              -   -webkit-column-break-inside: avoid;
              -   border-bottom: 1px solid #d8d9d4;
              -   padding: 4px 0;
              -   text-align: center;
              -}
              -
              -
            16. -
            17. -

              Set the footer size:

              -
              -footer 
              -{
              -   padding: 2vh;
              -   height: 5vh;
              -   background: rgba(103, 119, 132, 0.2);
              -}
              -
              -
            18. -
            -
          4. -
          5. Add the JavaScript code to make the content dynamic: -
              -
            1. -

              Declare a variable for the images. Elements included in the variable amount to data displayed in a column layout, such as a newsfeed:

              -
              -var images = ["images/pinwheel_green.png",
              -              "images/Tizen_Pinwheel_Secondary_Confetti.png", 
              -              "images/Tizen_WhiteFold_4.png", 
              -              "images/pinwheel_yellow.png"];
              -
              -
            2. -
            3. -

              Declare a variable for the input element for selecting the number of images added to the content:

              -
              -var howManyInput;
              -
              -
            4. -
            5. -

              Use the addGroup() method with the input parameter value to add random images to the column layout and initialize the button events:

              - -
              -window.onload = function() 
              -{
              -   addGroup(4);
              -   howManyInput = document.getElementById('howMany');
              -   var addBtn = document.getElementById('addSections');
              -   addBtn.onclick = function() 
              -   {
              -      addGroup(howManyInput.value);
              -
              -      return false;
              -   };
              -   var removeBtn = document.getElementById('removeGroup');
              -   removeBtn.onclick = function() 
              -   {
              -      removeGroup();
              -
              -      return false;
              -   };
              -};
              -
              -
            6. -
            7. -

              Declare the h1No variable containing the number of h1 elements included in the article elements, and one added to next lines.

              - -

              Declare the newHTML variable to add new content to the column layout. Each added element contains an h1 element as a header, and section elements. Include an img element with a text description in each section element to display a random image. The art variable is initialized, and new HTML code (newHTML) is concatenated with the existing one (innerHTML):

              -
              -function addGroup(howMany) 
              -{
              -   var h1No = document.querySelectorAll('article>h1').length + 1;
              -   var newHTML = "<h1>Group " + h1No + "</h1>";
              -   var i;
              -
              -   for (i = 0; i < howMany; ++i) 
              -   {
              -      newHTML += "<section><img alt='' src='";
              -      newHTML += images[Math.floor(Math.random() * 4)];
              -      newHTML += "'>Lorem ipsum dolor sit amet diam sodales rutrum.</section>";
              -   }
              -   var art = document.getElementById("article");
              -   art.innerHTML += newHTML;
              -}
              -
              -
            8. -
            9. -

              When the user taps the Remove last Group button, the removeGroup() method is called to remove the group of images that was added last. Use the all variable to select all h1 elements in the content using the querySelectorAll() method. If the last value is less than 0, there is no element to remove. Use the removeNextSibling() method to recursively delete the next sibling element, and the removeChild() method to remove the h1 elements from its parent.

              -
              -function removeGroup() 
              -{
              -   var all = document.querySelectorAll('article>h1');
              -   var last = all.length - 1;
              -   if (last < 0) 
              -   {
              -      return;
              -   }
              -   removeNextSibling(all[last].nextSibling);
              -   all[last].parentElement.removeChild(all[last]);
              -}
              -
              -
            10. -
            -
          -

          The following figures illustrate the created layout in different display sizes and orientations.

          - -

          Figure: Dynamic layout on a 480 x 800 display

          -

          Dynamic layout on a 480 x 800 display

          - -

          Figure: Dynamic layout on a 720 x 1280 display

          -

          Dynamic layout on a 720 x 1280 display

          -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/multiple_screens_mw.htm b/org.tizen.ui.guides/html/web/w3c/multiple_screens_mw.htm deleted file mode 100755 index 6af563d..0000000 --- a/org.tizen.ui.guides/html/web/w3c/multiple_screens_mw.htm +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - - - - - - - - Multiple Screen Support: Supporting Different Screen Sizes - - - - - -
          -

          Multiple Screen Support: Supporting Different Screen Sizes

          - -

          Tizen is available in various devices which support different screen sizes and resolutions. When developing Tizen Web applications, you must take this into account if you want your application to function well in various device models.

          - - - - - - - - - - - -
          Note
          This feature is supported in mobile applications only.
          - -

          Before implementing multiple screen support, make sure you are familiar with the key concepts of multiple screen support.

          -

          Tizen provides the UI scalability resolution feature, which allows you to create scalable applications.

          -

          To optimize images used in Web applications, images based on a single resource can be used in various resolutions.

          -

          Key Concepts

          -

          Before building a Web application for multiple resolutions, make sure you are familiar with the following W3C Web content scaling standards, which must be taken into account when developing Web applications:

          -
            -
          • Viewport meta tag
          • -
          • CSS media query
          • -
          -

          Viewport Meta Tag

          -

          A viewport defines the application area that displays the Web page content.

          -

          In a Web browser, the viewport size depends on the browser window size. If the viewport is smaller than the Web content size, horizontal and vertical scrollbars are displayed for page navigation. The Web browser viewport does not support the zoom feature. However, in a mobile Web browser, there are no window scrollbars and the viewport supports the zoom feature.

          -

          The viewport meta tag enables you to customize the viewport size and zoom levels in a majority of mobile Web browsers. Using this tag, you can set the width, height, initial scale, and scale range for Web pages.

          -

          To use the viewport meta tag while developing Web applications, you must note the following:

          -
            -
          • The device-height and device-width attributes defined in the viewport meta tag are not the same as the real device width and height in pixels.
          • -
          • Using the viewport meta tag, the Web browsers of different devices display the same content with different layout size and scale factor. The scale factor is calculated using the device pixel ratio (DPR).
          • -
          -

          CSS Media Query

          -

          The CSS media query enables you to set conditions for particular media features and types to apply different CSS files for the application content. For Web content scaling, you can use the CSS media query to, for example:

          -
            -
          • Define the image resource to be used based on the screen dots per inch (DPI) ratio.
          • -
          • Determine the CSS layout to be used based on the screen width.
          • -
          -

          -

          UI Scalability

          -

          With UI scalability, you can support multiple screen resolutions in a single Tizen Web application. Tizen automatically converts and translates the size and position values that are defined in the application's logical resolution to the physical resolution at runtime. The Tizen Advanced UI (TAU) uses the viewport meta tag to fit the Web page into the device screen, and the rem unit to determine the size of the Tizen Web UI components.

          -

          Setting the Viewport

          -

          Tizen devices support a variety of screen resolutions and dots per inch (DPI) values. If the viewport meta tag is not defined, TAU uses the default viewport width and scale factor. This ensures that Web content layout varies between different screen resolutions.

          -

          In the following example, the viewport width is set to device-width, which is determined by the width of the Tizen device. The device-width value is retrieved to set similar virtual DPI values and to display UI components with similar physical sizes across all devices. (TAU uses the example value by default, if no other viewport value is defined.)

          -
          <meta name="viewport"
          -      content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
          -

          If the viewport width is set to device-width, the width and scale factor values are calculated by the Web browser. The following table shows different layout sizes and scale factors of the Tizen Web site (http://tizen.org) on different devices with the viewport width set to device-width.

          -
          <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - Table: Layout size and scale factor -
          Device screen resolutionReal screen DPIDevice DPIWeb browser pageViewport widthScale factor
          720 x 1280306320captured screen1360 px2.0
          480 x 800218240captured screen2320 px1.5
          -

          Working with Tizen Web Winsets

          -

          The default sizes of Tizen Web winsets (such as Popup, Button, and Checkbox) are designed based on the reference viewport DPI of 160. Therefore, these winsets are of similar sizes on any Tizen device if the viewport width is set to device-width.

          -

          If you manually set the viewport width of your application to a fixed value, the Tizen Web winsets may not fit appropriately in the application. To avoid the problem, Tizen Web winsets use the rem unit for the winset length, which depends on the base font size of the winset. Each Tizen Web winset theme has its own base font size, and the <html> element font size is also set to the base font size. If the viewport width is set to a fixed value, this base font size is recalculated and set to the <html> element to adjust the Tizen Web winset sizes accurately.

          -

          Creating Applications Supporting Multiple Screens

          -

          To create an application that supports multiple screen sizes, you must consider the following while coding your application:

          -
            -
          • Configuring the viewport
          • -
          • Optimizing resources
          • -
          • Creating screen resolution-independent UI
          • -
          -

          Configuring the Viewport

          -

          To use UI scalability in your application, set the viewport meta tag while creating a Web application project in IDE. To configure the viewport in the Tizen Web applications, add the viewport meta tag in the <head> section of the index.html file:

          -
          <meta name="viewport"
          -      content="width=device-width, initial-scale=1.0,
          -               minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
          -

          Optimizing Resources

          -

          By default, the Tizen Advanced UI (TAU) consists of the HD Web winsets. The winset scale is lowered for lower screen resolution devices. To optimize resources for different screen resolutions and devices, use the CSS media query for different resolutions available in Tizen. You can use CSS media queries in the HTML or CSS files.

          -

          In the HTML file:

          -
          <link media="only screen and (min-resolution: 320dpi)"
          -      href="high-quality-images.css" type= "text/css" rel="stylesheet">
          -

          In the CSS file:

          -
          @media screen and (max-resolution: 159dpi)
          -{
          -   <!--Set styles-->
          -}
          -
          -@media screen and (min-resolution: 160dpi and max-resolution: 239dpi)
          -{
          -   <!--Set styles-->
          -}
          -
          -@media screen and (min-resolution: 240dpi and max-resolution: 319dpi)
          -{
          -   <!--Set styles-->
          -}
          -
          -@media screen and (min-resolution: 320dpi)
          -{
          -   <!--Set styles-->
          -}
          -
          -

          You can also set different layout and resources for the portrait and landscape views in the CSS file:

          -
          @media screen and (orientation: portrait)
          -{
          -   <!--Set styles-->
          -}
          -
          -@media screen and (orientation: landscape)
          -{
          -   <!--Set styles-->
          -}
          -
          -

          Creating Screen Resolution-independent UI

          -

          The Tizen base font size is 22 px. This base font size value varies based on the device screen resolution. However, to create a screen resolution-independent UI, the Web browser engine renders the base font size as a logical pixel size instead of a physical pixel size.

          -

          Image Resolution Optimization

          - -

          In Web applications, optimization of applications for various platforms (regarding devices, OS, and resolution) is efficient.

          -

          Media Queries and Flexible Box Layout can be used to create flexible layouts, and to build the deployable package easily.

          - -

          Images can be used in Web applications in the following ways:

          - -

          When selecting an option from the list above, consider the type of the image resource you are going to use.

          -

          You can use the following types of image resources:

          - -

          Photos

          -

          An image can be added to an application using the HTML img tag, or CSS background property as shown in the following example:

          -
          <!--HTML-->
          -<img src="images/sample.jpg" alt="sample image" />
          -
          -<!--CSS-->
          -.photo
          -{
          -   background: url(../images/sample.jpg) 0 0 no-repeat;
          -   background-size: 100%;
          -   width: 100%;
          -   height: 200px;
          -}
          -
          -

          In terms of performance, there is no difference between the options.

          - -

          The image color is expressed based on pixels. Therefore, the higher resolution an image has, the better it looks on a large screen. For full HD display, a resolution bigger than the image size displayed on the screen is needed. However, since a high resolution image tends to have a large size, limit the image size as to fit the maximum screen size:

          -
          • 1024 x 768 px: 90 KB
          • 300 x 200 px: 39 KB
          • 300 x 200 px: 15 KB
          -

          Current full HD displays have a resolution that is 1.5 to 2 times bigger than the actual screen size. The image quality is guaranteed if you size images as 2 times bigger than their original size.

          -
          img
          -{
          -   max-width: 100%;
          -}
          -
          - -

          Figure: Enlarging a low-resolution image

          -

          Enlarging a low-resolution image

          -

          Icons

          -

          Icons generally have a fixed size. Size icon images as 2 times bigger than their original size. Using the CSS3 background-size property, you can add an image with the size of, for example, 40 x 40 px, compressed as 20 x 20 px.

          -
          .prev_icon, .next_icon
          -{
          -   padding-left: 30px;
          -   height: 30px;
          -   line-height: 30px;
          -   font-size: 1.2em;
          -   background-repeat: no-repeat;
          -   background-position: 0 50%;
          -   background-size: auto 20px;
          -}
          -
          -.prev_icon.icon1
          -{
          -   background-image: url(../images/page_navi_arrow_left_01.png);
          -}
          -
          - -

          When multiple icons are used on a page, all the image files are called separately. This slows down the loading speed and causes a large number of network roundtrips, as illustrated in the figure below.

          - -

          Figure: Network speed when calling each image separately

          -

          Calling each of image separately

          - -

          You can use the sprite image technique (grouping multiple images as one and showing the only desired images defined with the background-position property) to noticeably reduce the page loading speed without any loss in quality of the image, as the following example shows. -

          -
          .prev_icon, .next_icon
          -{
          -   background-size: 20px auto; <!--Full HD Display-->
          -   background-image: url(../images/page_navi_arrow.png);
          -}
          -
          -.prev_icon.icon1
          -{
          -   background-position: 0 0;
          -}
          -
          -.prev_icon.icon2
          -{
          -   background-position: 0 -50px;
          -}
          -
          -

          Figure: Network speed when using sprite images

          -

          Network speed when using sprite image

          -

          Animated Images

          -

          Animated images can be created in various formats and with many tools, such as GIF, JavaScript, Canvas, and SVG.

          - -

          To create a simple and repetitive animation effect as below as effectively as possible, use GIF images, JavaScript, or the CSS3 animation attribute.

          -

          Figure: JAVA mascot character in GIF (source: http://lea.verou.me)

          -

          JAVA mascot character  in GIF


          - -

          Below, the network capacity usage and timeline using the following animation types are compared using the Web Inspector:

          - - -

          GIF Animation

          - -

          Using GIF animation, the resource usage is as follows:

          -
          • Events: Fires only the painting event
          • -
          • Memory: 3 ~ 4 MB
          • -
          • Network: 10 ~ 25 ms
          • -
          - -

          Figure: Events for a GIF image

          -

          Events


          -

          Figure: Memory usage of a GIF image

          -

          Memory


          -

          Figure: Network capacity usage of a GIF image

          -

          Network


          - -

          GIF animation can be created in various resolutions without quality loss, when you use the option introduced in Photos. This, however, increases memory occupancy.

          - -

          JavaScript Animation

          - -

          JavaScript animation is less affected by enlarging or reducing its screen size. However, it uses a lot of device resources compared to using CSS3 animations:

          -
          • -Events: Event is fired every 100 ms, the interval of setInterval().
          • -Memory: Increases in proportion to time, from the initial size 90 KB.
          • -Network: Used until the animation is stopped.
          -

          Figure: Events for a JavaScript animation

          -

          Events


          -

          Figure: Memory usage of a JavaScript animation

          -

          Memory


          -

          Figure: Network capacity usage of a JavaScript animation

          -

          Network


          -

          The following example shows how JavaScript animation can be implemented:

          -
          <script>
          -   var obj = document.querySelector(".animated img"), flag = 0;
          -   function animate()
          -   {
          -      obj.src = './images/sprite_' + ((flag++) % 10) + '.png';
          -   };
          -   setInterval(animate, 100);
          -</script>
          -
          - -

          You can use the requestAnimationFrame() method of the Timing control for script-based animations API to prevent animation freezes that occur occasionally:

          - -
          <script>
          -   var obj = document.querySelector(".animated img"), flag = 0, i = 0;
          -   function animate()
          -   {
          -      if (!(i % 6)) obj.src = './images/sprite_' + ((flag++) % 10) + '.png';
          -         i++;
          -      -webkit-RequestAnimationFrame(animate);
          -   };
          -   -webkit-RequestAnimationFrame(animate);
          -</script>
          -
          - -

          CSS3 Animation

          - -

          CSS3 animation has a low usage of events, memory, and network capacity. It is efficient for animations that have a fixed size. However, since CSS3 animation is pixel-based, it is difficult to use for animations that need to be enlarged or reduced, in which case JavaScript is a better option:

          -
          • -Events: Fires only rendering and painting events
          • -Memory: 50 ~ 90 KB
          • -Network: 9 ~ 21 ms
          - -

          Figure: Events for a CSS3 animation

          -

          Events


          -

          Figure: Memory usage of a CSS3 animation

          -

          Memory


          -

          Figure: Network capacity usage of a CSS3 animation

          -

          Network


          - -

          The following example shows how CSS3 animation can be implemented:

          -
          <style>
          -   .css_animation
          -   {
          -      width: 50px;
          -      height: 70px;
          -      background-image: url(../images/sprite.png);
          -      -webkit-animation: cssAni .8s steps(10) infinite;
          -   }
          -
          -   @-webkit-keyframes cssAni
          -   {
          -      from {background-position: 0px;}
          -      to {background-position: -500px;}
          -   }
          -</style>
          -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/selector_w.htm b/org.tizen.ui.guides/html/web/w3c/selector_w.htm deleted file mode 100644 index 8753b68..0000000 --- a/org.tizen.ui.guides/html/web/w3c/selector_w.htm +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - - - Selectors API Level 1 and Level 2: Selecting DOM Elements - - - - - -
          -

          Selectors API Level 1 and Level 2: Selecting DOM Elements

          - -

          The selectors allow you to select element nodes in the DOM tree by matching them against a group of selectors, and testing whether the element matches a particular selector. Using selectors makes searching and selecting complex elements faster.

          - -

          You can use the querySelector() and querySelectorAll() methods to retrieve the element nodes. Both methods accept a single parameter, a string selector. The string selector is a selector or a group of selectors that can be surrounded by whitespace. If you use a selector group as the string selector with the querySelector() method, the method returns the first element (if any) that matches any of the selectors in the group.

          - -

          The main features of the Selectors API Level 1 and Level 2 include:

          - -

          You can also create an accordion menu.

          - -

          Selecting a Single Node

          -

          To enhance the user experience of your application, you must learn to use selectors to handle page elements, and to select a single node:

          -
            -
          1. To select the first matching element found in the child nodes, use the querySelector() method with CSS selectors. You get the same result as when using the getElementById(), getElementsByTagName(), and getElementsByClassName() methods. -
            var obj1 = document.getElementsByTagName('td')[0]; /* First <td> element in the document */
            -var obj2 = document.getElementById('foo'); /* Element with the ID #foo */
            -var obj3 = document.getElementsByClassName('bar')[0]; /* First element in the bar class */
            -  
            -var obj4 = document.querySelector('td'); /* Same as obj1 */
            -var obj5 = document.querySelector('#foo'); /* Same as obj2 */ 
            -var obj6 = document.querySelector('.bar'); /* Same as obj3 */
            -

            The querySelector() method returns the first matching element node within the subtrees of the context node. If no matching element is found, the method returns null.

          2. -
          3. You can use the CSS selectors to ensure that elements with complex structures can be easily selected. -

            For example, the following example selects the last element among the child nodes of the second <tr> element, which is a child of the <tbody> element in the second <table> element of the document.

            -
            var obj = document.querySelector('table:nth-child(2) tbody > tr:nth-child(2) :last-child');
          4. -
          5. You can use method chaining to select an element: -
            var obj = document.querySelector('table:nth-child(2)');
            -var targetObj = obj.querySelector('tbody > tr:nth-child(2) :last-child')
          6. -
          - -

          Figure: Single node selection (in mobile applications only)

          -

          Single node selection (in mobile applications only)

          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Selecting Multiple Nodes

          -

          To enhance the user experience of your application, you must learn to use selectors to handle page elements, and to select multiple nodes in a node list:

          -
            -
          1. Select an element in the node list using the querySelector() method: -
            var obj = document.querySelector('table:nth-child(2)');
            -

            The querySelector() method returns the first matching element node within the subtrees of the context node. If no matching element is found, the method returns null. The query above selects the second <table> element in the document as a single element.

            -
          2. - -
          3. Select multiple elements in the node list using the querySelectorAll() method, and define a variable to represent the length of the targetObj node list: -
            var targetObj = obj.querySelectorAll('thead th, tbody td');
            -var i = targetObj.length;
            -

            The querySelectorAll() method returns an array containing all of the matching element nodes within the subtrees of the context node, in the document order, and saves the elements in a node list. If there are no matching nodes, the method returns an empty array. The query above selects the <th> elements in the table head and the <td> elements in the table body.

            -
          4. -
          5. Apply a defined style to all elements stored in the targetObj node list: -
            while (0 < i) 
            -{
            -   i--;
            -   targetObj[i].style.backgroundColor = 'orange';
            -   targetObj[i].textContent = 'Exam 3' + i;
            -}
          - -

          Figure: Multiple node selection (in mobile applications only)

          -

          Multiple node selection (in mobile applications only)

          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Creating an Accordion Menu

          - -

          To enhance the user experience of your application, you must learn to retrieve element nodes from the DOM tree to create a simple accordion menu.

          -

          The accordion menu is created using the CSS3 Basic User Interface Module Level 3 API (in mobile or wearable applications). When a title is touched, the relevant content is shown, and other content is hidden.

          -
            -
          1. Create the HTML layout: -
            <ul class="accordion">
            -   <li>
            -      <p class="title current">Title 1<p>
            -      <div>contents 1</div>
            -   </li>
            -   <li>
            -      <p class="title">Title 2</p>
            -      <div>contents 2</div>
            -   </li>
            -   <!--Other list elements-->
            -</ul>
          2. - -
          3. Use CSS transitions to add sliding effects when content appears: -
            .accordion  > li  > div 
            -{
            -   padding: 0 15px;
            -
            -   <!--Assign time for CSS transformation-->
            -   -webkit-transition: all .5s;
            -   opacity: 0;
            -   height: 0;
            -   box-shadow: inset 1px 1px 4px rgba(0, 0, 0, .5);
            -   line-height: 2;
            -}
            -<!--Assign styles to be applied in case the current class is added to p.title-->
            -.accordion  > li  > p.current 
            -{
            -   background: -webkit-linear-gradient(top, #666, #000);
            -   color: #fff;
            -}
            -.accordion > li > p.current + div 
            -{
            -   opacity: 1;
            -   height: 200px;
            -}
          4. -
          5. Use the querySelector() and querySelectorAll() methods to change the class of the subject in the elements where the event is fired: -
            var testAccordion = function(obj) 
            -{
            -   var targetObj = document.querySelector(obj);
            -   var targetLength = document.querySelectorAll(obj + 'li').length;
            -
            -   /* In case the elements are not selected */
            -   if (targetLength <= 0) 
            -      return false;
            -
            -   targetObj.onclick = function(e) 
            -   {
            -      var that = e.target;
            -
            -      /* In case the e.target class is not title */
            -      if ((that.className !== 'title')) return false;
            -
            -      for (var i = 0; i < targetLength; i++) 
            -      {
            -         /* Change all classes of the 'li p' elements at the bottom of .accordion to title */
            -         targetObj.querySelectorAll('li p')[i].className = 'title';
            -      }
            -      /* Define the e.target class as current */
            -      that.className += 'current';
            -   }
            -}
            -
          6. -
          7. Define the elements that use the accordion menu: -
            testAccordion('.accordion');
          - -

          Figure: Accordion menu (in mobile applications only)

          -

          Accordion menu (in mobile applications only)

          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/session_history_w.htm b/org.tizen.ui.guides/html/web/w3c/session_history_w.htm deleted file mode 100644 index 3908cec..0000000 --- a/org.tizen.ui.guides/html/web/w3c/session_history_w.htm +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - HTML5 session history of browsing contexts: Managing Browsing Contexts - - - - - -
          - - -

          HTML5 session history of browsing contexts: Managing Browsing Contexts

          - -

          You can manage the session history of browsing contexts.

          -

          The history interface is used to save in the session history the page information that has been read by the user. You can also use the state object to directly store the page information which has already been analyzed in the URL, or general information which is not stored in the URL (such as location, or the scroll state of the page or a certain DOM element).

          - - -

          The main features of the HTML5 session history of browsing contexts API include:

          -
            -
          • Adding entries to the session history -

            You can use the pushState() method of the history interface to add an entry to the session history. With the replaceState() method, you can update the session history details. -

          • -
          • Detecting session history status changes -

            The popstate event is fired when the user navigates to a page stored in the session history. The popstate event -references the information stored with the pushState() or replaceState() methods, and enables you to change the status of the page based on the stored session history (such as moving focus to a certain DOM element).

            -
          • -
          - -

          Managing Session History Entries

          - -

          Learning how to manage the session history enhances the user browsing experience in your application:

          - -
            -
          1. To add an entry to the session history, use the pushState() method of the history interface: -
            -<script>
            -   history.pushState({index: currentIndex}, document.title);
            -</script>
            -
            - - - - - - - - - -
            Note
            The pushState() method accepts the data, title, and url (optional) parameters. The title parameter refers to the key value used to search for entries saved in the session history, and is currently ignored in all browsers.
            -
          2. - -
          3. To update the entry details, use the replaceState() method: -
            -<script>
            -   history.replaceState({index: currentIndex}, document.title, '#page' + currentIndex);
            -</script>
            -
            -

            The replaceState() method uses the same parameters as the pushState() method. The history_sample.html is the url parameter, which refers to the address of the page that is to be changed.

            -
          4. - -
          5. To use the session history information: -
              -
            1. Implement a page with the Prev and Next buttons: -
              -<nav class="paging">
              -   <a href="#">Prev</a>
              -   <a href="#">Next</a>
              -</nav>
              -<p>Current Index: <output> </output></p>
              -
              -<a href="http://tizen.org/">Tizen.org</a>
              -
              -
            2. -
            3. When the user clicks the buttons, the current index value (representing page numbers) is changed and stored in the state object of the history interface: -
              -var currentIndex = 0;
              -var prev = document.querySelector('.paging > a:nth-child(1)');
              -var next = document.querySelector('.paging > a:nth-child(2)');
              -
              -/* Prev button click event */ 
              -prev.onclick = function() 
              -{
              -   currentIndex -= 1;   
              -   setState(currentIndex);
              -    
              -   return false;
              -};
              -    
              -/* Next button click event */ 
              -next.onclick = function() 
              -{
              -   currentIndex += 1;  
              -   setState(currentIndex);
              -    
              -   return false;
              -};
              -
              -
            4. - -
            5. If the state object has data in it, use the replaceState() method to change the previously stored information. Otherwise, add new info with the pushState() method. -
              -function setState(currentIndex) 
              -{
              -   if (history.state) 
              -   {
              -      history.replaceState({index: currentIndex}, document.title, '#page' + currentIndex);
              -   } 
              -   else 
              -   {
              -      history.pushState({index: currentIndex}, document.title);
              -   }
              -   output.textContent = currentIndex;
              -}
              -
              -
            6. -
            -
          6. -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Detecting Session History Changes

          - -

          Learning how to track session history changes enhances the user browsing experience in your application:

          - -
          1. A page with data stored in the session history fires a popstate event when the page is loaded (for example, because it is refreshed or moved to from the previous page). -

            Register the event listener:

            - -
            -window.addEventListener("popstate", foo, false);
            -
          2. - -
          3. Define the event handler for the event. You can use the data stored in the state object to retrieve the correct location on the page to be loaded. -
            -var output = document.querySelector('output');
            -
            -window.onpopstate = function() 
            -{
            -   currentIndex = history.state.index;
            -   output.textContent = currentIndex;
            -}
            -
            -

            In the snippet above, when a popstate event is fired, it saves the index value stored in the state object to the currentIndex variable, and outputs the <output> element from the correct index location. -

            - -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - - - -
          - -Go to top - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/text_module_w.htm b/org.tizen.ui.guides/html/web/w3c/text_module_w.htm deleted file mode 100755 index bd570e1..0000000 --- a/org.tizen.ui.guides/html/web/w3c/text_module_w.htm +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - CSS Text Module Level 3: Manipulating Text - - - - - - -
          -

          CSS Text Module Level 3: Manipulating Text

          - -

          You can apply various text effects easily.

          - -

          The new text features in CSS Text Module Level 3 include:

          -
            - -
          • Text properties -

            You can use CSS text properties, such as text-transform, text-align, text-indent, letter-spacing, and word-spacing, to manipulate and transform text.

          • -
          - -

          Manipulating Text

          - -

          To enhance the user experience of your application, you must learn to handle line breaking, justification, alignment, white space handling, and text transformations using CSS text properties:

          - -
            -
          1. Define the text-transform property within a <style> element in the <head> section of the Web page to control the text capitalization: - -
            -<head>
            -   <style>
            -      p:nth-child(1) {text-transform: none;}
            -      p:nth-child(2) {text-transform: capitalize;}
            -      p:nth-child(3) {text-transform: uppercase;}
            -      p:nth-child(4) {text-transform: lowercase;}
            -      p:nth-child(5) {text-transform: full-width;}
            -   </style>
            -</head>
            -<body>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -</body>
            -
            - -
          2. - -
          3. Define the text-align property, which controls the text alignment: - -
            -<head>
            -   <style>
            -      p:nth-child(1) {text-align: start;}
            -      p:nth-child(2) {text-align: end;}
            -      p:nth-child(3) {text-align: left;}
            -      p:nth-child(4) {text-align: right;}
            -      p:nth-child(5) {text-align: center;}
            -      p:nth-child(6) {text-align: justify;}
            -   </style>
            -</head>
            -
            - -
          4. - -
          5. Define the text-indent property, which controls the text indentation: - -
            -<head>
            -   <style>
            -      p:nth-child(1) {text-indent: 0}
            -      p:nth-child(2) {text-indent: 1em}
            -      p:nth-child(3) {text-indent: -1em}
            -      p:nth-child(4) {text-indent: 5%}
            -      p:nth-child(5) {text-indent: -5%}
            -   </style>
            -</head>
            -
            - -
          6. - -
          7. Define the letter-spacing property, which controls the letter spacing: -
            -<head>
            -   <style>
            -      p:nth-child(1) {letter-spacing: .5em}
            -      p:nth-child(2) {letter-spacing: -.1em}
            -   </style>
            -</head>
            -
            - -
          8. - -
          9. Define the word-spacing property, which controls the space between words: -
            -<head>
            -   <style>
            -      p:nth-child(1) {word-spacing: 1em}
            -      p:nth-child(2) {word-spacing: -.1em}
            -   </style>
            -</head>
            -
            - -
          10. - -
          11. Define the word-break property, which determines the line breaking rules for non-CJK (Chinese, Japanese, and Korean) scripts: -
            -<head>
            -   <style>
            -      p:nth-child(1) {word-break: normal}
            -      p:nth-child(2) {word-break: keep-all}
            -      p:nth-child(3) {word-break: break-all}
            -   </style>
            -</head>
            -
            - -
          12. - -
          13. Define the white-space property, which determines the handling of empty space within an element: -
            -<head>
            -   <style>
            -      p:nth-child(1) {white-space: normal}
            -      p:nth-child(2) {white-space: pre}
            -      p:nth-child(3) {white-space: nowrap}
            -      p:nth-child(4) {white-space: pre-wrap}
            -      p:nth-child(5) {white-space: pre-line}
            -   </style>
            -</head>
            -<body>
            -   <p>The quick brown fox jumps
            -   over a lazy dog.</p>
            -   <p>The quick brown fox jumps
            -   over a lazy dog.</p>
            -   <p>The quick brown fox jumps
            -   over a lazy dog.</p>
            -   <p>The quick brown fox jumps
            -   over a lazy dog.</p>
            -   <p>The quick brown fox jumps
            -   over a lazy dog.</p>
            -</body>
            -</html>
            -
            - -
          14. - -
          15. Define the text-shadow property, which adds a shadow effect to text: -
            -<head>
            -   <style>
            -      p:nth-child(1) {text-shadow: 0.1em 0.1em 0.2em rgba(0, 0, 0, .7)}
            -      p:nth-child(2) {text-shadow: -0.2em 0.2em 0.2em #000, 0.2em -0.2em 0.2em #f00}
            -      p:nth-child(3) {color: #fff; text-shadow: 0 0 .7em #000;}
            -      p:nth-child(4) {color: #fff; text-shadow: 0 0 1px #f00;}
            -   </style>
            -</head>
            -
            - -
          16. - -
          17. Define the word-wrap and overflow-wrap properties, which control forced line breaks when the length of a word is longer than the area where it is displayed: -
            -<head>
            -   <style>
            -      p:nth-child(1) {word-wrap: normal}
            -      p:nth-child(2) {word-wrap: break-word}
            -      p:nth-child(3) {overflow-wrap: normal}
            -      p:nth-child(4) {overflow-wrap: break-word}
            -   </style>
            -</head>
            -<body>
            -   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
            -   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
            -   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
            -   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
            -</body>
            -
            - -
          18. - -
          - - -

          The following figure shows examples of manipulating the text properties.

          -

          Figure: Text properties (in mobile applications only)

          -

          Text properties (in mobile applications only)

          - - - - - - - - - - -
          Note
          For a complete list of CSS Text Module Level 3 text properties (in mobile or wearable applications) and their possible values, see the Property index.
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/transform_w.htm b/org.tizen.ui.guides/html/web/w3c/transform_w.htm deleted file mode 100755 index ecffd0a..0000000 --- a/org.tizen.ui.guides/html/web/w3c/transform_w.htm +++ /dev/null @@ -1,772 +0,0 @@ - - - - - - - - - - - - - CSS Transforms: Manipulating Elements - - - - - - -
          -

          CSS Transforms: Manipulating Elements

          - -

          Transforms allow you to modify the coordinate space where each element is positioned. The elements can be translated, rotated, and scaled in 2- or 3-dimensional space. According to the API, the coordinate system is a visual formatting model, and positions and sizes in the coordinate space are expressed in pixels, starting in the origin of point with positive values proceeding to the right and down.

          - -

          To enhance the rendering performance and user experience, you can use hardware acceleration and create fade effects.

          - -

          When using the CSS transform properties, the Tizen browser requires no prefix, the Firefox browser requires the -moz- prefix, the Chrome and Safari browsers require the -webkit- prefix, and the Opera browser requires the -o- prefix.

          - -

          Transform Properties

          - -

          You can define various properties to control the elements within the coordinate space:

          - -
            -
          • transform-origin -

            This property changes the location of the transformed element. It can only be used with elements for whom the transform property has been declared.

          • - -
          • transform-style -

            This property defines the rendering of the inherited element in the 3D space. Animation property has been added in the example for easier comprehension.

          • - -
          • perspective -

            This property changes the perspective of the element being expressed. A 3D transform element must be used together with this property to emphasize the expression of the X axis.

          • - -
          • perspective-origin -

            This property defines the location facing the element.

          • -
          • backface-visibility -

            This property defines whether the backface of the transformed element is expressed.

          • -
          - -
          -<head>
          -   <style type="text/css">
          -      .box 
          -      {
          -         transform: rotate(30deg);
          -         transform-origin: 30% 30%;
          -         perspective: 220;
          -         animation: trans-ani 10s infinite linear;
          -         backface-visibility: visible;
          -
          -         /* Chrome and Safari browsers */
          -         -webkit-transform: rotate(30deg);
          -         -webkit-transform-origin: 30% 30%;
          -         -webkit-perspective: 220;
          -         -webkit-animation: trans-ani 10s infinite linear;
          -         -webkit-backface-visibility: visible;
          -      }
          -      .box.case01 
          -      {
          -         transform-style: preserve-3d;
          -         perspective-origin: 30% 30%;
          -
          -         /* Chrome and Safari browsers */
          -         -webkit-transform-style: preserve-3d;
          -         -webkit-perspective-origin: 30% 30%;
          -      }
          -   </style>
          -</head>
          -<body>
          -   <h1>transform-origin</h1>
          -   <div class="boxarea">
          -      <div class="box">
          -         <p>transform</p>
          -         <p>transform-origin: 30% 30%;</p>
          -      </div>
          -      <div class="box case01">
          -         <p>box</p>
          -      </div>
          -   </div>
          -</body>
          -
          - -

          In addition to transform properties, you can also use various 2D and 3D transform functions.

          - -

          2D and 3D Transform Functions

          - -

          The CSS Transforms API supports various transform functions in 2D and 3D.

          - -

          In 2D transforms, all transform functions are expressed based on a matrix. The X and Y values of the translate(), scale(), and skew() functions can be expressed in individual functions. For example, the X and Y values of the translate() function can be expressed with the translateX(number) and translateY(number) functions.

          - -
          -<head>
          -   <style type="text/css">
          -      .box-translate 
          -      {
          -         transform: translate(30px, 30px);
          -         -webkit-transform: translate(30px, 30px);
          -      }
          -
          -      .box-scale 
          -      {
          -         transform: scale(1.2, 1.2);
          -         -webkit-transform: scale(1.2, 1.2);
          -      }
          -
          -      .box-rotate 
          -      {
          -         transform: rotate(45deg);
          -         -webkit-transform: rotate(45deg);
          -      }
          -
          -      .box-skew 
          -      {
          -         transform: skew(20deg, 20deg);
          -         -webkit-transform: skew(20deg, 20deg);
          -      }
          -
          -      .box-matrix 
          -      {
          -         transform: matrix(0.8, 0.5, 0.9, 0.9, 0, 0);
          -         -webkit-transform: matrix(0.8, 0.5, 0.9, 0.9, 0, 0);
          -      }
          -   </style>
          -</head>
          -<body>
          -   <h1>2d transform</h1>
          -   <h2>translate</h2>
          -   <div class="boxarea">
          -      <div class="box no-transform">
          -         <p>Original</p>
          -      </div>
          -      <div class="box transformed box-translate">
          -         <p>transform</p>
          -         <p>transform: translate(30px, 30px);</p>
          -      </div>
          -   </div>
          -</body>
          -
          - -

          In 3D transforms, the Z axis has been added (for example, translateZ(number) and scale3dZ(number)). When handling 3D transforms, pay attention to the following:

          -
            -
          • If a transform function is used together with the perspective property, the z axis is emphasized.
          • -
          • The X, Y, and Z values of the translate3d(), scale3d(), and rotate3d() functions can be expressed in individual functions.
          • -
          • In the rotate3d(number, number, number, angle) function, the element rotates according to the assigned parameter (angle) with the X, Y, and Z directional vectors as the center. Each vector can be expressed as an individual function: for example, the rotateX(<angle>) and rotate3d(1, 0, 0, <angle>) functions perform the same task.
          • -
          -

          The following code snippet demonstrates how to implement a 3D transform. For a complete source code, see 3d_transform.html.

          -
          -<head>
          -   <style type="text/css">
          -      .first-transform {opacity: .5; background: #3399cc;}
          -      .transformed {opacity: .8;}
          -      /* translate3d */
          -      .box-translate3d: hover .first-transform 
          -      {
          -         transform: translate3d(-5px, -5px, -60px) rotateY(70deg);
          -         -webkit-transform: translate3d(-5px, -5px, -60px) rotateY(70deg);
          -      }
          -      .box-translate3d: hover .transformed 
          -      {
          -         transform: translate3d(15px, 15px, 60px) rotateY(70deg);
          -         -webkit-transform: translate3d(15px, 15px, 60px) rotateY(70deg);
          -      }
          -      /* scale3d */
          -      .box-scale3d: hover .first-transform 
          -      {
          -         transform: scale3d(1, 1, 1) rotateY(70deg);
          -         -webkit-transform: scale3d(1, 1, 1) rotateY(70deg);
          -      }
          -      .box-scale3d: hover .transformed 
          -      {
          -         transform: scale3d(0.6, 0.6, 2) rotateY(70deg);
          -         -webkit-transform: scale3d(0.6, 0.6, 2) rotateY(70deg);
          -      }
          -      /* rotate3d */
          -      .box-rotate3d: hover .first-transform 
          -      {
          -         transform: rotate3d(-1, -1, -1, 110deg);
          -         -webkit-transform: rotate3d(-1, -1, -1, 110deg);
          -      }
          -      .box-rotate3d: hover .transformed 
          -      {
          -         transform: rotate3d(1, 1, 1, 110deg);
          -         -webkit-transform: rotate3d(1, 1, 1, 110deg);
          -      }
          -      /* matrix3d */
          -      .box-matrix3d: hover .first-transform 
          -      {
          -         transform: matrix3d(0.3, 0.2, -0.9, 0, 0.2, 0.8, 0.2, 0, 0.6, 0, 0.4, 0, 0, 0, 0, 1);
          -         -webkit-transform: matrix3d(0.3, 0.2, -0.9, 0, 0.2, 0.8, 0.2, 0, 0.6, 0, 0.4, 0, 0, 0, 0, 1);
          -      }
          -      .box-matrix3d: hover .transformed 
          -      {
          -         transform: matrix3d(0.4, -0.5, 0.8, 0, 0.2, 0.8, 0.2, 0, -0.6, 0, 0.4, 0, 0, 0, 0, 1);
          -         -webkit-transform: matrix3d(0.4, -0.5, 0.8, 0, 0.2, 0.8, 0.2, 0, -0.6, 0, 0.4, 0, 0, 0, 0, 1);
          -      }
          -   </style>
          -</head>
          -<body>
          -   <h1>3D transform</h1>
          -   <h2></h2>
          -   <p><strong>First box value:</strong> transform: translate3d(-5px, -5px, -60px) rotateY(70deg);</p>
          -   <p><strong>Second box value:</strong> transform: translate3d(15px, 15px, 60px) rotateY(70deg);</p>
          -   <div class="boxarea box-translate3d">
          -      <div class="box first-transform">
          -         First box
          -      </div>
          -      <div class="box transformed">
          -         <p>Second Box</p>
          -         Mouse over or tab here to animate
          -      </div>
          -   </div>
          -</body>
          -
          - - -

          Creating an Animation with Transforms

          - -

          To enhance the user experience of your application, you must learn to use transforms with animations. This example uses the animation from the Creating a Logo Animation use case as a basis, and adds a more diverse visual effect to it with the transform property. In the modified animation:

          - -
            -
          • As in the original animation, no elements are initially shown on the screen.
          • -
          • The Tizen logo gradually appears in the middle of the screen, and as it moves to the right, it becomes smaller. With the transform property, the logo is made to rotate.
          • -
          • Each letter in the word "TIZEN" consecutively comes in from the left of the screen and moves to the right to its correct location. With the transform property, the letters are translated in the 3D space and rotated around the Y axis.
          • -
          - -

          Figure: Tizen logo to be transformed

          -

          Tizen logo to be transformed

          - - -
            -
          1. Create the HTML layout to control the movement of each individual animation element: -
            -<div class="animation-holder">
            -   <span class="tizen-txt t"></span>
            -   <span class="tizen-txt i"></span>
            -   <span class="tizen-txt z"></span>
            -   <span class="tizen-txt e"></span>
            -   <span class="tizen-txt n"></span>
            -   <span class="tizen-txt tm"></span>
            -   <span class="tizen-logo"></span>
            -</div>
            -
            -
          2. -
          3. Define the basic style of the animation elements. Add the perspective property to increase the Z axis effect of the 3D transform. -
            -.animation-holder 
            -{
            -   -webkit-perspective: 1000px;
            -   height: 88px;
            -   left: 50%;
            -   margin: -54px 0px 0px -140px;
            -   position: absolute;
            -   top: 50%;
            -   width: 280px;
            -}
            -.tizen-txt,
            -.tizen-logo 
            -{
            -   background-position: 50% 50%;
            -   background-repeat: no-repeat;
            -   display: block;
            -   position: absolute;
            -}
            -.tizen-txt.t 
            -{
            -   background-image: url("images/txt_t.png");
            -   height: 56px;
            -   left: 0px;
            -   top: 31px;
            -   width: 48px;
            -}
            -
            -
          4. -
          5. Create the animation: -
              -
            1. -

              Assign keyframes for the logo element to transform it. In order to rotate the logo, use the -webkit-transform: rotate() function, which defines the angle of the rotation. -

              -
              -@-webkit-keyframes tizen-logo 
              -{
              -   0% 
              -   {
              -      -webkit-animation-timing-function: ease-in;
              -      height: 211px;
              -      left: 30px;
              -      opacity: 0;
              -      top: -61px;
              -      -webkit-transform: rotate(0deg);
              -      width: 220px;
              -   }
              -   30% 
              -   {
              -      -webkit-animation-timing-function: ease-out;
              -      height: 211px;
              -      left: 30px;
              -      opacity: 1;
              -      top: -61px;
              -      -webkit-transform: rotate(720deg);
              -      width: 220px;
              -   }
              -   50% 
              -   {
              -      height: 32px;
              -      left: 247px;
              -      opacity: 1;
              -      top: 0;
              -      -webkit-transform: rotate(1440deg);
              -      width: 33px;
              -   }
              -   100% 
              -   {
              -      height: 32px;
              -      left: 247px;
              -      opacity: 1;
              -      top: 0;
              -      -webkit-transform: rotate(1440deg);
              -      width: 33px;
              -   }
              -}
              -
              - - - - - - - - - -
              Note
              For a rotation, the image has to be carefully created to ensure the correct end result. The rotation occurs with the center of the element as the center. If the rotation center must be moved because the image center is not aligned, use the transform-origin property to adjust the rotation location.
            2. -
            3. Create the keyframes for the first letter in the word "TIZEN". In the animation, due to the translate3d() and rotateY() methods, each letter transforms slightly from the right to the left as it comes in. - -

              Animation

              - -
              -@-webkit-keyframes tizen-txt-t 
              -{
              -   0% 
              -   {
              -      opacity: 0;
              -      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
              -   }
              -   30% 
              -   {
              -      opacity: 0;
              -      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
              -   }
              -   35% 
              -   {
              -      opacity: 1;
              -      -webkit-transform: translate3d(0, 0, 0) rotateY(0deg);
              -   }
              -   100% {}
              -}
              -
            4. -
            5. To emphasize the fact that the letters are being created on the right, change the location of the transform. If the transform-origin property is declared for the entire animation element, the logo rotation changes. Consequently, you must only declared it for the letters. -
              -.tizen-txt 
              -{
              -   -webkit-transform-origin: 100% 50%;
              -}
              -
            6. - -
            7. Create the keyframes for the other letters similarly:

              -
              -@-webkit-keyframes tizen-txt-i 
              -{
              -   0% 
              -   {
              -      opacity: 0;
              -      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
              -   }
              -   32% 
              -   {
              -      opacity: 0;
              -      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
              -   }
              -   37% 
              -   {
              -      opacity: 1;
              -      -webkit-transform: translateX(0) rotateY(0deg);
              -   }
              -    100% {}
              -}
              -
            - -
          6. -
          - -

          The following figure shows the full Tizen logo animation with the transform properties.

          -

          Figure: Full Tizen logo animation

          -

          Full Tizen logo animation

          - -

          Source Code

          -

          For the complete source code related to this use case, see the following files:

          - - -

          Creating Fade Animation Effects

          - - -

          To enhance the user experience of your application, you must learn to use fade animation effects.

          -

          The modal layer pop-up can be used to, for example, show enlarged thumbnail images or notice messages. The modal layer pop-up has the following basic properties:

          -
            -
          • If an event is fired, it gradually becomes visible. This is known as the Fade In effect.
          • -
          • The existing background is covered with a translucent layer to make the user focus on the pop-up.
          • -
          • When the pop-up is closed, it gradually becomes transparent. This is known as the Fade Out effect.
          • -
          - -

          Figure: Fade effect

          -

          Fade effect

          - -

          You can control UI events and change the DOM elements in the following ways:

          -
            -
          • Events can be controlled with JavaScript, and DOM elements can be devised with CSS.
          • -
          • You can use JavaScript frameworks, such as jQuery, Prototype, and Dojo.
          • -
          - -

          To create fade effects:

          - -
            -
          • Create a modal layer pop-up using jQuery: - -
            -(function($) 
            -{
            -   function showModalPopup(url) 
            -   {
            -      $('body').append('<div class="mask"></div>'); /* Mask in body appended */
            -      $('.mask').css({'height': $(window).height()}); /* Mask area set */
            -
            -      /* Target layer position set */
            -      $(url).css(
            -      {
            -         'top': ($(window).height()/2 + $(document).scrollTop() - $(url).height()/2) + 'px', 
            -         'left': ($(window).width()/2 + $(document).scrollLeft() - $(url).width()/2) + 'px'
            -      });
            -
            -      /* Fade effect */
            -      $('.mask').fadeTo('slow', 0.7);
            -      $(url).fadeTo('slow', 1);
            -   };
            -
            -   $('.layerpopupActive a').on('click', function()
            -   {
            -      var targetUrl = $(this).attr('href');
            -
            -      showModalPopup(targetUrl);
            -
            -      return false;
            -   });
            -  
            -   /* End processing - Fade Out effect */
            -    
            -   $('body').on('click', function(e) 
            -   {
            -      if (e.target.className === 'mask') 
            -      {
            -         $('.layerpop').fadeOut();
            -         $('.mask').fadeOut(400, function() 
            -         {
            -            $('.mask').remove();
            -         });
            -      };
            -   });
            -})(jQuery);
            - -

            If the animation effect is created by using JavaScript, the browser executes the following tasks:

            -
              -
            1. A structure layer is created and added to the document. This is a CPU task.
            2. -
            3. The added layer is painted as a default value. This is a GPU task.
            4. -
            5. The layer is painted once again according to the change of value. This is a CPU operation.
            6. -
            - -

            Steps a and c incur CPU tasks, which affect performance the most.

            -

            In case of step a, only 2 layers are created, but as the number of layers created increases, the efficiency of page rendering work drops. In case of step c as well, the more steps it undergoes, the slower the rendering becomes.

            -

            In certain browsers, even if the style of just 1 layer is changed, the entire document is repainted. As the repainting takes only a moment, any animation effects that are supposed to happen cannot be executed in such a short time. This issue occurs frequently in Android™ with severe fragmentation.

            - - - - - - - - - - -
            Note
            If a new layer is created in Android 4.0X version, and if the fade effect is used, it only shows the initial value and the result value of the layer style.
            - -

            To avoid such a situation to the maximum possible extent, CPU tasks must be reduced to the minimum, and it is better to use transition or animation that uses the internal timer of the browser.

            - - - - - - - - - - -
            Note
            In case of using 3D effects, -webkit-transform: translateZ(0); can be used to accelerate the hardware. However, since hardware acceleration support varies between the OS and devices, the actual resulting effects can vary too. Moreover, in the case of version Android™ 2.1, iOS™3.X and below, note that transition and animation may not be realized.
            -
          • -
          • Create a modal layer pop-up using CSS3: -
            -<!--CSS-->
            -.mask 
            -{
            -   opacity: 0;
            -   z-index: -1;
            -   -webkit-transition: all 400ms ease-in-out;
            -}
            -
            -.mask.active 
            -{
            -   opacity: .7;
            -   z-index: 498;
            -}
            -
            -<!--Layer pop-up public styles-->
            -.layerpop 
            -{
            -   opacity: 0;
            -   z-index: -1;
            -   -webkit-transition: all 300ms ease-in-out;
            -}
            -
            -.layerpop.active 
            -{
            -   opacity: 1;
            -   z-index: 499;
            -}
            -/* JavaScript */
            -function showModalPopup(url) 
            -{
            -   url.className += 'active';
            -}
            -
          • -
          -

          Performance Differences

          - -

          There can be a difference in performance depending on how the modal layer pop-up is used.

          -

          The following figures illustrate the difference in event performance, when using JavaScript and CSS3.

          -

          Figure: Event performance using JavaScript

          -

          Events using JavaScript

          - -

          Figure: Event performance using CSS3

          -

          Events using CSS3

          - -

          The following figures illustrate the difference in memory performance, when using JavaScript and CSS3.

          -

          Figure: Memory performance using JavaScript

          -

          Memory when using JavaScript

          - -

          Figure: Memory performance using CSS3

          -

          Memory when using CSS3

          - -

          When the styles are applied using JavaScript, the UI thread is used to create the pop-up. The UI thread increases the usage of CPU memory in proportion to the number of pop-ups used.

          - - - - - - - - - - -
          Note
          Tizen provides remote debugging through the JavaScript Debugger tool.
          - - - - - - - - - - -
          Note

          If CSS is used, the handling of JavaScript events and UI DOM operations becomes unnecessary, so the load of the UI thread decreases, and the usage of CPU memory decreases as well. However, CSS3 transitions cannot be applied to versions below Android™ 2.3 and for versions above iOS™ 4.3, which are still widely used, so attention is needed when distributing it to various devices.

          - -

          Using Hardware Acceleration

          - -

          The rendering performance of a Web application depends on both the Tizen platform and application design.

          -

          In hardware acceleration, GPU is used to perform a function faster than is possible if the application is running on the CPU. It enhances the rendering performance in the dynamic objects used in Web applications.

          - -

          Using CSS Transition and 3D Transform

          -

          To improve the rendering performance, separate moving elements to independent layers as much as possible. You can use CSS transition with the -webkit-transition CSS attribute, or 3D transform with the -webkit-transform attribute. For the best performance, set the -webkit-transform attribute to the 3D type.

          -

          In all the following examples, a blue box moves from top left to bottom right for a second.

          -

          Figure: Blue box

          -

          Blue box

          - -
            -
          • Use CPU painting: -

            JavaScript performs CPU painting for a moving element for each frame at 16 ms interval using the setTimeout() method over the changing top-left coordinate. This approach does not use hardware acceleration, but only running on the CPU.

            -
              -
            1. Construct the blue box and set its position on the screen: -
              <!DOCTYPE html>
              -<html xmlns="http://www.w3.org/1999/xhtml">
              -   <head>
              -      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
              -      <title>JavaScript transition sample</title>
              -      <style>
              -         #box 
              -         {
              -            position: absolute;
              -            width: 100px;
              -            height: 100px;
              -            background-color: blue;
              -            left: 0px;
              -            top: 50px;
              -         }
              -      </style>
              -
            2. -
            3. -

              Perform CPU painting for a moving element at a rate of 1 frame per 16 ms (62.5 frames per second) using the setTimeout() method:

              -
                    <script>
              -         var delta = 0;
              -         function startTransition() 
              -         {
              -            process();
              -         }
              -         function process ()
              -         {
              -            document.getElementById('box').style.left = delta + "px";
              -            document.getElementById('box').style.top = delta + 50 + "px";
              -            delta += 4;
              -            if (delta <= 200)
              -               setTimeout(function() {process();}, 16);
              -         }
              -      </script>
              -   </head>
              -   <body>
              -      <div id='box' onclick='startTransition()'>click me!</div>
              -   </body>
              -</html>
          • -
          • Use CSS transition: -

            Separate a moving element to an independent layer with the -webkit-transition CSS attribute. This approach uses hardware acceleration, and can enhance performance while an element is moving.

            -
            <!DOCTYPE html>
            -<html xmlns="http://www.w3.org/1999/xhtml">
            -   <head>
            -      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            -      <title>-webkit-transition sample</title>
            -      <style>
            -         #box 
            -         {
            -            position: absolute;
            -            width: 100px;
            -            height: 100px;
            -            left: 0px;
            -            top: 50px;
            -            background-color: blue;
            -            -webkit-transition-duration: 1s;
            -            -webkit-transition-timing-function: linear;
            -         }
            -      </style>
            -      <script>
            -         function startTransition()
            -         {
            -            document.getElementById('box').style.webkitTransform = "translate(200px, 200px)";
            -         }
            -      </script>
            -   </head>
            -   <body>
            -      <div id='box' onclick='startTransition()'>click me!</div>
            -   </body>
            -</html>
            -
          • -
          • Use 3D transform: -

            Use the -webkit-transform: translate3d 3D transform attribute. The element is separated to an independent layer and uses hardware acceleration irrespective of its movement:

            -
            <!DOCTYPE html>
            -<html xmlns="http://www.w3.org/1999/xhtml">
            -   <head>
            -      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            -      <title>-webkit-transition with translate3d sample</title>
            -      <style>
            -         #box 
            -         {
            -            position: absolute;
            -            width: 100px;
            -            height: 100px;
            -            left: 0px;
            -            top: 50px;
            -            background-color: blue;
            -            -webkit-transform: translate3d(0, 0, 0);
            -            -webkit-transition-duration: 1s;
            -            -webkit-transition-timing-function: linear;
            -         }
            -      </style>
            -      <script>
            -         function startTransition() 
            -         {
            -            document.getElementById('box').style.webkitTransform = "translate3d(200px, 200px, 0px)";
            -         }
            -      </script>
            -   </head>
            -   <body>
            -      <div id='box' onclick='startTransition()'>click me!<p></div>
            -   </body>
            -</html>
            -
          • -
          -

          Using Accelerated Overflow Scroll

          -

          If a page has an overflow scroll, use the -webkit-overflow-scrolling attribute. It separates overflow scroll to an independent layer and enhances rendering performance:

          -
          #scroll_area 
          -{
          -   overflow: scroll;
          -   -webkit-overflow-scrolling: touch;
          -}
          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/transition_w.htm b/org.tizen.ui.guides/html/web/w3c/transition_w.htm deleted file mode 100755 index c21bc1e..0000000 --- a/org.tizen.ui.guides/html/web/w3c/transition_w.htm +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - - - - - - - - CSS Transitions Module Level 3: Changing Element Styles - - - - - - -
          -

          CSS Transitions Module Level 3: Changing Element Styles

          - -

          Transitions allow you to enable implicit transitions, which describe how the CSS properties can be made to change smoothly from one value to another over a given duration. To enhance the rendering performance, you can use hardware acceleration.

          - -

          When using the CSS transition properties, the Tizen browser requires the -webkit- prefix.

          - -

          Transition Properties

          - -

          You can define various properties to control the element transitions:

          - -
            -
          • transition-property -

            This property defines the element property that is changed during the transition. In the following code snippet, both the width and height of the element change when the mouse hovers over it, but the transition effect is applied to the width property only.

          • - -
          • transition-duration -

            This property defines the duration of the transition. You must define as many instances of the property as you have elements in the transition-property property.

          • - -
          • transition-timing-function -

            This property defines the pace of the transition. The value of the property is defined as a stepping function or a cubic Bézier curve. The ease stepping function equals cubic-bezier(0.25, 0.1, 0.25, 1), and the linear stepping function equals cubic-bezier(0, 0, 1, 1).

          • - -
          • transition-delay -

            This property defines the delay time before the start of the transition.

          • - -
          - -

          The following code snippet demonstrates how to use transition properties. For a complete source code, see transition_property.html.

          - -
          -<head>
          -   <style type="text/css">
          -      body{font-size: 12px}
          -
          -      .box 
          -      {
          -         -webkit-transition-property: width;
          -         -webkit-transition-duration: 2s;
          -         -webkit-transition-timing-function: ease;
          -         -webkit-transition-delay: 0.5s;
          -      }
          -
          -      .box: hover 
          -      {
          -         width: 300px;
          -         height: 200px;
          -         background: CornflowerBlue;
          -      }
          -   </style>
          -</head>
          -<body>
          -   <h1>CSS transitions tutorial</h1>
          -   <div class="box">
          -      <p>Mouse over or tap here to animate</p>
          -      <p>transition-property: width, height, background</p>
          -   </div>
          -</body>
          -
          - - - - - - - - - -
          Note
          The hover pseudo class in Tizen maintains a mouseover state when an element is tapped, and becomes a mouseout state when another element is tapped.
          - -

          The transition property allows you to define all the transition properties in a shorthand mode in the order of transition-property | transition-duration | transition-timing-function | transition-delay. If you omit a property value, a default value is used instead.

          - -
          -<style type="text/css">
          -   .box 
          -   {
          -      -webkit-transition: width 1s ease 1s;
          -   }
          -</style>
          -
          - -

          The transition property connects movement more naturally than the more generally used the pseudo classes, such as :hover or :active. The smooth effect can be achieved more conveniently and easily with the transition property than with JavaScript or Flash, and the transition property also supports the browser side to provide excellent performance.

          - - -

          Modifying Element Properties

          - -

          To enhance the user experience of your application, you must learn to use transitions to change element property values naturally. This example uses a partial section of the http://tizen.org Web site, where the current "UPCOMING EVENTS" area only has the text-decoration: underline property in a mouseover state (the text gets underlined when the mouse hovers over it). To improve the effects, the example adds various transitions properties in this area.

          - - -

          Figure: Tizen site section to be transitioned

          -

          Tizen site section to be transitioned

          - - -
          1. Add a background color change to the "UPCOMING EVENTS" area during a mouseover state:

            - -
            1. Originally, the area on the site is defined as follows:

              - -
              -<h2 class="block-title">Upcoming Events</h2>
              -
              - - -

              Additionally, a transition property is declared in the block-title class:

              - -
              -.block-title 
              -{
              -   -webkit-transition: all 2s ease;
              -}
              -
              -

              The all value in the transition property means that the transition effect applies to all CSS properties of the element.

              -
            2. - -
            3. Define the mouseover state for the block-title class: - -
              -.block-title: hover {background: #eaeaea;}
              -
              - -

              Due to the CSS characteristics, adding a class through an event allows immediate rendering in the screen.

            - -

            When the mouse is moved over the "UPCOMING EVENTS" area, the background color changes.

            - -

            Background color change

          2. - -
          3. - -

            Apply the transition effect in other elements:

            - -
            1. To avoid unnecessary repetition, tie a list of transition elements together into groups a and span: - -
              -.location, .date, .location .anibg, h3 > a, .day > span 
              -{
              -   -webkit-transition: all 1s ease;
              -}
              -
            2. - -
            3. When the mouse hovers over the date element, change the background of the date and the font size of all the elements tied into the span group. When the mouse hovers over the title element, change the color of all elements tied into the a group.

              -
              -.date: hover {background: #d2ecff !important;}
              -.date: hover .day > span {font-size: 1.9em;}
              -
              -.event-info: hover h3 > a {color: #ec4986;}
              -
            - -

            Before mouseover -

          4. -
          5. - -

            Emphasize the location phrase by adding an empty element. The emphasis is made by filling the background with black from left to right, and changing the font color to an appropriate value for the black background.

            -
              -
            1. Add the empty element:

              - -
              -<div class="location">San Francisco, CA<span class="anibg"></span></div>
              -
            2. -
            3. Create the effect using the width value of the added element:

              -
              -.location {position: relative; z-index: 3; margin-top: 3px;}
              -.location .anibg 
              -{
              -   position: absolute; 
              -   left: -3px; top: 0; 
              -   display: block; 
              -   width: 0; height: 100%; 
              -   background: #000; 
              -   z-index: -1;
              -}
              -
              - -

              The effect is defined by using the position property. The location element position is declared relative, while the anibg child element position is declared as absolute. The width of the child element basic state is set as 0. Since the child element layer covers the location text, the child element has been defined to come out from the back of the text in the z-index value of the child.

            4. -
            5. Define the state to be changed:

              -
              -.location, .date, .location .anibg, h3 > a, .day > span 
              -{
              -   -webkit-transition: all 1s ease;
              -}
              -
              -.event-info: hover .location {color: #fff;}
              -.event-info: hover .location .anibg {width: 100%; color: #fff;}
              -
              - -

              The transition takes place when the property in question is at the front on the screen. The event-info class is used as the subject for the change, and it has been defined so that the transition occurs simultaneously in the .location and .anibg elements when the mouse hovers over any of the elements tied together as group a. -

            6. - -

            Location phrase emphasis

            -
          -

          Source Code

          -

          For the complete source code related to this use case, see the following file:

          - - -

          Using Hardware Acceleration

          - -

          The rendering performance of a Web application depends on both the Tizen platform and application design.

          -

          In hardware acceleration, GPU is used to perform a function faster than is possible if the application is running on the CPU. It enhances the rendering performance in the dynamic objects used in Web applications.

          - -

          Using CSS Transition and 3D Transform

          -

          To improve the rendering performance, separate moving elements to independent layers as much as possible. You can use CSS transition with the -webkit-transition CSS attribute, or 3D transform with the -webkit-transform attribute. For the best performance, set the -webkit-transform attribute to the 3D type.

          -

          In all the following examples, a blue box moves from top left to bottom right for a second.

          -

          Figure: Blue box

          -

          Blue box

          - -
            -
          • Use CPU painting: -

            JavaScript performs CPU painting for a moving element for each frame at 16 ms interval using the setTimeout() method over the changing top-left coordinate. This approach does not use hardware acceleration, but only running on the CPU.

            -
              -
            1. Construct the blue box and set its position on the screen: -
              <!DOCTYPE html>
              -<html xmlns="http://www.w3.org/1999/xhtml">
              -   <head>
              -      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
              -      <title>JavaScript transition sample</title>
              -      <style>
              -         #box 
              -         {
              -            position: absolute;
              -            width: 100px;
              -            height: 100px;
              -            background-color: blue;
              -            left: 0px;
              -            top: 50px;
              -         }
              -      </style>
              -
            2. -
            3. -

              Perform CPU painting for a moving element at a rate of 1 frame per 16 ms (62.5 frames per second) using the setTimeout() method:

              -
                    <script>
              -         var delta = 0;
              -         function startTransition() 
              -         {
              -            process();
              -         }
              -         function process ()
              -         {
              -            document.getElementById('box').style.left = delta + "px";
              -            document.getElementById('box').style.top = delta + 50 + "px";
              -            delta += 4;
              -            if (delta <= 200)
              -               setTimeout(function() {process();}, 16);
              -         }
              -      </script>
              -   </head>
              -   <body>
              -      <div id='box' onclick='startTransition()'>click me!</div>
              -   </body>
              -</html>
          • -
          • Use CSS transition: -

            Separate a moving element to an independent layer with the -webkit-transition CSS attribute. This approach uses hardware acceleration, and can enhance performance while an element is moving.

            -
            <!DOCTYPE html>
            -<html xmlns="http://www.w3.org/1999/xhtml">
            -   <head>
            -      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            -      <title>-webkit-transition sample</title>
            -      <style>
            -         #box 
            -         {
            -            position: absolute;
            -            width: 100px;
            -            height: 100px;
            -            left: 0px;
            -            top: 50px;
            -            background-color: blue;
            -            -webkit-transition-duration: 1s;
            -            -webkit-transition-timing-function: linear;
            -         }
            -      </style>
            -      <script>
            -         function startTransition()
            -         {
            -            document.getElementById('box').style.webkitTransform = "translate(200px, 200px)";
            -         }
            -      </script>
            -   </head>
            -   <body>
            -      <div id='box' onclick='startTransition()'>click me!</div>
            -   </body>
            -</html>
            -
          • -
          • Use 3D transform: -

            Use the -webkit-transform: translate3d 3D transform attribute. The element is separated to an independent layer and uses hardware acceleration irrespective of its movement:

            -
            <!DOCTYPE html>
            -<html xmlns="http://www.w3.org/1999/xhtml">
            -   <head>
            -      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            -      <title>-webkit-transition with translate3d sample</title>
            -      <style>
            -         #box 
            -         {
            -            position: absolute;
            -            width: 100px;
            -            height: 100px;
            -            left: 0px;
            -            top: 50px;
            -            background-color: blue;
            -            -webkit-transform: translate3d(0, 0, 0);
            -            -webkit-transition-duration: 1s;
            -            -webkit-transition-timing-function: linear;
            -         }
            -      </style>
            -      <script>
            -         function startTransition() 
            -         {
            -            document.getElementById('box').style.webkitTransform = "translate3d(200px, 200px, 0px)";
            -         }
            -      </script>
            -   </head>
            -   <body>
            -      <div id='box' onclick='startTransition()'>click me!<p></div>
            -   </body>
            -</html>
            -
          • -
          -

          Using Accelerated Overflow Scroll

          -

          If a page has an overflow scroll, use the -webkit-overflow-scrolling attribute. It separates overflow scroll to an independent layer and enhances rendering performance:

          -
          #scroll_area 
          -{
          -   overflow: scroll;
          -   -webkit-overflow-scrolling: touch;
          -}
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/ui_layout_ww.htm b/org.tizen.ui.guides/html/web/w3c/ui_layout_ww.htm deleted file mode 100755 index afecdf8..0000000 --- a/org.tizen.ui.guides/html/web/w3c/ui_layout_ww.htm +++ /dev/null @@ -1,715 +0,0 @@ - - - - - - - - - - - - - Multiple UI Layouts: Designing Applications for Multiple Devices - - - - - -
          -

          Multiple UI Layouts: Designing Applications for Multiple Devices

          - -

          To ensure the largest possible market for your application, you have to design your application layout so that your application can run on multiple Tizen devices.

          - - - - - - - - - - -
          Note
          This feature is supported in wearable applications only.
          - -

          Although the Web was originally designed to structure documents for large-scaled Internet world, with CSS (Cascading Style Sheet), JavaScript, and various device APIs, it is quickly evolving to a complete runtime environment for applications. In addition, its W3C open development model and the flexibility of its CSS-based presentation make it every developer's choice as the next development platform. CSS is the key technology for flexible presentation, and it is used to describe the look and formatting of HTML documents. The role of CSS is to determine how the logical structure of the document is displayed to the user.

          - -

          The Tizen Web engine provides the basic mechanisms for fitting the application content to the target screen. However, to ensure that the application runs well on multiple devices, you must understand those mechanisms in detail. In general, select a relative layout rather than a fixed layout, because a relative layout helps to maintain usability even when the application runs on unexpected devices. To enhance usability even further, use different layouts for each device category.

          - -

          Using some CSS techniques and Tizen Web engine mechanisms, you can design your application UI layout so that it displays properly on multiple devices:

          -
          • You can use a single layout and take advantage of the auto-fitting mechanism of the Tizen Web engine to ensure that a single layout covers multiple devices.
          • -
          • You can use multiple layouts to define a separate optimal layout for each device category.
          - -

          Single Layout for Multiple Devices

          -

          A typical application developer designs an optimized UI for a target device with a fixed layout and high-quality resources. This approach usually results in a nice look for the end user, but can sometimes result in an ugly layout, which makes the application unusable. And this unfortunate result can occur merely due to a change in the device form factor.

          -

          Since the presentation and business logic are strictly separated in a Web application, it handles the device form factor change better than native applications. One single layout, taking advantage of Web technology, can ensure usability even on multiple devices with different form factors.

          - -

          To design applications with a single layout, you must consider the following issues:

          - - - -

          For a complete application layout that considers all the above issues, see Single Layout Example.

          - -

          Viewport and Other Meta Tags

          - -

          The viewport is a screen area that the Web engine displays in the UI and, in the Web world, the viewport meta tag is used to inform the Web engine that this content is written for a specific form factor, such as device width. The viewport meta tag was introduced by Apple to fill the screen resolution gap between initial Smartphone (for example, 320 px) and PC (for example, 980 px). Basically, the viewport meta tag helps the Web engine to determine the scale factor for the content on the current device.

          - -

          To use the tag in an HTML file, set its name and content:

          -
          -<meta name="viewport" content="XXX">
          -
          - -

          As shown in the following code snippet, use the viewport meta tag to tell the Web engine which device width is targeted by the application. The Web engine can estimate the scale factor based on the target content size and the real screen width. For example, usually almost all wearable applications have the following viewport meta tag, which sets the viewport width to the appropriate size based on each device:

          -
          -<meta name="viewport" content="width=device-width, user-scalable=no">
          -
          - -

          If you want to set your content layout to the target width of 320 px on every wearable device, use the following meta tag:

          -
          -<meta name="viewport" content="width=320">
          -
          - -

          The viewport meta tag has other properties, such as height, initial-scale, minimum-scale, maximum-scale, and user-scalable. However, do not use those properties unless you understand their exact meaning. Wrong values can cause the Web engine to incorrectly fit the application content to the current device.

          - -

          Relative Layout

          - -

          The relative layout concept means that the element size of all content is set as a relative unit (such as percentage), and not as absolute values (such as pixels or points). In responsive Web design, this concept is also known as fluid grid (for more information, search for responsive web design in your Web browser). To achieve a layout that works on multiple devices, you only need to know about relative layout, not all the other concepts of responsive Web design.

          -

          To implementing a relative layout, you only have to set the width and height of each element as a percentage, as shown in the following example and figure. In the example, the width and height of the number_pad element is set to 100% and 70%, not 320 px and 224 px.

          - -

          Figure: 320x320 calculator

          -

          number_pad {width: 100%; height: 70%;}

          -

          320x320 calculator

          - -

          An application with this relative layout is auto-fitted when it runs on an unexpected device, such as the device with a 360x480 resolution shown in the following figure. Even though this adjusted layout may not be as good as the original, it is good enough, since it shows a usable application UI.

          - - -

          Figure: 360x480 calculator with a relative layout

          -

          360x480 calculator with a relative layout

          - -

          The following figure shows what happens if you use an absolute 320x320 layout. The presentation is definitely ugly (with an empty white space at the bottom) and usability reduced, although the calculation logic itself still works.

          -

          Figure: 360x480 calculator with an absolute 320x320 layout

          -

          number_pad {width: 320px; height: 224px;}

          - - -

          360x480 calculator with an absolute 320x320 layout

          - - - -

          While the content layout itself becomes the application UI layout on a Web page, a typical wearable application layout consists of a header area, content area, and footer area. With this trend, many wearable Web applications are designed by separating the 3 areas explicitly.

          -

          Figure: Typical wearable Web application layout

          -

          Typical wearable Web application layout

          - -

          Not setting the place of the header and footer areas clearly can easily cause problems for your layout. In case of the header, the side-effect is relatively small. However, a wrongly defined footer area can be quite visible and lead to poor usability. The following figure shows the original layout of a pedometer application that consists of a header, content, and footer, with a Stop button set in the footer area.

          -

          Figure: 320x320 sample Web application

          -

          320x320 sample Web application

          - -

          In this case, if the position of the footer is not defined explicitly or if the position and bottom properties do not have proper values, an ugly layout can be displayed on an unexpected device, such as the 360x480 screen shown in the following figure.

          -

          Figure: Layout on 360x480

          -

          Layout on 360x480

          - -

          To make the layout correct, define the position property as fixed and set the bottom property explicitly as 0 px:

          - -
          -.footer {position: fixed; bottom: 0px;}
          -
          - -

          The following figure shows the same Web application running on the unexpected device after the footer properties are defined properly. With the correct values, the Web application is usable even on a new target, not planned during the development phase. Note that if a relative layout is also applied to the content area, the result is an even better layout and further improved usability.

          -

          Figure: Usable layout on 360x480

          -

          Usable layout on 360x480

          - -

          Flexible Media

          - -

          One of key elements used in the content area is a media element, including image and video. As all other elements, the media elements also must be placed within a relative layout to allow the application flexibly handle resolution changes. When such relative sizing is applied to a media element, it is called flexible media in responsive Web design.

          -

          The main issue when making a media element size relative is to ensure that the usable ratio does not change. The following figure shows a video element that works on both 320x320 and 360x480 resolutions, even though the aspect ratio of the screen is changed and scaled up. Basically, when handling media elements, you want to keep the size or ratio of the element the same as in the initially targeted device, even when displayed using a different resolution and aspect ratio. To achieve this, set the width and height properties of the media element with percentage and the auto keyword.

          - -

          Figure: Flexible media on 320x320 and 360x480

          -

          .video iframe {width: 100%; height: auto;}

          -

          Flexible media on 320x320 and 360x480

          - - -

          The following figure shows an example of wrong usage, where usability decreases as the video element is simply scaled up based on the aspect ratio change. If you set the video element size using a fixed size like this, you get no benefit from the increased resolution, and the layout on the whole screen becomes inharmonious, decreasing usability.

          - - -

          Figure: Fixed size media element

          -

          .video iframe {width: 320px; height: 240px;}

          -

          Fixed size media element

          - -

          Single Layout Example

          - -

          This section illustrates a complete application layout that takes advantage of the issues discussed in previous sections. In particular, it shows how to set the viewport properly to help the Web engine scaling mechanism and how to create a CSS-based layout.

          - - -

          First of all, set the targeted size of the content area as 320 px in the viewport meta tag, and disable the user-scalable property, as shown in the following code snippet.

          - -
          -<html>
          -   <head>
          -      <link href="css/style.css" rel="stylesheet" type="text/css">                                             
          -      <meta name="viewport" content="width=320px, user-scalable=no" />                                                 
          -   </head>                                                                                                           
          -   <body>
          -      <main>
          -         <div class="tile left">
          -            <div id="box1" class="box"></div>
          -         </div>            
          -         <div class="tile right">
          -            <div id="box2" class="box"></div>
          -         </div> 
          -         <div class="tile left">
          -            <div id="box3" class="box"></div>                                                                       
          -         </div>
          -         <div class="tile right">
          -            <div id="box4" class="box"></div>                                                                       
          -         </div> 
          -      </main>
          -   </body> 
          -</html>
          -
          - -

          In the above HTML code, the content area consists of 4 <div> box elements, and their UI layout is described in the style.css file. The following CSS code programs the layout and the specific box element styles that were defined in the HTML file.

          -

          The code snippet shows that the content size is set to be same as the viewport size. Each box is filled with a different color and placed so that it fills a quarter of the content area. Because each box size is defined with the width and height of 100%, the relative size of each box element remains the same even if the viewport size changes.

          - -
          -<!--Default, used for all-->
          -* {box-sizing: border-box;}
          -body, div, h1 {margin: 0px; padding: 0px;}
          -html, body {width: 100%; height: 100%; overflow-x: hidden;}
          -
          -#box1 {background-color: rgb(255, 255, 141);}
          -#box2 {background-color: rgb(165, 241, 238);}
          -#box3 {background-color: rgb(248, 179, 179);}
          -#box4 {background-color: rgb(192, 161, 246);}
          -.tile 
          -{
          -   width: 50%;
          -   height: 50%;
          -   float: left;
          -}
          -.left {padding: 10px 5px 5px 10px;}
          -.right {padding: 10px 10px 5px 5px;}
          -
          -.box 
          -{
          -   width: 100%;
          -   height: 100%;
          -}
          -
          - - -

          The following figure shows a final view when the 320 px is set as a target device in the HTML file. As defined in the CSS file, the content area fills the whole screen, 320x320 pixels, and the 4 box elements equally divide the area.

          - -

          Figure: Original layout on a target device

          -

          Original layout on a target device

          -

          The following figure shows that the relative layout and scaling are correctly applied even when the same application is run on a mobile device with the aspect ratio of 16:9.

          -

          Figure: Scaled layout on a 16:9 mobile device

          -

          Scaled layout on a 16:9 mobile device

          -

          The following code snippet shows an example where the background color is replaced with an image while the layout is exactly same as in the 4 box example. The following figures show how the layout including media elements (such as images) functions exactly like the basic box layout.

          - -
          -<!--Default, used for all-->
          -* {box-sizing: border-box;}
          -body, div, h1 {margin: 0px; padding: 0px;}
          -html, body {width: 100%; height: 100%; overflow-x: hidden;}
          -
          -#box1 {background-color: rgb(255, 255, 141);}
          -#box2 {background-color: rgb(165, 241, 238);}
          -#box3 {background-color: rgb(248, 179, 179);}
          -#box4 {background-color: rgb(192, 161, 246);}
          -.tile 
          -{
          -   width: 50%;
          -   height: 50%;
          -   float: left;
          -}
          -.left {padding: 10px 5px 5px 10px;}
          -.right {padding: 10px 10px 5px 5px;}
          -
          -.box 
          -{
          -   width: 100%;
          -   height: 100%;
          -   padding: 20px;
          -   background: no-repeat center;
          -   background-size: 100% 100%;
          -}
          -
          -#box1 {background-image: url('../a.png');}
          -#box2 {background-image: url('../b.png');}
          -#box3 {background-image: url('../c.png');}
          -#box4 {background-image: url('../d.png');}
          -
          - - - -

          Figure: Image-based layout on a target device

          -

          Image-based layout on a target device

          - -

          Figure: Image-based scaled layout on a 16:9 mobile device

          -

          Image-based scaled layout on a 16:9 mobile device

          - - -

          Multiple Layouts for Multiple Devices

          - -

          In many cases, the desired end result for your application can be achieved using scaling and a relative layout within a single layout. However, this approach does not always provide the best quality for the end user.

          -

          You can support the best possible layout and usability with some additional development efforts. For instance, you can create an application which, on a tablet, shows the main information (clock face) and also delivers more meaningful information (calendar), while on a watch device the same application only displays the main information (clock face). This kind of end result, as shown in the following figure, cannot be achieved by only scaling up the whole layout of the watch device.

          -

          Figure: Application for a watch and tablet

          -

          Application for a watch and tablet

          - -

          W3C CSS3 Media Queries already support the majority of techniques needed to provide category-based layouts. To support the optimal layout using CSS techniques and design applications with multiple layouts, you must consider the following issues:

          - - - - -

          Since the 2.3.1 version, Tizen also supports a special media query feature to provide device shape-based layouts. If you want to create an application for both square-shaped and circular-shaped devices, you can easily migrate your application to support both shapes.

          -

          Figure: Application for a square and circular device

          -

          Application for a square and circular device

          - - -

          Viewport Setting for Multiple Layouts

          -

          The difference between multiple and single layouts is that, in the multiple layouts, the content width of the viewport meta tag is set to "device-width". This sets the layout viewport width to the ideal viewport width and tells the Web engine that the application adapts to the device width. In short, the "device-width" setting is needed to create an adaptive and responsive Web application.

          - -

          To use the meta tag in an HTML file, set its name and content:

          -
          -<meta name="viewport" content="width=device-width, user-scalable=no">
          -
          - -

          Category Classification

          - -

          When creating multiple layouts, you must first configure the layout categories. In other words, a classifying category is needed to fit the layout on the current executable environment. Media queries are supported in CSS3 to give Web application information to the executable environment.

          - -

          W3C Media Queries

          -

          Media queries consist of a media type and expressions of media features.

          - -

          The media types indicate the media on which the current Web application is running. They are defined in HTML4. The following media types are supported:

          -
          • aural
          • -
          • braille
          • -
          • handheld
          • -
          • print
          • -
          • projection
          • -
          • screen
          • -
          • tty
          • -
          • tv
          • -
          - -

          You can declare that sections apply to certain media types inside a CSS style sheet. As in the following example, you can declare screen as a media type and describe its layout inside {...}. That code applies the layout inside {...} when the Web application is run on the screen type executable context.

          - -
          -@media screen {...}
          -
          - -

          Several media queries can be combined in a media query list to configure the executable environment and define the detailed layout configuration, as needed. The following example shows a case in which the Web application runs on the executable environment having a screen media type and a 500 pixel minimum width. Its final view shows the layout inside {...} to the end user.

          - -
          -@media screen and (min-width: 500px) {...}
          -
          - -

          The following table lists the CSS media features, which you can use to specify the layout utilizing the media queries.

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Table: Media features
          FeatureValueMin/MaxDescription
          colorintegeryesNumber of bits per a color component
          color-indexNumber of entries in the color lookup table
          device-aspect-ratiointeger/integerAspect ratio
          device-heightlengthOutput device height
          device-widthOutput device width
          gridintegernoSet to true for a grid-based device
          heightlengthyesRendering surface height
          monochromeintegerNumber of bits per pixel in a monochrome frame buffer
          resolutionresolution (dpi or dpcm)Resolution
          scanprogressive or interlacednoScanning process of the tv media types
          widthlengthyesRendering surface width
          - -

          Tizen Specialized Media Query

          -

          Tizen supports a special media query feature for a circular device shape. The following table lists the supported media features.

          - - - - - - - - - - -
          Note
          This feature is supported since 2.3.1.
          - - - - - - - - - - - - - - - - - - - -
          Table: Tizen specialized media feature
          FeatureValueMin/MaxDescription
          -tizen-geometric-shape"rectangle" | "circle"NoDevice shape
          - -

          You can combine this media query feature with the W3C type in your code. The final view shows the layout inside {...} to the end user:

          -
          -@media all and (-tizen-geometric-shape: circle) {...}
          -
          - - -

          Classification for Display Modes

          - -

          The display mode can be classified as portrait or landscape for a rectangle-shaped device, or circular for a circular device.

          - -

          Portrait and Landscape

          - -

          You can configure the device landscape and portrait mode using the device-aspect-ratio attribute in media queries. This approach is already commonly used in creating mobile Web applications. The following example shows how the max-device-aspect-ratio feature is used.

          -

          If you use the orientation:portrait/landscape feature, the layout can change unexpectedly when the virtual keypad is displayed. To avoid the problem, use the device-aspect-ratio to configure the portrait and landscape mode.

          -
          -@media screen and (max-width: 320px) and (max-device-aspect-ratio: 1/1) 
          -{
          -   <!--For portrait mode-->
          -}
          -@media screen and (max-width: 640px) and (min-device-aspect-ratio: 11/10) 
          -{
          -   <!--For landscape mode-->
          -}
          -
          - -

          Circular Device

          - -

          You can configure the device circular mode using the -tizen-geometric-shape attribute in the Tizen environment. The following example shows how to use the -tizen-geometric-shape feature.

          - - - - - - - - - - -
          Note
          This feature is supported since 2.3.1.
          - - -
          -@media all and (-tizen-geometric-shape: circle) 
          -{
          -   <!--For a circular device-->
          -}
          -
          - -

          Application Migration to a Circular Device

          - -

          This section illustrates an example for how you can migrate a basic application from a rectangular device (such as Gear 2 or Gear S) to a circular device. Use this example as the best practice to improve your layout.

          - -

          The example uses the following HTML and CSS code for the sample application and its layout.

          - -
          -<!--HTML code-->
          -<section id="main">
          -   <header>HEADER</header>
          -   <article id="content">
          -      lt;ul>
          -         <li>List Item 1</li>
          -         <li>List Item 2</li>
          -         <li>List Item 3</li>
          -         <li>List Item 4</li>
          -         <li>List Item 5</li>
          -         <li>List Item 6</li>
          -         <li>List Item 7</li>
          -         <li>List Item 8</li>
          -         <li>List Item 9</li>
          -         <li>List Item 10</li>
          -      </ul>
          -   </article>
          -   <footer>FOOTER</footer>
          -</section>
          -
          -<!--CSS code-->
          -html, body 
          -{
          -   height: 100%;
          -   width: 100%;
          -   padding: 0;
          -   margin: 0;
          -   font-size: 24px;
          -   overflow: hidden;
          -}
          -
          -section 
          -{
          -   width: 100%;
          -   height: 100%;
          -   overflow: auto;
          -   padding: 70px 0;
          -}
          -
          -header, footer 
          -{
          -   width: 100%;
          -   height: 70px;
          -   min-height: 70px;
          -   line-height: 70px;
          -   font-size: 30px;
          -   text-align: center;
          -   position: fixed;
          -}
          -
          -header 
          -{
          -   top: 0;
          -}
          -
          -footer 
          -{
          -   bottom: 0;
          -}
          -
          -article ul li 
          -{
          -   border-top: 1px solid rgba(52, 52, 52, 1);
          -   padding: 15px 20px;
          -   color: rgba(209, 209, 209, 1);
          -   font-size: 40px;
          -}
          -
          -article ul li:first 
          -{
          -   border-top: 0 none;
          -}
          - -

          To migrate the application, use the following steps:

          - -
            -
          1. Use a relative layout. - -

            To achieve a responsive layout for different devices, implement a relative layout. Simply set the width: 100% attribute to the layout elements in the CSS code:

            -
            -section 
            -{
            -   width: 100%;
            -   height: 100%;
            -   ...
            -}
            -
            -header, footer 
            -{
            -   width: 100%;
            -   ...
            -} 
            - - - - - - - - - -
            Note
            The relative layout concept is described in more detail in Relative Layout.
            -
          2. -
          3. Set extra spaces both at the top and bottom. - -

            During the migration, you can see how a certain portion of the rectangle view is covered over by the circular view, especially the header and the footer. To make them fully and consistently visible in the circular view, provide a "padding" space at the top and bottom of the page. In the following example migrating to a circular gear device from a rectangular Gear S, extra 77 px padding is used:

            -
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   section {padding: 77px 0;}
            -}
            -
            - -

            Figure: Top and bottom padding

            -

            Top and bottom padding

            -
          4. -
          5. Set the header and footer position. - -

            After setting the top and bottom padding, set the header and footer position for scrolling in the circular view.

            -

            For a rectangular device with a lengthwise screen, especially Gear S, the best option is to make only the content area scrollable.

            - -

            Figure: Scrolling with a rectangular screen

            -

            Scrolling with a rectangular screen

            -

            In a circular screen, it is better to make the whole page scrollable, including the top and bottom space.

            -

            Figure: Scrolling with a circular screen

            -

            Scrolling with a circular screen

            - -

            To implement the header and footer position, use the CSS position attribute:

            -
            -<!--Rectangular device-->
            -header, footer 
            -{
            -   position: fixed;
            -}
            -
            -<!--Circular device-->
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   header, footer 
            -   {
            -      position: static;
            -   }
            -}
            -
            - -
          6. -
          7. Move the display to the initial position. - -

            To provide a better user experience, show the entire display at the beginning, including the "top padding" space. A few seconds after the application launch, move the display back to its initial position, where the header is placed on the top without any space between itself and the edge of the screen. When the display moves like this, the users can perceive the existence of the top space.

            - -

            Figure: Moving to the initial position

            -

            Moving to the initial position

            - -

            The scroll move requires several lines of JavaScript code. In the following sample, the few (N) seconds is set to 1500 ms, but you can change the value as needed.

            -
            -(function initScrollPosition() 
            -{
            -   var SCROLL_DELAY_TIME = 1500,
            -       page = document.getElementById("main"),
            -       scrollPosition = window.parseInt(window.getComputedStyle(page)["padding-top"]),
            -       initScrollTimeoutId = null,
            -       mql = window.matchMedia("(-tizen-geometric-shape: circle)");;
            -
            -   /* The effect is applied to a circular device only, so use mediaquery */
            -   if (mql.matches) 
            -   {	
            -      page.addEventListener("scroll", function clearInitScrollCallback() 
            -      {
            -         window.clearTimeout(initScrollTimeoutId);
            -         page.removeEventListener("scroll", clearInitScrollCallback, false);
            -      }, false);
            -
            -      initScrollTimeoutId = window.setTimeout(function() 
            -      {
            -         page.scrollTop = scrollPosition;
            -      }, SCROLL_DELAY_TIME);
            -   }
            -}());
            -
            - -
          8. -
          9. Set extra attributes for a better view. - -

            Extra attributes are not mandatory in the migration process, but they can be helpful for a better application view.

            -

            Sometimes changing the layout of the basic elements is not enough to achieve a user-friendly view, and changes in other elements' layout are needed too. For example, consider setting the text-align: center attribute for the header and list items in the circular view (this attribute is already defined in the above circular screenshots). If the list is aligned to left in a circular view, the list items may not be all visible when placed out of the middle space.

            - -
            -<!--Common style for header and footer text-->
            -header, footer 
            -{
            -   text-align: center;
            -}
            -
            -<!--In a circular screen, list item has a center position-->
            -@media all and (-tizen-geometric-shape: circle) 
            -{
            -   article ul li 
            -   {
            -      text-align: center;
            -      line-height: 60px;
            -   }
            -}
            -
            -
          10. -
          - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/html/web/w3c/woff_w.htm b/org.tizen.ui.guides/html/web/w3c/woff_w.htm deleted file mode 100755 index fa02e72..0000000 --- a/org.tizen.ui.guides/html/web/w3c/woff_w.htm +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - WOFF File Format 1.0: Changing Fonts Using WOFF - - - - - - -
          -

          WOFF File Format 1.0: Changing Fonts Using WOFF

          - -

          You can decode and restore font data easily.

          - -

          The new text features in WOFF File Format 1.0 include:

          -
            - -
          • WOFF file format 1.0 -

            WOFF (Web Open Font Format) is a packaging format used to decode and restore font data according to the @font-face rule to display it identically with the input font. The @font-face rule is a CSS rule that allows linking to fonts and finding a suitable font to display if the original font is not available. You can use WOFF within a Web page.

          • -
          - -

          Using the WOFF File Format

          - -

          To enhance the user experience of your application, you must learn to use the WOFF (Web Open Font Format) file format 1.0, which is a W3C standard font packaging format used in Web pages:

          - -
            -
          1. Download and use fonts installed on the Web server by creating @font-face rules. Within the rules, you can define the following properties: -
              -
            • font-family -

              Defines a name for the font. This property is mandatory.

            • -
            • src -

              Defines the URL of the font file on the server. This property is mandatory. If the local attribute is defined, the font resource is not downloaded from the server if it already exists in the local storage.

            • -
            • font-stretch -

              Defines the way the font is stretched. This property is optional.

            • -
            • font-style -

              Defines the font style. This property is optional.

            • -
            • font-weight -

              Defines the font weight. This property is optional.

            • -
            -

            Define the rules with in a <style> element in the <head> section of a Web page:

            -
            -<head>
            -   <style>
            -   @font-face
            -   {
            -      font-family: MuseoSans;
            -      src: local('MuseoSans'),
            -           url('https://www.tizen.org/sites/all/themes/tizen_theme/webfonts/244CBE_1_0.woff') format('woff');
            -   }
            -
            -   @font-face
            -   {
            -      font-family: MuseoSans;
            -      font-weight: bold;
            -      src: local('MuseoSans'),
            -           url('https://www.tizen.org/sites/all/themes/tizen_theme/webfonts/244CBE_0_0.woff') format('woff');
            -   }
            -
            -   @font-face
            -   {
            -      font-family: MuseoSans;
            -      font-weight: 900;
            -      src: local('MuseoSans'),
            -           url('https://www.tizen.org/sites/all/themes/tizen_theme/webfonts/244CBE_2_0.woff') format('woff');
            -   }
            -
            -   p:nth-child(2) {font-family: MuseoSans}
            -   p:nth-child(3) {font-family: MuseoSans; font-weight: bold;}
            -   p:nth-child(4) {font-family: MuseoSans; font-weight: 900;}
            -   </style>
            -</head>
            -
          2. -
          3. In the <body> section, create <p> elements containing text in which the font rules are implemented: -
            <body>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -   <p>The quick brown fox jumps over a lazy dog.</p>
            -</body>
            -</html>
            -
            -
          4. -
          -

          Figure: Implementing the @font-face rules (in mobile applications only)

          -

          Implementing the @font-face rules (in mobile applications only)

          - - - - -
          - -Go to top - - - - - - - \ No newline at end of file diff --git a/org.tizen.ui.guides/index.xml b/org.tizen.ui.guides/index.xml deleted file mode 100755 index 78f30e1..0000000 --- a/org.tizen.ui.guides/index.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.tizen.ui.guides/plugin.xml b/org.tizen.ui.guides/plugin.xml deleted file mode 100755 index 4c22a91..0000000 --- a/org.tizen.ui.guides/plugin.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.tizen.ui.practices/.project b/org.tizen.ui.practices/.project new file mode 100644 index 0000000..0e416e7 --- /dev/null +++ b/org.tizen.ui.practices/.project @@ -0,0 +1,22 @@ + + + org.tizen.ui.practices_2.4.0 + + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + + diff --git a/org.tizen.ui.practices/META-INF/MANIFEST.MF b/org.tizen.ui.practices/META-INF/MANIFEST.MF new file mode 100644 index 0000000..9f596bf --- /dev/null +++ b/org.tizen.ui.practices/META-INF/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 1 +Bundle-Name: Tizen UI Practices +Bundle-SymbolicName: org.tizen.ui.practices;singleton=true +Bundle-Version: 2.4.0 +Bundle-Vendor: The Linux Foundation + diff --git a/org.tizen.ui.guides/about.html b/org.tizen.ui.practices/about.html old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/about.html rename to org.tizen.ui.practices/about.html diff --git a/org.tizen.ui.practices/build.properties b/org.tizen.ui.practices/build.properties new file mode 100644 index 0000000..b84ff38 --- /dev/null +++ b/org.tizen.ui.practices/build.properties @@ -0,0 +1,8 @@ +bin.includes = plugin.xml,\ + META-INF/,\ + html/,\ + build.properties,\ + .project,\ + about.html,\ + index.xml + diff --git a/org.tizen.ui.practices/html/cover_page.htm b/org.tizen.ui.practices/html/cover_page.htm new file mode 100644 index 0000000..f355edc --- /dev/null +++ b/org.tizen.ui.practices/html/cover_page.htm @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + Tizen UI Practices + + + + +

          Tizen
          +UI Practices

          + +

          Click the application type you want:

          +

          Web Application Native Application

          + + + + + + + + + + + + diff --git a/org.tizen.ui.practices/html/css/snippet.css b/org.tizen.ui.practices/html/css/snippet.css new file mode 100644 index 0000000..f880409 --- /dev/null +++ b/org.tizen.ui.practices/html/css/snippet.css @@ -0,0 +1,52 @@ +/* Pretty printing styles. Used with prettify.js. */ + +/* SPAN elements with the classes below are added by prettyprint. */ +.pln { color: #000 } /* plain text */ + +@media screen { + .str { color: #793AFF } /* string content */ + .kwd { color: #7F0055 } /* a keyword */ + .com { color: green} /* a comment */ + .typ { color: #1C1C1C } /* a type name */ + .lit { color: black } /* a literal value */ + /* punctuation, lisp open bracket, lisp close bracket */ + .pun, .opn, .clo { color: #1C1C1C} + .tag { color: #008 } /* a markup tag name */ + .atn { color: #606 } /* a markup attribute name */ + .atv { color: #080 } /* a markup attribute value */ + .dec, .var { color: #606 } /* a declaration; a variable name */ + .fun { color: red } /* a function name */ +} + +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { color: #060 } + .kwd { color: #006; font-weight: bold } + .com { color: #600; font-style: italic } + .typ { color: #404; font-weight: bold } + .lit { color: #044 } + .pun, .opn, .clo { color: #440 } + .tag { color: #006; font-weight: bold } + .atn { color: #404 } + .atv { color: #060 } +} + +/* Put a border around prettyprinted code snippets. */ +pre.prettyprint { overflow: auto; padding: 2px; border: 1px solid #888 } + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } diff --git a/org.tizen.ui.practices/html/css/styles.css b/org.tizen.ui.practices/html/css/styles.css new file mode 100644 index 0000000..4c8f5a8 --- /dev/null +++ b/org.tizen.ui.practices/html/css/styles.css @@ -0,0 +1,756 @@ +@charset "utf-8"; + +body { + background: white; + color: #1C1C1C; + margin-right: 20px; + margin-left: 20px; + font-size: 9pt; + font-weight: normal; + font-family: Arial, Helvetica, sans-serif; +} + +h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ol, dl, dd, dt, footer { + font-family: Arial, Verdana, Helvetica, sans-serif + } + +/* Set default font to 9 pt */ +table, div, p, dl, td, caption, th, ul, ol, li, dd, dt, pre, code { + font-size: 9pt; +} + +pre, code { + font-family: "Courier New", Courier, monospace; + border: 1px solid #719cc7; + margin: 6px 1.5px; + padding: 1px 1px 1px 1px; + font-weight: normal; + font-style: normal; +} + +h1 {font-size: 24pt; color: #0E437D;} +h2 {font-size: 18pt; color: #0E437D;} +h3 {font-size: 14pt; color: #1C1C1C;} +h4 {font-size: 12pt; color: #1C1C1C;} +h5 {font-size: 10pt; color: #1C1C1C;} + +h1, h2, h3, h4, h5 { + font-weight: bold; + font-style: normal; + line-height: normal; + margin-top: 16pt; +} + +caption, p.caption { + font-size: 9pt; + color: #1C1C1C; + font-weight: bold; + text-align: left; + margin-top: 20px; + margin-bottom: 0px; +} + +ol { + margin-bottom: 20px; +} + +ul ul , ol ul, ul ol, ol ol{ + margin-top: 10px; +} + +ul li, ol li { + margin-bottom: 10px; +} + +ol.tutorstep li { + border-top: 2px solid #719cc7; + list-style-position: inside; + font-weight: bold; + margin-top: 30px; + margin-left: -20px; + padding-top: 3px; + font-size: 12pt; +} + +ol.tutorstep li p{ + font-size: 9pt; + font-weight: normal; + margin-top: 10px; +} + +ol.tutorstep ol li, ol.tutorstep li ol li, ol.tutorstep li ul li { + font-size: 9pt; + list-style-position: outside; + margin-left: 0px; + font-weight: normal; +} + +ol.tutorstep ol li p, ol.tutorstep ul li p { + font-size: 9pt; + font-weight: normal; + margin-top: 5px; +} + +ol li p, ul li p { + font-size: 9pt; + font-weight: normal; + margin-bottom: 2px; + margin-top: 2px; +} + +ol ol , ol.tutorstep ol{ + font-size: 9pt; + font-weight: normal; + list-style-type: lower-alpha; + color: #1C1C1C; + border-style: none; + margin-top: 10px; +} + +ol.tutorstep ul { + margin-top: 10px; + font-size: 9pt; +} + +ol ol li, ol ul li, ol.tutorstep ol li, ol.tutorstep ul li { + border-style: none; + margin-top: 5px; + font-size: 9pt; +} + +ul { + font-size: 9pt; + font-weight: normal; + color: #1C1C1C; +} + + +/* End of font face declarations */ + +/* Set table borders and heading row background */ +table { + border: 0px; + border-collapse: collapse; + width: 100%; + margin-top: 20px; + margin-bottom: 20px; + background: white; +} + +th { + border-top: 2px solid #719cc7; + border-right: 1px solid #c6d9f1; + border-left: 1px solid #c6d9f1; + background-color: #f3f7fb; + padding: 4px; + color: #719cc7; + font-size: 9pt; + font-weight: bold; +} + +td { + border: 1px solid #c6d9f1; + vertical-align:top; + padding: 3px 20px 5px 20px; + } + +td.middle { + border: 1px solid #c6d9f1; + vertical-align:middle; + padding: 3px 20px 5px 20px; + } + +/* Notes stand out using a light top & bottom borders with yellow background */ +table.note { + border-top: 2px solid #719cc7; + border-left: 0px; + border-right: 0px; + width: 100%; +} + +tr.note { + text-align: left; +} + +th.note { + text-align: left; + background-color: #ddd9c3; + background-image: note.gif; + border-top: 2px solid #719cc7; + border-bottom:1px solid #719cc7; + border-right: none; + +} + +td.note, p.note { + background-color: #eeece1; + color: #1C1C1C; + padding: 5px; + margin-top:12px; + margin-bottom:12px; + border: none; +} + +/* Figure titles are centered and bolded */ +p.figure , ol.tutorstep li p.figure, ol.tutorstep ol li p.figure, ol.tutorstep ul li p.figure { + text-align: center; + font-weight: bold; +} + +/* Red background and white text for things that need fixing before release */ +.fix { + background-color: red; + font-weight: bold; + color: white; + } + +/* Classes for creating collapsible content */ +#banner { + padding: 8px 4px 8px 4px; + /* top right bottom left */ + border: 1px solid #7f7f7f; + width: 100%; + background-image: url("banner.png"); + text-align: left; + font-weight: bold; + font-size: 9pt; + color: #ffffff; +} + +#toc-navigation {width: 20%; position: fixed; right: 17px; top: 0; bottom: 51px; /* overflow: auto; *//* min-width: 200px; *//* background: white; */z-index: 100;padding-top: 10px;/* padding-bottom: 88px; */margin-bottom: 89px;} +#toc {padding: 0px 20px 5px 20px; /* border: 2px solid #567a9c; */ border-radius: 15px;position: absolute;top: 78px;bottom: 9px;overflow: auto;/* margin-bottom: 5px; */padding-bottom: 5px;border-bottom: 3px transparent solid;margin-left: 5px;} +#main {width: 75%; height: 90%;} +#container {width:100%;} +#container #contents {padding:0px 0 20px; overflow: auto;position: fixed;top: 0;bottom: 0;margin-bottom: 64px;right: 200px;left: 20px;} +body.no-toc #container #contents {right: 0;padding-right:30px;} +body.no-toc #toc-navigation {width: auto;} +body.no-toc .top {right: 19px; /* float:none; */ width: 28px;} +body.no-toc #profile {float: right;right: -32px;} +body.no-toc #profile p {padding: 0; margin: 0;} +#container #contents:after {content: "."; display: block; height: 20px; clear: both; visibility: hidden;} + #container #contents>.content {/* width:75%; */min-width: 600px;/* right: 300px; *//* position: fixed; */padding-right: 5px;} + #container #contents>.content>.cont { margin-bottom:80px; padding-bottom:80px; } + +.devicespecs-util {float:right; margin-top:25px;} + .devicespecs-util ul.dutil {margin:0; padding-bottom:0; height: 11px; list-style-type:none;} + .devicespecs-util ul.dutil:after {content: "."; display: block; height: 0px; clear: both; visibility: hidden;} + .devicespecs-util ul.dutil li {float:left; margin-right:8px; padding-right:8px; background:url('../images/bg_util_bar.gif') no-repeat right center; color:#666;} + .devicespecs-util ul.dutil li.none {margin-right:0; padding-right:0; background-image:none;} + .devicespecs-util ul.dutil li a { font-size:11px; color:#666; line-height: 11px;} + .devicespecs-util ul.dutil li a:hover { color:#222; } + .devicespecs-util ul.dutil li a:active { color:#222; } + +ul.devicespecifications {clear:both; width:100%; margin:0; padding: 0;} +ul.devicespecifications > li { width:100%; margin-top:0; padding-left:0; list-style-type:none; border:1px solid #799cd3; padding: 5px 0px 5px 0px;} +ul.devicespecifications li div.devicespec-con {width:90%; margin:10px 0 20px 0; padding:0 14px; font-size: 13px;} +ul.devicespecifications li div.devicespec-tit {/*height:22px;*/ padding-right: 71px; background-color:#ffffff; position: relative;} + ul.devicespecifications li div.devicespec-tit .items-tit { /*float:left;*/ margin:0 0 0 14px; padding:0; color:#567a9c; line-height: 22px; font-size: 14px; font-style:normal; font-weight: bold;} + + ul.devicespecifications li div.devicespec-tit .items-tit-h2 { /*float:left;*/ margin: 0px 0px 0px 14px; padding:0; line-height: 22px; font-size: 18pt; color: #0E437D; font-style:normal; font-weight: bold;} + ul.devicespecifications li div.devicespec-tit .items-tit-h3 { /*float:left;*/ margin:0 0 0 14px; padding:0; line-height: 22px; font-size: 14pt; color: #1C1C1C; font-style:normal; font-weight: bold;} + ul.devicespecifications li div.devicespec-tit .items-tit-h4 { /*float:left;*/ margin:0 0 0 14px; padding:0; line-height: 22px; font-size: 12pt; color: #1C1C1C; font-style:normal; font-weight: bold;} + + ul.devicespecifications li div.devicespec-tit > span {position: absolute; top: 0; right:0;background:#416cbb; display:block; height:22px; margin-right:0; border-left: solid 1px #7a9bd4; } + ul.devicespecifications li div.devicespec-tit > span a.bt-arr {display:block; width: 55px; height:15px; margin-left:0; padding-top:5px; padding-left: 14px; text-align:left; background: url('../images/ico_arr_hidden.gif') 46px 9px no-repeat;} + ul.devicespecifications li div.devicespec-tit > span a.bt-arr em {display:inline-block; height: 14px; line-height:11px; font-size:11px; color:#fff; font-style:normal; margin-right: 8px;} + ul.devicespecifications li div.devicespec-tit > span * {vertical-align:middle;} + + ul.devicespecifications li div.devicespec-con ul.con-list { width:100%; } + ul.devicespecifications li div.devicespec-con ul.con-list li {line-height: 18px; margin:0; padding:0 0 0 7px; background: url("../images/ico_bullet_2_7.gif") 0 8px no-repeat; } + +.ul.ul, .ul.ul li {margin-bottom: 10px; list-style-type: disc; border: none;} +.ul.ul ul, .ul.ul ul li, .ol.ol ul, .ol.ol ul li {list-style-type: circle;} +.ol.ol, .ol.ol li {list-style-type: decimal; border: none;} +.ol.ol ol, .ol.ol ol li, .ul.ul ol, .ul.ul ol li {list-style-type: lower-alpha;} + +.static-cont {width:100%; margin-bottom:40px;} + +.top {text-align: right;} +.toc, ul.toc{ + margin: 10px 0px 0px 0px; + padding-left: 13px; + list-style: disc; + font-size: 9pt; + line-height: 115%; + } + +.toc-title { + font-size: 12pt; + color: #0E437D; + font-weight: bold; + font-style: normal; + line-height: normal; + margin-top: 16pt; +} + +a.top { + display:block; + float: right; + position:fixed; + width: 28px; + height:89px; + bottom:50px; + z-index: 101; + right: 19%; + } + +a img {border: 0;} + +/* Footer includes space and a gray line above */ +#footer { + position: fixed; + /* width: 100%; */ + bottom: 0px; + text-align: center; + border-top: 1px solid #CCCCCC; + background-color: #FFFFFF; + left: 21px; right: 21px; +} + +.footer {font-size: 8pt;} + +caption { + font-size: 9pt; + color: #1C1C1C; + font-weight: bold; + text-align: center; + margin-top: 20px; + margin-bottom: 0px; +} + +div.qindex, div.navpath, div.navtab{ + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a:link { + color: #719cc7; + text-decoration: underline; + font-weight: bold; +} + +a:hover { + color: #0e437d; +} + +a:visited { + text-decoration: underline; + color: #719cc7; + font-weight: bold; +} + +a.qindex { + font-weight: bold; + padding: 2px; +} + +a.qindex:hover { + text-decoration: underline; + color: #0e437d; + padding: 2px; +} + +a.qindex:visited { + text-decoration: underline; + font-weight: bold; + color: #719cc7; + padding: 2px; +} + +a.qindexHL { + text-decoration: underline; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + padding: 2px 6px; + border: 1px double #9295C2; +} + +a.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; + padding: 2px 6px; +} + +dl.el { + margin-left: -1cm +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 4px 6px; + margin: 4px 8px 4px 2px; +} + +div.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 6px; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +td.md { + background-color: #f5f5f5; + font-weight: bold; +} + +td.mdname1 { + background-color: #f5f5f5; + font-weight: bold; + color: #602020; +} + +td.mdname { + background-color: #f5f5f5; + font-weight: bold; + color: #602020; + width: 600px; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +td.indexkey { + background-color: #eeeeff; + font-weight: bold; + border: 1px solid #CCCCCC; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #eeeeff; + border: 1px solid #CCCCCC; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #f0f0f0; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { +} + +img.formulaInl { + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { color: #008000 } +span.keywordtype { color: #604020 } +span.keywordflow { color: #e08000 } +span.comment { color: #800000 } +span.preprocessor { color: #806020 } +span.stringliteral { color: #002080 } +span.charliteral { color: #008080 } +span.vhdldigit { color: #ff00ff } +span.vhdlchar { color: #000000 } +span.vhdlkeyword { color: #700070 } +span.vhdllogic { color: #ff0000 } + +.mdTable { + border: 1px solid #868686; + background-color: #F4F4FB; +} + +.mdRow { + padding: 8px 10px; +} + +/* @group Member Descriptions */ + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F4F4F4A; + border: none; + margin: 4px; + padding: 3px 8px 4px 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #DBDBDB; +} + +.memTemplParams { + color: #606060; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #eeeeff; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; +} + +.memname { + white-space: nowrap; + font-weight: bold; +} + +.memproto, .memdoc { + border: 1px solid #9BBCDD; +} + +.memproto { + padding: 0; + background-color: #D5E2EF; + font-weight: bold; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + -moz-border-radius-topleft: 8px; + -moz-border-radius-topright: 8px; +} + +.memdoc { + padding: 2px 5px; + background-color: #eef3f5; + border-top-width: 0; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; +} + +.memdoc p, .memdoc dl, .memdoc ul { + margin: 6px 0; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #853E0E; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +.search { color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #eeeeff; +} + +td.tiny { + font-size: 75%; +} + +.highlight { + background-color:#E2E2FF; +} + +/*---------- ide-eclipse Styles ---------*/ +.sh_ide-eclipse{font-family: "Courier New", Courier, monospace; + margin: 0px 0px; + padding: -30px -30px -30px -30px; + font-weight: normal; + font-style: normal;} +.sh_ide-eclipse .sh_sourceCode{background-color:#fff;color:#000;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_keyword{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_type{color:#7f0055;font-weight:bold;font-style:normal;} +/*.sh_ide-eclipse .sh_sourceCode .sh_string{color:#00f;font-weight:normal;font-style:normal;}*/ +.sh_ide-eclipse .sh_sourceCode .sh_string{color:#2A00FF;font-weight:normal;font-style:normal;} + +.sh_ide-eclipse .sh_sourceCode .sh_regexp{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_specialchar{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_comment{color:#238E23;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_number{color:#000;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_preproc{color:#3f5fbf;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_function{color:#000;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_url{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_date{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_time{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_file{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_ip{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_name{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_variable{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_oldfile{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_newfile{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_difflines{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_selector{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_property{color:#7f0055;font-weight:bold;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_value{color:#00f;font-weight:normal;font-style:normal;} +.sh_ide-eclipse .sh_sourceCode .sh_unknown{font-family: "Courier New", Courier, monospace;} + +/*------------- STYLE FOR NAMES FROM XML FILE -------------*/ +.sh_styleFromXML{color:#800000;font-weight:bold;} +/*-------------------------------------------------------*/ + +/*-------- Snippet Base Styles ----------*/ +.snippet-wrap {position:relative;} +*:first-child+html .snippet-wrap {display:inline-block;} +* html .snippet-wrap {display:inline-block;} +.snippet-reveal{text-decoration:underline;} +.snippet-wrap .snippet-menu, .snippet-wrap .snippet-hide {position:absolute; top:-99999px; right:15px; font-size:.9em;z-index:1;background-color:transparent;} +.snippet-wrap .snippet-hide {top:auto; bottom:1px;} +*:first-child+html .snippet-wrap .snippet-hide {bottom:1px;} +* html .snippet-wrap .snippet-hide {bottom:1px;} +.snippet-wrap .snippet-menu pre, .snippet-wrap .snippet-hide pre {background-color:transparent; margin:1; padding:0;} +.snippet-wrap .snippet-menu a, .snippet-wrap .snippet-hide a {padding:1px; text-decoration:underline;} +.snippet-wrap pre.sh_sourceCode{padding:1px;line-height:120%;overflow:auto;position:relative; +-moz-border-radius:0px; +-webkit-border-radius:0px; +border-radius:0px; +box-shadow: 1px 1px px #000; +-moz-box-shadow: 2px 2px 1px #000; +-webkit-box-shadow: 1px 1px 1px #000;} +.snippet-wrap pre.snippet-textonly {padding:1em;} +*:first-child+html .snippet-wrap pre.snippet-formatted {padding:0.5em 0.5em;} +* html .snippet-wrap pre.snippet-formatted {padding:0em 0.3em;} +.snippet-reveal pre.sh_sourceCode {padding:0em 0em; text-align:right;} +.snippet-wrap .snippet-num li{padding-left:2px;} +.snippet-wrap .snippet-no-num{list-style:none; padding:0em 0em; margin:0;} +.snippet-wrap .snippet-no-num li {list-style:none; padding-left:0;} +.snippet-wrap .snippet-num {margin:1em 0 1em 1em; padding-left:2px;} +.snippet-wrap .snippet-num li {list-style:decimal-leading-zero outside none;} +.snippet-wrap .snippet-no-num li.box {padding:0 6px; margin-left:-6px;} +.snippet-wrap .snippet-num li.box {border:1px solid; list-style-position:inside; margin-left:0px; padding-left:2px;} +*:first-child+html .snippet-wrap .snippet-num li.box {margin-left:-2px;} +* html .snippet-wrap .snippet-num li.box {margin-left:-2px;} +.snippet-wrap li.box-top {border-width:0px 0px 0 !important;} +.snippet-wrap li.box-bot {border-width:0 0px 0px !important;} +.snippet-wrap li.box-mid {border-width:0 0px !important;} +.snippet-wrap .snippet-num li .box-sp {width:10px; display:inline-block;} +*:first-child+html .snippet-wrap .snippet-num li .box-sp {width:20px;} +* html .snippet-wrap .snippet-num li .box-sp {width:2px;} +.snippet-wrap .snippet-no-num li.box {border:1px solid;} +.snippet-wrap .snippet-no-num li .box-sp {display:none;} + +/* Layout fixing */ +.clfix:after {content: "."; display: block; height: 0px; clear: both; visibility: hidden;} +.clfix {display: inline-block;} +.clfix {display: block;} +* html .clfix {height: 1%;} /* Hides from IE-mac */ +.clfix {zoom:1;} /*for IE 5.5-7*/ + +.fl {float:left !important;} +.fr {float:right !important;} +.cl {clear:both;} +.rel {position:relative;} +.abs {position:absolute;} +.ac {text-align:center !important;} +.ar {text-align:right !important;} +.al {text-align:left !important;} +.at {vertical-align:top !important;} +.am {vertical-align:middle !important;} +.ab {vertical-align:bottom;} +.hand {cursor:pointer;} +.bgnone {background:none !important;} +.brnone {border:none !important;} +.b {font-weight:bold !important;} +.n {font-weight:normal !important;} +.invisible{display:block; overflow:hidden; visibility:hidden; width:0; height:0; margin:0; font-size:0; line-height:0;} +.mt5 {margin-top:5px !important;} +/* //Layout fixing */ + +@media print { .hide, .show { display: none; }} + +div#profile { + position: relative; +} +#profile p { + text-align: right; +} + +div#toc_border { + border: 2px solid rgb(86, 122, 156); border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; height: 565px; +} + +#contents li { + padding-top: 3px; + margin-top: 5px; + /* overflow: auto; */ +} + +p { + /* overflow: auto; */ +} + +div.table { + /* overflow: auto; */ +} \ No newline at end of file diff --git a/org.tizen.ui.guides/html/images/4_columns.png b/org.tizen.ui.practices/html/images/4_columns.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/4_columns.png rename to org.tizen.ui.practices/html/images/4_columns.png diff --git a/org.tizen.ui.guides/html/images/9patch.png b/org.tizen.ui.practices/html/images/9patch.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/9patch.png rename to org.tizen.ui.practices/html/images/9patch.png diff --git a/org.tizen.ui.guides/html/images/9patch_buffer.png b/org.tizen.ui.practices/html/images/9patch_buffer.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/9patch_buffer.png rename to org.tizen.ui.practices/html/images/9patch_buffer.png diff --git a/org.tizen.ui.guides/html/images/9patch_resource.png b/org.tizen.ui.practices/html/images/9patch_resource.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/9patch_resource.png rename to org.tizen.ui.practices/html/images/9patch_resource.png diff --git a/org.tizen.ui.guides/html/images/9patch_zoomed.png b/org.tizen.ui.practices/html/images/9patch_zoomed.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/9patch_zoomed.png rename to org.tizen.ui.practices/html/images/9patch_zoomed.png diff --git a/org.tizen.ui.guides/html/images/accordion_menu.png b/org.tizen.ui.practices/html/images/accordion_menu.png similarity index 100% rename from org.tizen.ui.guides/html/images/accordion_menu.png rename to org.tizen.ui.practices/html/images/accordion_menu.png diff --git a/org.tizen.ui.guides/html/images/actor_coordinates.png b/org.tizen.ui.practices/html/images/actor_coordinates.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/actor_coordinates.png rename to org.tizen.ui.practices/html/images/actor_coordinates.png diff --git a/org.tizen.ui.guides/html/images/actor_position.png b/org.tizen.ui.practices/html/images/actor_position.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/actor_position.png rename to org.tizen.ui.practices/html/images/actor_position.png diff --git a/org.tizen.ui.guides/html/images/actor_types.png b/org.tizen.ui.practices/html/images/actor_types.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/actor_types.png rename to org.tizen.ui.practices/html/images/actor_types.png diff --git a/org.tizen.ui.practices/html/images/after_resize.png b/org.tizen.ui.practices/html/images/after_resize.png new file mode 100644 index 0000000..3690528 Binary files /dev/null and b/org.tizen.ui.practices/html/images/after_resize.png differ diff --git a/org.tizen.ui.guides/html/images/align.png b/org.tizen.ui.practices/html/images/align.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/align.png rename to org.tizen.ui.practices/html/images/align.png diff --git a/org.tizen.ui.guides/html/images/align_hints.png b/org.tizen.ui.practices/html/images/align_hints.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/align_hints.png rename to org.tizen.ui.practices/html/images/align_hints.png diff --git a/org.tizen.ui.guides/html/images/anchor_point.png b/org.tizen.ui.practices/html/images/anchor_point.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/anchor_point.png rename to org.tizen.ui.practices/html/images/anchor_point.png diff --git a/org.tizen.ui.guides/html/images/animation1.png b/org.tizen.ui.practices/html/images/animation1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/animation1.png rename to org.tizen.ui.practices/html/images/animation1.png diff --git a/org.tizen.ui.guides/html/images/animation_components.png b/org.tizen.ui.practices/html/images/animation_components.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/animation_components.png rename to org.tizen.ui.practices/html/images/animation_components.png diff --git a/org.tizen.ui.guides/html/images/application_page_layout.png b/org.tizen.ui.practices/html/images/application_page_layout.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/application_page_layout.png rename to org.tizen.ui.practices/html/images/application_page_layout.png diff --git a/org.tizen.ui.guides/html/images/application_store_sd.png b/org.tizen.ui.practices/html/images/application_store_sd.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/application_store_sd.png rename to org.tizen.ui.practices/html/images/application_store_sd.png diff --git a/org.tizen.ui.guides/html/images/applying_color.png b/org.tizen.ui.practices/html/images/applying_color.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/applying_color.png rename to org.tizen.ui.practices/html/images/applying_color.png diff --git a/org.tizen.ui.guides/html/images/applying_invisibility.png b/org.tizen.ui.practices/html/images/applying_invisibility.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/applying_invisibility.png rename to org.tizen.ui.practices/html/images/applying_invisibility.png diff --git a/org.tizen.ui.guides/html/images/aspect-control-both.png b/org.tizen.ui.practices/html/images/aspect-control-both.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/aspect-control-both.png rename to org.tizen.ui.practices/html/images/aspect-control-both.png diff --git a/org.tizen.ui.guides/html/images/aspect-control-horizontal.png b/org.tizen.ui.practices/html/images/aspect-control-horizontal.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/aspect-control-horizontal.png rename to org.tizen.ui.practices/html/images/aspect-control-horizontal.png diff --git a/org.tizen.ui.guides/html/images/aspect-control-none.png b/org.tizen.ui.practices/html/images/aspect-control-none.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/aspect-control-none.png rename to org.tizen.ui.practices/html/images/aspect-control-none.png diff --git a/org.tizen.ui.guides/html/images/backWearable.png b/org.tizen.ui.practices/html/images/backWearable.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/backWearable.png rename to org.tizen.ui.practices/html/images/backWearable.png diff --git a/org.tizen.ui.guides/html/images/background_control_color.png b/org.tizen.ui.practices/html/images/background_control_color.png similarity index 100% rename from org.tizen.ui.guides/html/images/background_control_color.png rename to org.tizen.ui.practices/html/images/background_control_color.png diff --git a/org.tizen.ui.guides/html/images/background_image.png b/org.tizen.ui.practices/html/images/background_image.png similarity index 100% rename from org.tizen.ui.guides/html/images/background_image.png rename to org.tizen.ui.practices/html/images/background_image.png diff --git a/org.tizen.ui.guides/html/images/background_image_color.png b/org.tizen.ui.practices/html/images/background_image_color.png similarity index 100% rename from org.tizen.ui.guides/html/images/background_image_color.png rename to org.tizen.ui.practices/html/images/background_image_color.png diff --git a/org.tizen.ui.guides/html/images/background_order.png b/org.tizen.ui.practices/html/images/background_order.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/background_order.png rename to org.tizen.ui.practices/html/images/background_order.png diff --git a/org.tizen.ui.guides/html/images/background_textlabel.png b/org.tizen.ui.practices/html/images/background_textlabel.png similarity index 100% rename from org.tizen.ui.guides/html/images/background_textlabel.png rename to org.tizen.ui.practices/html/images/background_textlabel.png diff --git a/org.tizen.ui.guides/html/images/base_layout.png b/org.tizen.ui.practices/html/images/base_layout.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/base_layout.png rename to org.tizen.ui.practices/html/images/base_layout.png diff --git a/org.tizen.ui.guides/html/images/base_scale.png b/org.tizen.ui.practices/html/images/base_scale.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/base_scale.png rename to org.tizen.ui.practices/html/images/base_scale.png diff --git a/org.tizen.ui.guides/html/images/base_scales.png b/org.tizen.ui.practices/html/images/base_scales.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/base_scales.png rename to org.tizen.ui.practices/html/images/base_scales.png diff --git a/org.tizen.ui.guides/html/images/basic_layout_480x800.png b/org.tizen.ui.practices/html/images/basic_layout_480x800.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/basic_layout_480x800.png rename to org.tizen.ui.practices/html/images/basic_layout_480x800.png diff --git a/org.tizen.ui.guides/html/images/basic_layout_720x1280.png b/org.tizen.ui.practices/html/images/basic_layout_720x1280.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/basic_layout_720x1280.png rename to org.tizen.ui.practices/html/images/basic_layout_720x1280.png diff --git a/org.tizen.ui.practices/html/images/before_resize.png b/org.tizen.ui.practices/html/images/before_resize.png new file mode 100644 index 0000000..4ab2c47 Binary files /dev/null and b/org.tizen.ui.practices/html/images/before_resize.png differ diff --git a/org.tizen.ui.guides/html/images/bg.png b/org.tizen.ui.practices/html/images/bg.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/bg.png rename to org.tizen.ui.practices/html/images/bg.png diff --git a/org.tizen.ui.guides/html/images/bg_tree.png b/org.tizen.ui.practices/html/images/bg_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/bg_tree.png rename to org.tizen.ui.practices/html/images/bg_tree.png diff --git a/org.tizen.ui.guides/html/images/bg_util_bar.gif b/org.tizen.ui.practices/html/images/bg_util_bar.gif old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/bg_util_bar.gif rename to org.tizen.ui.practices/html/images/bg_util_bar.gif diff --git a/org.tizen.ui.guides/html/images/bg_wn.png b/org.tizen.ui.practices/html/images/bg_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/bg_wn.png rename to org.tizen.ui.practices/html/images/bg_wn.png diff --git a/org.tizen.ui.guides/html/images/blue_box.png b/org.tizen.ui.practices/html/images/blue_box.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/blue_box.png rename to org.tizen.ui.practices/html/images/blue_box.png diff --git a/org.tizen.ui.guides/html/images/border.png b/org.tizen.ui.practices/html/images/border.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/border.png rename to org.tizen.ui.practices/html/images/border.png diff --git a/org.tizen.ui.guides/html/images/bottom.png b/org.tizen.ui.practices/html/images/bottom.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/bottom.png rename to org.tizen.ui.practices/html/images/bottom.png diff --git a/org.tizen.ui.guides/html/images/box.png b/org.tizen.ui.practices/html/images/box.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/box.png rename to org.tizen.ui.practices/html/images/box.png diff --git a/org.tizen.ui.guides/html/images/box_model_properties.png b/org.tizen.ui.practices/html/images/box_model_properties.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/box_model_properties.png rename to org.tizen.ui.practices/html/images/box_model_properties.png diff --git a/org.tizen.ui.guides/html/images/box_model_properties_struct.png b/org.tizen.ui.practices/html/images/box_model_properties_struct.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/box_model_properties_struct.png rename to org.tizen.ui.practices/html/images/box_model_properties_struct.png diff --git a/org.tizen.ui.guides/html/images/btn_top.gif b/org.tizen.ui.practices/html/images/btn_top.gif old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/btn_top.gif rename to org.tizen.ui.practices/html/images/btn_top.gif diff --git a/org.tizen.ui.guides/html/images/button.png b/org.tizen.ui.practices/html/images/button.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button.png rename to org.tizen.ui.practices/html/images/button.png diff --git a/org.tizen.ui.guides/html/images/button_anchor.png b/org.tizen.ui.practices/html/images/button_anchor.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_anchor.png rename to org.tizen.ui.practices/html/images/button_anchor.png diff --git a/org.tizen.ui.guides/html/images/button_bottom_o_wn.png b/org.tizen.ui.practices/html/images/button_bottom_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_bottom_o_wn.png rename to org.tizen.ui.practices/html/images/button_bottom_o_wn.png diff --git a/org.tizen.ui.guides/html/images/button_circle.png b/org.tizen.ui.practices/html/images/button_circle.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_circle.png rename to org.tizen.ui.practices/html/images/button_circle.png diff --git a/org.tizen.ui.guides/html/images/button_default.png b/org.tizen.ui.practices/html/images/button_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_default.png rename to org.tizen.ui.practices/html/images/button_default.png diff --git a/org.tizen.ui.guides/html/images/button_default_wn.png b/org.tizen.ui.practices/html/images/button_default_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_default_wn.png rename to org.tizen.ui.practices/html/images/button_default_wn.png diff --git a/org.tizen.ui.guides/html/images/button_drawers.png b/org.tizen.ui.practices/html/images/button_drawers.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_drawers.png rename to org.tizen.ui.practices/html/images/button_drawers.png diff --git a/org.tizen.ui.guides/html/images/button_dropdown.png b/org.tizen.ui.practices/html/images/button_dropdown.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_dropdown.png rename to org.tizen.ui.practices/html/images/button_dropdown.png diff --git a/org.tizen.ui.guides/html/images/button_green_wn.png b/org.tizen.ui.practices/html/images/button_green_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_green_wn.png rename to org.tizen.ui.practices/html/images/button_green_wn.png diff --git a/org.tizen.ui.guides/html/images/button_hover_v.png b/org.tizen.ui.practices/html/images/button_hover_v.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_hover_v.png rename to org.tizen.ui.practices/html/images/button_hover_v.png diff --git a/org.tizen.ui.guides/html/images/button_hover_v_entry.png b/org.tizen.ui.practices/html/images/button_hover_v_entry.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_hover_v_entry.png rename to org.tizen.ui.practices/html/images/button_hover_v_entry.png diff --git a/org.tizen.ui.guides/html/images/button_hoversel.png b/org.tizen.ui.practices/html/images/button_hoversel.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_hoversel.png rename to org.tizen.ui.practices/html/images/button_hoversel.png diff --git a/org.tizen.ui.guides/html/images/button_hoversel_entry.png b/org.tizen.ui.practices/html/images/button_hoversel_entry.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_hoversel_entry.png rename to org.tizen.ui.practices/html/images/button_hoversel_entry.png diff --git a/org.tizen.ui.guides/html/images/button_next_wn.png b/org.tizen.ui.practices/html/images/button_next_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_next_wn.png rename to org.tizen.ui.practices/html/images/button_next_wn.png diff --git a/org.tizen.ui.guides/html/images/button_option.png b/org.tizen.ui.practices/html/images/button_option.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_option.png rename to org.tizen.ui.practices/html/images/button_option.png diff --git a/org.tizen.ui.guides/html/images/button_orange_wn.png b/org.tizen.ui.practices/html/images/button_orange_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_orange_wn.png rename to org.tizen.ui.practices/html/images/button_orange_wn.png diff --git a/org.tizen.ui.guides/html/images/button_recorder.png b/org.tizen.ui.practices/html/images/button_recorder.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_recorder.png rename to org.tizen.ui.practices/html/images/button_recorder.png diff --git a/org.tizen.ui.guides/html/images/button_red_wn.png b/org.tizen.ui.practices/html/images/button_red_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_red_wn.png rename to org.tizen.ui.practices/html/images/button_red_wn.png diff --git a/org.tizen.ui.guides/html/images/button_title_cancel.png b/org.tizen.ui.practices/html/images/button_title_cancel.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_title_cancel.png rename to org.tizen.ui.practices/html/images/button_title_cancel.png diff --git a/org.tizen.ui.guides/html/images/button_title_done.png b/org.tizen.ui.practices/html/images/button_title_done.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_title_done.png rename to org.tizen.ui.practices/html/images/button_title_done.png diff --git a/org.tizen.ui.guides/html/images/button_titleicon_wn.png b/org.tizen.ui.practices/html/images/button_titleicon_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_titleicon_wn.png rename to org.tizen.ui.practices/html/images/button_titleicon_wn.png diff --git a/org.tizen.ui.guides/html/images/button_tree.png b/org.tizen.ui.practices/html/images/button_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_tree.png rename to org.tizen.ui.practices/html/images/button_tree.png diff --git a/org.tizen.ui.guides/html/images/button_wn.png b/org.tizen.ui.practices/html/images/button_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/button_wn.png rename to org.tizen.ui.practices/html/images/button_wn.png diff --git a/org.tizen.ui.guides/html/images/calculator_sd.png b/org.tizen.ui.practices/html/images/calculator_sd.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/calculator_sd.png rename to org.tizen.ui.practices/html/images/calculator_sd.png diff --git a/org.tizen.ui.guides/html/images/calling_img_sep.png b/org.tizen.ui.practices/html/images/calling_img_sep.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/calling_img_sep.png rename to org.tizen.ui.practices/html/images/calling_img_sep.png diff --git a/org.tizen.ui.guides/html/images/captured_screen1.png b/org.tizen.ui.practices/html/images/captured_screen1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/captured_screen1.png rename to org.tizen.ui.practices/html/images/captured_screen1.png diff --git a/org.tizen.ui.guides/html/images/captured_screen2.png b/org.tizen.ui.practices/html/images/captured_screen2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/captured_screen2.png rename to org.tizen.ui.practices/html/images/captured_screen2.png diff --git a/org.tizen.ui.guides/html/images/change_text_globally.png b/org.tizen.ui.practices/html/images/change_text_globally.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/change_text_globally.png rename to org.tizen.ui.practices/html/images/change_text_globally.png diff --git a/org.tizen.ui.guides/html/images/changed_order.png b/org.tizen.ui.practices/html/images/changed_order.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/changed_order.png rename to org.tizen.ui.practices/html/images/changed_order.png diff --git a/org.tizen.ui.guides/html/images/changing_opacity.png b/org.tizen.ui.practices/html/images/changing_opacity.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/changing_opacity.png rename to org.tizen.ui.practices/html/images/changing_opacity.png diff --git a/org.tizen.ui.guides/html/images/check.png b/org.tizen.ui.practices/html/images/check.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check.png rename to org.tizen.ui.practices/html/images/check.png diff --git a/org.tizen.ui.guides/html/images/check_default.png b/org.tizen.ui.practices/html/images/check_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_default.png rename to org.tizen.ui.practices/html/images/check_default.png diff --git a/org.tizen.ui.guides/html/images/check_default_o_wn.png b/org.tizen.ui.practices/html/images/check_default_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_default_o_wn.png rename to org.tizen.ui.practices/html/images/check_default_o_wn.png diff --git a/org.tizen.ui.guides/html/images/check_default_wn.png b/org.tizen.ui.practices/html/images/check_default_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_default_wn.png rename to org.tizen.ui.practices/html/images/check_default_wn.png diff --git a/org.tizen.ui.guides/html/images/check_favorite.png b/org.tizen.ui.practices/html/images/check_favorite.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_favorite.png rename to org.tizen.ui.practices/html/images/check_favorite.png diff --git a/org.tizen.ui.guides/html/images/check_on_off.png b/org.tizen.ui.practices/html/images/check_on_off.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_on_off.png rename to org.tizen.ui.practices/html/images/check_on_off.png diff --git a/org.tizen.ui.guides/html/images/check_onoff_o_wn.png b/org.tizen.ui.practices/html/images/check_onoff_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_onoff_o_wn.png rename to org.tizen.ui.practices/html/images/check_onoff_o_wn.png diff --git a/org.tizen.ui.guides/html/images/check_onoff_wn.png b/org.tizen.ui.practices/html/images/check_onoff_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_onoff_wn.png rename to org.tizen.ui.practices/html/images/check_onoff_wn.png diff --git a/org.tizen.ui.guides/html/images/check_small_o_wn.png b/org.tizen.ui.practices/html/images/check_small_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_small_o_wn.png rename to org.tizen.ui.practices/html/images/check_small_o_wn.png diff --git a/org.tizen.ui.guides/html/images/check_tree.png b/org.tizen.ui.practices/html/images/check_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_tree.png rename to org.tizen.ui.practices/html/images/check_tree.png diff --git a/org.tizen.ui.guides/html/images/check_wn.png b/org.tizen.ui.practices/html/images/check_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/check_wn.png rename to org.tizen.ui.practices/html/images/check_wn.png diff --git a/org.tizen.ui.guides/html/images/checkbox_button.png b/org.tizen.ui.practices/html/images/checkbox_button.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/checkbox_button.png rename to org.tizen.ui.practices/html/images/checkbox_button.png diff --git a/org.tizen.ui.guides/html/images/circle_datetime.png b/org.tizen.ui.practices/html/images/circle_datetime.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/circle_datetime.png rename to org.tizen.ui.practices/html/images/circle_datetime.png diff --git a/org.tizen.ui.guides/html/images/circle_genlist.png b/org.tizen.ui.practices/html/images/circle_genlist.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/circle_genlist.png rename to org.tizen.ui.practices/html/images/circle_genlist.png diff --git a/org.tizen.ui.guides/html/images/circle_progressbar.png b/org.tizen.ui.practices/html/images/circle_progressbar.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/circle_progressbar.png rename to org.tizen.ui.practices/html/images/circle_progressbar.png diff --git a/org.tizen.ui.guides/html/images/circle_scroller.png b/org.tizen.ui.practices/html/images/circle_scroller.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/circle_scroller.png rename to org.tizen.ui.practices/html/images/circle_scroller.png diff --git a/org.tizen.ui.guides/html/images/circle_slider.png b/org.tizen.ui.practices/html/images/circle_slider.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/circle_slider.png rename to org.tizen.ui.practices/html/images/circle_slider.png diff --git a/org.tizen.ui.practices/html/images/circle_spinner.png b/org.tizen.ui.practices/html/images/circle_spinner.png new file mode 100644 index 0000000..6d228d2 Binary files /dev/null and b/org.tizen.ui.practices/html/images/circle_spinner.png differ diff --git a/org.tizen.ui.guides/html/images/circular_support.png b/org.tizen.ui.practices/html/images/circular_support.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/circular_support.png rename to org.tizen.ui.practices/html/images/circular_support.png diff --git a/org.tizen.ui.guides/html/images/coin_flip_effect.png b/org.tizen.ui.practices/html/images/coin_flip_effect.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/coin_flip_effect.png rename to org.tizen.ui.practices/html/images/coin_flip_effect.png diff --git a/org.tizen.ui.guides/html/images/color_colorplane.png b/org.tizen.ui.practices/html/images/color_colorplane.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/color_colorplane.png rename to org.tizen.ui.practices/html/images/color_colorplane.png diff --git a/org.tizen.ui.guides/html/images/colorsel.png b/org.tizen.ui.practices/html/images/colorsel.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/colorsel.png rename to org.tizen.ui.practices/html/images/colorsel.png diff --git a/org.tizen.ui.guides/html/images/colorselector_tree.png b/org.tizen.ui.practices/html/images/colorselector_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/colorselector_tree.png rename to org.tizen.ui.practices/html/images/colorselector_tree.png diff --git a/org.tizen.ui.guides/html/images/column_break.png b/org.tizen.ui.practices/html/images/column_break.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/column_break.png rename to org.tizen.ui.practices/html/images/column_break.png diff --git a/org.tizen.ui.guides/html/images/column_gap.png b/org.tizen.ui.practices/html/images/column_gap.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/column_gap.png rename to org.tizen.ui.practices/html/images/column_gap.png diff --git a/org.tizen.ui.guides/html/images/column_rule.png b/org.tizen.ui.practices/html/images/column_rule.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/column_rule.png rename to org.tizen.ui.practices/html/images/column_rule.png diff --git a/org.tizen.ui.guides/html/images/column_settings.png b/org.tizen.ui.practices/html/images/column_settings.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/column_settings.png rename to org.tizen.ui.practices/html/images/column_settings.png diff --git a/org.tizen.ui.guides/html/images/column_span.png b/org.tizen.ui.practices/html/images/column_span.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/column_span.png rename to org.tizen.ui.practices/html/images/column_span.png diff --git a/org.tizen.ui.guides/html/images/column_width.png b/org.tizen.ui.practices/html/images/column_width.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/column_width.png rename to org.tizen.ui.practices/html/images/column_width.png diff --git a/org.tizen.ui.guides/html/images/conformant.png b/org.tizen.ui.practices/html/images/conformant.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/conformant.png rename to org.tizen.ui.practices/html/images/conformant.png diff --git a/org.tizen.ui.guides/html/images/contextual_bottom_o_wn.png b/org.tizen.ui.practices/html/images/contextual_bottom_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/contextual_bottom_o_wn.png rename to org.tizen.ui.practices/html/images/contextual_bottom_o_wn.png diff --git a/org.tizen.ui.guides/html/images/contextual_select_o_wn.png b/org.tizen.ui.practices/html/images/contextual_select_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/contextual_select_o_wn.png rename to org.tizen.ui.practices/html/images/contextual_select_o_wn.png diff --git a/org.tizen.ui.guides/html/images/contextual_top_o_wn.png b/org.tizen.ui.practices/html/images/contextual_top_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/contextual_top_o_wn.png rename to org.tizen.ui.practices/html/images/contextual_top_o_wn.png diff --git a/org.tizen.ui.guides/html/images/contextual_wn.png b/org.tizen.ui.practices/html/images/contextual_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/contextual_wn.png rename to org.tizen.ui.practices/html/images/contextual_wn.png diff --git a/org.tizen.ui.guides/html/images/copy_pasting.png b/org.tizen.ui.practices/html/images/copy_pasting.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/copy_pasting.png rename to org.tizen.ui.practices/html/images/copy_pasting.png diff --git a/org.tizen.ui.guides/html/images/css_bg1.png b/org.tizen.ui.practices/html/images/css_bg1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_bg1.png rename to org.tizen.ui.practices/html/images/css_bg1.png diff --git a/org.tizen.ui.guides/html/images/css_bg_tutorial1.png b/org.tizen.ui.practices/html/images/css_bg_tutorial1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_bg_tutorial1.png rename to org.tizen.ui.practices/html/images/css_bg_tutorial1.png diff --git a/org.tizen.ui.guides/html/images/css_bg_tutorial2.png b/org.tizen.ui.practices/html/images/css_bg_tutorial2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_bg_tutorial2.png rename to org.tizen.ui.practices/html/images/css_bg_tutorial2.png diff --git a/org.tizen.ui.guides/html/images/css_color_tutorial1.png b/org.tizen.ui.practices/html/images/css_color_tutorial1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_color_tutorial1.png rename to org.tizen.ui.practices/html/images/css_color_tutorial1.png diff --git a/org.tizen.ui.guides/html/images/css_result.png b/org.tizen.ui.practices/html/images/css_result.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_result.png rename to org.tizen.ui.practices/html/images/css_result.png diff --git a/org.tizen.ui.guides/html/images/css_transforms1.png b/org.tizen.ui.practices/html/images/css_transforms1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_transforms1.png rename to org.tizen.ui.practices/html/images/css_transforms1.png diff --git a/org.tizen.ui.guides/html/images/css_transforms2.png b/org.tizen.ui.practices/html/images/css_transforms2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_transforms2.png rename to org.tizen.ui.practices/html/images/css_transforms2.png diff --git a/org.tizen.ui.guides/html/images/css_transforms5.png b/org.tizen.ui.practices/html/images/css_transforms5.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/css_transforms5.png rename to org.tizen.ui.practices/html/images/css_transforms5.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup1.png b/org.tizen.ui.practices/html/images/ctxpopup1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup1.png rename to org.tizen.ui.practices/html/images/ctxpopup1.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup2.png b/org.tizen.ui.practices/html/images/ctxpopup2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup2.png rename to org.tizen.ui.practices/html/images/ctxpopup2.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup3.png b/org.tizen.ui.practices/html/images/ctxpopup3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup3.png rename to org.tizen.ui.practices/html/images/ctxpopup3.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup_default.png b/org.tizen.ui.practices/html/images/ctxpopup_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup_default.png rename to org.tizen.ui.practices/html/images/ctxpopup_default.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup_dropdown.png b/org.tizen.ui.practices/html/images/ctxpopup_dropdown.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup_dropdown.png rename to org.tizen.ui.practices/html/images/ctxpopup_dropdown.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup_dropdown_label.png b/org.tizen.ui.practices/html/images/ctxpopup_dropdown_label.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup_dropdown_label.png rename to org.tizen.ui.practices/html/images/ctxpopup_dropdown_label.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup_tree.png b/org.tizen.ui.practices/html/images/ctxpopup_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup_tree.png rename to org.tizen.ui.practices/html/images/ctxpopup_tree.png diff --git a/org.tizen.ui.guides/html/images/ctxpopup_wn.png b/org.tizen.ui.practices/html/images/ctxpopup_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ctxpopup_wn.png rename to org.tizen.ui.practices/html/images/ctxpopup_wn.png diff --git a/org.tizen.ui.guides/html/images/dali_component.png b/org.tizen.ui.practices/html/images/dali_component.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/dali_component.png rename to org.tizen.ui.practices/html/images/dali_component.png diff --git a/org.tizen.ui.practices/html/images/dali_threads.png b/org.tizen.ui.practices/html/images/dali_threads.png new file mode 100644 index 0000000..8010ca6 Binary files /dev/null and b/org.tizen.ui.practices/html/images/dali_threads.png differ diff --git a/org.tizen.ui.guides/html/images/date2.png b/org.tizen.ui.practices/html/images/date2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/date2.png rename to org.tizen.ui.practices/html/images/date2.png diff --git a/org.tizen.ui.guides/html/images/datetime_date_layout.png b/org.tizen.ui.practices/html/images/datetime_date_layout.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_date_layout.png rename to org.tizen.ui.practices/html/images/datetime_date_layout.png diff --git a/org.tizen.ui.guides/html/images/datetime_date_o_wn.png b/org.tizen.ui.practices/html/images/datetime_date_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_date_o_wn.png rename to org.tizen.ui.practices/html/images/datetime_date_o_wn.png diff --git a/org.tizen.ui.guides/html/images/datetime_date_wn.png b/org.tizen.ui.practices/html/images/datetime_date_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_date_wn.png rename to org.tizen.ui.practices/html/images/datetime_date_wn.png diff --git a/org.tizen.ui.guides/html/images/datetime_time_24h.png b/org.tizen.ui.practices/html/images/datetime_time_24h.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_time_24h.png rename to org.tizen.ui.practices/html/images/datetime_time_24h.png diff --git a/org.tizen.ui.guides/html/images/datetime_time_layout.png b/org.tizen.ui.practices/html/images/datetime_time_layout.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_time_layout.png rename to org.tizen.ui.practices/html/images/datetime_time_layout.png diff --git a/org.tizen.ui.guides/html/images/datetime_time_o_wn.png b/org.tizen.ui.practices/html/images/datetime_time_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_time_o_wn.png rename to org.tizen.ui.practices/html/images/datetime_time_o_wn.png diff --git a/org.tizen.ui.guides/html/images/datetime_time_wn.png b/org.tizen.ui.practices/html/images/datetime_time_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_time_wn.png rename to org.tizen.ui.practices/html/images/datetime_time_wn.png diff --git a/org.tizen.ui.guides/html/images/datetime_tree.png b/org.tizen.ui.practices/html/images/datetime_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_tree.png rename to org.tizen.ui.practices/html/images/datetime_tree.png diff --git a/org.tizen.ui.guides/html/images/datetime_wn.png b/org.tizen.ui.practices/html/images/datetime_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/datetime_wn.png rename to org.tizen.ui.practices/html/images/datetime_wn.png diff --git a/org.tizen.ui.guides/html/images/default_order.png b/org.tizen.ui.practices/html/images/default_order.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/default_order.png rename to org.tizen.ui.practices/html/images/default_order.png diff --git a/org.tizen.ui.guides/html/images/depth.png b/org.tizen.ui.practices/html/images/depth.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/depth.png rename to org.tizen.ui.practices/html/images/depth.png diff --git a/org.tizen.ui.guides/html/images/dimension_dependency.png b/org.tizen.ui.practices/html/images/dimension_dependency.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/dimension_dependency.png rename to org.tizen.ui.practices/html/images/dimension_dependency.png diff --git a/org.tizen.ui.guides/html/images/display_text_classes.png b/org.tizen.ui.practices/html/images/display_text_classes.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/display_text_classes.png rename to org.tizen.ui.practices/html/images/display_text_classes.png diff --git a/org.tizen.ui.guides/html/images/dragdrop.png b/org.tizen.ui.practices/html/images/dragdrop.png similarity index 100% rename from org.tizen.ui.guides/html/images/dragdrop.png rename to org.tizen.ui.practices/html/images/dragdrop.png diff --git a/org.tizen.ui.guides/html/images/dynamic_layout_480x800.png b/org.tizen.ui.practices/html/images/dynamic_layout_480x800.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/dynamic_layout_480x800.png rename to org.tizen.ui.practices/html/images/dynamic_layout_480x800.png diff --git a/org.tizen.ui.guides/html/images/dynamic_layout_720x1280.png b/org.tizen.ui.practices/html/images/dynamic_layout_720x1280.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/dynamic_layout_720x1280.png rename to org.tizen.ui.practices/html/images/dynamic_layout_720x1280.png diff --git a/org.tizen.ui.guides/html/images/edc_masking.png b/org.tizen.ui.practices/html/images/edc_masking.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edc_masking.png rename to org.tizen.ui.practices/html/images/edc_masking.png diff --git a/org.tizen.ui.guides/html/images/edje_color.png b/org.tizen.ui.practices/html/images/edje_color.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edje_color.png rename to org.tizen.ui.practices/html/images/edje_color.png diff --git a/org.tizen.ui.guides/html/images/edje_message.png b/org.tizen.ui.practices/html/images/edje_message.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edje_message.png rename to org.tizen.ui.practices/html/images/edje_message.png diff --git a/org.tizen.ui.guides/html/images/edje_object_scales.png b/org.tizen.ui.practices/html/images/edje_object_scales.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edje_object_scales.png rename to org.tizen.ui.practices/html/images/edje_object_scales.png diff --git a/org.tizen.ui.guides/html/images/edje_signal1.png b/org.tizen.ui.practices/html/images/edje_signal1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edje_signal1.png rename to org.tizen.ui.practices/html/images/edje_signal1.png diff --git a/org.tizen.ui.guides/html/images/edje_signal2.png b/org.tizen.ui.practices/html/images/edje_signal2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edje_signal2.png rename to org.tizen.ui.practices/html/images/edje_signal2.png diff --git a/org.tizen.ui.guides/html/images/edje_text_main.png b/org.tizen.ui.practices/html/images/edje_text_main.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/edje_text_main.png rename to org.tizen.ui.practices/html/images/edje_text_main.png diff --git a/org.tizen.ui.guides/html/images/efl_complex_clock.png b/org.tizen.ui.practices/html/images/efl_complex_clock.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_complex_clock.png rename to org.tizen.ui.practices/html/images/efl_complex_clock.png diff --git a/org.tizen.ui.guides/html/images/efl_complex_clock_tree.png b/org.tizen.ui.practices/html/images/efl_complex_clock_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_complex_clock_tree.png rename to org.tizen.ui.practices/html/images/efl_complex_clock_tree.png diff --git a/org.tizen.ui.guides/html/images/efl_layers.png b/org.tizen.ui.practices/html/images/efl_layers.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_layers.png rename to org.tizen.ui.practices/html/images/efl_layers.png diff --git a/org.tizen.ui.guides/html/images/efl_notilevels.png b/org.tizen.ui.practices/html/images/efl_notilevels.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_notilevels.png rename to org.tizen.ui.practices/html/images/efl_notilevels.png diff --git a/org.tizen.ui.guides/html/images/efl_phone.png b/org.tizen.ui.practices/html/images/efl_phone.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_phone.png rename to org.tizen.ui.practices/html/images/efl_phone.png diff --git a/org.tizen.ui.guides/html/images/efl_simple_clock.png b/org.tizen.ui.practices/html/images/efl_simple_clock.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_simple_clock.png rename to org.tizen.ui.practices/html/images/efl_simple_clock.png diff --git a/org.tizen.ui.guides/html/images/efl_simple_clock_tree.png b/org.tizen.ui.practices/html/images/efl_simple_clock_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_simple_clock_tree.png rename to org.tizen.ui.practices/html/images/efl_simple_clock_tree.png diff --git a/org.tizen.ui.guides/html/images/efl_windowlayer.png b/org.tizen.ui.practices/html/images/efl_windowlayer.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efl_windowlayer.png rename to org.tizen.ui.practices/html/images/efl_windowlayer.png diff --git a/org.tizen.ui.guides/html/images/efllibs.png b/org.tizen.ui.practices/html/images/efllibs.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/efllibs.png rename to org.tizen.ui.practices/html/images/efllibs.png diff --git a/org.tizen.ui.guides/html/images/elementary.png b/org.tizen.ui.practices/html/images/elementary.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/elementary.png rename to org.tizen.ui.practices/html/images/elementary.png diff --git a/org.tizen.ui.guides/html/images/elementary_app.png b/org.tizen.ui.practices/html/images/elementary_app.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/elementary_app.png rename to org.tizen.ui.practices/html/images/elementary_app.png diff --git a/org.tizen.ui.guides/html/images/email_sample.png b/org.tizen.ui.practices/html/images/email_sample.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/email_sample.png rename to org.tizen.ui.practices/html/images/email_sample.png diff --git a/org.tizen.ui.guides/html/images/empty_window.png b/org.tizen.ui.practices/html/images/empty_window.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/empty_window.png rename to org.tizen.ui.practices/html/images/empty_window.png diff --git a/org.tizen.ui.guides/html/images/enlarge_low_res_image.png b/org.tizen.ui.practices/html/images/enlarge_low_res_image.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/enlarge_low_res_image.png rename to org.tizen.ui.practices/html/images/enlarge_low_res_image.png diff --git a/org.tizen.ui.guides/html/images/entry.png b/org.tizen.ui.practices/html/images/entry.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry.png rename to org.tizen.ui.practices/html/images/entry.png diff --git a/org.tizen.ui.guides/html/images/entry2.png b/org.tizen.ui.practices/html/images/entry2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry2.png rename to org.tizen.ui.practices/html/images/entry2.png diff --git a/org.tizen.ui.guides/html/images/entry2_wn.png b/org.tizen.ui.practices/html/images/entry2_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry2_wn.png rename to org.tizen.ui.practices/html/images/entry2_wn.png diff --git a/org.tizen.ui.guides/html/images/entry_default.png b/org.tizen.ui.practices/html/images/entry_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry_default.png rename to org.tizen.ui.practices/html/images/entry_default.png diff --git a/org.tizen.ui.guides/html/images/entry_default_wn.png b/org.tizen.ui.practices/html/images/entry_default_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry_default_wn.png rename to org.tizen.ui.practices/html/images/entry_default_wn.png diff --git a/org.tizen.ui.guides/html/images/entry_tree.png b/org.tizen.ui.practices/html/images/entry_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry_tree.png rename to org.tizen.ui.practices/html/images/entry_tree.png diff --git a/org.tizen.ui.guides/html/images/entry_wn.png b/org.tizen.ui.practices/html/images/entry_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/entry_wn.png rename to org.tizen.ui.practices/html/images/entry_wn.png diff --git a/org.tizen.ui.guides/html/images/evas_advanced.png b/org.tizen.ui.practices/html/images/evas_advanced.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_advanced.png rename to org.tizen.ui.practices/html/images/evas_advanced.png diff --git a/org.tizen.ui.guides/html/images/evas_blur1.png b/org.tizen.ui.practices/html/images/evas_blur1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_blur1.png rename to org.tizen.ui.practices/html/images/evas_blur1.png diff --git a/org.tizen.ui.guides/html/images/evas_blur2.png b/org.tizen.ui.practices/html/images/evas_blur2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_blur2.png rename to org.tizen.ui.practices/html/images/evas_blur2.png diff --git a/org.tizen.ui.guides/html/images/evas_image_loader.png b/org.tizen.ui.practices/html/images/evas_image_loader.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_image_loader.png rename to org.tizen.ui.practices/html/images/evas_image_loader.png diff --git a/org.tizen.ui.guides/html/images/evas_image_scaling.png b/org.tizen.ui.practices/html/images/evas_image_scaling.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_image_scaling.png rename to org.tizen.ui.practices/html/images/evas_image_scaling.png diff --git a/org.tizen.ui.guides/html/images/evas_map_1.png b/org.tizen.ui.practices/html/images/evas_map_1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_1.png rename to org.tizen.ui.practices/html/images/evas_map_1.png diff --git a/org.tizen.ui.guides/html/images/evas_map_10.png b/org.tizen.ui.practices/html/images/evas_map_10.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_10.png rename to org.tizen.ui.practices/html/images/evas_map_10.png diff --git a/org.tizen.ui.guides/html/images/evas_map_11.png b/org.tizen.ui.practices/html/images/evas_map_11.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_11.png rename to org.tizen.ui.practices/html/images/evas_map_11.png diff --git a/org.tizen.ui.guides/html/images/evas_map_2.png b/org.tizen.ui.practices/html/images/evas_map_2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_2.png rename to org.tizen.ui.practices/html/images/evas_map_2.png diff --git a/org.tizen.ui.guides/html/images/evas_map_3.png b/org.tizen.ui.practices/html/images/evas_map_3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_3.png rename to org.tizen.ui.practices/html/images/evas_map_3.png diff --git a/org.tizen.ui.guides/html/images/evas_map_4.png b/org.tizen.ui.practices/html/images/evas_map_4.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_4.png rename to org.tizen.ui.practices/html/images/evas_map_4.png diff --git a/org.tizen.ui.guides/html/images/evas_map_5.png b/org.tizen.ui.practices/html/images/evas_map_5.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_5.png rename to org.tizen.ui.practices/html/images/evas_map_5.png diff --git a/org.tizen.ui.guides/html/images/evas_map_6.png b/org.tizen.ui.practices/html/images/evas_map_6.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_6.png rename to org.tizen.ui.practices/html/images/evas_map_6.png diff --git a/org.tizen.ui.guides/html/images/evas_map_7.png b/org.tizen.ui.practices/html/images/evas_map_7.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_7.png rename to org.tizen.ui.practices/html/images/evas_map_7.png diff --git a/org.tizen.ui.guides/html/images/evas_map_8.png b/org.tizen.ui.practices/html/images/evas_map_8.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_8.png rename to org.tizen.ui.practices/html/images/evas_map_8.png diff --git a/org.tizen.ui.guides/html/images/evas_map_9.png b/org.tizen.ui.practices/html/images/evas_map_9.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_9.png rename to org.tizen.ui.practices/html/images/evas_map_9.png diff --git a/org.tizen.ui.guides/html/images/evas_map_effect.png b/org.tizen.ui.practices/html/images/evas_map_effect.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_map_effect.png rename to org.tizen.ui.practices/html/images/evas_map_effect.png diff --git a/org.tizen.ui.guides/html/images/evas_object_display.png b/org.tizen.ui.practices/html/images/evas_object_display.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_object_display.png rename to org.tizen.ui.practices/html/images/evas_object_display.png diff --git a/org.tizen.ui.guides/html/images/evas_partial_update.png b/org.tizen.ui.practices/html/images/evas_partial_update.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_partial_update.png rename to org.tizen.ui.practices/html/images/evas_partial_update.png diff --git a/org.tizen.ui.guides/html/images/evas_scaling1.png b/org.tizen.ui.practices/html/images/evas_scaling1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_scaling1.png rename to org.tizen.ui.practices/html/images/evas_scaling1.png diff --git a/org.tizen.ui.guides/html/images/evas_scaling2.png b/org.tizen.ui.practices/html/images/evas_scaling2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_scaling2.png rename to org.tizen.ui.practices/html/images/evas_scaling2.png diff --git a/org.tizen.ui.guides/html/images/evas_scaling3.png b/org.tizen.ui.practices/html/images/evas_scaling3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_scaling3.png rename to org.tizen.ui.practices/html/images/evas_scaling3.png diff --git a/org.tizen.ui.guides/html/images/evas_smooth_disabled.png b/org.tizen.ui.practices/html/images/evas_smooth_disabled.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_smooth_disabled.png rename to org.tizen.ui.practices/html/images/evas_smooth_disabled.png diff --git a/org.tizen.ui.guides/html/images/evas_smooth_enabled.png b/org.tizen.ui.practices/html/images/evas_smooth_enabled.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/evas_smooth_enabled.png rename to org.tizen.ui.practices/html/images/evas_smooth_enabled.png diff --git a/org.tizen.ui.guides/html/images/events.png b/org.tizen.ui.practices/html/images/events.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events.png rename to org.tizen.ui.practices/html/images/events.png diff --git a/org.tizen.ui.guides/html/images/events2.png b/org.tizen.ui.practices/html/images/events2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events2.png rename to org.tizen.ui.practices/html/images/events2.png diff --git a/org.tizen.ui.guides/html/images/events3.png b/org.tizen.ui.practices/html/images/events3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events3.png rename to org.tizen.ui.practices/html/images/events3.png diff --git a/org.tizen.ui.guides/html/images/events_flow.png b/org.tizen.ui.practices/html/images/events_flow.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events_flow.png rename to org.tizen.ui.practices/html/images/events_flow.png diff --git a/org.tizen.ui.guides/html/images/events_scope.png b/org.tizen.ui.practices/html/images/events_scope.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events_scope.png rename to org.tizen.ui.practices/html/images/events_scope.png diff --git a/org.tizen.ui.guides/html/images/events_using_css3.png b/org.tizen.ui.practices/html/images/events_using_css3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events_using_css3.png rename to org.tizen.ui.practices/html/images/events_using_css3.png diff --git a/org.tizen.ui.guides/html/images/events_using_javascript.png b/org.tizen.ui.practices/html/images/events_using_javascript.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/events_using_javascript.png rename to org.tizen.ui.practices/html/images/events_using_javascript.png diff --git a/org.tizen.ui.guides/html/images/fade_affect_animation.png b/org.tizen.ui.practices/html/images/fade_affect_animation.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/fade_affect_animation.png rename to org.tizen.ui.practices/html/images/fade_affect_animation.png diff --git a/org.tizen.ui.practices/html/images/fallback_imageset.png b/org.tizen.ui.practices/html/images/fallback_imageset.png new file mode 100644 index 0000000..1f56355 Binary files /dev/null and b/org.tizen.ui.practices/html/images/fallback_imageset.png differ diff --git a/org.tizen.ui.guides/html/images/fill_to_parent.png b/org.tizen.ui.practices/html/images/fill_to_parent.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/fill_to_parent.png rename to org.tizen.ui.practices/html/images/fill_to_parent.png diff --git a/org.tizen.ui.guides/html/images/first_screen_edc.png b/org.tizen.ui.practices/html/images/first_screen_edc.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/first_screen_edc.png rename to org.tizen.ui.practices/html/images/first_screen_edc.png diff --git a/org.tizen.ui.guides/html/images/fit_to_children.png b/org.tizen.ui.practices/html/images/fit_to_children.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/fit_to_children.png rename to org.tizen.ui.practices/html/images/fit_to_children.png diff --git a/org.tizen.ui.guides/html/images/fixed.png b/org.tizen.ui.practices/html/images/fixed.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/fixed.png rename to org.tizen.ui.practices/html/images/fixed.png diff --git a/org.tizen.ui.guides/html/images/flex_container.png b/org.tizen.ui.practices/html/images/flex_container.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flex_container.png rename to org.tizen.ui.practices/html/images/flex_container.png diff --git a/org.tizen.ui.guides/html/images/flexcontainer_properties.png b/org.tizen.ui.practices/html/images/flexcontainer_properties.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flexcontainer_properties.png rename to org.tizen.ui.practices/html/images/flexcontainer_properties.png diff --git a/org.tizen.ui.guides/html/images/flexible_box_alignment.png b/org.tizen.ui.practices/html/images/flexible_box_alignment.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flexible_box_alignment.png rename to org.tizen.ui.practices/html/images/flexible_box_alignment.png diff --git a/org.tizen.ui.guides/html/images/flexible_default_structure.png b/org.tizen.ui.practices/html/images/flexible_default_structure.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flexible_default_structure.png rename to org.tizen.ui.practices/html/images/flexible_default_structure.png diff --git a/org.tizen.ui.guides/html/images/flexible_screen_size.png b/org.tizen.ui.practices/html/images/flexible_screen_size.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flexible_screen_size.png rename to org.tizen.ui.practices/html/images/flexible_screen_size.png diff --git a/org.tizen.ui.guides/html/images/flexitem_properties.png b/org.tizen.ui.practices/html/images/flexitem_properties.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flexitem_properties.png rename to org.tizen.ui.practices/html/images/flexitem_properties.png diff --git a/org.tizen.ui.guides/html/images/flip_tree.png b/org.tizen.ui.practices/html/images/flip_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flip_tree.png rename to org.tizen.ui.practices/html/images/flip_tree.png diff --git a/org.tizen.ui.guides/html/images/flipsel_default.png b/org.tizen.ui.practices/html/images/flipsel_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/flipsel_default.png rename to org.tizen.ui.practices/html/images/flipsel_default.png diff --git a/org.tizen.ui.guides/html/images/focal_length.png b/org.tizen.ui.practices/html/images/focal_length.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/focal_length.png rename to org.tizen.ui.practices/html/images/focal_length.png diff --git a/org.tizen.ui.guides/html/images/font_face.png b/org.tizen.ui.practices/html/images/font_face.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/font_face.png rename to org.tizen.ui.practices/html/images/font_face.png diff --git a/org.tizen.ui.guides/html/images/font_properties.png b/org.tizen.ui.practices/html/images/font_properties.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/font_properties.png rename to org.tizen.ui.practices/html/images/font_properties.png diff --git a/org.tizen.ui.guides/html/images/form_contact_layout.png b/org.tizen.ui.practices/html/images/form_contact_layout.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/form_contact_layout.png rename to org.tizen.ui.practices/html/images/form_contact_layout.png diff --git a/org.tizen.ui.guides/html/images/gengrid.png b/org.tizen.ui.practices/html/images/gengrid.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid.png rename to org.tizen.ui.practices/html/images/gengrid.png diff --git a/org.tizen.ui.guides/html/images/gengrid_album_pre.png b/org.tizen.ui.practices/html/images/gengrid_album_pre.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_album_pre.png rename to org.tizen.ui.practices/html/images/gengrid_album_pre.png diff --git a/org.tizen.ui.guides/html/images/gengrid_block.png b/org.tizen.ui.practices/html/images/gengrid_block.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_block.png rename to org.tizen.ui.practices/html/images/gengrid_block.png diff --git a/org.tizen.ui.guides/html/images/gengrid_def.png b/org.tizen.ui.practices/html/images/gengrid_def.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_def.png rename to org.tizen.ui.practices/html/images/gengrid_def.png diff --git a/org.tizen.ui.guides/html/images/gengrid_def_gridtext.png b/org.tizen.ui.practices/html/images/gengrid_def_gridtext.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_def_gridtext.png rename to org.tizen.ui.practices/html/images/gengrid_def_gridtext.png diff --git a/org.tizen.ui.guides/html/images/gengrid_def_gridtext2.png b/org.tizen.ui.practices/html/images/gengrid_def_gridtext2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_def_gridtext2.png rename to org.tizen.ui.practices/html/images/gengrid_def_gridtext2.png diff --git a/org.tizen.ui.guides/html/images/gengrid_def_style.png b/org.tizen.ui.practices/html/images/gengrid_def_style.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_def_style.png rename to org.tizen.ui.practices/html/images/gengrid_def_style.png diff --git a/org.tizen.ui.guides/html/images/gengrid_default.png b/org.tizen.ui.practices/html/images/gengrid_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_default.png rename to org.tizen.ui.practices/html/images/gengrid_default.png diff --git a/org.tizen.ui.guides/html/images/gengrid_grp_index.png b/org.tizen.ui.practices/html/images/gengrid_grp_index.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_grp_index.png rename to org.tizen.ui.practices/html/images/gengrid_grp_index.png diff --git a/org.tizen.ui.guides/html/images/gengrid_tree.png b/org.tizen.ui.practices/html/images/gengrid_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gengrid_tree.png rename to org.tizen.ui.practices/html/images/gengrid_tree.png diff --git a/org.tizen.ui.guides/html/images/genlist.png b/org.tizen.ui.practices/html/images/genlist.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist.png rename to org.tizen.ui.practices/html/images/genlist.png diff --git a/org.tizen.ui.guides/html/images/genlist1_wn.png b/org.tizen.ui.practices/html/images/genlist1_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist1_wn.png rename to org.tizen.ui.practices/html/images/genlist1_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist2_wn.png b/org.tizen.ui.practices/html/images/genlist2_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist2_wn.png rename to org.tizen.ui.practices/html/images/genlist2_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist3_wn.png b/org.tizen.ui.practices/html/images/genlist3_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist3_wn.png rename to org.tizen.ui.practices/html/images/genlist3_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1line.png b/org.tizen.ui.practices/html/images/genlist_1line.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1line.png rename to org.tizen.ui.practices/html/images/genlist_1line.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text1icon1_o_wn.png b/org.tizen.ui.practices/html/images/genlist_1text1icon1_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text1icon1_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text1icon1_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text1icon1_wn.png b/org.tizen.ui.practices/html/images/genlist_1text1icon1_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text1icon1_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text1icon1_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text1icon_o_wn.png b/org.tizen.ui.practices/html/images/genlist_1text1icon_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text1icon_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text1icon_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text1icon_wn.png b/org.tizen.ui.practices/html/images/genlist_1text1icon_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text1icon_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text1icon_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text1icondivider_o_wn.png b/org.tizen.ui.practices/html/images/genlist_1text1icondivider_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text1icondivider_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text1icondivider_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text1icondivider_wn.png b/org.tizen.ui.practices/html/images/genlist_1text1icondivider_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text1icondivider_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text1icondivider_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text_o_wn.png b/org.tizen.ui.practices/html/images/genlist_1text_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_1text_wn.png b/org.tizen.ui.practices/html/images/genlist_1text_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_1text_wn.png rename to org.tizen.ui.practices/html/images/genlist_1text_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_2text1_wn.png b/org.tizen.ui.practices/html/images/genlist_2text1_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_2text1_wn.png rename to org.tizen.ui.practices/html/images/genlist_2text1_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_2text1icon1_o_wn.png b/org.tizen.ui.practices/html/images/genlist_2text1icon1_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_2text1icon1_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_2text1icon1_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_2text1icon1_wn.png b/org.tizen.ui.practices/html/images/genlist_2text1icon1_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_2text1icon1_wn.png rename to org.tizen.ui.practices/html/images/genlist_2text1icon1_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_2text_o_wn.png b/org.tizen.ui.practices/html/images/genlist_2text_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_2text_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_2text_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_2text_wn.png b/org.tizen.ui.practices/html/images/genlist_2text_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_2text_wn.png rename to org.tizen.ui.practices/html/images/genlist_2text_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_def_o_wn.png b/org.tizen.ui.practices/html/images/genlist_def_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_def_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_def_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_def_wn.png b/org.tizen.ui.practices/html/images/genlist_def_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_def_wn.png rename to org.tizen.ui.practices/html/images/genlist_def_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_edit_o_wn.png b/org.tizen.ui.practices/html/images/genlist_edit_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_edit_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_edit_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_group_o_wn.png b/org.tizen.ui.practices/html/images/genlist_group_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_group_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_group_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_group_wn.png b/org.tizen.ui.practices/html/images/genlist_group_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_group_wn.png rename to org.tizen.ui.practices/html/images/genlist_group_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_htree.png b/org.tizen.ui.practices/html/images/genlist_htree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_htree.png rename to org.tizen.ui.practices/html/images/genlist_htree.png diff --git a/org.tizen.ui.guides/html/images/genlist_item.png b/org.tizen.ui.practices/html/images/genlist_item.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_item.png rename to org.tizen.ui.practices/html/images/genlist_item.png diff --git a/org.tizen.ui.guides/html/images/genlist_multi.png b/org.tizen.ui.practices/html/images/genlist_multi.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_multi.png rename to org.tizen.ui.practices/html/images/genlist_multi.png diff --git a/org.tizen.ui.guides/html/images/genlist_multi1_wn.png b/org.tizen.ui.practices/html/images/genlist_multi1_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_multi1_wn.png rename to org.tizen.ui.practices/html/images/genlist_multi1_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_multi2_wn.png b/org.tizen.ui.practices/html/images/genlist_multi2_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_multi2_wn.png rename to org.tizen.ui.practices/html/images/genlist_multi2_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_title_o_wn.png b/org.tizen.ui.practices/html/images/genlist_title_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_title_o_wn.png rename to org.tizen.ui.practices/html/images/genlist_title_o_wn.png diff --git a/org.tizen.ui.guides/html/images/genlist_tree.png b/org.tizen.ui.practices/html/images/genlist_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_tree.png rename to org.tizen.ui.practices/html/images/genlist_tree.png diff --git a/org.tizen.ui.guides/html/images/genlist_wn.png b/org.tizen.ui.practices/html/images/genlist_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/genlist_wn.png rename to org.tizen.ui.practices/html/images/genlist_wn.png diff --git a/org.tizen.ui.guides/html/images/gesture_view2.png b/org.tizen.ui.practices/html/images/gesture_view2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gesture_view2.png rename to org.tizen.ui.practices/html/images/gesture_view2.png diff --git a/org.tizen.ui.guides/html/images/gl-default.png b/org.tizen.ui.practices/html/images/gl-default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gl-default.png rename to org.tizen.ui.practices/html/images/gl-default.png diff --git a/org.tizen.ui.guides/html/images/gl-double-label.png b/org.tizen.ui.practices/html/images/gl-double-label.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gl-double-label.png rename to org.tizen.ui.practices/html/images/gl-double-label.png diff --git a/org.tizen.ui.guides/html/images/gl-end-icon.png b/org.tizen.ui.practices/html/images/gl-end-icon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/gl-end-icon.png rename to org.tizen.ui.practices/html/images/gl-end-icon.png diff --git a/org.tizen.ui.guides/html/images/global_scales.png b/org.tizen.ui.practices/html/images/global_scales.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/global_scales.png rename to org.tizen.ui.practices/html/images/global_scales.png diff --git a/org.tizen.ui.guides/html/images/globalize_folder_structure.png b/org.tizen.ui.practices/html/images/globalize_folder_structure.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/globalize_folder_structure.png rename to org.tizen.ui.practices/html/images/globalize_folder_structure.png diff --git a/org.tizen.ui.guides/html/images/globalize_folder_structure_main.png b/org.tizen.ui.practices/html/images/globalize_folder_structure_main.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/globalize_folder_structure_main.png rename to org.tizen.ui.practices/html/images/globalize_folder_structure_main.png diff --git a/org.tizen.ui.guides/html/images/glview.png b/org.tizen.ui.practices/html/images/glview.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/glview.png rename to org.tizen.ui.practices/html/images/glview.png diff --git a/org.tizen.ui.guides/html/images/glview_tree.png b/org.tizen.ui.practices/html/images/glview_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/glview_tree.png rename to org.tizen.ui.practices/html/images/glview_tree.png diff --git a/org.tizen.ui.guides/html/images/glview_wn.png b/org.tizen.ui.practices/html/images/glview_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/glview_wn.png rename to org.tizen.ui.practices/html/images/glview_wn.png diff --git a/org.tizen.ui.guides/html/images/google_cardboard.png b/org.tizen.ui.practices/html/images/google_cardboard.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/google_cardboard.png rename to org.tizen.ui.practices/html/images/google_cardboard.png diff --git a/org.tizen.ui.guides/html/images/grid.png b/org.tizen.ui.practices/html/images/grid.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/grid.png rename to org.tizen.ui.practices/html/images/grid.png diff --git a/org.tizen.ui.guides/html/images/hello_world_dali.png b/org.tizen.ui.practices/html/images/hello_world_dali.png similarity index 100% rename from org.tizen.ui.guides/html/images/hello_world_dali.png rename to org.tizen.ui.practices/html/images/hello_world_dali.png diff --git a/org.tizen.ui.guides/html/images/ico_arr_hidden.gif b/org.tizen.ui.practices/html/images/ico_arr_hidden.gif old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ico_arr_hidden.gif rename to org.tizen.ui.practices/html/images/ico_arr_hidden.gif diff --git a/org.tizen.ui.guides/html/images/ico_bullet_2_7.gif b/org.tizen.ui.practices/html/images/ico_bullet_2_7.gif old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ico_bullet_2_7.gif rename to org.tizen.ui.practices/html/images/ico_bullet_2_7.gif diff --git a/org.tizen.ui.guides/html/images/icon.png b/org.tizen.ui.practices/html/images/icon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon.png rename to org.tizen.ui.practices/html/images/icon.png diff --git a/org.tizen.ui.guides/html/images/icon_apps.png b/org.tizen.ui.practices/html/images/icon_apps.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_apps.png rename to org.tizen.ui.practices/html/images/icon_apps.png diff --git a/org.tizen.ui.guides/html/images/icon_arrowdown.png b/org.tizen.ui.practices/html/images/icon_arrowdown.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_arrowdown.png rename to org.tizen.ui.practices/html/images/icon_arrowdown.png diff --git a/org.tizen.ui.guides/html/images/icon_arrowleft.png b/org.tizen.ui.practices/html/images/icon_arrowleft.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_arrowleft.png rename to org.tizen.ui.practices/html/images/icon_arrowleft.png diff --git a/org.tizen.ui.guides/html/images/icon_arrowright.png b/org.tizen.ui.practices/html/images/icon_arrowright.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_arrowright.png rename to org.tizen.ui.practices/html/images/icon_arrowright.png diff --git a/org.tizen.ui.guides/html/images/icon_arrowup.png b/org.tizen.ui.practices/html/images/icon_arrowup.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_arrowup.png rename to org.tizen.ui.practices/html/images/icon_arrowup.png diff --git a/org.tizen.ui.guides/html/images/icon_chat.png b/org.tizen.ui.practices/html/images/icon_chat.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_chat.png rename to org.tizen.ui.practices/html/images/icon_chat.png diff --git a/org.tizen.ui.guides/html/images/icon_clock.png b/org.tizen.ui.practices/html/images/icon_clock.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_clock.png rename to org.tizen.ui.practices/html/images/icon_clock.png diff --git a/org.tizen.ui.guides/html/images/icon_close.png b/org.tizen.ui.practices/html/images/icon_close.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_close.png rename to org.tizen.ui.practices/html/images/icon_close.png diff --git a/org.tizen.ui.guides/html/images/icon_delete.png b/org.tizen.ui.practices/html/images/icon_delete.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_delete.png rename to org.tizen.ui.practices/html/images/icon_delete.png diff --git a/org.tizen.ui.guides/html/images/icon_edit.png b/org.tizen.ui.practices/html/images/icon_edit.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_edit.png rename to org.tizen.ui.practices/html/images/icon_edit.png diff --git a/org.tizen.ui.guides/html/images/icon_file.png b/org.tizen.ui.practices/html/images/icon_file.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_file.png rename to org.tizen.ui.practices/html/images/icon_file.png diff --git a/org.tizen.ui.guides/html/images/icon_forward.png b/org.tizen.ui.practices/html/images/icon_forward.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_forward.png rename to org.tizen.ui.practices/html/images/icon_forward.png diff --git a/org.tizen.ui.guides/html/images/icon_home.png b/org.tizen.ui.practices/html/images/icon_home.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_home.png rename to org.tizen.ui.practices/html/images/icon_home.png diff --git a/org.tizen.ui.guides/html/images/icon_info.png b/org.tizen.ui.practices/html/images/icon_info.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_info.png rename to org.tizen.ui.practices/html/images/icon_info.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_apps.png b/org.tizen.ui.practices/html/images/icon_menu_apps.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_apps.png rename to org.tizen.ui.practices/html/images/icon_menu_apps.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_arrdown.png b/org.tizen.ui.practices/html/images/icon_menu_arrdown.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_arrdown.png rename to org.tizen.ui.practices/html/images/icon_menu_arrdown.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_arrleft.png b/org.tizen.ui.practices/html/images/icon_menu_arrleft.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_arrleft.png rename to org.tizen.ui.practices/html/images/icon_menu_arrleft.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_arrright.png b/org.tizen.ui.practices/html/images/icon_menu_arrright.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_arrright.png rename to org.tizen.ui.practices/html/images/icon_menu_arrright.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_arrup.png b/org.tizen.ui.practices/html/images/icon_menu_arrup.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_arrup.png rename to org.tizen.ui.practices/html/images/icon_menu_arrup.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_chat.png b/org.tizen.ui.practices/html/images/icon_menu_chat.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_chat.png rename to org.tizen.ui.practices/html/images/icon_menu_chat.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_clock.png b/org.tizen.ui.practices/html/images/icon_menu_clock.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_clock.png rename to org.tizen.ui.practices/html/images/icon_menu_clock.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_close.png b/org.tizen.ui.practices/html/images/icon_menu_close.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_close.png rename to org.tizen.ui.practices/html/images/icon_menu_close.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_delete.png b/org.tizen.ui.practices/html/images/icon_menu_delete.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_delete.png rename to org.tizen.ui.practices/html/images/icon_menu_delete.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_edit.png b/org.tizen.ui.practices/html/images/icon_menu_edit.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_edit.png rename to org.tizen.ui.practices/html/images/icon_menu_edit.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_file.png b/org.tizen.ui.practices/html/images/icon_menu_file.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_file.png rename to org.tizen.ui.practices/html/images/icon_menu_file.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_folder.png b/org.tizen.ui.practices/html/images/icon_menu_folder.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_folder.png rename to org.tizen.ui.practices/html/images/icon_menu_folder.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_home.png b/org.tizen.ui.practices/html/images/icon_menu_home.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_home.png rename to org.tizen.ui.practices/html/images/icon_menu_home.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_nophoto.png b/org.tizen.ui.practices/html/images/icon_menu_nophoto.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_nophoto.png rename to org.tizen.ui.practices/html/images/icon_menu_nophoto.png diff --git a/org.tizen.ui.guides/html/images/icon_menu_refresh.png b/org.tizen.ui.practices/html/images/icon_menu_refresh.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_menu_refresh.png rename to org.tizen.ui.practices/html/images/icon_menu_refresh.png diff --git a/org.tizen.ui.guides/html/images/icon_next.png b/org.tizen.ui.practices/html/images/icon_next.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_next.png rename to org.tizen.ui.practices/html/images/icon_next.png diff --git a/org.tizen.ui.guides/html/images/icon_pause.png b/org.tizen.ui.practices/html/images/icon_pause.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_pause.png rename to org.tizen.ui.practices/html/images/icon_pause.png diff --git a/org.tizen.ui.guides/html/images/icon_photo_nophoto.png b/org.tizen.ui.practices/html/images/icon_photo_nophoto.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_photo_nophoto.png rename to org.tizen.ui.practices/html/images/icon_photo_nophoto.png diff --git a/org.tizen.ui.guides/html/images/icon_play.png b/org.tizen.ui.practices/html/images/icon_play.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_play.png rename to org.tizen.ui.practices/html/images/icon_play.png diff --git a/org.tizen.ui.guides/html/images/icon_prev.png b/org.tizen.ui.practices/html/images/icon_prev.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_prev.png rename to org.tizen.ui.practices/html/images/icon_prev.png diff --git a/org.tizen.ui.guides/html/images/icon_refresh.png b/org.tizen.ui.practices/html/images/icon_refresh.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_refresh.png rename to org.tizen.ui.practices/html/images/icon_refresh.png diff --git a/org.tizen.ui.guides/html/images/icon_rewind.png b/org.tizen.ui.practices/html/images/icon_rewind.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_rewind.png rename to org.tizen.ui.practices/html/images/icon_rewind.png diff --git a/org.tizen.ui.guides/html/images/icon_stop.png b/org.tizen.ui.practices/html/images/icon_stop.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_stop.png rename to org.tizen.ui.practices/html/images/icon_stop.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_apps.png b/org.tizen.ui.practices/html/images/icon_toolbar_apps.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_apps.png rename to org.tizen.ui.practices/html/images/icon_toolbar_apps.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_arrdown.png b/org.tizen.ui.practices/html/images/icon_toolbar_arrdown.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_arrdown.png rename to org.tizen.ui.practices/html/images/icon_toolbar_arrdown.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_arrleft.png b/org.tizen.ui.practices/html/images/icon_toolbar_arrleft.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_arrleft.png rename to org.tizen.ui.practices/html/images/icon_toolbar_arrleft.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_arrright.png b/org.tizen.ui.practices/html/images/icon_toolbar_arrright.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_arrright.png rename to org.tizen.ui.practices/html/images/icon_toolbar_arrright.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_arrup.png b/org.tizen.ui.practices/html/images/icon_toolbar_arrup.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_arrup.png rename to org.tizen.ui.practices/html/images/icon_toolbar_arrup.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_chat.png b/org.tizen.ui.practices/html/images/icon_toolbar_chat.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_chat.png rename to org.tizen.ui.practices/html/images/icon_toolbar_chat.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_clock.png b/org.tizen.ui.practices/html/images/icon_toolbar_clock.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_clock.png rename to org.tizen.ui.practices/html/images/icon_toolbar_clock.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_close.png b/org.tizen.ui.practices/html/images/icon_toolbar_close.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_close.png rename to org.tizen.ui.practices/html/images/icon_toolbar_close.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_delete.png b/org.tizen.ui.practices/html/images/icon_toolbar_delete.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_delete.png rename to org.tizen.ui.practices/html/images/icon_toolbar_delete.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_edit.png b/org.tizen.ui.practices/html/images/icon_toolbar_edit.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_edit.png rename to org.tizen.ui.practices/html/images/icon_toolbar_edit.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_file.png b/org.tizen.ui.practices/html/images/icon_toolbar_file.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_file.png rename to org.tizen.ui.practices/html/images/icon_toolbar_file.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_folder.png b/org.tizen.ui.practices/html/images/icon_toolbar_folder.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_folder.png rename to org.tizen.ui.practices/html/images/icon_toolbar_folder.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_moremenu.png b/org.tizen.ui.practices/html/images/icon_toolbar_moremenu.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_moremenu.png rename to org.tizen.ui.practices/html/images/icon_toolbar_moremenu.png diff --git a/org.tizen.ui.guides/html/images/icon_toolbar_refresh.png b/org.tizen.ui.practices/html/images/icon_toolbar_refresh.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_toolbar_refresh.png rename to org.tizen.ui.practices/html/images/icon_toolbar_refresh.png diff --git a/org.tizen.ui.guides/html/images/icon_tree.png b/org.tizen.ui.practices/html/images/icon_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/icon_tree.png rename to org.tizen.ui.practices/html/images/icon_tree.png diff --git a/org.tizen.ui.guides/html/images/idlers.png b/org.tizen.ui.practices/html/images/idlers.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/idlers.png rename to org.tizen.ui.practices/html/images/idlers.png diff --git a/org.tizen.ui.guides/html/images/image.png b/org.tizen.ui.practices/html/images/image.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/image.png rename to org.tizen.ui.practices/html/images/image.png diff --git a/org.tizen.ui.guides/html/images/image_after.png b/org.tizen.ui.practices/html/images/image_after.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/image_after.png rename to org.tizen.ui.practices/html/images/image_after.png diff --git a/org.tizen.ui.guides/html/images/image_before.png b/org.tizen.ui.practices/html/images/image_before.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/image_before.png rename to org.tizen.ui.practices/html/images/image_before.png diff --git a/org.tizen.ui.guides/html/images/image_tree.png b/org.tizen.ui.practices/html/images/image_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/image_tree.png rename to org.tizen.ui.practices/html/images/image_tree.png diff --git a/org.tizen.ui.guides/html/images/image_wn.png b/org.tizen.ui.practices/html/images/image_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/image_wn.png rename to org.tizen.ui.practices/html/images/image_wn.png diff --git a/org.tizen.ui.guides/html/images/immediate_mode.png b/org.tizen.ui.practices/html/images/immediate_mode.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/immediate_mode.png rename to org.tizen.ui.practices/html/images/immediate_mode.png diff --git a/org.tizen.ui.guides/html/images/import_css_area.png b/org.tizen.ui.practices/html/images/import_css_area.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/import_css_area.png rename to org.tizen.ui.practices/html/images/import_css_area.png diff --git a/org.tizen.ui.guides/html/images/import_linked_in_head.png b/org.tizen.ui.practices/html/images/import_linked_in_head.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/import_linked_in_head.png rename to org.tizen.ui.practices/html/images/import_linked_in_head.png diff --git a/org.tizen.ui.guides/html/images/index.png b/org.tizen.ui.practices/html/images/index.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index.png rename to org.tizen.ui.practices/html/images/index.png diff --git a/org.tizen.ui.guides/html/images/index_circle_o_wn.png b/org.tizen.ui.practices/html/images/index_circle_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_circle_o_wn.png rename to org.tizen.ui.practices/html/images/index_circle_o_wn.png diff --git a/org.tizen.ui.guides/html/images/index_default.png b/org.tizen.ui.practices/html/images/index_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_default.png rename to org.tizen.ui.practices/html/images/index_default.png diff --git a/org.tizen.ui.guides/html/images/index_default02.png b/org.tizen.ui.practices/html/images/index_default02.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_default02.png rename to org.tizen.ui.practices/html/images/index_default02.png diff --git a/org.tizen.ui.guides/html/images/index_pagecontrol.png b/org.tizen.ui.practices/html/images/index_pagecontrol.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_pagecontrol.png rename to org.tizen.ui.practices/html/images/index_pagecontrol.png diff --git a/org.tizen.ui.guides/html/images/index_tab_wn.png b/org.tizen.ui.practices/html/images/index_tab_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_tab_wn.png rename to org.tizen.ui.practices/html/images/index_tab_wn.png diff --git a/org.tizen.ui.guides/html/images/index_thumb_o_wn.png b/org.tizen.ui.practices/html/images/index_thumb_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_thumb_o_wn.png rename to org.tizen.ui.practices/html/images/index_thumb_o_wn.png diff --git a/org.tizen.ui.guides/html/images/index_thumb_wn.png b/org.tizen.ui.practices/html/images/index_thumb_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_thumb_wn.png rename to org.tizen.ui.practices/html/images/index_thumb_wn.png diff --git a/org.tizen.ui.guides/html/images/index_tree.png b/org.tizen.ui.practices/html/images/index_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_tree.png rename to org.tizen.ui.practices/html/images/index_tree.png diff --git a/org.tizen.ui.guides/html/images/index_wn.png b/org.tizen.ui.practices/html/images/index_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/index_wn.png rename to org.tizen.ui.practices/html/images/index_wn.png diff --git a/org.tizen.ui.guides/html/images/label.png b/org.tizen.ui.practices/html/images/label.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/label.png rename to org.tizen.ui.practices/html/images/label.png diff --git a/org.tizen.ui.guides/html/images/label_tree.png b/org.tizen.ui.practices/html/images/label_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/label_tree.png rename to org.tizen.ui.practices/html/images/label_tree.png diff --git a/org.tizen.ui.guides/html/images/label_wn.png b/org.tizen.ui.practices/html/images/label_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/label_wn.png rename to org.tizen.ui.practices/html/images/label_wn.png diff --git a/org.tizen.ui.guides/html/images/layout_app.png b/org.tizen.ui.practices/html/images/layout_app.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_app.png rename to org.tizen.ui.practices/html/images/layout_app.png diff --git a/org.tizen.ui.guides/html/images/layout_calculator.png b/org.tizen.ui.practices/html/images/layout_calculator.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_calculator.png rename to org.tizen.ui.practices/html/images/layout_calculator.png diff --git a/org.tizen.ui.guides/html/images/layout_calculator_absolute.png b/org.tizen.ui.practices/html/images/layout_calculator_absolute.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_calculator_absolute.png rename to org.tizen.ui.practices/html/images/layout_calculator_absolute.png diff --git a/org.tizen.ui.guides/html/images/layout_calculator_relative.png b/org.tizen.ui.practices/html/images/layout_calculator_relative.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_calculator_relative.png rename to org.tizen.ui.practices/html/images/layout_calculator_relative.png diff --git a/org.tizen.ui.guides/html/images/layout_fixed_media.png b/org.tizen.ui.practices/html/images/layout_fixed_media.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_fixed_media.png rename to org.tizen.ui.practices/html/images/layout_fixed_media.png diff --git a/org.tizen.ui.guides/html/images/layout_flexible_media.png b/org.tizen.ui.practices/html/images/layout_flexible_media.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_flexible_media.png rename to org.tizen.ui.practices/html/images/layout_flexible_media.png diff --git a/org.tizen.ui.guides/html/images/layout_image.png b/org.tizen.ui.practices/html/images/layout_image.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_image.png rename to org.tizen.ui.practices/html/images/layout_image.png diff --git a/org.tizen.ui.guides/html/images/layout_image_scaled.png b/org.tizen.ui.practices/html/images/layout_image_scaled.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_image_scaled.png rename to org.tizen.ui.practices/html/images/layout_image_scaled.png diff --git a/org.tizen.ui.guides/html/images/layout_original.png b/org.tizen.ui.practices/html/images/layout_original.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_original.png rename to org.tizen.ui.practices/html/images/layout_original.png diff --git a/org.tizen.ui.guides/html/images/layout_original_scaled.png b/org.tizen.ui.practices/html/images/layout_original_scaled.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_original_scaled.png rename to org.tizen.ui.practices/html/images/layout_original_scaled.png diff --git a/org.tizen.ui.guides/html/images/layout_sample.png b/org.tizen.ui.practices/html/images/layout_sample.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_sample.png rename to org.tizen.ui.practices/html/images/layout_sample.png diff --git a/org.tizen.ui.guides/html/images/layout_sample_ok.png b/org.tizen.ui.practices/html/images/layout_sample_ok.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_sample_ok.png rename to org.tizen.ui.practices/html/images/layout_sample_ok.png diff --git a/org.tizen.ui.guides/html/images/layout_sample_ugly.png b/org.tizen.ui.practices/html/images/layout_sample_ugly.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/layout_sample_ugly.png rename to org.tizen.ui.practices/html/images/layout_sample_ugly.png diff --git a/org.tizen.ui.guides/html/images/list.png b/org.tizen.ui.practices/html/images/list.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/list.png rename to org.tizen.ui.practices/html/images/list.png diff --git a/org.tizen.ui.guides/html/images/list_tree.png b/org.tizen.ui.practices/html/images/list_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/list_tree.png rename to org.tizen.ui.practices/html/images/list_tree.png diff --git a/org.tizen.ui.guides/html/images/list_wn.png b/org.tizen.ui.practices/html/images/list_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/list_wn.png rename to org.tizen.ui.practices/html/images/list_wn.png diff --git a/org.tizen.ui.guides/html/images/main_app_layout.png b/org.tizen.ui.practices/html/images/main_app_layout.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/main_app_layout.png rename to org.tizen.ui.practices/html/images/main_app_layout.png diff --git a/org.tizen.ui.guides/html/images/map_tree.png b/org.tizen.ui.practices/html/images/map_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/map_tree.png rename to org.tizen.ui.practices/html/images/map_tree.png diff --git a/org.tizen.ui.guides/html/images/mapbuf_tree.png b/org.tizen.ui.practices/html/images/mapbuf_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/mapbuf_tree.png rename to org.tizen.ui.practices/html/images/mapbuf_tree.png diff --git a/org.tizen.ui.guides/html/images/mascot.gif b/org.tizen.ui.practices/html/images/mascot.gif old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/mascot.gif rename to org.tizen.ui.practices/html/images/mascot.gif diff --git a/org.tizen.ui.guides/html/images/media_queries1.png b/org.tizen.ui.practices/html/images/media_queries1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/media_queries1.png rename to org.tizen.ui.practices/html/images/media_queries1.png diff --git a/org.tizen.ui.guides/html/images/media_queries3.png b/org.tizen.ui.practices/html/images/media_queries3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/media_queries3.png rename to org.tizen.ui.practices/html/images/media_queries3.png diff --git a/org.tizen.ui.guides/html/images/memory.png b/org.tizen.ui.practices/html/images/memory.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/memory.png rename to org.tizen.ui.practices/html/images/memory.png diff --git a/org.tizen.ui.guides/html/images/memory2.png b/org.tizen.ui.practices/html/images/memory2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/memory2.png rename to org.tizen.ui.practices/html/images/memory2.png diff --git a/org.tizen.ui.guides/html/images/memory3.png b/org.tizen.ui.practices/html/images/memory3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/memory3.png rename to org.tizen.ui.practices/html/images/memory3.png diff --git a/org.tizen.ui.guides/html/images/memory_using_css3.png b/org.tizen.ui.practices/html/images/memory_using_css3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/memory_using_css3.png rename to org.tizen.ui.practices/html/images/memory_using_css3.png diff --git a/org.tizen.ui.guides/html/images/memory_using_javascript.png b/org.tizen.ui.practices/html/images/memory_using_javascript.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/memory_using_javascript.png rename to org.tizen.ui.practices/html/images/memory_using_javascript.png diff --git a/org.tizen.ui.guides/html/images/menu_skeleton.png b/org.tizen.ui.practices/html/images/menu_skeleton.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/menu_skeleton.png rename to org.tizen.ui.practices/html/images/menu_skeleton.png diff --git a/org.tizen.ui.guides/html/images/migrate_move_to_top.png b/org.tizen.ui.practices/html/images/migrate_move_to_top.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/migrate_move_to_top.png rename to org.tizen.ui.practices/html/images/migrate_move_to_top.png diff --git a/org.tizen.ui.guides/html/images/migrate_padding.png b/org.tizen.ui.practices/html/images/migrate_padding.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/migrate_padding.png rename to org.tizen.ui.practices/html/images/migrate_padding.png diff --git a/org.tizen.ui.guides/html/images/migrate_scrollable_circle.png b/org.tizen.ui.practices/html/images/migrate_scrollable_circle.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/migrate_scrollable_circle.png rename to org.tizen.ui.practices/html/images/migrate_scrollable_circle.png diff --git a/org.tizen.ui.guides/html/images/migrate_scrollable_rect.png b/org.tizen.ui.practices/html/images/migrate_scrollable_rect.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/migrate_scrollable_rect.png rename to org.tizen.ui.practices/html/images/migrate_scrollable_rect.png diff --git a/org.tizen.ui.practices/html/images/mn_division.png b/org.tizen.ui.practices/html/images/mn_division.png new file mode 100644 index 0000000..faecb28 Binary files /dev/null and b/org.tizen.ui.practices/html/images/mn_division.png differ diff --git a/org.tizen.ui.guides/html/images/mn_icon.png b/org.tizen.ui.practices/html/images/mn_icon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/mn_icon.png rename to org.tizen.ui.practices/html/images/mn_icon.png diff --git a/org.tizen.ui.practices/html/images/mobile_s_n.png b/org.tizen.ui.practices/html/images/mobile_s_n.png new file mode 100644 index 0000000..ad8c779 Binary files /dev/null and b/org.tizen.ui.practices/html/images/mobile_s_n.png differ diff --git a/org.tizen.ui.practices/html/images/mobile_s_w.png b/org.tizen.ui.practices/html/images/mobile_s_w.png new file mode 100644 index 0000000..f86df29 Binary files /dev/null and b/org.tizen.ui.practices/html/images/mobile_s_w.png differ diff --git a/org.tizen.ui.practices/html/images/mobile_s_w_optional.png b/org.tizen.ui.practices/html/images/mobile_s_w_optional.png new file mode 100644 index 0000000..0434b73 Binary files /dev/null and b/org.tizen.ui.practices/html/images/mobile_s_w_optional.png differ diff --git a/org.tizen.ui.practices/html/images/more_option.png b/org.tizen.ui.practices/html/images/more_option.png new file mode 100644 index 0000000..4d315e1 Binary files /dev/null and b/org.tizen.ui.practices/html/images/more_option.png differ diff --git a/org.tizen.ui.practices/html/images/more_option_item.png b/org.tizen.ui.practices/html/images/more_option_item.png new file mode 100644 index 0000000..842c480 Binary files /dev/null and b/org.tizen.ui.practices/html/images/more_option_item.png differ diff --git a/org.tizen.ui.practices/html/images/more_option_main.png b/org.tizen.ui.practices/html/images/more_option_main.png new file mode 100644 index 0000000..b03b67e Binary files /dev/null and b/org.tizen.ui.practices/html/images/more_option_main.png differ diff --git a/org.tizen.ui.practices/html/images/more_option_sub.png b/org.tizen.ui.practices/html/images/more_option_sub.png new file mode 100644 index 0000000..ea191db Binary files /dev/null and b/org.tizen.ui.practices/html/images/more_option_sub.png differ diff --git a/org.tizen.ui.guides/html/images/moving1.png b/org.tizen.ui.practices/html/images/moving1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/moving1.png rename to org.tizen.ui.practices/html/images/moving1.png diff --git a/org.tizen.ui.guides/html/images/moving2.png b/org.tizen.ui.practices/html/images/moving2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/moving2.png rename to org.tizen.ui.practices/html/images/moving2.png diff --git a/org.tizen.ui.guides/html/images/multi_button_default.png b/org.tizen.ui.practices/html/images/multi_button_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/multi_button_default.png rename to org.tizen.ui.practices/html/images/multi_button_default.png diff --git a/org.tizen.ui.guides/html/images/multi_node_selection.png b/org.tizen.ui.practices/html/images/multi_node_selection.png similarity index 100% rename from org.tizen.ui.guides/html/images/multi_node_selection.png rename to org.tizen.ui.practices/html/images/multi_node_selection.png diff --git a/org.tizen.ui.guides/html/images/multi_threading.png b/org.tizen.ui.practices/html/images/multi_threading.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/multi_threading.png rename to org.tizen.ui.practices/html/images/multi_threading.png diff --git a/org.tizen.ui.guides/html/images/multi_threading2.png b/org.tizen.ui.practices/html/images/multi_threading2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/multi_threading2.png rename to org.tizen.ui.practices/html/images/multi_threading2.png diff --git a/org.tizen.ui.guides/html/images/multiple_layout_example.png b/org.tizen.ui.practices/html/images/multiple_layout_example.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/multiple_layout_example.png rename to org.tizen.ui.practices/html/images/multiple_layout_example.png diff --git a/org.tizen.ui.guides/html/images/multipoint_touch.png b/org.tizen.ui.practices/html/images/multipoint_touch.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/multipoint_touch.png rename to org.tizen.ui.practices/html/images/multipoint_touch.png diff --git a/org.tizen.ui.practices/html/images/mw_division.png b/org.tizen.ui.practices/html/images/mw_division.png new file mode 100644 index 0000000..c4a8655 Binary files /dev/null and b/org.tizen.ui.practices/html/images/mw_division.png differ diff --git a/org.tizen.ui.guides/html/images/mw_icon.png b/org.tizen.ui.practices/html/images/mw_icon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/mw_icon.png rename to org.tizen.ui.practices/html/images/mw_icon.png diff --git a/org.tizen.ui.guides/html/images/mw_icon_optional.png b/org.tizen.ui.practices/html/images/mw_icon_optional.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/mw_icon_optional.png rename to org.tizen.ui.practices/html/images/mw_icon_optional.png diff --git a/org.tizen.ui.practices/html/images/n_division.png b/org.tizen.ui.practices/html/images/n_division.png new file mode 100644 index 0000000..5a0b8f6 Binary files /dev/null and b/org.tizen.ui.practices/html/images/n_division.png differ diff --git a/org.tizen.ui.guides/html/images/network.png b/org.tizen.ui.practices/html/images/network.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/network.png rename to org.tizen.ui.practices/html/images/network.png diff --git a/org.tizen.ui.guides/html/images/network2.png b/org.tizen.ui.practices/html/images/network2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/network2.png rename to org.tizen.ui.practices/html/images/network2.png diff --git a/org.tizen.ui.guides/html/images/network3.png b/org.tizen.ui.practices/html/images/network3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/network3.png rename to org.tizen.ui.practices/html/images/network3.png diff --git a/org.tizen.ui.guides/html/images/network_speed_sprite.png b/org.tizen.ui.practices/html/images/network_speed_sprite.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/network_speed_sprite.png rename to org.tizen.ui.practices/html/images/network_speed_sprite.png diff --git a/org.tizen.ui.guides/html/images/nine_patch_dali.9.png b/org.tizen.ui.practices/html/images/nine_patch_dali.9.png similarity index 100% rename from org.tizen.ui.guides/html/images/nine_patch_dali.9.png rename to org.tizen.ui.practices/html/images/nine_patch_dali.9.png diff --git a/org.tizen.ui.guides/html/images/nine_patch_expanded.png b/org.tizen.ui.practices/html/images/nine_patch_expanded.png similarity index 100% rename from org.tizen.ui.guides/html/images/nine_patch_expanded.png rename to org.tizen.ui.practices/html/images/nine_patch_expanded.png diff --git a/org.tizen.ui.guides/html/images/nine_patch_explained.png b/org.tizen.ui.practices/html/images/nine_patch_explained.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/nine_patch_explained.png rename to org.tizen.ui.practices/html/images/nine_patch_explained.png diff --git a/org.tizen.ui.guides/html/images/notify_tree.png b/org.tizen.ui.practices/html/images/notify_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/notify_tree.png rename to org.tizen.ui.practices/html/images/notify_tree.png diff --git a/org.tizen.ui.guides/html/images/object_size_16.png b/org.tizen.ui.practices/html/images/object_size_16.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/object_size_16.png rename to org.tizen.ui.practices/html/images/object_size_16.png diff --git a/org.tizen.ui.guides/html/images/object_size_22.png b/org.tizen.ui.practices/html/images/object_size_22.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/object_size_22.png rename to org.tizen.ui.practices/html/images/object_size_22.png diff --git a/org.tizen.ui.guides/html/images/object_size_44.png b/org.tizen.ui.practices/html/images/object_size_44.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/object_size_44.png rename to org.tizen.ui.practices/html/images/object_size_44.png diff --git a/org.tizen.ui.guides/html/images/padding-hints.png b/org.tizen.ui.practices/html/images/padding-hints.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/padding-hints.png rename to org.tizen.ui.practices/html/images/padding-hints.png diff --git a/org.tizen.ui.guides/html/images/pane_tuto.png b/org.tizen.ui.practices/html/images/pane_tuto.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/pane_tuto.png rename to org.tizen.ui.practices/html/images/pane_tuto.png diff --git a/org.tizen.ui.guides/html/images/panel_default.png b/org.tizen.ui.practices/html/images/panel_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/panel_default.png rename to org.tizen.ui.practices/html/images/panel_default.png diff --git a/org.tizen.ui.guides/html/images/panel_tree.png b/org.tizen.ui.practices/html/images/panel_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/panel_tree.png rename to org.tizen.ui.practices/html/images/panel_tree.png diff --git a/org.tizen.ui.guides/html/images/panes.png b/org.tizen.ui.practices/html/images/panes.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/panes.png rename to org.tizen.ui.practices/html/images/panes.png diff --git a/org.tizen.ui.guides/html/images/parent_origin.png b/org.tizen.ui.practices/html/images/parent_origin.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/parent_origin.png rename to org.tizen.ui.practices/html/images/parent_origin.png diff --git a/org.tizen.ui.guides/html/images/path_animation.png b/org.tizen.ui.practices/html/images/path_animation.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/path_animation.png rename to org.tizen.ui.practices/html/images/path_animation.png diff --git a/org.tizen.ui.guides/html/images/perspective_buttons.png b/org.tizen.ui.practices/html/images/perspective_buttons.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/perspective_buttons.png rename to org.tizen.ui.practices/html/images/perspective_buttons.png diff --git a/org.tizen.ui.guides/html/images/perspective_screen.png b/org.tizen.ui.practices/html/images/perspective_screen.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/perspective_screen.png rename to org.tizen.ui.practices/html/images/perspective_screen.png diff --git a/org.tizen.ui.guides/html/images/perspective_swallow.png b/org.tizen.ui.practices/html/images/perspective_swallow.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/perspective_swallow.png rename to org.tizen.ui.practices/html/images/perspective_swallow.png diff --git a/org.tizen.ui.guides/html/images/photo_tree.png b/org.tizen.ui.practices/html/images/photo_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/photo_tree.png rename to org.tizen.ui.practices/html/images/photo_tree.png diff --git a/org.tizen.ui.guides/html/images/photocam_tree.png b/org.tizen.ui.practices/html/images/photocam_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/photocam_tree.png rename to org.tizen.ui.practices/html/images/photocam_tree.png diff --git a/org.tizen.ui.guides/html/images/plug_tree.png b/org.tizen.ui.practices/html/images/plug_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/plug_tree.png rename to org.tizen.ui.practices/html/images/plug_tree.png diff --git a/org.tizen.ui.guides/html/images/popup.png b/org.tizen.ui.practices/html/images/popup.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup.png rename to org.tizen.ui.practices/html/images/popup.png diff --git a/org.tizen.ui.guides/html/images/popup_circle_o_wn.png b/org.tizen.ui.practices/html/images/popup_circle_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_circle_o_wn.png rename to org.tizen.ui.practices/html/images/popup_circle_o_wn.png diff --git a/org.tizen.ui.guides/html/images/popup_default.png b/org.tizen.ui.practices/html/images/popup_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_default.png rename to org.tizen.ui.practices/html/images/popup_default.png diff --git a/org.tizen.ui.guides/html/images/popup_default_wn.png b/org.tizen.ui.practices/html/images/popup_default_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_default_wn.png rename to org.tizen.ui.practices/html/images/popup_default_wn.png diff --git a/org.tizen.ui.guides/html/images/popup_toast.png b/org.tizen.ui.practices/html/images/popup_toast.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_toast.png rename to org.tizen.ui.practices/html/images/popup_toast.png diff --git a/org.tizen.ui.guides/html/images/popup_toast_o_wn.png b/org.tizen.ui.practices/html/images/popup_toast_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_toast_o_wn.png rename to org.tizen.ui.practices/html/images/popup_toast_o_wn.png diff --git a/org.tizen.ui.guides/html/images/popup_toast_wn.png b/org.tizen.ui.practices/html/images/popup_toast_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_toast_wn.png rename to org.tizen.ui.practices/html/images/popup_toast_wn.png diff --git a/org.tizen.ui.guides/html/images/popup_tree.png b/org.tizen.ui.practices/html/images/popup_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_tree.png rename to org.tizen.ui.practices/html/images/popup_tree.png diff --git a/org.tizen.ui.guides/html/images/popup_wn.png b/org.tizen.ui.practices/html/images/popup_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/popup_wn.png rename to org.tizen.ui.practices/html/images/popup_wn.png diff --git a/org.tizen.ui.guides/html/images/pos_map_all.png b/org.tizen.ui.practices/html/images/pos_map_all.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/pos_map_all.png rename to org.tizen.ui.practices/html/images/pos_map_all.png diff --git a/org.tizen.ui.guides/html/images/progressbar.png b/org.tizen.ui.practices/html/images/progressbar.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar.png rename to org.tizen.ui.practices/html/images/progressbar.png diff --git a/org.tizen.ui.guides/html/images/progressbar_default.png b/org.tizen.ui.practices/html/images/progressbar_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_default.png rename to org.tizen.ui.practices/html/images/progressbar_default.png diff --git a/org.tizen.ui.guides/html/images/progressbar_default_wn.png b/org.tizen.ui.practices/html/images/progressbar_default_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_default_wn.png rename to org.tizen.ui.practices/html/images/progressbar_default_wn.png diff --git a/org.tizen.ui.guides/html/images/progressbar_group_wn.png b/org.tizen.ui.practices/html/images/progressbar_group_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_group_wn.png rename to org.tizen.ui.practices/html/images/progressbar_group_wn.png diff --git a/org.tizen.ui.guides/html/images/progressbar_pending_wn.png b/org.tizen.ui.practices/html/images/progressbar_pending_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_pending_wn.png rename to org.tizen.ui.practices/html/images/progressbar_pending_wn.png diff --git a/org.tizen.ui.guides/html/images/progressbar_process_o_wn.png b/org.tizen.ui.practices/html/images/progressbar_process_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_process_o_wn.png rename to org.tizen.ui.practices/html/images/progressbar_process_o_wn.png diff --git a/org.tizen.ui.guides/html/images/progressbar_process_wn.png b/org.tizen.ui.practices/html/images/progressbar_process_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_process_wn.png rename to org.tizen.ui.practices/html/images/progressbar_process_wn.png diff --git a/org.tizen.ui.guides/html/images/progressbar_small_o_wn.png b/org.tizen.ui.practices/html/images/progressbar_small_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_small_o_wn.png rename to org.tizen.ui.practices/html/images/progressbar_small_o_wn.png diff --git a/org.tizen.ui.guides/html/images/progressbar_tree.png b/org.tizen.ui.practices/html/images/progressbar_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_tree.png rename to org.tizen.ui.practices/html/images/progressbar_tree.png diff --git a/org.tizen.ui.guides/html/images/progressbar_wheel.png b/org.tizen.ui.practices/html/images/progressbar_wheel.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_wheel.png rename to org.tizen.ui.practices/html/images/progressbar_wheel.png diff --git a/org.tizen.ui.guides/html/images/progressbar_wn.png b/org.tizen.ui.practices/html/images/progressbar_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/progressbar_wn.png rename to org.tizen.ui.practices/html/images/progressbar_wn.png diff --git a/org.tizen.ui.guides/html/images/pseudo_elements_selector_range.png b/org.tizen.ui.practices/html/images/pseudo_elements_selector_range.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/pseudo_elements_selector_range.png rename to org.tizen.ui.practices/html/images/pseudo_elements_selector_range.png diff --git a/org.tizen.ui.guides/html/images/pseudo_elements_selector_required.png b/org.tizen.ui.practices/html/images/pseudo_elements_selector_required.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/pseudo_elements_selector_required.png rename to org.tizen.ui.practices/html/images/pseudo_elements_selector_required.png diff --git a/org.tizen.ui.guides/html/images/push_button.png b/org.tizen.ui.practices/html/images/push_button.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/push_button.png rename to org.tizen.ui.practices/html/images/push_button.png diff --git a/org.tizen.ui.guides/html/images/radio.png b/org.tizen.ui.practices/html/images/radio.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio.png rename to org.tizen.ui.practices/html/images/radio.png diff --git a/org.tizen.ui.guides/html/images/radio_button.png b/org.tizen.ui.practices/html/images/radio_button.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_button.png rename to org.tizen.ui.practices/html/images/radio_button.png diff --git a/org.tizen.ui.guides/html/images/radio_default.png b/org.tizen.ui.practices/html/images/radio_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_default.png rename to org.tizen.ui.practices/html/images/radio_default.png diff --git a/org.tizen.ui.guides/html/images/radio_default_o_wn.png b/org.tizen.ui.practices/html/images/radio_default_o_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_default_o_wn.png rename to org.tizen.ui.practices/html/images/radio_default_o_wn.png diff --git a/org.tizen.ui.guides/html/images/radio_default_wn.png b/org.tizen.ui.practices/html/images/radio_default_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_default_wn.png rename to org.tizen.ui.practices/html/images/radio_default_wn.png diff --git a/org.tizen.ui.guides/html/images/radio_state_changes.png b/org.tizen.ui.practices/html/images/radio_state_changes.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_state_changes.png rename to org.tizen.ui.practices/html/images/radio_state_changes.png diff --git a/org.tizen.ui.guides/html/images/radio_tree.png b/org.tizen.ui.practices/html/images/radio_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_tree.png rename to org.tizen.ui.practices/html/images/radio_tree.png diff --git a/org.tizen.ui.guides/html/images/radio_wn.png b/org.tizen.ui.practices/html/images/radio_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/radio_wn.png rename to org.tizen.ui.practices/html/images/radio_wn.png diff --git a/org.tizen.ui.guides/html/images/rectangular_footer.png b/org.tizen.ui.practices/html/images/rectangular_footer.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_footer.png rename to org.tizen.ui.practices/html/images/rectangular_footer.png diff --git a/org.tizen.ui.guides/html/images/rectangular_header.png b/org.tizen.ui.practices/html/images/rectangular_header.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_header.png rename to org.tizen.ui.practices/html/images/rectangular_header.png diff --git a/org.tizen.ui.guides/html/images/rectangular_index.png b/org.tizen.ui.practices/html/images/rectangular_index.png similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_index.png rename to org.tizen.ui.practices/html/images/rectangular_index.png diff --git a/org.tizen.ui.guides/html/images/rectangular_list.png b/org.tizen.ui.practices/html/images/rectangular_list.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_list.png rename to org.tizen.ui.practices/html/images/rectangular_list.png diff --git a/org.tizen.ui.guides/html/images/rectangular_moreoption.png b/org.tizen.ui.practices/html/images/rectangular_moreoption.png similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_moreoption.png rename to org.tizen.ui.practices/html/images/rectangular_moreoption.png diff --git a/org.tizen.ui.guides/html/images/rectangular_multibtn.png b/org.tizen.ui.practices/html/images/rectangular_multibtn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_multibtn.png rename to org.tizen.ui.practices/html/images/rectangular_multibtn.png diff --git a/org.tizen.ui.guides/html/images/rectangular_popup_bottom.png b/org.tizen.ui.practices/html/images/rectangular_popup_bottom.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_popup_bottom.png rename to org.tizen.ui.practices/html/images/rectangular_popup_bottom.png diff --git a/org.tizen.ui.guides/html/images/rectangular_popup_side.png b/org.tizen.ui.practices/html/images/rectangular_popup_side.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_popup_side.png rename to org.tizen.ui.practices/html/images/rectangular_popup_side.png diff --git a/org.tizen.ui.guides/html/images/rectangular_processing.png b/org.tizen.ui.practices/html/images/rectangular_processing.png similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_processing.png rename to org.tizen.ui.practices/html/images/rectangular_processing.png diff --git a/org.tizen.ui.guides/html/images/rectangular_progress.png b/org.tizen.ui.practices/html/images/rectangular_progress.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_progress.png rename to org.tizen.ui.practices/html/images/rectangular_progress.png diff --git a/org.tizen.ui.guides/html/images/rectangular_thumbnail.png b/org.tizen.ui.practices/html/images/rectangular_thumbnail.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rectangular_thumbnail.png rename to org.tizen.ui.practices/html/images/rectangular_thumbnail.png diff --git a/org.tizen.ui.guides/html/images/redrawing01.png b/org.tizen.ui.practices/html/images/redrawing01.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/redrawing01.png rename to org.tizen.ui.practices/html/images/redrawing01.png diff --git a/org.tizen.ui.guides/html/images/redrawing02.png b/org.tizen.ui.practices/html/images/redrawing02.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/redrawing02.png rename to org.tizen.ui.practices/html/images/redrawing02.png diff --git a/org.tizen.ui.guides/html/images/redrawing03.png b/org.tizen.ui.practices/html/images/redrawing03.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/redrawing03.png rename to org.tizen.ui.practices/html/images/redrawing03.png diff --git a/org.tizen.ui.guides/html/images/redrawing04.png b/org.tizen.ui.practices/html/images/redrawing04.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/redrawing04.png rename to org.tizen.ui.practices/html/images/redrawing04.png diff --git a/org.tizen.ui.guides/html/images/redrawing05.png b/org.tizen.ui.practices/html/images/redrawing05.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/redrawing05.png rename to org.tizen.ui.practices/html/images/redrawing05.png diff --git a/org.tizen.ui.guides/html/images/rel1_rel2_offsets.png b/org.tizen.ui.practices/html/images/rel1_rel2_offsets.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rel1_rel2_offsets.png rename to org.tizen.ui.practices/html/images/rel1_rel2_offsets.png diff --git a/org.tizen.ui.guides/html/images/rel1_rel2_offsets_and_relative.png b/org.tizen.ui.practices/html/images/rel1_rel2_offsets_and_relative.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rel1_rel2_offsets_and_relative.png rename to org.tizen.ui.practices/html/images/rel1_rel2_offsets_and_relative.png diff --git a/org.tizen.ui.guides/html/images/removing_padding.png b/org.tizen.ui.practices/html/images/removing_padding.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/removing_padding.png rename to org.tizen.ui.practices/html/images/removing_padding.png diff --git a/org.tizen.ui.guides/html/images/rendering1.png b/org.tizen.ui.practices/html/images/rendering1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rendering1.png rename to org.tizen.ui.practices/html/images/rendering1.png diff --git a/org.tizen.ui.guides/html/images/retained_mode.png b/org.tizen.ui.practices/html/images/retained_mode.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/retained_mode.png rename to org.tizen.ui.practices/html/images/retained_mode.png diff --git a/org.tizen.ui.guides/html/images/rotary_event.png b/org.tizen.ui.practices/html/images/rotary_event.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/rotary_event.png rename to org.tizen.ui.practices/html/images/rotary_event.png diff --git a/org.tizen.ui.practices/html/images/rotary_selector.png b/org.tizen.ui.practices/html/images/rotary_selector.png new file mode 100644 index 0000000..23d7a6c Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector.png differ diff --git a/org.tizen.ui.practices/html/images/rotary_selector_item.png b/org.tizen.ui.practices/html/images/rotary_selector_item.png new file mode 100644 index 0000000..8bb84cb Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector_item.png differ diff --git a/org.tizen.ui.practices/html/images/rotary_selector_main.png b/org.tizen.ui.practices/html/images/rotary_selector_main.png new file mode 100644 index 0000000..c6c8dcd Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector_main.png differ diff --git a/org.tizen.ui.practices/html/images/rotary_selector_main_text.png b/org.tizen.ui.practices/html/images/rotary_selector_main_text.png new file mode 100644 index 0000000..211d864 Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector_main_text.png differ diff --git a/org.tizen.ui.practices/html/images/rotary_selector_selector.png b/org.tizen.ui.practices/html/images/rotary_selector_selector.png new file mode 100644 index 0000000..42de2a7 Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector_selector.png differ diff --git a/org.tizen.ui.practices/html/images/rotary_selector_sub.png b/org.tizen.ui.practices/html/images/rotary_selector_sub.png new file mode 100644 index 0000000..87647f6 Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector_sub.png differ diff --git a/org.tizen.ui.practices/html/images/rotary_selector_sub_text.png b/org.tizen.ui.practices/html/images/rotary_selector_sub_text.png new file mode 100644 index 0000000..e26b473 Binary files /dev/null and b/org.tizen.ui.practices/html/images/rotary_selector_sub_text.png differ diff --git a/org.tizen.ui.practices/html/images/round_footer.png b/org.tizen.ui.practices/html/images/round_footer.png new file mode 100644 index 0000000..d5c63b4 Binary files /dev/null and b/org.tizen.ui.practices/html/images/round_footer.png differ diff --git a/org.tizen.ui.guides/html/images/round_header.png b/org.tizen.ui.practices/html/images/round_header.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/round_header.png rename to org.tizen.ui.practices/html/images/round_header.png diff --git a/org.tizen.ui.guides/html/images/round_index.png b/org.tizen.ui.practices/html/images/round_index.png similarity index 100% rename from org.tizen.ui.guides/html/images/round_index.png rename to org.tizen.ui.practices/html/images/round_index.png diff --git a/org.tizen.ui.guides/html/images/round_list.png b/org.tizen.ui.practices/html/images/round_list.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/round_list.png rename to org.tizen.ui.practices/html/images/round_list.png diff --git a/org.tizen.ui.practices/html/images/round_moreoption.png b/org.tizen.ui.practices/html/images/round_moreoption.png new file mode 100644 index 0000000..adec378 Binary files /dev/null and b/org.tizen.ui.practices/html/images/round_moreoption.png differ diff --git a/org.tizen.ui.practices/html/images/round_multibtn.png b/org.tizen.ui.practices/html/images/round_multibtn.png new file mode 100644 index 0000000..77b6d6b Binary files /dev/null and b/org.tizen.ui.practices/html/images/round_multibtn.png differ diff --git a/org.tizen.ui.guides/html/images/round_popup_bottom.png b/org.tizen.ui.practices/html/images/round_popup_bottom.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/round_popup_bottom.png rename to org.tizen.ui.practices/html/images/round_popup_bottom.png diff --git a/org.tizen.ui.guides/html/images/round_popup_side.png b/org.tizen.ui.practices/html/images/round_popup_side.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/round_popup_side.png rename to org.tizen.ui.practices/html/images/round_popup_side.png diff --git a/org.tizen.ui.practices/html/images/round_processing.png b/org.tizen.ui.practices/html/images/round_processing.png new file mode 100644 index 0000000..7b59fe2 Binary files /dev/null and b/org.tizen.ui.practices/html/images/round_processing.png differ diff --git a/org.tizen.ui.guides/html/images/round_progress.png b/org.tizen.ui.practices/html/images/round_progress.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/round_progress.png rename to org.tizen.ui.practices/html/images/round_progress.png diff --git a/org.tizen.ui.guides/html/images/round_thumbnail.png b/org.tizen.ui.practices/html/images/round_thumbnail.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/round_thumbnail.png rename to org.tizen.ui.practices/html/images/round_thumbnail.png diff --git a/org.tizen.ui.guides/html/images/scalable_group1.png b/org.tizen.ui.practices/html/images/scalable_group1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scalable_group1.png rename to org.tizen.ui.practices/html/images/scalable_group1.png diff --git a/org.tizen.ui.guides/html/images/scalable_group2.png b/org.tizen.ui.practices/html/images/scalable_group2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scalable_group2.png rename to org.tizen.ui.practices/html/images/scalable_group2.png diff --git a/org.tizen.ui.guides/html/images/scale.png b/org.tizen.ui.practices/html/images/scale.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale.png rename to org.tizen.ui.practices/html/images/scale.png diff --git a/org.tizen.ui.guides/html/images/scale_1.3_finger_50.png b/org.tizen.ui.practices/html/images/scale_1.3_finger_50.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_1.3_finger_50.png rename to org.tizen.ui.practices/html/images/scale_1.3_finger_50.png diff --git a/org.tizen.ui.guides/html/images/scale_1_finger_50.png b/org.tizen.ui.practices/html/images/scale_1_finger_50.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_1_finger_50.png rename to org.tizen.ui.practices/html/images/scale_1_finger_50.png diff --git a/org.tizen.ui.guides/html/images/scale_1_finger_90.png b/org.tizen.ui.practices/html/images/scale_1_finger_90.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_1_finger_90.png rename to org.tizen.ui.practices/html/images/scale_1_finger_90.png diff --git a/org.tizen.ui.guides/html/images/scale_align_hint.png b/org.tizen.ui.practices/html/images/scale_align_hint.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_align_hint.png rename to org.tizen.ui.practices/html/images/scale_align_hint.png diff --git a/org.tizen.ui.guides/html/images/scale_box.png b/org.tizen.ui.practices/html/images/scale_box.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_box.png rename to org.tizen.ui.practices/html/images/scale_box.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_1.png b/org.tizen.ui.practices/html/images/scale_effect_1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_1.png rename to org.tizen.ui.practices/html/images/scale_effect_1.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_10.png b/org.tizen.ui.practices/html/images/scale_effect_10.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_10.png rename to org.tizen.ui.practices/html/images/scale_effect_10.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_2.png b/org.tizen.ui.practices/html/images/scale_effect_2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_2.png rename to org.tizen.ui.practices/html/images/scale_effect_2.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_3.png b/org.tizen.ui.practices/html/images/scale_effect_3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_3.png rename to org.tizen.ui.practices/html/images/scale_effect_3.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_4.png b/org.tizen.ui.practices/html/images/scale_effect_4.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_4.png rename to org.tizen.ui.practices/html/images/scale_effect_4.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_5.png b/org.tizen.ui.practices/html/images/scale_effect_5.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_5.png rename to org.tizen.ui.practices/html/images/scale_effect_5.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_6.png b/org.tizen.ui.practices/html/images/scale_effect_6.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_6.png rename to org.tizen.ui.practices/html/images/scale_effect_6.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_7.png b/org.tizen.ui.practices/html/images/scale_effect_7.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_7.png rename to org.tizen.ui.practices/html/images/scale_effect_7.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_8.png b/org.tizen.ui.practices/html/images/scale_effect_8.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_8.png rename to org.tizen.ui.practices/html/images/scale_effect_8.png diff --git a/org.tizen.ui.guides/html/images/scale_effect_9.png b/org.tizen.ui.practices/html/images/scale_effect_9.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_effect_9.png rename to org.tizen.ui.practices/html/images/scale_effect_9.png diff --git a/org.tizen.ui.guides/html/images/scale_example_image.png b/org.tizen.ui.practices/html/images/scale_example_image.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_example_image.png rename to org.tizen.ui.practices/html/images/scale_example_image.png diff --git a/org.tizen.ui.guides/html/images/scale_example_image_set.png b/org.tizen.ui.practices/html/images/scale_example_image_set.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_example_image_set.png rename to org.tizen.ui.practices/html/images/scale_example_image_set.png diff --git a/org.tizen.ui.guides/html/images/scale_example_part.png b/org.tizen.ui.practices/html/images/scale_example_part.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_example_part.png rename to org.tizen.ui.practices/html/images/scale_example_part.png diff --git a/org.tizen.ui.guides/html/images/scale_example_part_aspect.png b/org.tizen.ui.practices/html/images/scale_example_part_aspect.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_example_part_aspect.png rename to org.tizen.ui.practices/html/images/scale_example_part_aspect.png diff --git a/org.tizen.ui.guides/html/images/scale_example_text.png b/org.tizen.ui.practices/html/images/scale_example_text.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_example_text.png rename to org.tizen.ui.practices/html/images/scale_example_text.png diff --git a/org.tizen.ui.guides/html/images/scale_example_text_fit.png b/org.tizen.ui.practices/html/images/scale_example_text_fit.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_example_text_fit.png rename to org.tizen.ui.practices/html/images/scale_example_text_fit.png diff --git a/org.tizen.ui.guides/html/images/scale_fixed.png b/org.tizen.ui.practices/html/images/scale_fixed.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_fixed.png rename to org.tizen.ui.practices/html/images/scale_fixed.png diff --git a/org.tizen.ui.guides/html/images/scale_fixed_flexible.png b/org.tizen.ui.practices/html/images/scale_fixed_flexible.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_fixed_flexible.png rename to org.tizen.ui.practices/html/images/scale_fixed_flexible.png diff --git a/org.tizen.ui.guides/html/images/scale_fixed_height.png b/org.tizen.ui.practices/html/images/scale_fixed_height.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_fixed_height.png rename to org.tizen.ui.practices/html/images/scale_fixed_height.png diff --git a/org.tizen.ui.guides/html/images/scale_flexible_height.png b/org.tizen.ui.practices/html/images/scale_flexible_height.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_flexible_height.png rename to org.tizen.ui.practices/html/images/scale_flexible_height.png diff --git a/org.tizen.ui.guides/html/images/scale_grid.png b/org.tizen.ui.practices/html/images/scale_grid.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_grid.png rename to org.tizen.ui.practices/html/images/scale_grid.png diff --git a/org.tizen.ui.guides/html/images/scale_original_image.png b/org.tizen.ui.practices/html/images/scale_original_image.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_original_image.png rename to org.tizen.ui.practices/html/images/scale_original_image.png diff --git a/org.tizen.ui.guides/html/images/scale_relative.png b/org.tizen.ui.practices/html/images/scale_relative.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_relative.png rename to org.tizen.ui.practices/html/images/scale_relative.png diff --git a/org.tizen.ui.guides/html/images/scale_relative_scaled.png b/org.tizen.ui.practices/html/images/scale_relative_scaled.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_relative_scaled.png rename to org.tizen.ui.practices/html/images/scale_relative_scaled.png diff --git a/org.tizen.ui.guides/html/images/scale_testing_app.png b/org.tizen.ui.practices/html/images/scale_testing_app.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_testing_app.png rename to org.tizen.ui.practices/html/images/scale_testing_app.png diff --git a/org.tizen.ui.guides/html/images/scale_values.png b/org.tizen.ui.practices/html/images/scale_values.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_values.png rename to org.tizen.ui.practices/html/images/scale_values.png diff --git a/org.tizen.ui.guides/html/images/scale_values2.png b/org.tizen.ui.practices/html/images/scale_values2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_values2.png rename to org.tizen.ui.practices/html/images/scale_values2.png diff --git a/org.tizen.ui.guides/html/images/scale_weight_hint.png b/org.tizen.ui.practices/html/images/scale_weight_hint.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_weight_hint.png rename to org.tizen.ui.practices/html/images/scale_weight_hint.png diff --git a/org.tizen.ui.guides/html/images/scale_weight_hint_multiple.png b/org.tizen.ui.practices/html/images/scale_weight_hint_multiple.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scale_weight_hint_multiple.png rename to org.tizen.ui.practices/html/images/scale_weight_hint_multiple.png diff --git a/org.tizen.ui.guides/html/images/scaling.png b/org.tizen.ui.practices/html/images/scaling.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scaling.png rename to org.tizen.ui.practices/html/images/scaling.png diff --git a/org.tizen.ui.guides/html/images/screenshot_1.png b/org.tizen.ui.practices/html/images/screenshot_1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/screenshot_1.png rename to org.tizen.ui.practices/html/images/screenshot_1.png diff --git a/org.tizen.ui.guides/html/images/screenshot_2.png b/org.tizen.ui.practices/html/images/screenshot_2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/screenshot_2.png rename to org.tizen.ui.practices/html/images/screenshot_2.png diff --git a/org.tizen.ui.guides/html/images/scrollview.png b/org.tizen.ui.practices/html/images/scrollview.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/scrollview.png rename to org.tizen.ui.practices/html/images/scrollview.png diff --git a/org.tizen.ui.guides/html/images/segm_control_default.png b/org.tizen.ui.practices/html/images/segm_control_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/segm_control_default.png rename to org.tizen.ui.practices/html/images/segm_control_default.png diff --git a/org.tizen.ui.guides/html/images/segment.png b/org.tizen.ui.practices/html/images/segment.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/segment.png rename to org.tizen.ui.practices/html/images/segment.png diff --git a/org.tizen.ui.guides/html/images/segment_control_tree.png b/org.tizen.ui.practices/html/images/segment_control_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/segment_control_tree.png rename to org.tizen.ui.practices/html/images/segment_control_tree.png diff --git a/org.tizen.ui.guides/html/images/segment_text.png b/org.tizen.ui.practices/html/images/segment_text.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/segment_text.png rename to org.tizen.ui.practices/html/images/segment_text.png diff --git a/org.tizen.ui.guides/html/images/setting_sd.png b/org.tizen.ui.practices/html/images/setting_sd.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/setting_sd.png rename to org.tizen.ui.practices/html/images/setting_sd.png diff --git a/org.tizen.ui.guides/html/images/show_frametime.png b/org.tizen.ui.practices/html/images/show_frametime.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/show_frametime.png rename to org.tizen.ui.practices/html/images/show_frametime.png diff --git a/org.tizen.ui.guides/html/images/signal_slot.png b/org.tizen.ui.practices/html/images/signal_slot.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/signal_slot.png rename to org.tizen.ui.practices/html/images/signal_slot.png diff --git a/org.tizen.ui.guides/html/images/single_node_selection.png b/org.tizen.ui.practices/html/images/single_node_selection.png similarity index 100% rename from org.tizen.ui.guides/html/images/single_node_selection.png rename to org.tizen.ui.practices/html/images/single_node_selection.png diff --git a/org.tizen.ui.guides/html/images/slider.png b/org.tizen.ui.practices/html/images/slider.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider.png rename to org.tizen.ui.practices/html/images/slider.png diff --git a/org.tizen.ui.guides/html/images/slider_hor.png b/org.tizen.ui.practices/html/images/slider_hor.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_hor.png rename to org.tizen.ui.practices/html/images/slider_hor.png diff --git a/org.tizen.ui.guides/html/images/slider_hor_center.png b/org.tizen.ui.practices/html/images/slider_hor_center.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_hor_center.png rename to org.tizen.ui.practices/html/images/slider_hor_center.png diff --git a/org.tizen.ui.guides/html/images/slider_hor_wn.png b/org.tizen.ui.practices/html/images/slider_hor_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_hor_wn.png rename to org.tizen.ui.practices/html/images/slider_hor_wn.png diff --git a/org.tizen.ui.guides/html/images/slider_tree.png b/org.tizen.ui.practices/html/images/slider_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_tree.png rename to org.tizen.ui.practices/html/images/slider_tree.png diff --git a/org.tizen.ui.guides/html/images/slider_ver.png b/org.tizen.ui.practices/html/images/slider_ver.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_ver.png rename to org.tizen.ui.practices/html/images/slider_ver.png diff --git a/org.tizen.ui.guides/html/images/slider_ver_center.png b/org.tizen.ui.practices/html/images/slider_ver_center.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_ver_center.png rename to org.tizen.ui.practices/html/images/slider_ver_center.png diff --git a/org.tizen.ui.guides/html/images/slider_wn.png b/org.tizen.ui.practices/html/images/slider_wn.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/slider_wn.png rename to org.tizen.ui.practices/html/images/slider_wn.png diff --git a/org.tizen.ui.guides/html/images/spin.png b/org.tizen.ui.practices/html/images/spin.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/spin.png rename to org.tizen.ui.practices/html/images/spin.png diff --git a/org.tizen.ui.guides/html/images/spinner_hor.png b/org.tizen.ui.practices/html/images/spinner_hor.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/spinner_hor.png rename to org.tizen.ui.practices/html/images/spinner_hor.png diff --git a/org.tizen.ui.guides/html/images/spinner_tree.png b/org.tizen.ui.practices/html/images/spinner_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/spinner_tree.png rename to org.tizen.ui.practices/html/images/spinner_tree.png diff --git a/org.tizen.ui.guides/html/images/spinner_ver.png b/org.tizen.ui.practices/html/images/spinner_ver.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/spinner_ver.png rename to org.tizen.ui.practices/html/images/spinner_ver.png diff --git a/org.tizen.ui.guides/html/images/spiral.png b/org.tizen.ui.practices/html/images/spiral.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/spiral.png rename to org.tizen.ui.practices/html/images/spiral.png diff --git a/org.tizen.ui.guides/html/images/stereo_projection.png b/org.tizen.ui.practices/html/images/stereo_projection.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/stereo_projection.png rename to org.tizen.ui.practices/html/images/stereo_projection.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_def.png b/org.tizen.ui.practices/html/images/styleguide_genlist_def.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_def.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_def.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_defstyle.png b/org.tizen.ui.practices/html/images/styleguide_genlist_defstyle.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_defstyle.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_defstyle.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_doublelabel.png b/org.tizen.ui.practices/html/images/styleguide_genlist_doublelabel.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_doublelabel.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_doublelabel.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_end.png b/org.tizen.ui.practices/html/images/styleguide_genlist_end.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_end.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_end.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_full.png b/org.tizen.ui.practices/html/images/styleguide_genlist_full.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_full.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_full.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_group.png b/org.tizen.ui.practices/html/images/styleguide_genlist_group.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_group.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_group.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_message.png b/org.tizen.ui.practices/html/images/styleguide_genlist_message.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_message.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_message.png diff --git a/org.tizen.ui.guides/html/images/styleguide_genlist_oneicon.png b/org.tizen.ui.practices/html/images/styleguide_genlist_oneicon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/styleguide_genlist_oneicon.png rename to org.tizen.ui.practices/html/images/styleguide_genlist_oneicon.png diff --git a/org.tizen.ui.guides/html/images/tableview.png b/org.tizen.ui.practices/html/images/tableview.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/tableview.png rename to org.tizen.ui.practices/html/images/tableview.png diff --git a/org.tizen.ui.practices/html/images/tau_animation_1.png b/org.tizen.ui.practices/html/images/tau_animation_1.png new file mode 100644 index 0000000..03962f7 Binary files /dev/null and b/org.tizen.ui.practices/html/images/tau_animation_1.png differ diff --git a/org.tizen.ui.practices/html/images/tau_animation_2.png b/org.tizen.ui.practices/html/images/tau_animation_2.png new file mode 100644 index 0000000..f370b90 Binary files /dev/null and b/org.tizen.ui.practices/html/images/tau_animation_2.png differ diff --git a/org.tizen.ui.practices/html/images/tau_animation_3.png b/org.tizen.ui.practices/html/images/tau_animation_3.png new file mode 100644 index 0000000..69a8d82 Binary files /dev/null and b/org.tizen.ui.practices/html/images/tau_animation_3.png differ diff --git a/org.tizen.ui.practices/html/images/tau_animation_4.png b/org.tizen.ui.practices/html/images/tau_animation_4.png new file mode 100644 index 0000000..f4d6430 Binary files /dev/null and b/org.tizen.ui.practices/html/images/tau_animation_4.png differ diff --git a/org.tizen.ui.practices/html/images/tau_animation_5.png b/org.tizen.ui.practices/html/images/tau_animation_5.png new file mode 100644 index 0000000..2e6aa0e Binary files /dev/null and b/org.tizen.ui.practices/html/images/tau_animation_5.png differ diff --git a/org.tizen.ui.guides/html/images/text_class_list.png b/org.tizen.ui.practices/html/images/text_class_list.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/text_class_list.png rename to org.tizen.ui.practices/html/images/text_class_list.png diff --git a/org.tizen.ui.guides/html/images/text_class_list_del.png b/org.tizen.ui.practices/html/images/text_class_list_del.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/text_class_list_del.png rename to org.tizen.ui.practices/html/images/text_class_list_del.png diff --git a/org.tizen.ui.guides/html/images/text_class_properties.png b/org.tizen.ui.practices/html/images/text_class_properties.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/text_class_properties.png rename to org.tizen.ui.practices/html/images/text_class_properties.png diff --git a/org.tizen.ui.guides/html/images/text_properties.png b/org.tizen.ui.practices/html/images/text_properties.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/text_properties.png rename to org.tizen.ui.practices/html/images/text_properties.png diff --git a/org.tizen.ui.guides/html/images/text_screen_2.png b/org.tizen.ui.practices/html/images/text_screen_2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/text_screen_2.png rename to org.tizen.ui.practices/html/images/text_screen_2.png diff --git a/org.tizen.ui.guides/html/images/textfield.png b/org.tizen.ui.practices/html/images/textfield.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/textfield.png rename to org.tizen.ui.practices/html/images/textfield.png diff --git a/org.tizen.ui.guides/html/images/textlabel.png b/org.tizen.ui.practices/html/images/textlabel.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/textlabel.png rename to org.tizen.ui.practices/html/images/textlabel.png diff --git a/org.tizen.ui.guides/html/images/thread_pool_lifecycle_1.png b/org.tizen.ui.practices/html/images/thread_pool_lifecycle_1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/thread_pool_lifecycle_1.png rename to org.tizen.ui.practices/html/images/thread_pool_lifecycle_1.png diff --git a/org.tizen.ui.guides/html/images/thread_pool_lifecycle_2.png b/org.tizen.ui.practices/html/images/thread_pool_lifecycle_2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/thread_pool_lifecycle_2.png rename to org.tizen.ui.practices/html/images/thread_pool_lifecycle_2.png diff --git a/org.tizen.ui.guides/html/images/thread_pool_lifecycle_3.png b/org.tizen.ui.practices/html/images/thread_pool_lifecycle_3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/thread_pool_lifecycle_3.png rename to org.tizen.ui.practices/html/images/thread_pool_lifecycle_3.png diff --git a/org.tizen.ui.practices/html/images/tizen_project_dali.png b/org.tizen.ui.practices/html/images/tizen_project_dali.png new file mode 100644 index 0000000..ed45fe1 Binary files /dev/null and b/org.tizen.ui.practices/html/images/tizen_project_dali.png differ diff --git a/org.tizen.ui.guides/html/images/toolbar.png b/org.tizen.ui.practices/html/images/toolbar.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/toolbar.png rename to org.tizen.ui.practices/html/images/toolbar.png diff --git a/org.tizen.ui.guides/html/images/toolbar_default.png b/org.tizen.ui.practices/html/images/toolbar_default.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/toolbar_default.png rename to org.tizen.ui.practices/html/images/toolbar_default.png diff --git a/org.tizen.ui.guides/html/images/toolbar_navigation.png b/org.tizen.ui.practices/html/images/toolbar_navigation.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/toolbar_navigation.png rename to org.tizen.ui.practices/html/images/toolbar_navigation.png diff --git a/org.tizen.ui.guides/html/images/toolbar_tabbar.png b/org.tizen.ui.practices/html/images/toolbar_tabbar.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/toolbar_tabbar.png rename to org.tizen.ui.practices/html/images/toolbar_tabbar.png diff --git a/org.tizen.ui.guides/html/images/toolbar_tree.png b/org.tizen.ui.practices/html/images/toolbar_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/toolbar_tree.png rename to org.tizen.ui.practices/html/images/toolbar_tree.png diff --git a/org.tizen.ui.guides/html/images/transit_rotation_zoom.png b/org.tizen.ui.practices/html/images/transit_rotation_zoom.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/transit_rotation_zoom.png rename to org.tizen.ui.practices/html/images/transit_rotation_zoom.png diff --git a/org.tizen.ui.guides/html/images/transitions1.png b/org.tizen.ui.practices/html/images/transitions1.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/transitions1.png rename to org.tizen.ui.practices/html/images/transitions1.png diff --git a/org.tizen.ui.guides/html/images/transitions2.png b/org.tizen.ui.practices/html/images/transitions2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/transitions2.png rename to org.tizen.ui.practices/html/images/transitions2.png diff --git a/org.tizen.ui.guides/html/images/transitions3.png b/org.tizen.ui.practices/html/images/transitions3.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/transitions3.png rename to org.tizen.ui.practices/html/images/transitions3.png diff --git a/org.tizen.ui.guides/html/images/transitions5.png b/org.tizen.ui.practices/html/images/transitions5.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/transitions5.png rename to org.tizen.ui.practices/html/images/transitions5.png diff --git a/org.tizen.ui.guides/html/images/ui_control_hierarchy.png b/org.tizen.ui.practices/html/images/ui_control_hierarchy.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ui_control_hierarchy.png rename to org.tizen.ui.practices/html/images/ui_control_hierarchy.png diff --git a/org.tizen.ui.guides/html/images/ui_controls.png b/org.tizen.ui.practices/html/images/ui_controls.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ui_controls.png rename to org.tizen.ui.practices/html/images/ui_controls.png diff --git a/org.tizen.ui.guides/html/images/uilayout_view2.png b/org.tizen.ui.practices/html/images/uilayout_view2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/uilayout_view2.png rename to org.tizen.ui.practices/html/images/uilayout_view2.png diff --git a/org.tizen.ui.guides/html/images/use_natural_size.png b/org.tizen.ui.practices/html/images/use_natural_size.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/use_natural_size.png rename to org.tizen.ui.practices/html/images/use_natural_size.png diff --git a/org.tizen.ui.guides/html/images/using_clipper.png b/org.tizen.ui.practices/html/images/using_clipper.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/using_clipper.png rename to org.tizen.ui.practices/html/images/using_clipper.png diff --git a/org.tizen.ui.guides/html/images/using_clipper2.png b/org.tizen.ui.practices/html/images/using_clipper2.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/using_clipper2.png rename to org.tizen.ui.practices/html/images/using_clipper2.png diff --git a/org.tizen.ui.guides/html/images/using_import_attribute.png b/org.tizen.ui.practices/html/images/using_import_attribute.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/using_import_attribute.png rename to org.tizen.ui.practices/html/images/using_import_attribute.png diff --git a/org.tizen.ui.guides/html/images/view_main.png b/org.tizen.ui.practices/html/images/view_main.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/view_main.png rename to org.tizen.ui.practices/html/images/view_main.png diff --git a/org.tizen.ui.practices/html/images/w_division.png b/org.tizen.ui.practices/html/images/w_division.png new file mode 100644 index 0000000..443a1ea Binary files /dev/null and b/org.tizen.ui.practices/html/images/w_division.png differ diff --git a/org.tizen.ui.practices/html/images/wearable_s_n.png b/org.tizen.ui.practices/html/images/wearable_s_n.png new file mode 100644 index 0000000..02e3791 Binary files /dev/null and b/org.tizen.ui.practices/html/images/wearable_s_n.png differ diff --git a/org.tizen.ui.practices/html/images/wearable_s_w.png b/org.tizen.ui.practices/html/images/wearable_s_w.png new file mode 100644 index 0000000..379a9c5 Binary files /dev/null and b/org.tizen.ui.practices/html/images/wearable_s_w.png differ diff --git a/org.tizen.ui.practices/html/images/wearable_s_w_optional.png b/org.tizen.ui.practices/html/images/wearable_s_w_optional.png new file mode 100644 index 0000000..cef460c Binary files /dev/null and b/org.tizen.ui.practices/html/images/wearable_s_w_optional.png differ diff --git a/org.tizen.ui.guides/html/images/win_tree.png b/org.tizen.ui.practices/html/images/win_tree.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/win_tree.png rename to org.tizen.ui.practices/html/images/win_tree.png diff --git a/org.tizen.ui.practices/html/images/wn_division.png b/org.tizen.ui.practices/html/images/wn_division.png new file mode 100644 index 0000000..dca667f Binary files /dev/null and b/org.tizen.ui.practices/html/images/wn_division.png differ diff --git a/org.tizen.ui.guides/html/images/wn_icon.png b/org.tizen.ui.practices/html/images/wn_icon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/wn_icon.png rename to org.tizen.ui.practices/html/images/wn_icon.png diff --git a/org.tizen.ui.practices/html/images/ww_division.png b/org.tizen.ui.practices/html/images/ww_division.png new file mode 100644 index 0000000..5f5160c Binary files /dev/null and b/org.tizen.ui.practices/html/images/ww_division.png differ diff --git a/org.tizen.ui.guides/html/images/ww_icon.png b/org.tizen.ui.practices/html/images/ww_icon.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ww_icon.png rename to org.tizen.ui.practices/html/images/ww_icon.png diff --git a/org.tizen.ui.guides/html/images/ww_icon_optional.png b/org.tizen.ui.practices/html/images/ww_icon_optional.png old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/images/ww_icon_optional.png rename to org.tizen.ui.practices/html/images/ww_icon_optional.png diff --git a/org.tizen.ui.practices/html/index.htm b/org.tizen.ui.practices/html/index.htm new file mode 100644 index 0000000..06a8ff0 --- /dev/null +++ b/org.tizen.ui.practices/html/index.htm @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + UI Practices + + + + +
          +
          + +
          + +

          UI Practices

          + +

          Web Application

          + + +

          Native Application

          + + + + +
          + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/actors_n.htm b/org.tizen.ui.practices/html/native/dali/actors_n.htm new file mode 100644 index 0000000..16d8392 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/actors_n.htm @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + Actors: Working with Basic DALi Components + + + + + + +
          +

          Actors: Working with Basic DALi Components

          + +

          An actor is the basic component that composes the entire scene. It can have visible (for example UI components or image actor) or invisible (for example camera actor or layer) forms.

          +

          Actor is also the primary object with which DALi applications interact. Multiple types of event signals provided by actors can be handled in a application through user-defined callback functions.

          + +

          Actor Types

          + +

          Figure: Actor types

          +

          Actor types

          + +

          Actor has the following concrete types:

          + +
            +
          • 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 (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 (in mobile and wearable applications).
          • +
          + + +

          Actors and Stage

          + +

          Stage is a top-level object that represents the entire screen. It is used for displaying a hierarchy of actors managed by the scene graph structure, which means an actor inherits a position relative to its parent, and can be moved in relation to this point.

          + +

          The stage instance is a singleton object (the only instance of its class during the lifetime of the program). You can get it using a static function.

          + +

          To display the contents of an actor, it must be added to a stage. The following example shows how to connect a new actor to the stage:

          + +
          Actor actor = Actor::New();
          +Stage::GetCurrent().Add(actor);
          +
          + + +

          Positioning Actors

          +

          An actor inherits its parent's position. The relative position between the actor & parent is determined by the following properties:

          +
            +
          • Parent origin +

            This Vector3 property defines a point within the parent actor's area.

            + +

            Figure: Parent origin

            +

            Parent origin

            + +

            The default is top-left (Dali::ParentOrigin::TOP_LEFT), which can be visualized in 2D as (0, 0), but is actually Vector3 (0, 0, 0.5) in the 3D DALi world. The actor position is relative to this point.

            +

            For more information, see the Dali::Actor::SetParentOrigin() function.

            +
          • + +
          • Anchor point + +

            This Vector3 property defines a point within the child actor area.

            + +

            Figure: Anchor point

            +

            Anchor point

            + +

            The default is center (Dali::AnchorPoint::CENTER), which can be visualized in 2D as (0.5, 0.5), but is actually Vector3 (0.5, 0.5, 0.5) in the 3D DALi world. The actor position is also relative to this point.

            +

            For more information, see the Dali::Actor::SetAnchorPoint() function.

            +
          • + + +
          • Position +

            This is the position vector between the parent origin and anchor point.

            + +

            Figure: Position

            +

            Position

            + +

            Therefore by default, an actor's position indicates the vector to its center from the top-left corner of its parent.

            + +

            For example (with the default camera):

            +
              +
            • An actor added directly to the stage with position (X = stageWidth*0.5, Y = stageHeight*0.5) appears in the center of the screen.
            • +
            • An actor with the position (X = actorWidth*0.5, Y = actorWidth*0.5) appears at the top-left corner of the screen. +

              For more information, see the Dali::Actor::SetPosition() function.

              +
            • +
            +
          • +
          + +

          Event Handling for Actors

          +

          The Dali::Actor class provides following event signals:

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Event signals +
          Event signalDescription
          TouchedSignal()This signal is emitted when a touch input is received.
          HoveredSignal()This signal is emitted when a hover input is received.
          WheelEventSignal()This signal is emitted when a wheel event is received.
          OnStageSignal()This signal is emitted after the actor has been connected to the stage.
          OffStageSignal()This signal is emitted after the actor has been disconnected from the stage.
          OnRelayoutSignal()This signal is emitted after the size has been set on the actor during relayout.
          + +

          For example, a touch event can be handled as follows:

          +
          +bool OnTouch(Actor actor, const TouchEvent& touch)
          +{
          +   bool handled = false;
          +
          +   switch(touch.GetPointCount())
          +   {
          +      case 1: // Single touch
          +         if (touch.GetPoint(0).GetState == TouchPoint::Down)
          +         {
          +            // Do action when first touches the touch screen
          +            handled = true;
          +         }
          +
          +         break;
          +
          +      case 2: // Multi-touch event
          +
          +         break;
          +   }
          +
          +   return handled; // true if the operation was successful
          +}
          +
          +// Elsewhere
          +Actor actor = Actor::New();
          +actor.TouchedSignal().Connect(&OnTouch);
          + +

          For more information, see Event Handling.

          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/animation_n.htm b/org.tizen.ui.practices/html/native/dali/animation_n.htm new file mode 100644 index 0000000..cb4c4b7 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/animation_n.htm @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + Animation: Making Your Actors Alive + + + + + + +
          +

          Animation: Making Your Actors Alive

          + +

          You can use animation to allow your objects to move around and change their properties for a specified duration.

          + +

          DALi provides a rich and easy to use animation framework which allows you to create visually rich applications. The Dali::Animation class can be used to animate the animatable properties of any number of objects.

          + +

          DALi animations occur in a dedicated thread. This allows animations to run smoothly, regardless of the time taken to process the input, events, and other factors in the application code.

          + +

          The following figure illustrates the animation components.

          + +

          Figure: DALi animation components

          +

          DALi animation components

          + + +

          To implement a basic animation, create an animation object that takes place over 3 seconds:

          +
          +Dali::Animation animation = Animation::New(3.0f);
          +
          + +

          Animating Properties

          + +

          To animate the properties within DALi, you can use 2 distinct functions:

          +
            +
          • AnimateTo(): Property animates TO the value in the given time.
          • +
          • AnimateBy(): Property animates BY the value in the given time (which means that it animates to a value that is the sum of the starting position and the given value).
          • +
          + +

          In the following example, the actor1 and actor2 instances are at the position 10.0f, 10.0f, 0.0f at the start of the animation.

          +
          +// Animate the actor1 position TO 10.0f, 50.0f, 0.0f
          +animation.AnimateTo(Property(actor1, Dali::Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f)); 
          +// End Position: 10.0f, 50.0f, 0.0f
          +
          +// Animate the actor2 position BY 10.0f, 50.0f, 0.0f
          +animation.AnimateBy(Property(actor2, Dali::Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f)); 
          +// End Position: 20.0f, 60.0f, 0.0f
          +
          + +

          Controlling Playback

          + +

          After the animation is created, you can play it:

          + +
            +
          • To play the animation, use the Play() function: +
            +animation.Play();
            +
            +

            The Play() function is not a synchronous function. It returns after sending a message. After the message is processed in a separate thread, the animation starts. Blocking the application thread does not stop the animation from playing.

            +
          • +
          • To pause or stop the animation: +
            +animation.Pause();
            +animation.Stop();
            +
          • + +
          • To loop the animation to play multiple times: +
            +animation.SetLooping(true);
            +
          • +
          • By default, when the animation ends, the properties that it was animating are baked (saved). To discard the property changes when the animation ends or is stopped: +
            +animation.SetEndAction(Animation::Discard);
            +
          +

          Using Notifications

          + +

          Using DALi's signal framework, the application can be notified when the animation finishes. The Dali::Animation class supports "fire and forget" behavior, which means that the animation continues to play even if the handle is discarded. In the following example, the finished signal is emitted after 2 seconds:

          +
          +// Assuming this code is in the HelloWorldController class
          +void 
          +Create(Application& application)
          +{
          +   PushButton actor = PushButton::New();
          +   Stage::GetCurrent().Add(actor);
          +
          +   Animation animation = Animation::New(2.0f); // Duration 2 seconds
          +   animation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(100.0f, 100.0f, 0.0f));
          +   animation.FinishedSignal().Connect(this, &HelloWorldController::OnFinished);
          +   animation.Play(); // Fire the animation and forget about it
          +} // At this point the animation handle has gone out of scope
          +
          +void 
          +OnFinished(Animation& animation)
          +{
          +   // Do something when the animation is finished
          +}
          +
          + +

          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 (in mobile and wearable applications).

          +
          +animation.SetDefaultAlphaFunction(Dali::AlphaFunction::EASE_IN);
          +
          +

          You can also create your own alpha function:

          +
          +float 
          +MyAlphaFunction(float progress)
          +{
          +   return progress;
          +}
          +
          +AlphaFunction alphaFunction(&MyAlphaFunction);
          +animation.SetDefaultAlphaFunction(alphaFunction);
          +
          +

          You can specify a different alpha function for each animate call within the Animation object:

          +
          +animation.AnimateTo(Property(actor1, Dali::Actor::Property::POSITION), 
          +                    Vector3(10.0f, 50.0f, 0.0f), Dali::AlphaFunction::EASE_IN);
          +
          + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/animation_types_n.htm b/org.tizen.ui.practices/html/native/dali/animation_types_n.htm new file mode 100644 index 0000000..eb1c426 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/animation_types_n.htm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + Animation Types: Types of Animations Supported by DALi + + + + + + +
          +

          Animation Types: Types of Animations Supported by DALi

          + +

          DALi supports key frame animation, path animation, and shader effect animation.

          + +

          Key Frame Animation

          + + +

          DALi provides support for animating between several different values, or key frames. A key frame takes a progress value between 0.0f and 1.0f (0 and 100% respectively) and portrays the value of the property when the animation has progressed that much. You can create several key frames:

          +
          +Dali::KeyFrames keyFrames = Dali::KeyFrames::New();
          +keyFrames.Add(0.0f, Vector3(10.0f, 10.0f, 10.0f));
          +keyFrames.Add(0.7f, Vector3(200.0f, 200.0f, 200.0f));
          +keyFrames.Add(1.0f, Vector3(100.0f, 100.0f, 100.0f));
          +
          + +

          Next, you can add the key frames to your animation.

          +
          +animation.AnimateBetween(Property(actor1, Dali::Actor::Property::POSITION), keyFrames);
          +
          +

          When you play the animation, DALi animates the position of actor1 between the specified key frames. The actor1 animates from (10.0f, 10.0f, 10.0f) to (200.0f, 200.f, 200.0f) by 70% of the animation time, and then spends the remaining time animating back to (100.0f, 100.0f, 100.0f).

          +

          The advantage of specifying a key frame at 0% is that regardless of where the actor1 is, it starts from position (10.0f, 10.0f, 10.0f). If AnimateTo() is used, the start position is the actor1's current position.

          + +

          Path Animation

          +

          The Dali::Path class can be used to animate the position and orientation of actors.

          + +

          The black points in the following figure are points where the DALi logo travels to. The red points are the control points which express the curvature of the path on the black points.

          + +

          Figure: Path animation

          +

          Path animation

          + +

          The following code presents the black points:

          +
          +Path path = Path::New();
          +path.AddPoint(Vector3(50.0f, 10.0f, 0.0f));
          +path.AddPoint(Vector3(90.0f, 50.0f, 0.0f));
          +path.AddPoint(Vector3(10.0f, 90.0f, 0.0f));
          +
          +

          The control points can be added manually using Dali::Path::AddControlPoint. The Dali::Path class can also auto-generate the control points for you.

          +
          +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 (in mobile and wearable applications).

          +

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

          +
          +animation.Animate(actor1, path, Vector3::ZERO);
          +
          +

          The third parameter is the forward vector (in a local space coordinate system) that is oriented with the path's tangent direction.

          + + +

          Shader Effect Animation

          +

          Shader effects provide a visual effect for actors. In a shader, uniforms are set according to the purpose of applications. The uniforms of a shader can be animated using the Animation::AnimateTo() functions.

          +

          For example, to animate the center point of the Bendy shader effect:

          +
          +Dali::Animation animation = Dali::Animation::New(1.0f);
          +
          +Vector2 newPosition(0.0f, 0.0f);
          +animation.AnimateTo(Property(shaderEffect, shaderEffect.GetPositionPropertyName()), newPosition);
          +
          +

          To animate a uniform of a custom shader effect, you must use the name of the uniform:

          +
          +Dali::Animation animation = Dali::Animation::New(1.0f);
          +
          +// Set the initial value for the uniform
          +shaderEffect.SetUniform("myUniform", -0.5f);
          +
          +// Animate the uniform to a value
          +animation.AnimateTo(Property(shaderEffect, "myUniform"), 0.5f);
          +
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/background_n.htm b/org.tizen.ui.practices/html/native/dali/background_n.htm new file mode 100644 index 0000000..5c9e909 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/background_n.htm @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + Background Knowledge: Using DALi More Effectively + + + + + + +
          +

          Background Knowledge: Using DALi More Effectively

          + +

          The following useful background knowledge enables you to use DALi more effectively:

          + + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/buttons_n.htm b/org.tizen.ui.practices/html/native/dali/buttons_n.htm new file mode 100644 index 0000000..3ff9fde --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/buttons_n.htm @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + Buttons: Push, Check, Select! + + + + + + +
          +

          Buttons: Push, Check, Select!

          + +

          A button is a small object on the UI that you press in order to operate it. DALi provides button controls, such as PushButton, CheckBoxButton, and RadioButton. The base class for the button controls is Toolkit::Button. The Toolkit::Button class provides the disabled property and the clicked signal. The following table lists the basic signals provided by the Toolkit::Button class.

          + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Toolkit::Button input signals +
          Input signalDescription
          PressedSignal()Emitted when the button is pressed. +
          ReleasedSignal()Emitted when the button is released. +
          ClickedSignal()Emitted when the button is clicked. +
          StateChangedSignal()Emitted when the button state is changed. +
          + +

          Push Button

          + +

          The PushButton class provides a button that can be pressed to operate it. A push button changes its appearance when is pressed and returns to its original appearance when is released.

          + +

          Figure: Push button

          +

          Push button

          + +

          A push button emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when clicked, and a Button::ReleasedSignal() signal when released or the touch point leaves the boundary of the button. The following code shows an example of a basic push button:

          + +
          +class 
          +ButtonsController: public ConnectionTracker
          +{
          +   public:
          +      ButtonController(Application& application): mApplication(application)
          +      {
          +         mApplication.InitSignal().Connect(this, &ButtonController::Create);
          +      }
          +      void Create(Application& application)
          +      {
          +         PushButton button = PushButton::New();
          +         button.SetLabel("Select");
          +         button.SetParentOrigin(ParentOrigin::CENTER);
          +         button.ClickedSignal().Connect(this, &ButtonController::OnButtonClicked);
          +         Stage::GetCurrent().Add(button);
          +      }
          +      bool OnButtonClicked(Toolkit::Button button)
          +      {
          +         cout << "OnButtonClicked" << endl;
          +
          +         return true;
          +      }
          +   private:
          +      Application&  mApplication;
          +};
          +
          +int 
          +main(int argc, char **argv)
          +{
          +   Application application = Application::New(&argc, &argv);
          +   ButtonController test(application);
          +   application.MainLoop();
          +
          +   return 0;
          +}
          +
          + + +

          CheckBox Button

          + +

          The CheckBoxButton class provides a check box button, which can be checked or unchecked.

          + +

          Figure: Checkbox button

          +

          Checkbox button

          + +

          A checkbox button emits all 4 button input signals, but usually you can just use the Button::StateChangedSignal() signal to be notified when the button changes its state to selected or unselected. The following code shows an example of a basic checkbox button:

          + +
          +// Same as the push button example
          +
          +void 
          +Create(Application& application)
          +{
          +   CheckBoxButton button = CheckBoxButton::New();
          +   button.SetLabel("Select");
          +   button.SetSize(100, 40);
          +   button.SetBackgroundColor(Vector4(1, 0, 0, 1));
          +   button.SetParentOrigin(ParentOrigin::CENTER);
          +   button.StateChangedSignal().Connect(this, &ButtonController::OnButtonStateChanged);
          +   Stage::GetCurrent().Add(button);
          +}
          +
          +bool 
          +OnButtonStateChanged(Toolkit::Button button)
          +{
          +   cout << "OnButtonStateChanged " << button.IsSelected() << endl;
          +
          +   return true;
          +}
          +
          +// Same as the push button example
          +
          + +

          Radio Button

          + +

          The RadioButton class provides a radio button with 2 states: selected and unselected.

          + +

          Figure: Radio button

          +

          Radio button

          + +

          Usually, radio buttons are grouped. Two or more radio buttons are in the same group when they have the same parent. In each group, only 1 radio button can be selected at a given time. You can use the Button::StateChangedSignal() signal to check which radio button is selected. The following code shows an example of a basic radio button:

          + +
          +// Same as the push button example
          +
          +void 
          +Create(Application& application)
          +{
          +   Actor radioGroup = Actor::New();
          +   radioGroup.SetParentOrigin(ParentOrigin::CENTER);
          +   Stage::GetCurrent().Add(radioGroup);
          +
          +   RadioButton button1 = RadioButton::New();
          +   button1.SetLabel("button1");
          +   button1.SetBackgroundColor(Vector4(1, 0, 0, 1));
          +   button1.SetPosition(0, -40);
          +   radioGroup.Add(button1);
          +
          +   RadioButton button2 = RadioButton::New();
          +   button2.SetLabel("button2");
          +   button2.SetBackgroundColor(Vector4(0, 0, 1, 1));
          +   button2.SetPosition(0, 40);
          +   radioGroup.Add(button2);
          +
          +   button1.StateChangedSignal().Connect(this, &ButtonController::OnButtonStateChanged);
          +   button2.StateChangedSignal().Connect(this, &ButtonController::OnButtonStateChanged);
          +}
          +
          +bool 
          +OnButtonStateChanged(Toolkit::Button button)
          +{
          +   cout << "OnButtonStateChanged " << button.GetLabel() << " " << button.IsSelected() << endl;
          +
          +   return true;
          +}
          +
          +// Same as the push button example
          +
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/constraints_n.htm b/org.tizen.ui.practices/html/native/dali/constraints_n.htm new file mode 100644 index 0000000..d571f7a --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/constraints_n.htm @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + Constraints: Imposing Your Own Constraints on Actors + + + + + + +
          +

          Constraints: Imposing Your Own Constraints on Actors

          + +

          Constraints are used to modify the property of an actor, based on other properties of the same actor; properties of the actor's parent; or properties of another actor altogether, when the modification needs to be at run-time. Custom functions or functors can be supplied, where the desired value of the property can be calculated. These functions (or functors) are called in every frame, therefore they must be fast and not too complex, otherwise they can affect performance.

          +

          Multiple constraints can be applied to the same actor at the same time. The order in which constraints are applied is important as this is the order in which they are processed in the update thread.

          +

          Constraints are applied after animations have been applied. This means that Constraints override the values set by Animations. Constraints are not applied to off-stage actors.

          +

          Not all properties can be used as a constraint input. For more details, see the IsPropertyAConstraintInput() function in the Dali::Handle class (in mobile and wearable applications).

          + +

          Using a Constraint

          + +

          Constraints are designed as a way of modifying properties that cannot be modified by any existing built-in functionality, such as animations, size negotiation, parent anchor, or origin settings. As they provide the ability for the application developer to execute their own code within the update thread, DALi can no longer guarantee the timeliness of this code, or how optimized it can be.

          +

          Generally, you must not use constraints with the size property as constraining the size and size negotiation are mutually exclusive. Consider the following use cases as an example of when and when not to use a constraint:

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Examples of constraint use +
          RequirementSolution
          Need a child to be 50% the size of it's parent.Use size negotiation.
          Need to zoom an actor in to the screen using its scale property.Use an animation.
          Need an actor to appear centered around the bottom-right corner of its parent.Use ParentOrigin and AnchorPoint.
          Need to lay out a series of controls with various alignment requirements.Use either Anchor and origin settings, or a TableView.
          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.Use a constraint.
          Need to position an actor relative to its parent actor in a NON-UNIFORM way, or a non-linear calculation needs to be performed that requires a functor.Use a constraint.
          Need to modify an actor's property in real time based on some calculations that require additional data to be stored in-between frames.Use a constraint. The constraint functor can hold any variables within it that need to be preserved frame-to-frame.
          + +

          For most general cases, the position and size requirements of a child or parent actor (from its child or parent) can be calculated with size negotiation.

          + +

          Defining Constraint Sources

          +

          These properties are used as input sources to the constraint. The constraint takes these values, optionally performs a calculation on them (if using a custom functor), and writes the result to the specified property of the target actor. The source actor is specified as either the same actor, its parent, or another actor.

          +
            +
          • Local source +

            A local source is based on the local properties (such as size, position, scale, orientation, or color) of an actor. For example, the actor's orientation can be used as a constraint input source.

            +
            +Dali::ConstraintSource source(Dali::LocalSource(Dali::Actor::Property::ORIENTATION));
            +
            +
          • +
          • Parent Source +

            A parent source is based on properties of the actor's parent. For example, a parent's position can be used as a constraint input source.

            +
            +Dali::ConstraintSource source(Dali::ParentSource(Dali::Actor::Property::POSITION));
            +
            +
          • +
          • Other Handle Source +

            You can base your source on the properties of another handle altogether. For example, a sibling actor's color can be used as a constraint input source.

            +
            +Dali::ConstraintSource source(Dali::Source(anotherHandle, Dali::Actor::Property::COLOR));
            +
            +
          • +
          + +

          Defining the Constraint Function

          + +

          The signature of the constraint function is:

          + +
          +void Function(PropertyType &current, const Dali::PropertyInputContainer &inputs);
          +
          +

          In this function the current parameter is a reference to the target property type, such as float, Vector2, or Vector3. This is an in or out parameter. It represents the current value of the property and the expectation is that it is modified by the function to the desired value.

          +

          The inputs parameter holds all the constraint input sources. Each element is a pointer to the property input and can be accessed using the indexing operator [ ]. The order in which the sources are added is the order in which the property inputs are sorted in the container.

          +
          +constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::POSITION));
          +constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::SIZE));
          +constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::POSITION));
          +constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::SIZE));
          +
          +

          In the constraint function this equals to:

          +
          +const Dali::Vector3& position(inputs[0]->GetVector3());
          +const Dali::Vector3& size(inputs[1]->GetVector3());
          +const Dali::Vector3& parentPosition(inputs[2]->GetVector3());
          +const Dali::Vector3& parentSize(inputs[3]->GetVector3());
          +
          + + +

          Creating a Constraint

          +

          Using C Functions

          +

          If you do not have any data that is changed at runtime, C functions must be used. For example, the color of an actor can be changed based on its position along the x axis to a preset distance of 100, beyond which it is transparent.

          +
          +Dali::Actor actor = Actor::New();
          +
          +// Create a constraint that targets actor
          +Dali::Constraint constraint = Dali::Constraint::New< Vector4 >(actor, Dali::Actor::Property::COLOR, MyConstraintFunction); 
          +
          +// Add the POSITION property as a constraint input
          +constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::POSITION)); 
          +
          +// Apply the constraint
          +constraint.Apply(); 
          +
          + +

          The following example shows the actual C function:

          +
          +void MyConstraintFunction(Dali::Vector4& current, const Dali::PropertyInputContainer& inputs)
          +{
          +   const Dali::Vector3& position(inputs[0]->GetVector3());
          +
          +   float distance = fabs(position.x);
          +
          +   // More than 100.0f away, opacity is 0.0f
          +   if (distance > 100.0f)
          +   {
          +      current.a = 0.0f;
          +   }
          +   else
          +   {
          +      // Otherwise it blends between fully opaque and transparent
          +      current.a = (100.0f - distance) / 100.0f;
          +   }
          +}
          +
          + +

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

          + +

          Using Functors

          + +

          If you need to store some data in a struct or class, a functor can be used. Reusing the last example, the color of an actor is changed based on its position along the x axis, but the distance when it is transparent is different for each applied constraint.

          +
          +Dali::Actor actor = Actor::New();
          +
          +// Create a constraint that targets actor, and uses MyFunctor with a distance of 200
          +Dali::Constraint constraint = Dali::Constraint::New< Vector4 >(actor, Dali::Actor::Property::COLOR, MyFunctor(200)); 
          +
          +// Add the POSITION property as a constraint input
          +constraint.AddSource(Dali::LocalSource(Dali::Actor::Property::POSITION)); 
          +
          +// Apply the constraint
          +constraint.Apply(); 
          +
          +

          The following example shows the structure:

          +
          +struct MyFunctor
          +{
          +   // Constructor which takes the distance at which the actor is fully transparent
          +   MyFunctor(float distance)
          +   : mDistance(distance)
          +   {
          +   }
          +
          +   // Functor
          +   void operator()(Dali::Vector4 &current, const Dali::PropertyInputContainer &inputs)
          +   {
          +      const Dali::Vector3& position(inputs[0]->GetVector3());
          +
          +      float distance = fabs(position.x);
          +
          +      // More than mDistance away, opacity is 0.0f
          +      if (distance > mDistance)
          +      {
          +         current.a = 0.0f;
          +      }
          +      else
          +      {
          +         // Otherwise it blends between fully opaque and transparent
          +         current.a = (100.0f - mDistance) / 100.0f;
          +      }
          +   }
          +
          +   // Data
          +   const float mDistance;
          +};
          +
          +

          MyFunctor() can be used also with another constraint with a different distance.

          +

          Instead of using the default functor, another function can be declared in the class or struct and be used as the constraint function.

          +

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

          + + +

          Removing Constraints

          + +

          The actor's constraints can later be removed in several ways:

          +
          +mConstraint.Remove(); // mConstraint is a base-handle to a constraint
          +actor.RemoveConstraints(); // Removes ALL constraints applied to an actor
          +actor.RemoveConstraint(tag); // All constraints with the tag are removed from the actor (tag can be set using SetTag)
          +
          + + +

          Setting an Equal To Constraint

          + +

          The built-in Dali::EqualToConstraint function can be used if only setting a property equal to another property is required:

          +
          +Dali::Constraint constraint = Dali::Constraint::New< Vector3 >(actor, Dali::Actor::Property::POSITION, Dali::EqualToConstraint());
          +constraint.AddSource(Dali::Source(anotherActor, Dali::Actor::Property::POSITION));
          +constraint.Apply();
          +
          +

          Here actor's position is set to equal the position of anotherActor.

          + + +

          Setting a Relative To Constraint

          + +

          The built in Dali::RelativeToConstraint and Dali::RelativeToConstraintFloat functions can be used if only setting a property relative to another property is required:

          + +
          +Dali::Constraint constraint = Dali::Constraint::New< Vector3 >(actor, Dali::Actor::Property::POSITION, Dali::RelativeToConstraint(2.0f));
          +constraint.AddSource(Dali::Source(anotherActor, Dali::Actor::Property::POSITION));
          +constraint.Apply();
          +
          +

          Here the actor's position is relative to the position of anotherActor. If anotherActor is at (10.0f, 20.0f, 30.0f), actor is at (20.0f, 40.0f, 60.0f).

          + + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/control_base_n.htm b/org.tizen.ui.practices/html/native/dali/control_base_n.htm new file mode 100644 index 0000000..e686ca6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/control_base_n.htm @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + Control: Base Class of UI Components + + + + + + +
          +

          Control: Base Class of UI Components

          + +

          The Dali::Toolkit::Control class is the base class for all UI components in DALi. With this class, you can, for example, manage the background color and images for UI components.

          + + +

          Setting the Background Color

          + +

          You can set a background color for a UI component. To set a red background for a component:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +control.SetSize(200.0f, 200.0f);
          +control.SetBackgroundColor(Dali::Color::RED);
          +
          + +

          Figure: Control object with a red background

          +

          Control object with a red background

          + +

          You can handle all existing controls similarly. For example, to set the background color for a TextLabel:

          + +
          +Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New("Hello World");
          +label.SetBackgroundColor(Dali::Color::RED);
          +
          + +

          Figure: TextLabel object with a red background

          +

          TextLabel object with a red background

          + + +

          Setting the Background Image

          + +

          You can set a background image of a control:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Image image = Dali::Image::New("image.png");
          +control.SetBackgroundImage(image);
          +
          + +

          Figure: Control object with a background image

          +

          Control object with a background image

          + +

          The background image is blended with the background color. The following example shows what happens if a red background color is set on the control with a background image:

          + +
          +control.SetBackgroundColor(Dali::Color::RED);
          +
          + +

          Figure: Control object with a background image blended with a background color

          +

          Control object with a background image blended with a background color

          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/dali_applications_n.htm b/org.tizen.ui.practices/html/native/dali/dali_applications_n.htm new file mode 100644 index 0000000..e9ada1f --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/dali_applications_n.htm @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + Application: Framework for DALi Application + + + + + + +
          +

          Application: Framework for DALi Application

          + +

          The Adaptor framework provides the Dali::Application class, which initializes and sets up DALi appropriately. The class provides many platform-related services.

          + +

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

          + +

          The following example shows how to create a Dali::Application instance and connect to its initialize signal, where the Dali::Actor hierarchy is created:

          + +
          void CreateProgram(Application& app)
          +{
          +   // Create DALi components...
          +   Dali::Actor actor = Actor::New();
          +   ...
          +}
          +int main (int argc, char **argv)
          +{
          +   Dali::Application app = Application::New(&argc, &argv);
          +   app.InitSignal().Connect(&CreateProgram);
          +   app.MainLoop();
          +}
          + +

          Window

          + +

          DALi provides the Window class to manage drawing to a default surface. The class is also responsible for drawing the Indicator bar if required. The Application class automatically creates a Window which the you can access after the SignalInit() function has fired.

          + +
          void CreateProgram(Application& app)
          +{
          +   app.GetWindow().ShowIndicator(Dali::Window::VISIBLE);
          +}
          +int main (int argc, char **argv)
          +{
          +   Dali::Application app = Application::New(argc, argv);
          +   app.SignalInit().Connect(&CreateProgram);
          +   app.MainLoop();
          +}
          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/dali_overview_n.htm b/org.tizen.ui.practices/html/native/dali/dali_overview_n.htm new file mode 100644 index 0000000..8d11197 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/dali_overview_n.htm @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + DALi Overview: Getting Started with DALi UI Programming + + + + + + +
          +

          DALi Overview: Getting Started with DALi UI Programming

          + +

          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.

          + +

          DALi Fundamentals

          + +

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

          + +

          Actor and Stage

          + +

          Actor is the primary object for interaction in DALi applications. Actors are effective nodes that receive input (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

          + +

          Signals and slots are used in the QT GUI library for communication between objects. Objects can send signals containing event information, which can be received by other objects using special functions known as slots. The DALi event system follows the signal and slot mechanism.

          + +

          Signal events are emitted when a certain action or event occurs. The application can connect using 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 Internal Structure

          + +

          DALi consists of the following modules:

          + +
            +
          • dali-core +

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

            +
          • +
          • dali-toolkit +

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

          • +
          • dali-adaptor +

            dali-adaptor is a platform adaptation layer. It initializes and sets up DALi appropriately. The module 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.

          • +
          +

          Figure: DALi internal structure

          +

          DALi internal structure

          + +

          Creating a DALi Application

          + +

          To create a 'Hello World' application with Dali:

          +
            +
          1. Create a DALi project: +
              +
            1. In the Tizen IDE menu, go to File > New > Tizen Native Project. +

              Press 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

              +
            2. +
            3. The new project is shown in the Project Explorer view of the IDE. If you open the src/basicdaliapplication.cpp file, you can see the source code of the basic DALi application: +
              +#include <dali-toolkit/dali-toolkit.h>
              +
              +using namespace Dali;
              +using Dali::Toolkit::TextLabel;
              +
              +// This example shows how to create and display Hello World using a simple TextLabel
              +
              +class HelloWorldController : public ConnectionTracker
              +{
              +   public:
              +
              +   HelloWorldController(Application& application)
              +   : mApplication(application)
              +   {
              +      // Connect to the application's Init signal
              +      mApplication.InitSignal().Connect(this, &HelloWorldController::Create);
              +   }
              +
              +      ~HelloWorldController()
              +   {
              +      // Nothing to do here
              +   }
              +
              +   // The 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.SetAnchorPoint(AnchorPoint::TOP_LEFT);
              +      textLabel.SetName("hello-world-label");
              +      stage.Add(textLabel);
              +
              +      // Respond to a click anywhere on the stage
              +      stage.GetRootLayer().TouchedSignal().Connect(this, &HelloWorldController::OnTouch);
              +   }
              +
              +   bool OnTouch Actor actor, const TouchEvent& touch)
              +   {
              +      // Exit the application
              +      mApplication.Quit();
              +      return true;
              +   }
              +
              +   private:
              +   Application& mApplication;
              +};
              +
              +// Entry point for Tizen applications
              +int main(int argc, char **argv)
              +{
              +   Application application = Application::New(&argc, &argv);
              +   HelloWorldController test(application);
              +   application.MainLoop();
              +   return 0;
              +}
              +
              +
            4. +
            +
          2. +
          3. Initialize the DALi application: + +

            To use the DALi APIs, include the dali-toolkit.h header file. It includes the dali-core and dali-adaptor modules.

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

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

            + +

            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 HelloWorldController class is used in other code samples in the DALi guide.

            + +

            Create a Dali::Application instance:

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

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

            + +
            +mApplication.InitSignal().Connect(this, &HelloWorldController::Create);
            + +

            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();
            +
          4. + +
          5. Create an actor and add it to a stage: + +

            The 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:

            + +
            +Stage stage = Stage::GetCurrent();
            +stage.SetBackgroundColor(Color::WHITE);
            +
            +TextLabel textLabel = TextLabel::New("Hello World");
            +textLabel.SetAnchorPoint(AnchorPoint::TOP_LEFT);
            +textLabel.SetName("hello-world-label");
            +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. Build the DALi application: + +

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

            +

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

            + +
          8. +
          9. Run the DALi application: + +

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

            +

            For more information, see Running Applications.

            +

            DALi application running on a Tizen emulator

            + +
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/event_handling_n.htm b/org.tizen.ui.practices/html/native/dali/event_handling_n.htm new file mode 100644 index 0000000..23350cc --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/event_handling_n.htm @@ -0,0 +1,575 @@ + + + + + + + + + + + + + + Event Handling: Managing the Event Flow + + + + + + +
          + +

          Event Handling: Managing the Event Flow

          + +

          DALi event handling system is composed of 2 major concepts:

          + +
            +
          • Signal +

            Notifications containing event information emitted by GUI components. Also known as events or notifications.

          • +
          • Slot +

            Special functions receiving signals. Also known as event handlers, observer, listener, or callbacks.

          • +
          +

          DALi emits various types of signals to an application to inform it of user actions and the application can handle them through slots.

          + +

          The concept of signal and slots were introduced by Qt for communication between objects. The event mechanism of DALi is inspired by Qt.

          + +

          Figure: A schematic example of signal-slot connections

          + + +

          Signal and slot event handling

          +

          In the figure, signal 1 is connected to slot 1, signal 2 is connected to slot 1 and slot 3, and signal 3 is connected to slot 2.

          + +

          The signal and slot system has following advantages:

          +
            +
          • Object-oriented: supports callbacks for C++ member functions
          • +
          • Type safe: the compiler is able to check for type safety
          • +
          • Non-coupling: no dependency between caller and callee
          • +
          • Non-type-intrusive: no modification to caller or callee types
          • +
          • Generic: works for all types of call-backs
          • +
          • 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:

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

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

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

          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. The meaning is valid only for the TouchedSignal() function, and other types of signals may not have a return value.

          + +

          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.

          + +

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

          + +
          +// Assuming this code is in the HelloWorldController class
          +void 
          +Create(Application& application)
          +{
          +   Control actor = Control::New(); 
          +   // Control is one of the simplest types of Actor that has a visible form
          +   actor.SetParentOrigin(ParentOrigin::CENTER);
          +   actor.SetSize(100.0f, 100.0f);
          +   actor.SetBackgroundColor(Vector4(1.0f, 1.0f, 1.0f, 1.0f));
          +   actor.TouchedSignal().Connect(this, &HelloWorldController::OnTouch);
          +   Stage::GetCurrent().Add(actor);
          +}
          +
          +bool 
          +OnTouch(Actor actor, const TouchEvent&touch)
          +{
          +   bool handled = false;
          +   unsigned int pointCount = touch.GetPointCount();
          +   if (pointCount == 1)
          +   {
          +      // Do the action on the first touch on the screen
          +      handled = true;
          +   }
          +   else if (pointCount > 1)
          +   {
          +      // Do action on a multi-touch on the screen
          +      handled = true;
          +   }
          +
          +   return handled; 
          +   // true if you have handled the touch, false otherwise
          +}
          +
          + +

          The touch event is first emitted to the hit actor by the primary touch point, which is the first point that the user touches. If this hit actor does not handle the event, then the event is offered to the hit actor's parent. Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.

          + +

          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.

          + +

          Key Events

          + +

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

          + +
          +// Assuming this code is in the HelloWorldController class
          +void 
          +Create(Application& application)
          +{
          +   Stage::GetCurrent().SetBackgroundColor(Vector4(1.0f, 1.0f, 1.0f, 1.0f));
          +   Stage::GetCurrent().KeyEventSignal().Connect(this, &HelloWorldController::OnKeyEvent);
          +
          +   PushButton button = PushButton::New();
          +   Stage::GetCurrent().Add(button);
          +}
          +
          +void 
          +OnKeyEvent(const KeyEvent& event)
          +{
          +   if (event.state == KeyEvent::Down)
          +   {
          +      if (IsKey(event, DALI_KEY_ESCAPE) || IsKey(event, DALI_KEY_BACK))
          +      {
          +         mApplication.Quit();
          +      }
          +   }
          +}
          +
          + +

          The stage is the top-most root object, so it can receive application-wide key events.

          + +

          DALi provides its own key codes for several special keys, such as DALI_KEY_ESCAPE or DALI_KEY_BACK. The following table lists the available DALi key codes.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: DALi key codes +
          Key codes
          DALI_KEY_INVALID
          DALI_KEY_ESCAPE
          DALI_KEY_BACKSPACE
          DALI_KEY_CURSOR_UP
          DALI_KEY_CURSOR_LEFT
          DALI_KEY_CURSOR_RIGHT
          DALI_KEY_CURSOR_DOWN
          DALI_KEY_BACK
          DALI_KEY_CAMERA
          DALI_KEY_CONFIG
          DALI_KEY_POWER
          DALI_KEY_PAUSE
          DALI_KEY_CANCEL
          DALI_KEY_PLAY_CD
          DALI_KEY_STOP_CD
          DALI_KEY_PAUSE_CD
          DALI_KEY_NEXT_SONG
          DALI_KEY_PREVIOUS_SONG
          DALI_KEY_REWIND
          DALI_KEY_FASTFORWARD
          DALI_KEY_MEDIA
          DALI_KEY_PLAY_PAUSE
          DALI_KEY_MUTE
          DALI_KEY_MENU
          DALI_KEY_HOME
          DALI_KEY_HOMEPAGE
          DALI_KEY_WEBPAGE
          DALI_KEY_MAIL
          DALI_KEY_SCREENSAVER
          DALI_KEY_BRIGHTNESS_UP
          DALI_KEY_BRIGHTNESS_DOWN
          DALI_KEY_SOFT_KBD
          DALI_KEY_QUICK_PANEL
          DALI_KEY_TASK_SWITCH
          DALI_KEY_APPS
          DALI_KEY_SEARCH
          DALI_KEY_VOICE
          DALI_KEY_LANGUAGE
          DALI_KEY_VOLUME_UP
          DALI_KEY_VOLUME_DOWN
          + + +

          Input Signals

          + +

          Many DALi classes provide various signals to notify events to the application. Among them, the most basic type of signals are input signals. This section briefly introduces these input signals in DALi.

          + +

          The basic DALi input signals are as follows:

          + +
            +
          • Touched signal notifies you of a screen touch or mouse click
          • +
          • Hovered signal notifies you of mouse hovering
          • +
          • Wheel event signal notifies you of mouse wheel rolling
          • +
          • Key event signal notifies you of a keyboard input
          • +
          • Key input focus signals notifies you that a control is ready to receive key event signals
          • +
          • Keyboard focus signals notifies you of a moved focus by navigation keys (such as left or right)
          • +
          +

          These signals are provided by the following classes:

          + +
            +
          • Dali::Actor + + + + + + + + + + + + + + + + + + + + + +
            + Table: Dali::Actor input signals +
            Input signalsDescription
            TouchedSignal()Emitted when touch input is received. +

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

            HoveredSignal()Emitted when hover input is received. +

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

            WheelEventSignal()Emitted when wheel event is received. +

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

            + +

            The actor receiving events is passed to the callbacks.

            +
          • + +
          • +Dali::Stage + + + + + + + + + + + + + + + + + + + + + +
            + Table: Dali::Stage input signals +
            Input signalsDescription
            TouchedSignal()Emitted when touch input is received. +

            Callback: void YourCallbackName(const TouchEvent& event)

            HoveredSignal()Emitted when hover input is received. +

            Callback: void YourCallbackName(const TouchEvent& event);

            KeyEventSignal()Emitted when a key event is received. +

            Callback: void YourCallbackName(const KeyEvent& event);

            + +

            Only events are passed to the callbacks since only a single stage instance can exist in DALi application. The callback return types are void because the stage has no parent to pass events to, even though it does not consume the events.

            +
          • + +
          • +Dali::Toolkit::Control + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + Table: Dali::Toolkit::Control input signals +
            Input signalsDescription
            KeyEventSignal()Emitted when a key event is received. +

            Callback: bool YourCallbackName(Control control, const KeyEvent& event);

            KeyInputFocusGainedSignal()Emitted when the control gets key input focus. +

            Callback: bool YourCallbackName(Control control);

            KeyInputFocusLostSignal()Emitted when the control loses key input focus, which can be due to it being gained by another control or actor or just cleared from this control as no longer required. +

            Callback: bool YourCallbackName(Control control);

            TouchedSignal(), HoveredSignal(), KeyEventSignal()Same as the ones supported by Actor +
            + +

            The key event signal is provided by the Dali::Stage and Dali::Toolkit::Control classes, not by the Dali::Actor class. The Dali::Actor class is not designed to get key events. To receive key events, an actor must be an instance of the Dali::Toolkit::Control class or one of its subclasses.

            +

            The Dali::Toolkit::Control class can also receive touch, hover, and wheel events as it inherits from the Dali::Actor class.

            +
          • + +
          • +Dali::Toolkit::KeyboardFocusManager + + + + + + + + + + + + + + + + + + + + + + + + + +
            + Table: Dali::Toolkit::KeyboardFocusManager input signals +
            Input signalsDescription
            PreFocusChangeSignal()Emitted before the focus is going to be changed. +

            Callback: Actor YourCallbackName(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocus::Direction direction);

            FocusChangedSignal()Emitted after the current focused actor has been changed. +

            Callback: void YourCallbackName(Actor originalFocusedActor, Actor currentFocusedActor);

            FocusGroupChangedSignal()Emitted when the focus group has been changed. +

            Callback: void YourCallbackName(Actor currentFocusedActor, bool forward);

            FocusedActorEnterKeySignal()Emitted when the current focused actor has the enter key pressed on it. +

            Callback: void YourCallbackName(Actor enterPressedActor);

            +
          • +
          + +

          Dali::Toolkit::KeyboardFocusManager provides the functionality of handling keyboard navigation and maintaining the 2-dimensional keyboard focus chain. Dissimilar to the key input focus, the keyboard focus is about the focus moving between actors, and that is why this signal is provided by the specific focus managing class.

          + +

          The following DALi classes provide signals:

          +
            +
          • Dali::Window
          • +
          • Dali::Application
          • +
          • Dali::Timer
          • +
          • Dali::Actor
          • +
          • Dali::Image
          • +
          • Dali::ResourceImage
          • +
          • Dali::LongPressGestureDetector
          • +
          • Dali::TapGestureDetector
          • +
          • Dali::PanGestureDetector
          • +
          • Dali::PinchGestureDetector
          • +
          • Dali::RenderTask
          • +
          • Dali::Stage
          • +
          • Dali::ObjectRegistry
          • +
          • Dali::PropertyNotification
          • +
          • Dali::Animation
          • +
          • Dali::Toolkit::Button
          • +
          • Dali::Toolkit::Control
          • +
          • Dali::Toolkit::TextField
          • +
          • Dali::Toolkit::View
          • +
          • Dali::Toolkit::GaussianBlurViewSignal
          • +
          • Dali::ScrollBar
          • +
          • Dali::Toolkit::Scrollable
          • +
          • Dali::Toolkit::ScrollView
          • +
          • Dali::Toolkit::AccessibilityFocusManager
          • +
          • Dali::Toolkit::KeyboardFocusManager
          • +
          +

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

          + +

          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.

          +

          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.

          + +

          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 two fingers towards or away from each other.
          • +
          • Dali::PanGestureDetector detects when the user moves one or more fingers in the same direction.
          • +
          + +

          The example below shows how an application can be notified of a pinch gesture:

          + +
          +// Assuming this code is in the HelloWorldController class
          +void 
          +Create(Application& application)
          +{
          +   PushButton actor = PushButton::New(); // Another type of Actor
          +   actor.SetParentOrigin(ParentOrigin::CENTER);
          +   actor.SetSize(100.0f, 100.0f);
          +   Stage::GetCurrent().Add(actor);
          +
          +   PinchGestureDetector detector = PinchGestureDetector::New();
          +   detector.Attach(actor);
          +   detector.DetectedSignal().Connect(this, &HelloWorldController::OnPinch);
          +}
          +
          +void 
          +OnPinch(Actor actor, const PinchGesture& pinch)
          +{
          +   // Scale your actor according to the pinch scale
          +   Vector3 newSize = actor.GetCurrentSize() * pinch.scale;
          +   actor.SetSize(newSize);
          +}
          +
          + +

          Automatic Connection Management

          + +

          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.

          + +

          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.

          + + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/guides_dali_n.htm b/org.tizen.ui.practices/html/native/dali/guides_dali_n.htm new file mode 100644 index 0000000..9d6b6ab --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/guides_dali_n.htm @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + DALi + + + + + + +
          +

          DALi

          + +

          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.

          + +

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

          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/handle_n.htm b/org.tizen.ui.practices/html/native/dali/handle_n.htm new file mode 100644 index 0000000..39180aa --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/handle_n.htm @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + Handle/Body Pattern: Basic Way of Using DALi Objects + + + + + + +
          +

          Handle/Body Pattern: Basic Way of Using DALi Objects

          + +

          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 (in mobile and wearable) 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:

          +
            +
          • Easier memory management +

            Each internal implementation class (body class) contains a single reference count object, which can be initialized with the static "New" functions in the DALi public API. This means that C++ new/delete operators do not have to be used in your code. (The internal body classes inherit from the Dali::BaseObject class, but you do not need to use this class directly.)

            +
          • +
          • Better encapsulation +

            The danger of API/ABI breaks is reduced, since the implementation of a class can be changed without modifying the public API, thus without recompiling code using the public API. This can also reduce the build time.

            +
          • +
          + +

          The following examples show how to use the handles:

          +
            + +
          • No need to call destructors: +
            +class 
            +HandleTest
            +{
            +   HandleTest()
            +   {
            +      mActor = Actor::New();
            +   }
            +
            +   ~HandleTest() {} // Actor object is destroyed automatically
            +
            +   Actor mActor;
            +};
            +
            +
          • + +
          • Can be stored in STL containers: +
            +class 
            +HandleTest
            +{
            +   HandleTest()
            +   {
            +      mActors.push_back(Actor::New());
            +      mActors.push_back(Actor::New());
            +   }
            +
            +   ~HandleTest() {} // Actors are destroyed automatically
            +
            +   std::vector<Actor> mActors;
            +};
            +
            +
          • + +
          • Passing by value is encouraged: +
            +void 
            +SomeFunction(Actor actor)
            +{
            +   if (actor)
            +   {
            +      actor.SomeMethod();
            +   }
            +}
            +
            +
          • + +
          • Validity check: +
            +{
            +   Actor actor;  // Create a NULL object
            +
            +   // At this stage, you cannot call any of the Actor functions
            +   if (!actor)  // This test passes, since the actor is NULL
            +   {
            +      actor = Actor::New();
            +   }
            +}
            +
            +
          • + +
          • Equality operators: +
            +{
            +   Actor handle1;
            +   Actor handle2;
            +   cout << handle1 == handle2 << endl; // "true", both handles are empty
            +
            +   handle2 = Actor::New();
            +   cout << handle1 == handle2 << endl; // "false", one handle is empty
            +
            +   handle1 = Actor::New();
            +   cout << handle1 == handle2 << endl; // "false", handles to different objects
            +
            +   handle1 = handle2;
            +   cout << handle1 == handle2 << endl; // "true", handles to same object
            +}
            +
            +
          • + +
          • Reference counting examples: +
            +class 
            +AnimationTest
            +{
            +   private:
            +      Animation mAnimation; // Animation handle
            +};
            +
            +void 
            +AnimationTest::Initialize ()
            +{
            +   mAnimation = Animation::New(10.0f); // Reference count is 1, the animation object stays alive when the function returns
            +}
            +
            +void 
            +AnimationTest::SetAnimation(Animation anim)
            +{
            +   mAnimation = anim; // Reference count of the original animation decreased, 'anim' is referenced instead
            +                     // If nobody else had a reference on the initial animation, the object is destroyed
            +}
            +
            + +
            +// At this point, you own a Dali::Actor named "container"
            +// Enter a code block
            +{
            +   // Create an text label
            +   TextLabel actor = TextLabel::New("test");
            +   // Add the text label to a container
            +   container.Add(actor);
            +}
            +// Exit the code block
            +// At this stage, the text label is still alive
            +// You do not keep the handle to the text label, but it can be retrieved from the container
            +
            +
          • +
          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/imageview_n.htm b/org.tizen.ui.practices/html/native/dali/imageview_n.htm new file mode 100644 index 0000000..371f4ca --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/imageview_n.htm @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + ImageView: Displaying Images + + + + + + +
          +

          ImageView: Displaying Images

          + +

          The ImageView component displays an image.

          + + +

          The image view is constructed by passing a Dali::Image object. The Dali::Image is an abstract base class with multiple derived classes, and the Dali::ResourceImage class is used for loading an image from a file or URL. The following example shows how to create an ImageView object:

          + +
          +Image image = ResourceImage::New(myImageFilename);
          +ImageView imageView = ImageView::New(image);
          +
          + + +

          The image view needs a reference to a Dali::Image object on creation. However, the image object can be later changed by calling the ImageView::SetImage() function:

          + +
          +imageView.SetImage(newImage);
          +
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/itemview_n.htm b/org.tizen.ui.practices/html/native/dali/itemview_n.htm new file mode 100644 index 0000000..0173731 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/itemview_n.htm @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + ItemView: Item Container with Layouts + + + + + + +
          +

          ItemView: Item Container with Layouts

          + +

          The ItemView class is a scrollable container that can contain many items. It provides several scrollable layouts, as illustrated in the following figure.

          + + +

          Figure: ItemView layouts

          + + + + + + + + + + + + + + +
          GridSpiralDepth
          captured screen2captured screen2captured screen2
          +

          You can also create your own custom layout by inheriting from the Dali::Toolkit::ItemLayout class.

          + +

          Implementing ItemFactory

          + +

          To create an ItemView instance, you must create your own ItemFactory class by deriving from the Dali::Toolkit::ItemFactory class and providing its instance to the ItemView::New() function. ItemFactory is an abstract class having 2 pure virtual member functions to create items and get the number of created items. The following basic example shows how to implement an ItemFactory class:

          + +
          +class MyFactory : public Dali::Toolkit::ItemFactory
          +{
          +public:  
          +   virtual unsigned int GetNumberOfItems()
          +   {
          +      // Return the number of items
          +
          +      return MY_ITEM_COUNT;
          +   } 
          + 
          +   virtual Actor NewItem(unsigned int itemId) 
          +   { 
          +      // Create the actor representing the item based on the itemId
          +      std::ostringstream imageName; 
          +      imageName << "my-image-folder/" << itemId << ".png";
          +
          +      // If item is 10, this results in my-image-folder/10.png
          +      Dali::ResourceImage image = Dali::ResourceImage::New(imageName.str());
          +
          +      // Create an ImageActor from the image
          +      return Dali::ImageActor::New(image);
          +   }
          +};
          + +

          The overridden functions in the derived class are called by the ItemView object.

          + +

          Creating an ItemView

          + +

          The following basic example shows how to create an ItemView:

          + +
          // Store this as a member variable
          +MyFactory factory; 
          +
          +// Pass in the factory
          +Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::New(factory); 
          +
          +itemView.SetParentOrigin(ParentOrigin::CENTER);
          +itemView.SetAnchorPoint(AnchorPoint::CENTER);
          +
          +// Create a layout
          +Dali::Toolkit::ItemLayoutPtr spiralLayout = Dali::Toolkit::DefaultItemLayout::New(Dali::Toolkit::DefaultItemLayout::SPIRAL);
          +
          +// Add the layout to the ItemView
          +itemView.AddLayout(spiralLayout);
          +
          +// More layouts can be created and added to the ItemView
          +// Activate the layout
          +itemView.ActivateLayout(0, Dali::Stage::GetCurrent().GetSize(), 0);
          +
          +Dali::Stage::GetCurrent().Add(itemView);
          + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/layout_n.htm b/org.tizen.ui.practices/html/native/dali/layout_n.htm new file mode 100644 index 0000000..b2ee1d6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/layout_n.htm @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + Layout Management + + + + + + +
          +

          Layout Management

          + +

          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 (in mobile and wearable applications) specifies the available dimensions as bit fields:

          +
            +
          • Dimension::WIDTH
          • +
          • Dimension::HEIGHT
          • +
          +

          If a function can process width and height at the same time, the Dimension::ALL_DIMENSIONS mask can be specified.

          + +

          Resize Policies

          + +

          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.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Resizing rules +
          Resize policyDescriptionIllustration
          ResizePolicy::FIXEDUse this option to maintain a specific size as set by the SetSize() function. This is the default for all actors.captured screen2
          ResizePolicy::USE_NATURAL_SIZEUse this option for objects, such as images or text, to get their natural size. This can mean the dimensions of an image or the size of text with no wrapping. You can also use this option with table views when the size of the table depends on its children.captured screen2
          ResizePolicy::FILL_TO_PARENTThe size of the actor is similar to its parent's size with proportionate filling considered.captured screen2
          ResizePolicy::SIZE_RELATIVE_TO_PARENTThe size of the actor is similar to its parent's size with a relative scale. Use the SetSizeModeFactor() function to specify the ratio.
          ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENTThe size of the actor is similar to its parent's size with a fixed offset using the SetSizeModeFactor() function.
          ResizePolicy::FIT_TO_CHILDRENThe size of the actor is scaled around the size of its children. For example, the height of a pop-up can be resized according to its content.captured screen2
          ResizePolicy::DIMENSION_DEPENDENCYThis option covers rules, such as width-for-height and height-for-width. You can specify that one dimension depends on another.captured screen2
          + + +

          Actor Layout Examples

          + +

          This section describes layout examples with a actor.

          + +

          Enabling Size Negotiation

          + +

          Text and image actors have relayout enabled by default, while plain actors are disabled unless the SetResizePolicy() function is called.

          + +

          Specifying Size Policies

          + +

          Actors have different size policies by default. For example, the image actor is set to USE_NATURAL_SIZE. This ensures that an image actor uses its natural size by default when it is placed on the stage. However, if the SetSize() function is used with sizes other than 0 on the image actor, the current resize policy is overridden by the FIXED policy and the actor takes the specified size.

          + +

          You can specify how an actor is size-negotiated using the SetResizePolicy() function. You can specify different policies for the different dimensions of width and height to archive different layouts.

          + +

          The following example shows the rootActor with its width set to ResizePolicy::FILL_TO_PARENT and its height set to ResizePolicy::FIT_TO_CHILDREN. It has an image actor added to it with an explicit call to USE_NATURAL_SIZE in both dimensions. This creates an actor that fills the space of its parent in the width dimension and fits its child in the height dimension. As the image actor child is using its natural size, the height of the root actor fits the height of the child image.

          + +
          Actor rootActor = Actor::New();
          +rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          +rootActor.SetResizePolicy(ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT);
          +ImageActor image = ImageActor::New(Image::New(MY_IMAGE_PATH));
          +image.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
          +rootActor.Add(image);
          + +

          The following figure shows the before and after layouts for this code example.

          + +

          Figure: Before and after setting the resize policy

          +

          Before and after setting the resize policy Before and after setting the resize policy

          + +

          To specify that a dimension has a dependency on another dimension, use the ResizePolicy::DIMENSION_DEPENDENCY policy. For example, if the dimension is Dimension::HEIGHT and the dependency is Dimension::WIDTH, there is a height-for-width dependency in effect. You can use the policy in a text view that wraps its text. The following example shows a text view that expands its width according to the size of its parent, wraps its contents and then determines its height based on the width:

          + +
          TextLabel text = TextLabel::New("Example");
          +text.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          +text.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          + +

          Specifying Sizes and Size Limits

          + +

          To specify a fixed size for an actor, use the FIXED resize policy and set the desired size using the SetSize() function. If only 1 dimension is FIXED, the other value in the size parameter is ignored, so it is safe to set it to 0.

          +

          To constrain the final negotiated size of an actor, set the minimum and maximum sizes:

          + +
          void SetMinimumSize(const Vector2& size)
          +void SetMaximumSize(const Vector2& size)
          + +

          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 (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 +

            This is the default policy.

          • +
          • SizeScalePolicy::FIT_WITH_ASPECT_RATIO +

            Fits the actor within the bounds it has been allocated while maintaining the aspect ratio.

          • +
          • SizeScalePolicy::FILL_WITH_ASPECT_RATIO +

            Fills all available space, potentially overflowing its bounds, while maintaining aspect ratio.

          • +
          + +

          Using Actors in Containers

          + +

          When using actors in containers, such as a table view, you can specify the padding surrounding the actor with the SetPadding() function. The padding specifies the left, right, bottom, and top padding value.

          + + + + + + + + + + +
          Note
          Beware of infinite dependency loops! +

          For example, when the resize policy of a parent actor is set to ResizePolicy::FIT_TO_CHILDREN with a child that has a resize policy of ResizePolicy::FILL_TO_PARENT, an infinite loop occurs.

          +

          Similarly, consider a situation where a parent actor has a width policy of ResizePolicy::DIMENSION_DEPENDENCY with a height policy of ResizePolicy::FIT_TO_CHILDREN. If the parent has a single child with a height policy ResizePolicy::DIMENSION_DEPENDENCY with width, and the child's width policy is ResizePolicy::FILL_TO_PARENT, a loop occurs.

          +

          Loops can occur over larger spreads of parent-child relationships. These loops are detected by the relayout algorithm, which allocates the actors 0 sizes.

          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/multi_threaded_n.htm b/org.tizen.ui.practices/html/native/dali/multi_threaded_n.htm new file mode 100644 index 0000000..fcbdd7f --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/multi_threaded_n.htm @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + Multi-threaded Architecture: Secret of DALi High-performance + + + + + + +
          +

          Multi-threaded Architecture: Secret of DALi High-performance

          + +

          DALi uses a multi-threaded architecture to provide the best performance and scalability:

          +
            +
          • Event thread: Main thread in which the application code and event handling run.
          • +
          • Update thread: Updates the nodes on the scene as well as the running animations and constraints.
          • +
          • Render thread: OpenGL drawing, texture, and geometry uploading.
          • +
          • Resource thread: Loads images and decodes them into bitmaps.
          • +
          + +

          Figure: DALi thread architecture

          +

          DALi thread architecture

          + + +

          Animations with Multi-threading

          + +

          DALi animations and rendering occur in a dedicated rendering thread. This allows animations to run smoothly, regardless of the time taken to process input events in the application code.

          + +

          Internally, DALi contains the scene graph that mirrors the actor hierarchy. The scene graph objects perform the actual animation and rendering, while the actors provide thread-safe access. Actors and scene graph objects communicate through messaging.

          + +

          The following figure shows an actor hierarchy, in which one of the actors is being animated. The green objects in are created by the application code, while the blue private objects are used in the dedicated rendering thread.

          + +

          Figure: Actor hierarchy with an animation

          +

          Actor hierarchy with an animation

          + +

          Reading an Animated Value

          + +

          When a property is animatable, it can only be modified in the rendering thread. The value returned from a getter function is the value used when the previous frame was rendered.

          + +

          For example, the GetCurrentPosition() function returns the position in which the actor was last rendered. Since the SetPosition() function is asynchronous, a call to GetCurrentPosition() function does not immediately return the same value.

          + +
          +Actor actor = Actor::New();
          +Stage::GetCurrent().Add(actor); // Initial position is 0, 0, 0
          +
          +actor.SetPosition(Vector3(10, 10, 10));
          +
          +Vector3 current;
          +current = actor.GetCurrentPosition();
          +std::cout << "Current position: " << current.x << ", " << current.y << ", " << current.z << std::endl;
          +
          +std::cout << "..." << std::endl;
          +
          +// Handling another event
          +
          +current = actor.GetCurrentPosition();
          +std::cout << "Current position: " << current.x << ", " << current.y << ", " << current.z << std::endl;
          +
          + +

          The above code is likely to output:

          +
          +Actor actor = Actor::New();
          +"Current position: 0,0,0"
          +// Other positions
          +"Current position: 10,10,10"
          +
          + +

          Setting a Property during an Animation

          + +

          When a property is being animated, the animation overrides all values set with other functions, such as the SetPosition() function.

          + +

          Figure: Actor hierarchy with an animated property

          +

          Actor hierarchy with an animated property

          + +

          The order of execution in the rendering thread is:

          +
            +
          1. Process the message and call the SetPosition() function.
          2. +
          3. Apply the animation and call the SetPosition() function.
          4. +
          5. Render the frame.
          6. +
          + +

          Resource Loading with Multi-threading

          + +

          DALi loads resources in separate threads. If these resource threads are not used, a large image file causes a block in the main thread, which cannot process the next operation while reading data from a file system or downloading from the network.

          + +

          Currently, DALi creates one thread for loading local resources and another for loading remote resources, as required.

          + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/properties_n.htm b/org.tizen.ui.practices/html/native/dali/properties_n.htm new file mode 100644 index 0000000..d380684 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/properties_n.htm @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + Properties: Accessing Properties of DALi Objects + + + + + + +
          +

          Properties: Accessing Properties of DALi Objects

          + +

          A property is a value used by an object. It can be modified or read using the Dali::Handle::GetProperty() or Dali::Handle::SetProperty() functions.

          + +

          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 (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 in mobile and wearable applications).

          +

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

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Dali::Actor properties +
          Property index (enumeration)Member functions
          Dali::Actor::POSITIONDali::Actor::GetCurrentPosition() / SetPosition()
          Dali::Actor::ORIENTATIONDali::Actor::GetCurrentOrientation() / SetOrientation()
          Dali::Actor::SIZEDali::Actor::GetCurrentSize() / SetSize()
          Dali::Actor::COLORDali::Actor::GetCurrentColor() / SetColor()
          Dali::Actor::NAMEDali::Actor::GetName() / SetName()
          + +

          You can access the properties in both ways:

          + +
          +Actor actor = Actor::New();
          +actor.SetName("test actor");
          +std::cout << actor.GetName() << std::endl;  // "test actor"
          +
          + +
          +Actor actor = Actor::New();
          +actor.SetProperty(Actor::Property::NAME, "test actor");
          +std::cout << actor.GetProperty(Actor::Property::NAME) << std::endl;  // "test actor"
          +std::cout << actor.GetProperty<std::string>(Actor::Property::NAME) << std::endl;  // "test actor"
          +std::cout << actor.GetProperty(Actor::Property::NAME).Get<std::string>() << std::endl;  // "test actor"
          +
          + + +

          Using Properties

          + +

          Registering User-defined Custom Properties to Objects

          + +

          Properties can be registered and unregistered at runtime using the functions of the Dali::Handle class (in mobile and wearable applications). This enables script-like programming in the DALi application, such as adding custom member data to an instance of a DALi class without subclassing the class or maintaining another pool of custom data.

          +

          For example, you can set your own custom data to PushButton objects and use them later when the buttons are clicked:

          +
          +void 
          +Create(Application& application)
          +{
          +   for (int i = 0; i < 5; ++i)
          +   {
          +      Toolkit::PushButton button = Toolkit::PushButton::New();
          +      button.SetSize(100, 100);
          +      button.SetPosition(100*i+50, 50);
          +      button.ClickedSignal().Connect(this, OnButtonClicked);
          +
          +      // Register a custom property having button index
          +      // Store the property index so you can look it up later
          +      // Note: This is much faster than looking the property up by property name and must be used if possible
          +      // As all control types are the same (PushButtons), the indices to the unique custom property are all same
          +      Property::Value data(i);
          +      mCustomDataIndex = button.RegisterProperty("custom-data", data);
          +
          +      Stage::GetCurrent().Add(button);
          +   }
          +}
          +
          +bool 
          +OnButtonClicked(Toolkit::Button button)
          +{
          +   // Look up the custom property by the stored property index
          +   // Note: If the property belongs to a control in another library, 
          +   // or you do not know the index, you can look the index up first with:
          +   // Property::Index index = button.GetPropertyIndex("custom-data");
          +   cout << button.GetProperty(mCustomDataIndex) << endl;
          +
          +   return true;
          +}
          +
          + + +

          Animating 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:

          + +
          +RadioButton actor = RadioButton::New();
          +Stage::GetCurrent().Add(actor);
          +Animation animation = Animation::New(2.0f); // Duration 2 seconds
          +animation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(100.0f, 200.0f, 0.0f));
          +animation.Play();
          +
          + +

          Imposing Constraints on 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:

          + +
          +Constraint constraint = Constraint::New<Vector3>(actor, Actor::Property::SIZE, EqualToConstraint());
          +constraint.AddSource(ParentSource(Actor::Property::SIZE));
          +constraint.Apply();
          +
          + + +

          Managing Property Attributes

          + +

          A property has the following attributes:

          + +
            +
          • Index: Enumeration number indicating the property. The property index is usually used to access properties.
          • + +
          • Type: Type of the property. Retrieved with the Dali::Handle::GetPropertyType() function.
          • + +
          • Name: Name of the property. Retrieved with the Dali::Handle::GetPropertyName() function.
          • + +
          • Writable: If true, the property value can be written. Retrieved with the Dali::Handle::IsPropertyWritable() function.
          • + +
          • Animatable: If true, the property can be animated using the Dali::Animation class. Retrieved with the Dali::Handle::IsPropertyAnimatable() function.
          • + +
          • Constraint-Input: If true, the property can be used as constraint input. Retrieved with the Dali::Handle::IsPropertyAConstraintInput() function.
          • +
          + +

          The following table lists the type and name attributes of the Dali::Actor properties.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Dali::Actor property attributes +
          Property index (enumeration)Property typeProperty name
          Dali::Actor::POSITIONVector3"position"
          Dali::Actor::ORIENTATIONQuaternion"orientation"
          Dali::Actor::SIZEVector3"size"
          Dali::Actor::COLORVector4"color"
          Dali::Actor::NAMEstd::string"name"
          + +

          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).

          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/rendering_effects_n.htm b/org.tizen.ui.practices/html/native/dali/rendering_effects_n.htm new file mode 100644 index 0000000..a669699 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/rendering_effects_n.htm @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Rendering and Effects: Managing Viewing Modes and Shader Effects + + + + + + +
          +

          Rendering and Effects: Managing Viewing Modes and Shader Effects

          + +

          DALi provides stereoscopic viewing modes. It also provides a way to use user-defined custom shader effects.

          + +

          Viewing Modes

          + +

          DALi supports the following viewing modes:

          +
            +
          • MONO
          • +
          • STEREO_HORIZONTAL
          • +
          • STEREO_VERTICAL
          • +
          + +

          MONO is the default viewing mode. When using the MONO mode, only 1 image per scene is produced in every update. In this setup, DALi creates a default render task, which renders everything added to the stage root layer, and 1 default camera for that render task.

          + +

          The STEREO_HORIZONTAL and STEREO_VERTICAL modes allow the application to produce stereo images. Stereoscopy is a technique for creating or enhancing the illusion of depth in an image. Stereo rendering technique produces 2 images of the scene with an slight offset between them, which is presented to the left and the right eye independently. In this setup, DALi creates 2 additional render tasks, 1 for the right eye and 1 for the left, each with its own camera. Those cameras are parented to the default camera. The method to generate the projection transformation for each camera is known as "parallel axis asymmetric frustum perspective projection" and is illustrated in the following figure.

          + +

          Figure: Stereoscopic projection

          +

          Stereoscopic projection

          + +

          The separation between the 2 cameras is configurable but, typically, it ranges between 50 and 70 millimeters. Too large a separation can be hard to resolve and is known as hyperstereo. The convergence plane for both frustums is the 2D plane, so the projection of anything lying in the 2D plane is coincident for both left and right eye, resulting in no parallax. Objects that lie in front of the projection plane appear to be in front of the screen and objects behind the projection plane appear to be "into" the screen. Objects behind the projection plane (positive parallax) are easier to look at without straining the eyes.

          + +

          To view stereoscopic images correctly, each image must be presented to each eye independently. There are devices on the market for this, such as a head-mounted display, which is a display device worn in the head that has 2 small displays, one for each eye. A cheaper alternative to this often expensive device is the Google cardboard viewer.

          + +

          Figure: Google cardboard viewer

          +

          Google cardboard viewer

          + +

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

          + +

          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.

          + +

          To define the viewing mode to be used, use the SetViewMode() function of the Application class, passing the mode as a parameter. You can query the view mode being used by calling the GetViewMode() function. To define the separation between the left and right cameras, use the SetStereoBase() function, passing the distance in millimeters as a parameter. This distance can be queried using the GetStereoBase() function. You can also set the viewing mode and offset at initialization time using 2 command line arguments for this purpose: -view-mode (or -v) and 0 for MONO, 1 for STEREO_HORIZONTAL, 2 for STEREO_VERTICAL, and -stereo-base (or -s) and the separation in millimeters.

          + +

          Restrictions

          + +

          There are certain restrictions when writing stereoscopic applications using DALi:

          + +
            +
          • When a stereo mode is selected, the default render task source actor is set to an uninitialized actor so it does not render anything. Changing the default render task source actor later on produces undesired results, as the user does not want to see anything rendered by the default camera when stereo mode is on.
          • +
          • Stereo cameras are parented to the default camera, so if the application needs to change the camera position or orientation, it must change the default camera transformation. The handle to the default camera can be obtained from the default render task as follows: + +
            Dali::RenderTask defaultRenderTask = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0); Dali::CameraActor defaultCamera = defaultRenderTask.GetCameraActor();
            +
          • +
          • Stereo render tasks render everything added to the stage's root layer. If the application must render an object hierarchy to an off-screen buffer, it must set the exclusive flag on that render task so that the stereo tasks do not render that particular subtree. To set the exclusive flag in a render task, use the SetExclusive() function defined in the render task.
          • +
          + + + + + + + + + + +
          Note
          DALi stereoscopic viewing mode is still under development, and may not be mature enough for commercialized applications at the moment. For example, distortion correction is not supported yet. Tizen continues to improve the stereoscopic mode to give you a chance to provide more exciting and immersive user experience to your customers. +
          + +

          Shader Effects

          +

          The shader effects allow the developer to apply visual deformations on the actors. They can affect the geometry, the colors and textures of the actor.

          +
            +
          • Each actor has its own default shaders.
          • +
          • Those default shaders can be overridden by modified shader effects.
          • +
          • In an application, each actor might possess its own shader effect.
          • +
          • In an application, multiple actors might apply the same effect.
          • +
          + +

          Custom Shader Effects

          +

          The ShaderEffect enables you to create custom shader effects by specifying the vertex and pixel shaders. For a custom shader, you can provide the vertex and fragment shader code as strings. These shader snippets get concatenated with the default attributes and uniforms.

          + +

          Create a custom shader effect:

          + +
          +std::string myVertexShader; // This variable would contain the code for a vertex shader
          +Dali::ShaderEffect myEffect = Dali::ShaderEffect::New(myVertexShader, "" // Use the default pixel shader
          +);
          + +

          Set the value of a uniform:

          + +
          // If the uniform was declared like this in the shader: uniform float myUniform;
          +myEffect.SetUniform("myUniform", 0.5f);
          + +

          You can apply the custom shader effect to an actor like any other shader:

          + +
          actor.SetShaderEffect(myEffect);
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/resources_n.htm b/org.tizen.ui.practices/html/native/dali/resources_n.htm new file mode 100644 index 0000000..7256670 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/resources_n.htm @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + Resources: Handling Images + + + + + + +
          +

          Resources: Handling Images

          + + +

          DALi provides several ways to handle resource images.

          + +

          Loading Image Files

          + +

          You can load an image file with the ResourceImage class by specifying its location:

          + +
          +Dali::ResourceImage image = Dali::ResourceImage::New("/my-path/my-image.png");
          +
          + +

          The loaded image can be displayed using the ImageView component:

          + +
          +ImageView imageView = ImageView::New(image);
          +Stage::GetCurrent().Add(imageView);
          +
          + + +

          Supported Resource Types

          + +

          The resource location can be a file path or a URL.

          + +

          The currently supported image types are:

          +
            +
          • png
          • +
          • jpeg
          • +
          • gif
          • +
          • bmp
          • +
          • wbmp
          • +
          • ico
          • +
          • ktx
          • +
          + +

          The currently supported URL schemes are:

          +
            +
          • http
          • +
          • https
          • +
          + +

          Asynchronous Loading

          + +

          Resources are loaded in separate threads, which means that when you call the ResourceImage::New() function, it returns immediately.

          + +

          The application can connect to the Dali::ResourceImage::LoadingFinishedSignal() signal to get notified when the image has loaded:

          + +
          +class ResourceImageController : public ConnectionTracker
          +{
          +   public:
          +      ResourceImageController(Application& application) : mApplication(application)
          +      {
          +         mApplication.InitSignal().Connect(this, &ResourceImageController::Create);
          +      }
          +
          +      void Create(Application& application)
          +      {
          +         ResourceImage image = ResourceImage::New("https://www.tizen.org/sites/default/files/admins/tizen-branding-lockup-on-light.png");
          +         image.LoadingFinishedSignal().Connect(this, &ResourceImageController::OnLoadFinished);
          +
          +         ImageView imageView = ImageView::New(image);
          +         imageView.SetSize(400, 200);
          +         imageView.SetParentOrigin(ParentOrigin::CENTER);
          +         Stage::GetCurrent().Add(imageView);
          +      }
          +
          +      void OnLoadFinished(ResourceImage image)
          +      {
          +         LoadingState state = image.GetLoadingState();
          +         if (state == ResourceLoadingSucceeded)
          +            cout << "Loading " << image.GetUrl() << " is succeeded" << endl;
          +         else if (state == ResourceLoadingFailed)
          +         cout << "Loading " << image.GetUrl() << " is failed" << endl;
          +      }
          +};
          +
          + +

          For more information about the resource threads, see Resource Loading with Multi-threading.

          + + +

          Load and Release Policies

          + + +

          By default, resource images start loading immediately and the data is released only when the ResourceImage handle is destroyed. To optimize its memory footprint, the application can ask resources to be loaded only when actually required and their data to be released automatically when they are no longer being used by actors:

          + +
          Dali::ResourceImage image = Dali::ResourceImage::New("/my-path/my-image.png", 
          +                                                     Dali::ResourceImage::ON_DEMAND, 
          +                                                     Dali::Image::UNUSED);
          + +

          If the Dali::Image::UNUSED property is used, the resource data is reloaded automatically when the image is used again.

          + +

          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 (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:

          + +
          +Dali::Image image = Dali::ResourceImage::New(filename, ImageDimensions(240, 240), FittingMode::SCALE_TO_FILL);
          +
          + +

          This example sets the size and fitting mode appropriately for a large thumbnail during the Dali::ResourceImage object construction. In general, to enable scaling on load, pass a non-zero width or height and one of the 4 fitting modes to the Dali::ResourceImage creator function as shown above.

          + +

          The fitting modes and suggested use cases are as follows:

          + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Fitting mode use cases +
          Fitting modeSuggested use case
          Dali::FittingMode::SHRINK_TO_FITFull-screen image display: limit the loaded image resolution to the device resolution, but show all of the image.
          Dali::FittingMode::SCALE_TO_FILLThumbnail gallery grid: limit the loaded image resolution to the screen tile, filling the whole tile but losing a few pixels to match the tile shape.
          Dali::FittingMode::FIT_WIDTHImage columns: limit the loaded image resolution to the column width.
          Dali::FittingMode::FIT_HEIGHTImage rows: limit the loaded image resolution to the row height.
          + + +

          Image Size

          + +

          If the application requires the image dimensions immediately, they can be retrieved synchronously:

          + +
          Dali::ImageDimensions dimensions = Dali::ResourceImage::GetImageSize("/my-path/my-image.png");
          + +

          This is a disk-read operation, which can be slow and block the event thread. This operation is currently not supported for remote resources, such as HTTP or HTTPS URLs.

          + + +

          Using Nine-Patch Images

          + + +

          DALi supports nine-patch images, which can be stretched while maintaining their corners.

          + +

          Nine-Patch Image Format

          + +

          A nine-patch image has 9 sections. In the following figure (on the right), the sections 2, 4, 5, 6, 8 are stretched and the sections 1, 3, 7, 9 keep their size unchanged when the size of the image is changed:

          + +

          Figure: A nine-patch image explained

          +

          A nine-patch image A nine-patch image

          + +

          The black lines top and left side of the image determine the stretchable region.

          + +

          This format is compatible with the one used in Android. Therefore, you can easily make nine-patch images using existing tools, such as Simple Nine-patch Generator.

          + + + +

          Nine-Patch Image Loading

          + +

          A nine-patch image can be loaded by the ResourceImage class just like other images. If an image file has a .9.png or .9.jpg extension and proper nine-patch image contents as mentioned earlier, the image loaded by the ResourceImage class is rendered in the nine-patch way with the ImageView class.

          + +

          The following is an example of using a *.9.png image:

          + +
          +ResourceImage image = ResourceImage::New("nine_patch_dali.9.png");
          +ImageActor imageView = ImageActor::New(image);
          +imageView.SetSize(200, 200);
          +
          + +

          The following figure shows the result:

          +

          Figure: 200 x 200 image

          +

          200 x 200 image

          + + +

          Using a Buffer Image

          + +

          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)
          +Dali::BufferImage image = Dali::BufferImage::New(200, 200);
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/scrollview_n.htm b/org.tizen.ui.practices/html/native/dali/scrollview_n.htm new file mode 100644 index 0000000..df39006 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/scrollview_n.htm @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + ScrollView: Scrollable Container for Items + + + + + + +
          +

          ScrollView: Scrollable Container for Items

          + +

          The ScrollView class provides a scrollable view, which contains actors and can be scrolled automatically or manually by panning.

          + + +

          The following figure shows example layouts using the ScrollView.

          + +

          Figure: ScrollView

          +

          ScrollView

          + + +

          A scroll view emits a SnapStartedSignal() signal when the ScrollView has started to snap or flick. The signal informs the target of the scroll position, scale, and rotation.

          + +

          Creating a ScrollView

          + +

          The following example shows how to create a ScrollView:

          + +
          Dali::Toolkit::ScrollView scrollView;
          +
          +// Create a ScrollView instance
          +myScrollView = ScrollView::New();
          +
          +// Add it to the stage
          +Stage::GetCurrent().Add(scrollView);
          +
          +// Set the size of stage; it covers the entire stage 
          +Stage stage = Dali::Stage::GetCurrent();
          +Size size = stage.GetSize();
          +scrollView.SetSize(size);
          +
          +// Add actors to the ScrollView 
          +Image image = Image::New(DALI_IMAGE_DIR "button-background.png");
          +ImageActor imageActor = ImageActor::New(image);
          +scrollView.Add(imageActor);
          +// The ScrollView contents are now draggable
          +
          +// To enforce horizontal-only scrolling, the Y axis ruler can be disabled 
          +RulerPtr rulerY = new DefaultRuler();
          +rulerY->Disable();
          +scrollView.SetRulerY(rulerY);
          +
          +// To enable snapping, a FixedRuler can be applied to the X axis, with snap points spaced to the width of the stage. 
          +Size size = stage.GetSize();
          +RulerPtr rulerX = new FixedRuler(size.width);
          +scrollView.SetRulerX(rulerX);
          +
          +// A domain can be applied to rulers to prevent scrolling beyond this boundary
          +// In this case, to 4 times the width of the stage, allowing for 4 pages to be scrolled
          +Size size = stage.GetSize();
          +RulerPtr rulerX = new FixedRuler(size.width);
          +rulerX->SetDomain(RulerDomain(0.0f, size.width*4.0f));
          +scrollView.SetRulerX(rulerX);
          + +

          Using Ruler, RulerDomain, and Wrap

          + +

          The Ruler abstract class defines the scroll axes. The RulerDomain class specifies the minimum and maximum values of a ruler. The ScrollView class provides a wrap mode for ScrollView contents. When enabled, the ScrollView contents are wrapped over the x/y domain. The ScrollView behavior depends on a combination of the Ruler, RulerDomain, and Wrap modes. The following table shows ScrollView behavior according to the combination.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Scrollview behavior in the Ruler, RulerDomain, and Wrap mode
          RulerDomainWrapBehavior
          DisabledDisabledWrapNo movement in axis
          DisabledEnabledNo wrapNo movement in axis
          DisabledEnabledWrapNo movement in axis
          EnabledDisabledNo wrapFree movement in axis
          EnabledDisabledWrapFree movement in axis, wrapped according to domain minimum and maximum
          EnabledEnabledNo wrapMovement limited to domain minimum and maximum
          EnabledEnabledWrapMovement limited to domain minimum and maximum
          + + + + + + + + + + +
          Note
          Actors within a ScrollView are controlled by constraints. If you apply constraints to these actors externally, undefined behavior can occur. Since applying additional constraints can conflict with the ScrollView constraints, place the actors within container actors. The container actors are affected by the constraints.
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/tableview_n.htm b/org.tizen.ui.practices/html/native/dali/tableview_n.htm new file mode 100644 index 0000000..2897aa0 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/tableview_n.htm @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + TableView: Container with Grid-like Layout + + + + + + +
          +

          TableView: Container with Grid-like Layout

          + +

          The TableView class is a layout container for aligning child actors in a grid like layout. TableView constraints the x and y position and width and height of the child actors.

          + +

          Figure: TableView

          +

          TableView

          + +

          Creating a TableView

          + +

          The following example shows how to create a TableView:

          + +
          class ButtonsController: public ConnectionTracker
          +{
          +   ButtonsController(Application& application)
          +      : mApplication(application)
          +   {
          +      mApplication.InitSignal().Connect(this, &ButtonsController::Create);
          +   }
          +
          +   void Create(Application& application)
          +   {
          +      Stage stage = Stage::GetCurrent();
          +
          +      TableView tableView = TableView::New(4,4);
          +      tableView.SetKeyboardFocusable(true);
          +      tableView.SetName("TableView");
          +
          +      for (int row = 0; row < 4; ++row)
          +      {
          +         for (int col = 0; col < 4; ++col)
          +         {
          +            Control control = Control::New();
          +            std::ostringstream str;
          +            str << row << "-" << col;
          +            control.SetName(str.str());
          +            control.SetKeyboardFocusable(true);
          +            tableView.AddChild(control, TableView::CellPosition(row, col));
          +         }
          +      }
          +      stage.Add(tableView);
          +   }
          +
          +   // Signal
          +
          +   Application& mApplication;
          +}
          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/textfield_n.htm b/org.tizen.ui.practices/html/native/dali/textfield_n.htm new file mode 100644 index 0000000..3352540 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/textfield_n.htm @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + TextField: Type Your Text! + + + + + + +
          +

          TextField: Type Your Text!

          + +

          The TextField class is a control providing a single-line editable text field.

          + +

          Figure: TextField

          +

          TextField

          + +

          Creating a TextField

          + +

          Before text has been entered, the TextField can display a placeholder text. An alternative placeholder can be displayed when the TextField has keyboard focus. For example, a TextField used to enter a username can initially show the text Unknown Name, and the text Enter Name. when the cursor is visible.

          + +
          TextField field = TextField::New();
          +field.SetProperty(TextField::Property::PLACEHOLDER_TEXT, "Unnamed Name");
          +field.SetProperty(TextField::Property::PLACEHOLDER_TEXT_FOCUSED, "Enter Name.");
          +Stage::GetCurrent().Add(field);
          +
          + +

          When the TextField is tapped, it automatically gets the keyboard focus. Key events enter the text, and the placeholder text is removed. After text has been entered, it can be retrieved from the TEXT property.

          + +
          Property::Value fieldText = field.GetProperty(TextField::Property::TEXT);
          +std::cout << "Received text: " << fieldText.Get< std::string >() << std::endl;
          + + +

          Aligning Text

          + +

          The TextField displays a single-line of text, which scrolls if there is not enough space for the text displayed. If there is enough space, the text can be aligned horizontally to the beginning, end, or center of the available area:

          + +
          field.SetProperty(TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); // "CENTER" or "END"
          + +

          Using Decorations

          + +

          For text decorations, the following TextLabel class properties are available.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: TextField properties +
          PropertyTypeWritableAnimatable
          RENDERING_BACKENDIntegerYesNo
          TEXTStringYesNo
          PLACEHOLDER_TEXTStringYesNo
          PLACEHOLDER_TEXT_FOCUSEDStringYesNo
          FONT_FAMILYStringYesNo
          FONT_STYLEStringYesNo
          POINT_SIZEFloatYesNo
          MAX_LENGTHIntegerYesNo
          EXCEED_POLICYIntegerYesNo
          HORIZONTAL_ALIGNMENTStringYesNo
          VERTICAL_ALIGNMENTStringYesNo
          COLORVector4YesNo
          SHADOW_OFFSETVector2YesNo
          SHADOW_COLORVector4YesNo
          PRIMARY_CURSOR_COLORVector4YesNo
          SECONDARY_CURSOR_COLORVector4YesNo
          ENABLE_CURSOR_BLINKBooleanYesNo
          CURSOR_BLINK_INTERVALFloatYesNo
          CURSOR_BLINK_DURATIONFloatYesNo
          GRAB_HANDLE_IMAGEStringYesNo
          GRAB_HANDLE_PRESSED_IMAGEStringYesNo
          SCROLL_THRESHOLDFloatYesNo
          SCROLL_SPEEDFloatYesNo
          SELECTION_HANDLE_IMAGE_RIGHTStringYesNo
          SELECTION_HANDLE_PRESSED_IMAGE_LEFTStringYesNo
          SELECTION_HANDLE_PRESSED_IMAGE_RIGHTStringYesNo
          SELECTION_HIGHLIGHT_COLORVector4YesNo
          DECORATION_BOUNDING_BOXRectangleYesNo
          INPUT_METHOD_SETTINGSMapYesNo
          + +

          To change the color of the text, use the TEXT_COLOR property. An alternative color can be used for placeholder text by setting the PLACEHOLDER_TEXT_COLOR property. Unlike the Actor::COLOR property, these properties do not affect child actors added to the TextField.

          + +
          field.SetProperty(TextField::Property::TEXT_COLOR, Color::CYAN);
          +field.SetProperty(TextField::Property::PLACEHOLDER_TEXT_COLOR, Color::BLACK);
          + + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/textlabel_n.htm b/org.tizen.ui.practices/html/native/dali/textlabel_n.htm new file mode 100644 index 0000000..d149f55 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/textlabel_n.htm @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + TextLabel: Displaying Text Labels + + + + + + +
          +

          TextLabel: Displaying Text Labels

          + +

          The TextLabel class provides a control that renders a short text string. The text labels are lightweight, non-editable, and do not respond to user input.

          + +

          Figure: TextLabel

          +

          TextLabel

          + +

          Creating a TextLabel

          + +

          The following example shows how to create a TextLabel instance:

          + +
          TextLabel label = TextLabel::New();
          +label.SetProperty(TextLabel::Property::TEXT, "Hello World");
          +Stage::GetCurrent().Add(label);
          + +

          Selecting Fonts

          + +

          By default, the TextLabel automatically selects a suitable font from the platform. Note that the selected font may not support all characters in your input text. For example, Latin fonts often do not provide Arabic glyphs.

          + +

          Alternatively, you can request a font using the FONT_FAMILY, FONT_STYLE, and POINT_SIZE properties:

          + +
          label.SetProperty(TextLabel::Property::FONT_FAMILY, "HelveticaNue");
          +label.SetProperty(TextLabel::Property::FONT_STYLE,  "Regular");
          +label.SetProperty(TextLabel::Property::POINT_SIZE,  12.0f);
          + +

          The TextLabel falls back to using the default font if the requested font does not support the required scripts.

          + + +

          Aligning Text

          + +

          Wrapping can be enabled using the MULTI_LINE property:

          + +
          label.SetProperty(TextLabel::Property::MULTI_LINE, true);
          + +

          The text can be aligned horizontally to the beginning, end, or center of the available area:

          + +
          label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); // "CENTER" or "END"
          + +

          Managing the Layout

          + +

          There are several resize policies commonly used with TextLabels. +The following examples show the actual size by setting a colored background, whilst the black area represents the size of the parent control.

          + +

          Natural Size Policy

          + +

          In its natural size, the TextLabel is large enough to display the text without wrapping, and does not have extra space to align the text within. In the following example, the same result is displayed regardless of the alignment or multi-line properties:

          + +
          TextLabel label = TextLabel::New("Hello World");
          +label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          +label.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE,Dimension::ALL_DIMENSIONS);
          +label.SetBackgroundColor(Color::BLUE);Stage::GetCurrent().Add(label);
          + +

          Height-for-width Policy

          + +

          To lay out text labels vertically, a fixed (maximum) width must be provided by the parent control. Each TextLabel reports the desired height for the given width. The following example uses TableView as the parent:

          + +
          TableView parent = TableView::New(3, 1);
          +parent.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          +parent.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
          +parent.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          +
          +Stage::GetCurrent().Add(parent);
          +
          +TextLabel label = TextLabel::New("Hello World");
          +label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          +label.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          +label.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          +label.SetBackgroundColor(Color::BLUE);
          +
          +parent.AddChild(label, TableView::CellPosition(0, 0));
          +parent.SetFitHeight(0);
          +
          +label = TextLabel::New("A Quick Brown Fox Jumps Over The Lazy Dog");
          +label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          +label.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          +label.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          +label.SetBackgroundColor(Color::GREEN);
          +label.SetProperty(TextLabel::Property::MULTI_LINE, true);
          +
          +parent.AddChild(label, TableView::CellPosition(1, 0));
          +parent.SetFitHeight(1);
          +
          +label = TextLabel::New("لإعادة ترتيب الشاشات، يجب تغيير نوع العرض إلى شبكة قابلة للتخصيص");
          +label.SetAnchorPoint(AnchorPoint::TOP_LEFT);
          +label.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
          +label.SetResizePolicy(ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT);
          +label.SetBackgroundColor(Color::BLUE);
          +label.SetProperty(TextLabel::Property::MULTI_LINE, true);
          +
          +parent.AddChild(label, TableView::CellPosition(2, 0));
          +parent.SetFitHeight(2);
          + +

          In the example, the "Hello World" text label has been given the full width, not the natural width.

          + +

          Using Decorations

          + +

          For text decorations, TextLabel provides several properties.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: TextLabel properties +
          PropertyTypeWritableAnimatable
          RENDERING_BACKENDIntegerYesNo
          TEXTStringYesNo
          FONT_FAMILYStringYesNo
          FONT_STYLEStringYesNo
          POINT_SIZEFloatYesNo
          MULTI_LINEBooleanYesNo
          HORIZONTAL_ALIGNMENTStringYesNo
          VERTICAL_ALIGNMENTStringYesNo
          TEXT_COLORVector4YesNo
          SHADOW_OFFSETVector2YesNo
          SHADOW_COLORVector4YesNo
          UNDERLINE_ENABLEDBooleanYesNo
          UNDERLINE_COLORVector4YesNo
          UNDERLINE_HEIGHTFloatYesNo
          + +

          Color

          + +

          To change the color of the text, use the TEXT_COLOR property. Unlike the Actor::COLOR property, this does not affect child actors added to the TextLabel.

          + +
          label.SetProperty(TextLabel::Property::TEXT, "Red Text");
          +label.SetProperty(TextLabel::Property::TEXT_COLOR, Color::RED);
          + +

          Drop Shadow

          + +

          To add a drop shadow to the text, set the SHADOW_OFFSET property with a non-zero values. The color can also be selected using the SHADOW_COLOR property.

          + +
          stage.SetBackgroundColor(Color::BLUE);
          +label1.SetProperty(TextLabel::Property::TEXT, "Plain Text");
          +label2.SetProperty(TextLabel::Property::TEXT, "Text with Shadow");
          +label2.SetProperty(TextLabel::Property::SHADOW_OFFSET, Vector2(1.0f, 1.0f));
          +label2.SetProperty(TextLabel::Property::SHADOW_COLOR, Color::BLACK);
          +label3.SetProperty(TextLabel::Property::TEXT, "Text with Bigger Shadow");
          +label3.SetProperty(TextLabel::Property::SHADOW_OFFSET, Vector2(2.0f, 2.0f));
          +label3.SetProperty(TextLabel::Property::SHADOW_COLOR, Color::BLACK);
          +label4.SetProperty(TextLabel::Property::TEXT, "Text with Color Shadow");
          +label4.SetProperty(TextLabel::Property::SHADOW_OFFSET, Vector2(1.0f, 1.0f));
          +label4.SetProperty(TextLabel::Property::SHADOW_COLOR, Color::RED);
          + +

          Underlining

          + +

          The text can be underlined by setting the UNDERLINE_ENABLED property. The color can also be selected using the UNDERLINE_COLOR property.

          + +
          label1.SetProperty(TextLabel::Property::TEXT, "Text with Underline");
          +label1.SetProperty(TextLabel::Property::UNDERLINE_ENABLED, true);
          +label2.SetProperty(TextLabel::Property::TEXT, "Text with Color Underline");
          +label2.SetProperty(TextLabel::Property::UNDERLINE_ENABLED, true);
          +label2.SetProperty(TextLabel::Property::UNDERLINE_COLOR, Color::GREEN); 
          + +

          By default, the underline height is based on the font metrics. This can be overridden using the UNDERLINE_HEIGHT property:

          + +
          label1.SetProperty(TextLabel::Property::UNDERLINE_HEIGHT, 1.0f);
          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/dali/ui_components_n.htm b/org.tizen.ui.practices/html/native/dali/ui_components_n.htm new file mode 100644 index 0000000..9a0a8c0 --- /dev/null +++ b/org.tizen.ui.practices/html/native/dali/ui_components_n.htm @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + UI Components: Creating the Application Layout + + + + + + +
          +

          UI Components: Creating the Application Layout

          + +

          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.

          + +

          Figure: DALi UI components

          +

          DALi UI components

          + +

          The following table lists the available UI components.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: DALi UI components +
          ControlDescriptionRelated classes
          ButtonsA push button that can be pressed, a checkbox button that can be checked/unchecked,and a radio button that only one option can be selected.Button, PushButton, CheckBoxButton, RadioButton
          ItemViewAn item view that renders item sets in a scrollable layout.ItemView, ItemFactory, ItemLayout, Scrollable
          ScrollViewA scroll view to provide scrollable view.ScrollView, Scrollable, ScrollViewEffect, ScrollViewPagePathEffect
          TableViewA table view that can align child actors in a grid like layout.TableView
          TextFieldA text field that provides a single-line editable text field.TextField
          TextLabelA text label that renders a short text string.TextLabel
          ImageViewAn image view that renders an image.ImageView
          + +

          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.

          + +

          The following figure illustrates the hierarchy of the UI components.

          + +

          Figure: DALi UI component hierarchy

          +

          DALi UI component hierarchy

          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/animation_effects_n.htm b/org.tizen.ui.practices/html/native/efl/animation_effects_n.htm new file mode 100644 index 0000000..4916ba0 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/animation_effects_n.htm @@ -0,0 +1,84 @@ + + + + + + + + + + + + + Animations and Effects: Creating Transformations + + + + + +
          + +

          Animations and Effects: Creating Transformations

          + +

          EFL provides the following animation functionalities: Ecore animators, Elementary transitions, Edje animations, and Evas Map animations.

          + +

          The first option for creating animations with EFL is to use Ecore animators. To create an Ecore animation, you must first determine the duration of the animation, and then define a callback function that performs the animation with that duration.

          + +

          You can also create animations using Elementary transitions. Elementary transitions allow you to apply various transition effects, such as translation and rotation, to Evas objects. Elementary transitions are mostly based on Ecore animators, but provide some transition methods at a higher level of abstraction. Elementary transitions provide a simpler way of animating objects than Ecore animators or Edje animations.

          + +

          A third option for animating objects is to use Edje animations, which are based on a simple principle: transitioning from one state to another. To animate an object with Edje, you have to first define the start and end states of the animation, and then transition the object from the start state to the end state.

          + +

          Finally, Evas Map animations allow you to apply transformations to all types of objects by way of UV mapping. In UV mapping, you map points in the source object to 3D space positions in the target object. This allows for rotation, perspective, scale, and other transformation effects, depending on the map. In addition, each map point can carry a multiplier color, which, if properly calculated, can be used to apply 3D shading effects on the target object.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/basic_tutorial_mn.htm b/org.tizen.ui.practices/html/native/efl/basic_tutorial_mn.htm new file mode 100644 index 0000000..a3d8647 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/basic_tutorial_mn.htm @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + Creating Basic Mobile Interactions + + + + + + +
          +

          Creating Basic Mobile Interactions

          + + +

          This tutorial teaches the basics of UI component interactions. It builds upon the Hello World example, using its basic application code.

          + +

          This feature is supported in mobile applications only.

          + +

          Using Buttons

          + +

          To use buttons:

          + +
            +
          • Create buttons with various styles: + +
              +
            • +

              To create a text-only button:

              +
              Evas_Object* button;
              +
              +button = elm_button_add(box);
              +elm_object_text_set(button, "Click me");
              +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
              +elm_box_pack_end(box, button);
              +evas_object_show(button);
              +
              +
            • +
            • +

              To create a button with an icon:

              +
              Evas_Object* button2;
              +Evas_Object* icon2;
              +
              +button2 = elm_button_add(box);
              +icon2 = elm_icon_add(box);
              +elm_image_file_set(icon2, "icon.png", NULL);
              +elm_object_part_content_set(button2, "icon", icon2);
              +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
              +elm_box_pack_end(box, button);
              +evas_object_show(button);
              +
              +
            • +
            • +

              To create a button with both an icon and a text label:

              +
              Evas_Object* button3;
              +Evas_Object* icon3;
              +button3 = elm_button_add(box);
              +icon3 = elm_icon_add(box);
              +elm_image_file_set(icon, "icon.png", NULL);
              +elm_object_part_content_set(button3, "icon", icon3);
              +elm_object_text_set(button3, "Press me");
              +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
              +elm_box_pack_end(box, button);
              +evas_object_show(button);
              +
              +
            • +
          • + +
          • Disable a button using the elm_object_disabled_set() function. +

            A disabled button is visible, but cannot be clicked.

            +
            elm_object_disabled_set(button2, EINA_TRUE);
            +
          • + +
          • Manage button callbacks. +

            The Elementary buttons respond to user interactions with several events.

            +
              +
            • Define and register a callback for a button click. +

              The clicked event is the most basic button event. The following code snippet changes the button text when the button is clicked (first pressed and then unpressed):

              +
              +static void _button_click_cb(void *data, Evas_Object *button, void *ev) 
              +{
              +   elm_object_text_set(button, "Clicked!");
              +}
              +evas_object_smart_callback_add(button, "clicked", _button_click_cb, NULL);
              +
              +
            • +
            • Define and register a callback for a button press and unpress. +

              The button can respond to the separate pressed and unpressed events instead of the entire click event:

              +
              static void _button_press_cb(void *data, Evas_Object *button, void *ev) 
              +{
              +   elm_object_text_set(button, "Pressed!");
              +}
              +static void _button_unpress_cb(void *data, Evas_Object *button, void *ev) 
              +{
              +   elm_object_text_set(button, "Unpressed!");
              +}
              +
              +evas_object_smart_callback_add(button3, "pressed", _button_press_cb, NULL);
              +evas_object_smart_callback_add(button3, "unpressed", _button_unpress_cb, NULL);
              +
              +
            • +
            • Define and register a callback for repeated button events. +

              The button can receive multiple repeated events when the user presses it down and holds it. You can define timings, such as the initial timeout and the repeat interval, for repeated events. In this example, the initial timeout is set to 1 second, and the repeat interval to half a second.

              +
              static void _button_repeat_cb(void *data, Evas_Object *button, void *ev) 
              +{
              +   static int count = 0;
              +   char buf[16];
              +
              +   snprintf(buf, sizeof(buf), "Repeat %d", count++);
              +
              +   elm_object_text_set(button, buf);
              +}
              +
              +elm_button_autorepeat_set(button3, EINA_TRUE);
              +elm_button_autorepeat_initial_timeout_set(button3, 1.0);
              +elm_button_autorepeat_gap_timeout_set(button3, 0.5);
              +evas_object_smart_callback_add(button3, "repeated", _button_repeat_cb, NULL);
              +
              +
            • +
          + +

          Using Simple Text

          + +

          To use simple text:

          +
            +
          • Create a label object: +
            label = elm_label_add(ad->win);
            +elm_object_text_set(label, "My label");
            +evas_object_show(label);
            +
            +
          • +
          • Slide the text, if it is too long to be shown at once, using one of the slide options: + +
              +
            • slide_short: Text stops at an edge, reverts to its initial position and slides again.
            • +
            • slide_long: Text is originally empty. It slides in, all the way to the edge, continues sliding until the label is empty, and loops.
            • +
            • slide_bounce: Text moves (bounces) backwards after stopping at the edge.
            • +
            + +

            In the following example, the duration of the slide is set to 5 seconds and slide option bounces the text at the end:

            + +
            Evas_Object* label;
            +label = elm_label_add(->win);
            +elm_object_text_set(label, "This text is supposed to be really long.");
            +elm_label_slide_set(label, EINA_TRUE);
            +elm_label_slide_duration_set(label, 5.);
            +elm_object_style_set(label, "slide_bounce");
            +evas_object_show(label);
            +
            + +

            If needed, you can use the slide,end event to respond to the moment when the sliding text reaches its end.

            +
          • + +
          • Create a marker. +

            A marker is a text that is by default bold, white, and centered. In the following example, the marker text is set to be blue:

            +
            elm_object_style_set(label, "marker");
            +evas_object_color_set(label, 0, 0, 255, 255);
            +
            +
          • +
          • Apply basic styles to the text with HTML elements. +

            The following example creates bold text:

            +
            elm_object_text_set(label, "<b>This text is bold.</b>");
            +
            +
          • +
          + + +

          Using Simple Lists

          + +

          A list is a scrollable container, whose children can be selected. For the list items, any Evas Object can be added as an icon, either at the beginning (third parameter) or the end (fourth parameter) of the item.

          + +

          The following example shows a list with 3 list items, where the second list item has an icon before the item text, and the third item has a button after the item text:

          +
          Evas_Object* list;
          +Evas_Object* icon;
          +list = elm_list_add(ad->win);
          +elm_list_item_append(list, "Text item", NULL, NULL, NULL, NULL);
          +icon = elm_icon_add(ad->win);
          +elm_icon_standard_set(icon, "chat");
          +elm_list_item_append(list, "Second item", icon, NULL, NULL, NULL);
          +Evas_Object* button;
          +button = elm_button_add();
          +elm_object_text_set(button, "Button");
          +elm_list_item_append(list, "Third item", NULL, button, NULL, NULL);
          +elm_list_go(list);
          +
          + + + +

          To manage lists:

          + +
            +
          • Set the orientation. +

            By default, a list is set vertically. To display the list horizontally:

            +
            elm_list_horizontal_set(list, EINA_TRUE);
            +
            +
          • +
          • Set a mode for the list: +
              +
            • ELM_LIST_COMPRESS: List does not set any size measures to inform the container how to resize it. If the list is not created as a "resize object", its dimensions are zeroed. The list respects the container's geometry and if any of the list items do not fit into the container transverse axis, the list does not scroll in that direction.
            • +
            • ELM_LIST_SCROLL (default): Same as ELM_LIST_COMPRESS, with the exception that if any of the list items do not fit into the container transverse axis, the list still scrolls in that direction.
            • +
            • ELM_LIST_LIMIT: Sets a minimum size measure on the list object, so that containers can respect it (and resize themselves to fit the child properly). More specifically, a minimum size measure is set for its transverse axis, so that the largest item in that direction fits well. This feature is bound by the list object's maximum size measures that are set externally.
            • +
            • ELM_LIST_EXPAND: Besides setting a minimum size on the transverse axis, as in ELM_LIST_LIMIT, this mode sets a minimum size on the longitudinal axis to reserve space for all its children to be visible at the same time. This feature is bound by the list object's maximum size measures that are set externally.
            • +
            +
            elm_list_mode_set(list, ELM_LIST_COMPRESS);
            +
            +
          • +
          • Manage the scroller. +

            You can control whether scrollbars are displayed for the list using the elm_scroller_policy_set() function. The second parameter is for the horizontal axis, the third one for the vertical axis.

            + +

            The available scroller policies are:

            +
              +
            • ELM_SCROLLER_POLICY_OFF: Scrollbar is hidden
            • +
            • ELM_SCROLLER_POLICY_ON: Scrollbar is displayed
            • +
            • ELM_SCROLLER_POLICY_AUTO: Scrollbar is displayed only when needed and stays hidden at other times
            • +
            + +
            elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_ON);
            +
            + +

            Several effects can also be shown on a list. In the following example, the scroller is set to bounce at the end on either direction (the second parameter is for the horizontal axis, and the third one for the vertical axis):

            +
            elm_scroller_bounce_set(list, EINA_TRUE, EINA_TRUE);
            +
            +
          • +
          • Manage events. +

            You can register and define various events for a list:

            +
              +
            • activated: User clicks or presses an item.
            • +
            • selected: User selects an item.
            • +
            • unselected: User clears an item.
            • +
            • longpressed: User long-presses an item.
            • +
            • edge,top: User scrolls the list to the top edge.
            • +
            • edge,bottom: User scrolls the list to the bottom edge.
            • +
            • edge,left: User scrolls the list to the left edge.
            • +
            • edge,right: User scrolls the list to the right edge.
            • +
            • highlighted: Item is pressed and highlighted.
            • +
            • unhighlighted: Item stops being pressed and highlighted.
            • +
            +
          • +
          + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/button_tutorial_wn.htm b/org.tizen.ui.practices/html/native/efl/button_tutorial_wn.htm new file mode 100644 index 0000000..4ccf091 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/button_tutorial_wn.htm @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + Creating Wearable Buttons + + + + + + +
          +

          Creating Wearable Buttons

          + + +

          This tutorial teaches the basics of the button component interactions.

          + +

          This feature is supported in wearable applications only.

          + + +

          Initializing the Button Application

          + +

          This use case creates an application with a window entitled "Button Basic Tutorial". The window consists of a box component, and a button is placed inside the box.

          + +

          To create a typical elementary application:

          +
          +static void
          +create_base_gui(appdata_s *ad) 
          +{
          +   // Window
          +   Evas_Object *btn1, *btn2, *btn3;
          +
          +   ad->win = elm_win_util_standard_add("main", "Button Basic Tutorial");
          +   elm_win_autodel_set(ad->win, EINA_TRUE);
          +
          +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          +
          +   ad->box = elm_box_add(ad->win);
          +   evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   evas_object_show(ad->box);
          +   elm_win_resize_object_add(ad->win, ad->box);
          +
          +   create_button(ad->box);
          +
          +   // Show the window after the base GUI is set up
          +   evas_object_show(ad->win);
          +}
          +
          +static bool
          +app_create(void *data)
          +{
          +   appdata_s *ad = data;
          +   create_base_gui(ad);
          +
          +   return true;
          +}
          +
          +int
          +main(int argc, char **argv)
          +{
          +   struct app_data ad = {0,};
          +   ui_app_lifecycle_callback_s event_callback = {0,};
          +
          +   event_callback.create = app_create;
          +
          +   return ui_app_main(&argc, &argv, &event_callback, &ad);
          +}
          + + +

          Using Button Styles

          + +

          The basic application code is the same as in the Hello World example.

          + +

          To use various button styles:

          + +
          1. To create buttons using various styles:

            + +
            • Create a basic text-only button: + +
              Evas_Object* button;
              +
              +button = elm_button_add(box);
              +elm_object_text_set(button, "Click me");
              +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
              +elm_box_pack_end(box, button);
              +evas_object_show(button);
              +
            • + +
            • Create a basic icon button (no text, just an icon): +
              Evas_Object* button2;
              +Evas_Object* icon2;
              +
              +button2 = elm_button_add(box);
              +icon2 = elm_icon_add(box);
              +elm_image_file_set(icon2, "icon.png", NULL);
              +elm_object_content_set(button2, icon2);
              +evas_object_size_hint_weight_set(button2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +evas_object_size_hint_align_set(button2, EVAS_HINT_FILL, 0.5);
              +elm_box_pack_end(box, button2);
              +evas_object_show(button2);
              +
            • + +
            • Create a button with both an icon and a text label: +
              Evas_Object* button3;
              +Evas_Object* icon3;
              +button3 = elm_button_add(box);
              +icon3 = elm_icon_add(box);
              +elm_image_file_set(icon3, "icon.png", NULL);
              +elm_object_content_set(button3, icon3);
              +elm_object_text_set(button3, "Press me");
              +evas_object_size_hint_weight_set(button3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +evas_object_size_hint_align_set(button3, EVAS_HINT_FILL, 0.5);
              +elm_box_pack_end(box, button3);
              +evas_object_show(button3);
              +
            • +
          2. +
          3. To disable a button so that it is not in use, only shown:

            +
            elm_object_disabled_set(button2, EINA_TRUE);
            +
          + +

          Managing Button Events

          +

          The Elementary buttons respond to user interactions with several events.

          +

          To manage button events:

          + +
            +
          • Handle click events: +

            The "click" event is the most basic and well-known one. The following code snippet changes the text of a button upon a click event: a press followed by an unpress.

            +
            +static void _button_click_cb(void *data, Evas_Object *button, void *ev) 
            +{
            +   elm_object_text_set(button, "Clicked!");
            +}
            +evas_object_smart_callback_add(button, "clicked", _button_click_cb, NULL);
            +
          • + +
          • Handle press and unpress events: +

            The button can respond to the separate press and unpress events instead of the entire click event.

            +
            static void _button_press_cb(void *data, Evas_Object *button, void *ev) 
            +{
            +   elm_object_text_set(button, "Pressed!");
            +}
            +static void _button_unpress_cb(void *data, Evas_Object *button, void *ev) 
            +{
            +   elm_object_text_set(button, "Unpressed!");
            +}
            +
            +evas_object_smart_callback_add(button3, "pressed", _button_press_cb, NULL);
            +evas_object_smart_callback_add(button3, "unpressed", _button_unpress_cb, NULL);
            +
          • + +
          • Handle repeated events: +

            The button can receive several events in case it is being held by the user. Timings, such as the initial timeout and the repeat interval, can be set. In this example, the initial timeout is set to 1 second, and the repeat interval to half a second.

            +
            static void _button_repeat_cb(void *data, Evas_Object *button, void *ev) 
            +{
            +   static int count = 0;
            +   char buf[16];
            +
            +   snprintf(buf, sizeof(buf), "Repeat %d", count++);
            +
            +   elm_object_text_set(button, buf);
            +}
            +
            +elm_button_autorepeat_set(button3, EINA_TRUE);
            +elm_button_autorepeat_initial_timeout_set(button3, 1.0);
            +elm_button_autorepeat_gap_timeout_set(button3, 0.5);
            +evas_object_smart_callback_add(button3, "repeated", _button_repeat_cb, NULL);
            +
          + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.guides/html/native/efl/circle_components_wn.htm b/org.tizen.ui.practices/html/native/efl/circle_components_wn.htm old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/native/efl/circle_components_wn.htm rename to org.tizen.ui.practices/html/native/efl/circle_components_wn.htm diff --git a/org.tizen.ui.practices/html/native/efl/component_background_mn.htm b/org.tizen.ui.practices/html/native/efl/component_background_mn.htm new file mode 100644 index 0000000..43a1fb5 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_background_mn.htm @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + Background + + + + + + +
          +

          Background

          + +

          This feature is supported in mobile applications only.

          + +

          The background component can be used to set a solid background decoration to a window or to a container object. It works like an image, but has some background specific properties, for example it can be set to a tiled, centered, scaled, or stretched mode. There are no specific signals relative to background object.

          + +

          Figure: Red color background

          +

          Red color background

          + +

          Figure: Background hierarchy

          +

          Background hierarchy

          + +

          Adding a Background Component

          + +

          A background is created with the elm_bg_add() function.

          + +
          +Evas_Object *bg, *parent;
          +
          +// Create a background
          +bg = elm_bg_add(parent);
          +
          + +

          Changing the Color of the Background

          + +

          You can set the color of the background with the elm_bg_color_set() function. The following example sets the background color to red.

          + +
          +Evas_Object *bg;
          +
          +// Use red color for background
          +elm_bg_color_set(bg, 0xFF, 0x00, 0x00);
          +
          + +

          Changing the Image of the Background

          + +

          It is also possible to set an image or an Edje group as a background using the elm_bg_file_set() function. The display mode of the image in the background can be chosen with elm_bg_option_set(), where the following modes are available:

          + +
            +
          • ELM_BG_OPTION_CENTER: center the background image.
          • +
          • ELM_BG_OPTION_SCALE: scale the background image, retaining aspect ratio.
          • +
          • ELM_BG_OPTION_STRETCH: stretch the background image to fill the UI component's area.
          • +
          • ELM_BG_OPTION_TILE: tile the background image at its original size.
          • +
          + +
          +Evas_Object *bg;
          +
          +// Set a file on the disk as a background image
          +elm_bg_file_set(bg, "/path/to/the/image", NULL);
          +// Set an Edje group as a background image
          +elm_bg_file_set(bg, "/path/to/the/edje", "edje_group");
          +elm_bg_option_set(bg, ELM_BG_OPTION_STRETCH)
          +
          + +

          Using Overlay

          + +

          An overlay can be set using the overlay part name.

          + +
          +elm_object_part_content_set(bg, "overlay", over);
          +
          + +

          Here, the overlay is an Edje object that is displayed on top of the current background object.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_background_wn.htm b/org.tizen.ui.practices/html/native/efl/component_background_wn.htm new file mode 100644 index 0000000..6c0b0c3 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_background_wn.htm @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + Background + + + + + + +
          +

          Background

          + +

          This feature is supported in wearable applications only.

          + +

          The background component can be used to set a solid background decoration to a window or to a container object. It works like an image, but has some background specific properties, for example it can be set to a tiled, centered, scaled, or stretched mode. There are no specific signals relative to background object.

          + + +

          Figure: Red color background

          +

          Red color background

          + +

          Figure: Background hierarchy

          +

          Background hierarchy

          + +

          Adding a Background Component

          + +

          A background is created with the elm_bg_add() function.

          + +
          +Evas_Object *bg, *parent;
          +
          +// Create a background
          +bg = elm_bg_add(parent);
          +
          + +

          Changing the Color of the Background

          + +

          You can set the color of the background with the elm_bg_color_set() function. The following example sets the background color to red.

          + +
          +Evas_Object *bg;
          +
          +// Use red color for background
          +elm_bg_color_set(bg, 0xFF, 0x00, 0x00);
          +
          + +

          Changing the Image of the Background

          + +

          It is also possible to set an image or an Edje group as a background using the elm_bg_file_set() function. The display mode of the image in the background can be chosen with elm_bg_option_set(), where the following modes are available:

          + +
            +
          • ELM_BG_OPTION_CENTER: center the background image.
          • +
          • ELM_BG_OPTION_SCALE: scale the background image, retaining aspect ratio.
          • +
          • ELM_BG_OPTION_STRETCH: stretch the background image to fill the UI component's area.
          • +
          • ELM_BG_OPTION_TILE: tile the background image at its original size.
          • +
          + +
          +Evas_Object *bg;
          +
          +// Set a file on the disk as a background image
          +elm_bg_file_set(bg, "/path/to/the/image", NULL);
          +// Set an Edje group as a background image
          +elm_bg_file_set(bg, "/path/to/the/edje", "edje_group");
          +elm_bg_option_set(bg, ELM_BG_OPTION_STRETCH)
          +
          + +

          Using Overlay

          + +

          An overlay can be set using the overlay part name.

          + +
          +elm_object_part_content_set(bg, "overlay", over);
          +
          + +

          Here, the overlay is an Edje object that is displayed on top of the current background object.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_button_mn.htm b/org.tizen.ui.practices/html/native/efl/component_button_mn.htm new file mode 100644 index 0000000..70c8110 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_button_mn.htm @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + Button + + + + + + +
          +

          Button

          + +

          This feature is supported in mobile applications only.

          + +

          The Elementary button component is a simple push button. It is composed of a label icon and an icon object and has an autorepeat feature.

          + +

          Figure: Button component

          +

          Button component

          + +

          Figure: Button hierarchy

          +

          Button hierarchy

          + +

          Adding a Button Component

          + +

          Create a button.

          +
          +Evas_Object *button, *parent;
          +
          +// Create a button
          +button = elm_button_add(parent);
          + +

          Adding an Icon Inside a Button

          + +

          The icon can be updated with elm_object_part_content_set() function with the icon part name.

          + +
          +Evas_Object *ic;
          +ic = elm_icon_add(button);
          +elm_image_file_set(ic, "icon.png", NULL);
          +elm_object_part_content_set(button, "icon", ic);
          +
          + +

          Adding Text Inside a Button

          + +

          The label can be modified using the elm_object_text_set() function.

          + +
          +elm_object_text_set(button, "Click me!");
          +
          + +

          Using Button Styles

          + +

          Various styles can be used on the button. Tizen supports the following styles:

          + +
            +
          • icon_reorder
          • +
          • icon_expand_add
          • +
          • icon_expand_delete
          • +
          • default
          • +
          • circle
          • +
          • bottom
          • +
          • contacts
          • +
          • option
          • +
          + +

          You can see these themes in action on the following screenshot (in the above order).

          + +

          Figure: Button component

          +

          Button component

          + +

          To change the style of the button, call the elm_object_style_set() function on the button object.

          + +
          +elm_object_style_set(button,"icon_expand_add");
          +
          + +

          Using the Button Callbacks

          + +

          The button emits the following signals:

          + +
            +
          • clicked: The user clicked the button (press/release).
          • +
          • repeated: The user pressed the button without releasing it.
          • +
          • pressed: The user pressed the button.
          • +
          • unpressed: The user released the button after pressing it.
          • +
          + +

          For all these signals the event_info parameter returned in the callback is NULL.

          + +

          This is an example to register and define a callback function called by the clicked signal.

          + +
          +{
          +   evas_object_smart_callback_add(button, "clicked", clicked_cb, data);
          +}
          +// Callback function for the "clicked" signal
          +// This callback is called when the button is clicked by the user
          +void clicked_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Button clicked\n");
          +}
          +
          + +

          Using the Autorepeat Feature

          + +

          The autorepeat feature is enabled by default. It consists of calling the repeated signal when the user keeps the button pressed. This feature can be disabled with the elm_button_autorepeat_set() function. The autorepeat is configured with the following functions:

          +
            +
          • elm_button_autorepeat_initial_timeout_set(): to set the initial timeout before the autorepeat event is generated
          • +
          • elm_button_autorepeat_gap_timeout_set(): to set the interval between two autorepeat events
          • +
          + +

          Disable the autorepeat feature.

          +
          +elm_button_autorepeat_set(button, EINA_FALSE);
          +
          + +

          Enable the autorepeat feature.

          +
          +elm_button_autorepeat_set(button, EINA_TRUE);
          +
          + +

          Set the initial timeout to five seconds.

          +
          +elm_button_autorepeat_initial_timeout_set(button, 5.0);
          +
          + +

          Set the gap between two signals to 0.5 seconds.

          +
          +elm_button_autorepeat_gap_timeout_set(button, 0.5);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_button_wn.htm b/org.tizen.ui.practices/html/native/efl/component_button_wn.htm new file mode 100644 index 0000000..c203e9f --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_button_wn.htm @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + Button + + + + + + +
          +

          Button

          + +

          This feature is supported in wearable applications only.

          + +

          The Elementary button component is a simple push button. It is composed of a label icon and an icon object and has an autorepeat feature.

          + + +

          Figure: Button component

          +

          Button component

          + +

          Figure: Button hierarchy

          +

          Button hierarchy

          + +

          Adding a Button Component

          + +

          Create a button.

          +
          +Evas_Object *button, *parent;
          +
          +// Create a button
          +button = elm_button_add(parent);
          + +

          Adding an Icon Inside a Button

          + +

          The icon can be updated with elm_object_part_content_set() function with the icon part name.

          + +
          +Evas_Object *ic;
          +ic = elm_icon_add(button);
          +elm_image_file_set(ic, "icon.png", NULL);
          +elm_object_part_content_set(button, "icon", ic);
          + +

          Adding Text Inside a Button

          + +

          The label can be modified using the elm_object_text_set() function.

          + +
          +elm_object_text_set(button, "Click me!");
          +
          + +

          Using Button Styles

          + +

          Various styles can be used on the button. Tizen supports the following styles for the rectangular UI component:

          +
            +
          • default
          • +
          • green
          • +
          • orange
          • +
          • red
          • +
          • nextdepth
          • +
          +

          Tizen supports the following styles for the circular UI component:

          +
            +
          • default
          • +
          • bottom
          • +
          + +

          To change the style of the button, call the elm_object_style_set() function on the button object.

          + +
          +// Example for the rectangular UI component
          +elm_object_style_set(button, "nextdepth");
          +
          +// Example for the circular UI component
          +elm_object_style_set(button, "bottom");
          +
          + +

          Using the Button Callbacks

          + +

          The button emits the following signals:

          + +
            +
          • clicked: The user clicked the button (press/release).
          • +
          • repeated: The user pressed the button without releasing it.
          • +
          • pressed: The user pressed the button.
          • +
          • unpressed: The user released the button after pressing it.
          • +
          + +

          For all these signals the event_info parameter returned in the callback is NULL.

          + +

          This is an example to register and define a callback function called by the clicked signal.

          +
          +{
          +   evas_object_smart_callback_add(button, "clicked", clicked_cb, data);
          +}
          +// Callback function for the "clicked" signal
          +// This callback is called when the button is clicked by the user
          +void clicked_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Button clicked\n");
          +}
          +
          + +

          Using the Autorepeat Feature

          + +

          The autorepeat feature is enabled by default. It consists of calling the repeated signal when the user keeps the button pressed. This feature can be disabled with the elm_button_autorepeat_set() function. The autorepeat is configured with the following functions:

          +
            +
          • elm_button_autorepeat_initial_timeout_set(): to set the initial timeout before the autorepeat event is generated
          • +
          • elm_button_autorepeat_gap_timeout_set(): to set the interval between two autorepeat events
          • +
          + +

          Disable the autorepeat feature.

          +
          +elm_button_autorepeat_set(button, EINA_FALSE);
          +
          + +

          Enable the autorepeat feature.

          +
          +elm_button_autorepeat_set(button, EINA_TRUE);
          +
          + +

          Set the initial timeout to five seconds.

          +
          +elm_button_autorepeat_initial_timeout_set(button, 5.0);
          +
          + +

          Set the gap between two signals to 0.5 seconds.

          +
          +elm_button_autorepeat_gap_timeout_set(button, 0.5);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_check_mn.htm b/org.tizen.ui.practices/html/native/efl/component_check_mn.htm new file mode 100644 index 0000000..f4eddcb --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_check_mn.htm @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + Check + + + + + + +
          +

          Check

          + +

          This feature is supported in mobile applications only.

          + + +

          The check component is similar to the radio component, except that it does not work as a group. It toggles the value of a boolean between true and false.

          + +

          This UI component inherits from the layout component. All layout functions can be used on the check component.

          + + +

          Figure: Check component

          +

          Check component

          + +

          Figure: Check hierarchy

          +

          Check hierarchy

          + +

          Adding a Check Component

          + +

          The following example shows how to create a check component.

          + +
          +Evas_Object *check, *parent;
          +check = elm_check_add(parent);
          +
          + +

          Modifying the Check Styles

          + +

          The check component style can be set with the elm_object_style_set() function. The following styles are available:

          +
            +
          • default
          • +
          • favorite
          • +
          • on and off
          • +
          + +

          The following example sets the favorite style on our check object.

          +
          +elm_object_style_set(check, "favorite");
          +
          + +

          To get the current style, use the elm_object_style_get() function.

          +
          +char *style = elm_object_style_get(check);
          +
          + +

          Using the Check Component

          + +

          After having created a check object, it is possible to set its boolean value to EINA_TRUE.

          +
          +elm_check_state_set(check, EINA_TRUE);
          +
          + +

          You can also retrieve the current value of the check object.

          +
          +Eina_Bool value = elm_check_state_get(check);
          +
          + +

          As with a radio object, an icon and a label can be set.

          +
          +// Create a Home icon 
          +Evas_Object *icon;
          +
          +icon = elm_icon_add(parent);
          +elm_icon_standard_set(icon, "home");
          +
          +// Set it to the check object 
          +elm_object_part_content_set(check, "icon", icon);
          +
          +// Set the check label 
          +elm_object_text_set(check, "Check label");
          +
          + +

          You can also modify the on and off labels.

          + +
          +elm_object_part_text_set(check, "on", "True");
          +elm_object_part_text_set(check, "off", "False");
          +
          + +

          The get functions of the elementary object API can be used to retrieve the content set to the check object.

          + +
          +// Get the current set text of the check label 
          +char *text = elm_object_text_get(check);
          +
          +// Get the content set in the icon part 
          +Evas_Object *icon = elm_object_part_content_get(check, "icon");
          +
          + +

          Using the Check Callbacks

          + +

          When the value is changed by the user, the changed signal is emitted. The event_info parameter is NULL.

          + +

          The following example shows how to register a callback on this signal.

          +
          +{
          +   evas_object_smart_callback_add(check, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the check value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_check_wn.htm b/org.tizen.ui.practices/html/native/efl/component_check_wn.htm new file mode 100644 index 0000000..9a5f515 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_check_wn.htm @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + Check + + + + + + +
          +

          Check

          + +

          This feature is supported in wearable applications only.

          + +

          The check component is similar to the radio component, except that it does not work as a group. It toggles the value of a boolean between true and false.

          + +

          This UI component inherits from the layout component. All layout functions can be used on the check component.

          + + +

          Figure: Check component

          +

          Check component

          + +

          Figure: Check hierarchy

          +

          Check hierarchy

          + +

          Adding a Check Component

          + +

          The following example shows how to create a check component.

          +
          +Evas_Object *check, *parent;
          +check = elm_check_add(parent);
          +
          + +

          Modifying the Check Styles

          + +

          The check component style can be set with the elm_object_style_set() function.

          +

          The following styles are available for the rectangular UI component:

          +
            +
          • default
          • +
          • on and off
          • +
          +

          The following styles are available for the circular UI component:

          +
            +
          • default
          • +
          • small
          • +
          • on and off
          • +
          + +

          The following example sets the on and off style on our check object.

          +
          +elm_object_style_set(check, "on and off");
          +
          + +

          To get the current style, use the elm_object_style_get() function.

          +
          +char *style = elm_object_style_get(check);
          +
          + +

          Using the Check Component

          + +

          After having created a check object, it is possible to set its boolean value to EINA_TRUE.

          +
          +elm_check_state_set(check, EINA_TRUE);
          +
          + +

          You can also retrieve the current value of the check object.

          +
          +Eina_Bool value = elm_check_state_get(check);
          +
          + +

          As with a radio object, an icon can be set for the rectangular UI component.

          +
          +// Create a Home icon 
          +Evas_Object *icon;
          +
          +icon = elm_icon_add(parent);
          +elm_icon_standard_set(icon, "home");
          +
          +// Set it to the check object 
          +elm_object_part_content_set(check, "icon", icon);
          +
          + +

          The get functions of the elementary object API can be used to retrieve the content set to the check object.

          +
          +// Get the content set in the icon part 
          +Evas_Object *icon = elm_object_part_content_get(check, "icon");
          +
          + +

          Using the Check Callbacks

          + +

          When the value is changed by the user, the changed signal is emitted. The event_info parameter is NULL.

          + +

          The following example shows how to register a callback on this signal.

          + +
          +{
          +   evas_object_smart_callback_add(check, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the check value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_datetime_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_datetime_wn.htm new file mode 100644 index 0000000..90e1621 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_datetime_wn.htm @@ -0,0 +1,116 @@ + + + + + + + + + + + + + Circle Datetime + + + + + +
          +

          Circle Datetime

          + +

          This feature is supported in wearable applications only.

          + +

          The circle datetime extends elm_datetime by visualizing the selected field. If a rotary event is activated by eext_rotary_object_event_activated_set(), a circle datetime increases or decreases value of selected field in elm_datetime by the clockwise or counter clockwise rotary event.

          + +

          Figure: Circle Datetime

          +

          Circle Datetime

          + +

          Creating a Circle Datetime

          + +

          You can use the eext_circle_object_datetime_add() function to create a circle object. When creating a circle datetime, the elm_datetime handle must be passed as an argument. If a circle surface is passed as an argument, a circle object connected with a circle surface is created, and it is rendered by the circle surface. When NULL is passed as a surface argument, the new circle object is managed and rendered by itself.

          +
          +Evas_Object *datetime;
          +Evas_Object *circle_datetime;
          +
          +datetime = elm_datetime_add(parent);
          +circle_datetime = eext_circle_object_datetime_add(datetime, surface);
          +
          + +

          Activating a Rotary Event

          + +

          You can activate and deactivate the circle datetime by using the eext_rotary_object_event_activated_set() function. If the second parameter is EINA_TRUE, the circle datetime can receive the rotary event. Otherwise, the circle datetime cannot receive the rotary event.

          +
          +eext_rotary_object_event_activated_set(circle_datetime, EINA_TRUE);
          +
          + +

          Using the Circle Object Property

          + +

          A circle datetime has the following styles:

          +
            +
          • default
          • +
          +

          When created, the circle datetime has default style automatically.

          + +

          The circle datetime objects support the following circle object API calls:

          +
            +
          • eext_circle_object_line_width_set()
          • +
          • eext_circle_object_line_width_get()
          • +
          • eext_circle_object_radius_set()
          • +
          • eext_circle_object_radius_get()
          • +
          • eext_circle_object_color_set()
          • +
          • eext_circle_object_color_get()
          • +
          • eext_circle_object_disabled_set()
          • +
          • eext_circle_object_disabled_get()
          • +
          +

          A circle datetime has the following item:

          +
            +
          • default: Default circle item that draws a marker.
          • +
          + +

          You can change the properties of the items by using the eext_circle_object_item* APIs.

          +

          For more information, see the Efl Extension Circle Datetime API.

          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_genlist_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_genlist_wn.htm new file mode 100644 index 0000000..12a5ddf --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_genlist_wn.htm @@ -0,0 +1,126 @@ + + + + + + + + + + + + + Circle Genlist + + + + + +
          +

          Circle Genlist

          + +

          This feature is supported in wearable applications only.

          + +

          Use the circle genlist to visualize and utilize the scroll effect for elm_genlist. While elm_genlist provides a scrollbar with straight horizontal and vertical movement, the circle genlist provides scrollbar with circular movement. It is also operated with rotary events to move to the next or previous item.

          + +

          Figure: Circle Genlist

          +

          Circle Genlist

          + +

          Creating a Circle Genlist

          + +

          A genlist and a surface are necessary when creating the circle genlist. The circle genlist is added with the eext_circle_object_genlist_add() function.

          +
          +Evas_Object *genlist, *circle_genlist, *parent;
          +
          +genlist = elm_genlist_add(parent);
          +circle_genlist = eext_circle_object_genlist_add(genlist, surface);
          +
          + +

          Configuring the Circle Genlist

          + +

          You can set the circle genlist scroller policy by using the eext_circle_object_genlist_scroller_policy_set() function.

          +
          +eext_circle_object_genlist_scroller_policy_set(circle_genlist, 
          +                                               ELM_SCROLLER_POLICY_OFF, 
          +                                               ELM_SCROLLER_POLICY_ON);
          +
          +

          This sets the scrollbar visibility policy of a given scroller. ELM_SCROLLER_POLICY_AUTO indicates the scrollbar is made visible if it is needed, and otherwise is kept hidden. ELM_SCROLLER_POLICY_ON turns the scrollbar on all the time, and ELM_SCROLLER_POLICY_OFF turns it off. This applies to the horizontal and vertical scrollbars respectively.

          +

          The following enum values are available for circle genlist.

          +
            +
          • ELM_SCROLLER_POLICY_AUTO
          • +
          • ELM_SCROLLER_POLICY_ON
          • +
          • ELM_SCROLLER_POLICY_OFF
          • +
          + +

          Activating a Rotary Event

          + +

          You can activate and deactivate the circle genlist by using the eext_rotary_object_event_activated_set() function. If the second parameter is EINA_TRUE, the circle genlist can receive the rotary event. Otherwise, the circle genlist cannot receive the rotary event.

          +
          +eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
          +
          + +

          Using the Circle Object Property

          + +

          Circle genlist objects support the following circle object API calls:

          +
            +
          • eext_circle_object_line_width_set()
          • +
          • eext_circle_object_line_width_get()
          • +
          • eext_circle_object_radius_set()
          • +
          • eext_circle_object_radius_get()
          • +
          • eext_circle_object_color_set()
          • +
          • eext_circle_object_color_get()
          • +
          • eext_circle_object_disabled_set()
          • +
          • eext_circle_object_disabled_get()
          • +
          +

          A circle genlist has the following item:

          +
            +
          • default: Default circle item. It draws vertical scroll bar.
          • +
          • vertical,scroll,bg: Vertical scroll background circle item.
          • +
          +

          You can change the properties of the items by using the eext_circle_object_item* APIs.

          +

          For more information, see the Efl Extension Circle Genlist API.

          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_object_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_object_wn.htm new file mode 100644 index 0000000..6132405 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_object_wn.htm @@ -0,0 +1,265 @@ + + + + + + + + + + + + + Circle Object + + + + + +
          +

          Circle Object

          + +

          This feature is supported in wearable applications only.

          + +

          A circle object extends elementary components in a form of circular design. Sometimes, a circle object merely provides additional UI features to elementary component, and sometimes it works as an independent component with UI and functionalities.

          + +

          Creating a Circle Object

          + +

          You can use the eext_circle_object_add() function to create a circle object. When creating a circle object, you can choose whether the circle object is rendered by itself or by the circle surface. If the circle surface is passed as an argument, a circle object connected with circle surface is created, and it is rendered by the circle surface.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +
          + +

          When NULL is passed as a surface argument, the new circle object is managed and rendered by itself. Here, a circle object without a circle surface is created and showed in a size of 360 x 360.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, NULL);
          +evas_object_size_hint_min_set(circle_obj, 360, 360);
          +evas_object_show(circle_obj);
          +
          + +

          Setting the Line Width

          + +

          You can set the line width of the circle object by using the eext_circle_object_line_width_set() function. Here, circle object with a surface is created and its line width set to 20. You can get the current line width of a circle object by using the eext_circle_object_line_width_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_line_width_set(circle_obj, 20);
          +
          + +

          You can set the line width of a certain item in a circle object by using the eext_circle_object_item_line_width_set() function. If the name of the item is passed as default, it works the same way as the eext_circle_object_line_width_set() function. Similar to the above example, a circle object with a surface is created and its line width is set to 20. You can get the current line width of the item by using the eext_circle_object_item_line_width_get() function.

          +
          Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_line_width_set(circle_obj, "default", 20);
          +
          + +

          Setting the Angle

          + +

          You can set the angle of the circle object by using the eext_circle_object_angle_set() function. Here, circle object with surface is created and its angle set to a 45.0 degree angle. You can get the current angle of a circle object by using the eext_circle_object_angle_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_angle_set(circle_obj, 45.0);
          +
          + +

          You can set the angle of a certain item in a circle object by using the eext_circle_object_item_angle_set() function. If name of the item is passed as default, it works the same way as eext_circle_object_angle_set() function. Similar to the above example, a circle object with surface is created and its angle is set to a 45.0 degree angle. You can get the current angle of the item by using the eext_circle_object_item_angle_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_angle_set(circle_obj, "default", 45.0);
          +
          + +

          Setting the Angle Offset

          + +

          You can set the angle offset of the circle object by using the eext_circle_object_angle_offset_set() function. Here, a circle object with a 45.0 degree angle is created and its angle offset set to 30.0 degrees. As a result, the circle object has an arch of 45.0 degree angle line starting from 30.0 degrees to 75.0 degrees. You can get the current angle offset of a circle object by using the eext_circle_object_angle_offset_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_angle_set(circle_obj, 45.0);
          +eext_circle_object_angle_offset_set(circle_obj, 30.0);
          +
          + +

          You can set the angle offset of a certain item in a circle object by using the eext_circle_object_item_angle_offset_set() function. If name of the item is passed as default, it works the same way as eext_circle_object_angle_offset_set() function. The following code works the same way as in the above example. You can get the current angle of the item by using the eext_circle_object_item_angle_offset_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_angle_set(circle_obj, "default", 45.0); 
          +eext_circle_object_item_angle_offset_set(circle_obj, "default", 30.0);
          +
          + +

          Setting the Minimum and Maximum Angle

          + +

          You can set the minimum and maximum angle of the circle object by using the eext_circle_object_angle_min_max_set() function. Here, a circle object with a surface is created and its minimum angle set to 0.0 degrees and maximum angle to 90.0 degrees. You can get the current minimum and maximum angle of the circle object by using the eext_circle_object_angle_min_max_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_angle_min_max_set(circle_obj, 0.0, 90.0);
          +
          + +

          You can set the minimum and maximum angles of a certain item in a circle object by using the eext_circle_object_item_angle_min_max_set() function. If name of the item is passed as default, it works the same way as the eext_circle_object_angle_min_max_set() function. Similar to the above example, a circle object with a minimum and maximum angles of 0.0 and 90.0 is created. You can get the current minimum and maximum angle of the item by using the eext_circle_object_item_angle_min_max_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_angle_min_max_set(circle_obj, "default", 0.0, 90.0);
          +
          + +

          Setting the Minimum and Maximum Value

          + +

          You can set the minimum and maximum values of the circle object by using the eext_circle_object_value_min_max_set() function. Here, a circle object with a surface is created and its minimum value is set to 0.0 degrees and maximum value to 10.0 degrees. You can get the current minimum and maximum value of the circle object by using the eext_circle_object_value_min_max_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_value_min_max_set(circle_obj, 0.0, 10.0);
          +
          + +

          You can set the value of a certain item in a circle object by using the eext_circle_object_item_angle_min_max_set() function. If name of the item is passed as default, it works the same way as the eext_circle_object_value_min_max_set() function. Similar to the above example, a circle object with a minimum and maximum value of 0.0 to 10.0 degrees is created. You can get the current minimum and maximum values of the item by using the eext_circle_object_item_value_min_max_get() function.

          +
           
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_value_min_max_set(circle_obj, "default", 0.0, 10.0);
          +
          + +

          Setting the Value

          + +

          You can set the value of the circle object by using the eext_circle_object_value_set() function. Here, a circle object with a surface is created and its value set to 5.0. You can get the current value of the circle object by using the eext_circle_object_value_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_value_set(circle_obj, 5.0);
          +
          + +

          You can set the value of a certain item in a circle object by using the eext_circle_object_item_value_set() function. If name of the item is passed as default, it works the same as the eext_circle_object_value_set() function. Similar to the above example, a circle object with a surface is created and its value is set to 5.0 degree angle. You can get the current value of the item by using the eext_circle_object_item_value_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_value_set(circle_obj, "default", 5.0);
          +
          + + + + + + + + + + +
          Note
          The value cannot be lower than the minimum value or higher than the maximum value.
          + +

          Setting the Color

          + +

          You can set the color of the circle object by using the eext_circle_object_color_set() function. To set the color, red, green, blue, and alpha values in range from 0 to 255 must be passed. Here, a circle object with a surface is created and its color set to blue. You can get the current color of circle object by using the eext_circle_object_color_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_color_set(circle_obj, 255, 0, 0, 255);
          +
          + +

          You can set the color of a certain item in a circle object by using the eext_circle_object_item_color_set() function. If name of the item is passed as default, it works the same way as the eext_circle_object_color_set() function. Similar to the above example, a circle object with a surface is created and its color is set to red. You can get the current color of the item by using the eext_circle_object_item_color_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_value_set(circle_obj, "default", 255, 0, 0, 255);
          +
          + +

          Setting the Radius

          + +

          You can set the radius of the circle object by using the eext_circle_object_radius_set() function. Here, a circle object with radius of 50.0 is created. You can get the current radius of the circle object by using the eext_circle_object_radius_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_radius_set(circle_obj, 50.0);
          +
          + +

          You can set the radius of a certain item in a circle object by using the eext_circle_object_item_radius_set() function. If name of the item is passed as default, it works the same way as the eext_circle_object_radius_set() function. Similar to the above example, a circle object with a radius of 50.0 is created. You can get the current radius of the item by using the eext_circle_object_item_radius_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_item_radius_set(circle_obj, "default", 50.0);
          +
          + +

          Disabling a Circle Object

          + +

          You can disable the circle object by using the eext_circle_object_disabled_set() function. Here, a circle object is disabled. You can get the current disabled status of circle object by using the eext_circle_object_disabled_get() function.

          +
          +Evas_Object *circle_obj;
          +
          +circle_obj = eext_circle_object_add(parent, surface);
          +eext_circle_object_disabled_set(circle_obj, EINA_TRUE);
          +
          + +

          You can enable a disabled circle object by using the eext_circle_object_disabled_set() function with EINA_FALSE argument.

          +
          +eext_circle_object_disabled_set(circle_obj, EINA_FALSE);
          +
          + + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_option_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_option_wn.htm new file mode 100644 index 0000000..a2730be --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_option_wn.htm @@ -0,0 +1,174 @@ + + + + + + + + + + + + + More Option + + + + + +
          +

          More Option

          + +

          This feature is supported in wearable applications only.

          + +

          The more option is one of the wearable circular UI components. The more option handle can use the elm_layout APIs, because the more option handle is an elm_layout object.

          + +

          The basic view of the more option is shown on the left in the following figure. It simply contains a cue button. When the cue button is clicked, the view including the selector appears from the cue location (shown on the right in the figure).

          + +

          The selector can receive a rotary event, and can emit events when each item and selector are clicked. When the back motion is done in the selector view, the selector view disappears.

          + +

          Figure: More Option

          +

          More Option

          + +

          Adding an Eext More Option Object

          +

          To create a more option object, use the eext_more_option_add() function:

          +
          +Evas_Object *more_option = NULL;
          +more_option = eext_more_option_add(parent);
          +
          + +

          Activating a Rotary Event

          + +

          You do not need to call the eext_rotary_object_event_activated_set() function for the more option object, since it is called automatically according to the elm_panel state.

          + +

          Configuring the More Option

          + +

          To configure the direction of the cue button, use the direction state, which has the following values:

          + +
          • EEXT_MORE_OPTION_DIRECTION_TOP: Cue button is at the top.
          • +
          • EEXT_MORE_OPTION_DIRECTION_BOTTOM: Cue button is at the bottom.
          • +
          • EEXT_MORE_OPTION_DIRECTION_LEFT: Cue button is on the left.
          • +
          • EEXT_MORE_OPTION_DIRECTION_RIGHT: Cue button is on the right (default value).
          + +

          To set the cue button direction for the more option:

          +
          +eext_more_option_direction_set(more_option, EEXT_MORE_OPTION_DIRECTION_RIGHT);
          +
          + +

          The following table shows the customizable more option parts.

          + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Customizable more option parts
          PartSetting functionView
          selector,main_texteext_more_option_item_part_text_set() +

          eext_more_option_item_domain_translatable_part_text_set()

          main_text

          selector,sub_texteext_more_option_item_part_text_set() +

          eext_more_option_item_domain_translatable_part_text_set()

          sub_text

          item,iconeext_more_option_item_part_content_set()

          Item content

          + +

          Adding a More Option Item

          + +

          To add an item, append it with the eext_more_option_item_append() function and set its attributes:

          + +
          +{
          +   Evas_Object *img = NULL;
          +   // Append item
          +   Eext_Object_Item *item  = eext_more_option_item_append(parent);
          +   // Set the text in the rotary_selector
          +   eext_more_option_item_part_text_set(item, "selector,main_text", "test1");
          +   eext_more_option_item_part_text_set(item, "selector,sub_text", "test1");
          +   // Set the content icon
          +   img = elm_image_add(parent);
          +   eext_more_option_item_part_content_set(item, "item,icon", img);
          +   elm_image_file_set(img, "/music_controller_btn_play.png", NULL);
          +}
          +
          + +

          Using the More Option Callbacks

          +

          The more option emits the following signals:

          + +
          • item,selected: User selected the item.
          • +
          • item,clicked: User selected the already selected item again or selected a selector.
          • +
          • more,option,opened: Layout with the rotary selector is shown..
          • +
          • more,option,closed: Layout with the rotary selector is hidden.
          + +

          For all these signals, the event_info parameter returned in the callback is NULL.

          + +

          To register and define a callback function called by the clicked signal:

          + +
          +{
          +   evas_object_smart_callback_add(more_option, “more,option,opened”, _opened_cb, data);
          +}
          +
          +// Callback function for the "more,option,opened" signal
          +// This callback is called when the more_option is seen
          +void 
          +_opened_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Open the More Option\n");
          +}
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_progressbar_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_progressbar_wn.htm new file mode 100644 index 0000000..41a7b9f --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_progressbar_wn.htm @@ -0,0 +1,117 @@ + + + + + + + + + + + + + Circle Progressbar + + + + + +
          +

          Circle Progressbar

          + +

          This feature is supported in wearable applications only.

          + +

          The circle progressbar aims to show the progress status of a given task with circular design. It visualizes the progress status within a range.

          + +

          Figure: Circle Progressbar

          +

          Circle Progressbar

          + +

          Creating a Circle Progressbar

          + +

          You can create the circle progressbar by using the eext_circle_object_progressbar_add() function. When creating the circle progressbar, a surface is necessary to render on the surface.

          +
          +Evas_Object *circle_progressbar, *parent;
          +circle_progressbar = eext_circle_object_progressbar_add(parent, surface);
          +
          + +

          Using the Circle Object Property

          +

          Circle progressbar supports the following circle object API calls:

          +
            +
          • eext_circle_object_value_min_max_set()
          • +
          • eext_circle_object_value_min_max_get()
          • +
          • eext_circle_object_value_set()
          • +
          • eext_circle_object_value_get()
          • +
          • eext_circle_object_angle_min_max_set()
          • +
          • eext_circle_object_angle_min_max_get()
          • +
          • eext_circle_object_angle_offset_set()
          • +
          • eext_circle_object_angle_offset_get()
          • +
          • eext_circle_object_angle_set()
          • +
          • eext_circle_object_angle_get()
          • +
          • eext_circle_object_line_width_set()
          • +
          • eext_circle_object_line_width_get()
          • +
          • eext_circle_object_radius_set()
          • +
          • eext_circle_object_radius_get()
          • +
          • eext_circle_object_color_set()
          • +
          • eext_circle_object_color_get()
          • +
          • eext_circle_object_disabled_set()
          • +
          • eext_circle_object_disabled_get()
          • +
          +

          A circle progressbar has the following items:

          +
            +
          • default: Default circle item that draws the progressbar.
          • +
          • bg: Progress bar background circle item.
          • +
          +

          You can change the properties of the items by using the eext_circle_object_item* APIs.

          +

          For more information, see the Efl Extension Circle Progressbar API.

          + +

          Configuring the Circle Progressbar

          + +

          Before using the circle progressbar, its minimum and maximum values are set with the eext_circle_object_value_min_max_set() function. The current value is set with eext_circle_object_value_set().

          +

          Here, the minimum value is set to 0.0, the maximum value to 100.0, and the current value to 3.0.

          +
          +eext_circle_object_value_min_max_set(circle_progressbar, 0.0, 100.0);
          +eext_circle_object_value_set(circle_progressbar, 3.0);
          +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_rotary_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_rotary_wn.htm new file mode 100644 index 0000000..3f2d039 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_rotary_wn.htm @@ -0,0 +1,239 @@ + + + + + + + + + + + + + Rotary Selector + + + + + +
          +

          Rotary Selector

          + +

          This feature is supported in wearable applications only.

          + +

          The rotary selector is optimized for wearable circular devices. It is composed of a selector and multiple items surrounding the selector. The rotary selector can be used to select an item or to move to the next or prev page through a rotary event.

          + +

          The rotary selector handle can use the elm_layout APIs, because the rotary selector handle is an elm_layout object.

          + +

          Figure: Rotary Selector

          +

          Rotary Selector

          + +

          Creating a Rotary Selector

          + +

          To create a rotary selector, use the eext_rotary_selector_add() function:

          +
          +Evas_Object *rotary_selector, *parent;
          +
          +Rotary_selector = eext_rotary_selector_add(parent);
          +
          + +

          Activating a Rotary Event

          +

          The rotary selector can be activated and deactivated by using the eext_rotary_object_event_activated_set() function. If the second parameter is set to EINA_TRUE, the created rotary selector can also receive a rotary event.

          +
          +eext_rotary_object_event_activated_set(rotary_selector, EINA_TRUE);
          +
          + +

          Configuring the Selector and Item State

          +

          You can configure the selector and item states:

          + +
          • The available selector states are: + +
            • EEXT_ROTARY_SELECTOR_SELECTOR_STATE_NORMAL: Selector is in a normal state.
            • +
            • EEXT_ROTARY_SELECTOR_SELECTOR_STATE_PRESSED: Selector is in a pressed state.
            + +

            For example, to set the selector color for a normal state selector:

            +
            +eext_rotary_selector_part_color_set(selector, "selector,bg_image", 
            +                                    EEXT_ROTARY_SELECTOR_SELECTOR_STATE_NORMAL, 
            +                                    100, 100, 100, 255);
            +
          • +
          • The available selector item states are: +
            • EEXT_ROTARY_SELECTOR_ITEM_STATE_NORMAL: Item is in a normal state.
            • +
            • EEXT_ROTARY_SELECTOR_ITEM_STATE_PRESSED: Item is in a pressed state.
            + +

            For example, to set the item color for a normal state item:

            +
            +eext_rotary_selector_item_part_color_set(item, "item,icon", 
            +                                         EEXT_ROTARY_SELECTOR_ITEM_STATE_NORMAL, 
            +                                         100, 100, 100, 255);
            +
          + +

          The following table shows the customizable rotary selector parts.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Customizable rotary selector parts
          PartSetting functionView
          selector,main_texteext_rotary_selector_item_part_color_set()

          main_text

          selector,sub_texteext_rotary_selector_item_part_color_set()

          sub_text

          item,icon +

          item,bg_image

          eext_rotary_selector_item_part_content_set() +

          eext_rotary_selector_item_part_color_set()

          Item content

          selector,icon +

          selector,content

          +

          selector,bg_image

          eext_rotary_selector_part_content_set() +

          eext_rotary_selector_part_color_set()

          +

          eext_rotary_selector_part_content_get()

          Selector content

          + +

          Setting the Rotary Selector Item Text

          + +

          The following table shows the functions you can use to set the main and sub text of an item. The text is displayed in the selector when the item is selected.

          + + + + + + + + + + + + + + + + + + + +
          Table: Item texts
          TextSetting functionView
          selector,main_texteext_rotary_selector_item_part_text_set() +

          eext_rotary_selector_item_domain_translatable_part_text_set()

          main_text

          selector,sub_texteext_rotary_selector_item_part_text_set() +

          eext_rotary_selector_item_domain_translatable_part_text_set()

          sub_text

          + +

          Adding a Rotary Selector Item

          + + + + + + + + + + +
          Note
          A maximum of 11 items can be displayed in one page of the rotary selector. Any exceeding items are arranged in the next page.
          + +

          To add an item, append it with the eext_rotary_selector_item_append() function and set its attributes:

          + +
          +Eext_Object_Item * item;
          +Evas_Object *image;
          +
          +// Append item
          +item = eext_rotary_selector_item_append(rotary_selector);
          +// Set item icon
          +image = elm_image_add(rotary_selector);
          +elm_image_file_set(image, "music_controller_btn_play.png", NULL);
          +
          +eext_rotary_selector_item_part_content_set(item, "item,icon", 
          +                                           EEXT_ROTARY_SELECTOR_ITEM_STATE_NORMAL, image);
          +// Set selector main text
          +eext_rotary_selector_item_part_text_set(item, "selector,main_text", "Options");
          +
          +// Set selector content icon
          +image = elm_image_add(rotary_selector);
          +elm_image_file_set(image, "music_controller_btn.png", NULL);
          +eext_rotary_selector_item_part_content_set(item, "selector,icon", 
          +                                           EEXT_ROTARY_SELECTOR_ITEM_STATE_NORMAL, image);
          +
          + +

          Using the Rotary Selector Callbacks

          +

          The rotary selector emits the following signals:

          + +
          • item,selected: User selected the item.
          • +
          • item,clicked: User clicked the item.
          + +

          For both signals, the event_info parameter returned in the callback is NULL.

          + +

          To register and define a callback function called by the clicked signal

          +
          +{
          +   evas_object_smart_callback_add(rotary_selector, "item,clicked", item_clicked_cb, data);
          +}
          +
          +// Callback function for the "item,clicked" signal
          +// This callback is called when the item is clicked by the user
          +void 
          +item_clicked_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Item clicked\n");
          +}
          +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_scroller_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_scroller_wn.htm new file mode 100644 index 0000000..68e3470 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_scroller_wn.htm @@ -0,0 +1,133 @@ + + + + + + + + + + + + + Circle Scroller + + + + + +
          +

          Circle Scroller

          + +

          This feature is supported in wearable applications only.

          + +

          The circle scroller changes corresponding to the rotary events. It shows the whole scrollable area with a circular scroll bar. It wraps the elm_scroller internally only to draw a circular scroll bar to the edge of the circular screen. This means you can use elm_scroller callbacks and APIs excluding elm_scroller_policy_set() and elm_scroller_policy_get() APIs.

          + +

          Figure: Circle Scroller

          +

          Circle Scroller

          + +

          Creating a Circle Scroller

          + +

          To create a circle scroller, use the eext_circle_object_scroller_add() function. elm_scroller has to be passed by the first parameter of this function.

          +
          +Evas_Object *scroller;
          +Evas_Object *circle_scroller;
          +
          +scroller = elm_scroller_add(parent);
          +circle_scroller = eext_circle_object_scroller_add(scroller, surface);
          +
          + +

          Activating a Rotary Event

          + +

          You can activate and deactivate the circle scroller by using the eext_rotary_object_event_activated_set() function. If the second parameter is EINA_TRUE, the circle scroller can receive the rotary event. Otherwise, the circle scroller cannot receive the rotary event.

          +
          +eext_rotary_object_event_activated_set(circle_scroller, EINA_TRUE);
          +
          + +

          Using the Circle Object Property

          + +

          A circle scroller has the following styles:

          +
            +
          • default
          • +
          +

          When created, the circle scroller has default style automatically.

          + +

          Circle scroller objects support the following circle object API calls:

          +
            +
          • eext_circle_object_line_width_set()
          • +
          • eext_circle_object_line_width_get()
          • +
          • eext_circle_object_radius_set()
          • +
          • eext_circle_object_radius_get()
          • +
          • eext_circle_object_color_set()
          • +
          • eext_circle_object_color_get()
          • +
          • eext_circle_object_disabled_set()
          • +
          • eext_circle_object_disabled_get()
          • +
          +

          A circle slider has the following items:

          +
            +
          • default: Default circle item that draws the vertical scroll bar.
          • +
          • vertical,scroll,bg: Vertical scroll background circle item.
          • +
          • horizontal,scroll,bar: Horizontal scroll bar circle item.
          • +
          • horizontal,scroll,bg : Horizontal scroll background circle item.
          • +
          +

          You can change the properties of the items by using the eext_circle_object_item* APIs.

          +

          For more information, see the Efl Extension Circle Scroller API.

          + +

          Configuring the Circle Scroller

          + +

          You can use elm_scroller APIs to configure a circle scroller, except elm_scroller_policy_set() and elm_scroller_policy_get() APIs.

          +

          Instead of excluded APIs, eext_circle_object_scroller_policy_set() and eext_circle_object_scroller_policy_get() functions are provided for the circle scroller.

          +

          A policy parameter has the following value.

          +
            +
          • ELM_SCROLLER_POLICY_AUTO: indicates the scrollbar is made visible if it is needed, and otherwise is kept hidden.
          • +
          • ELM_SCROLLER_POLICY_ON: Turns the scrollbar on all the time.
          • +
          • ELM_SCROLLER_POLICY_OFF: Turns the scrollbar off. This applies to the horizontal and vertical scrollbars respectively.
          • +
          +

          The following example shows how to set the scroll bar visibility policy to ELM_SCROLLER_POLICY_AUTO for horizontal scroll bar and ELM_SCROLLER_POLICY_OFF for vertical scroll bar.

          +
          +eext_circle_object_scroller_policy_set(circle_scroller, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
          +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_slider_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_slider_wn.htm new file mode 100644 index 0000000..eaa78d2 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_slider_wn.htm @@ -0,0 +1,164 @@ + + + + + + + + + + + + + Circle Slider + + + + + +
          +

          Circle Slider

          + +

          This feature is supported in wearable applications only.

          + +

          The circle slider changes corresponding to rotary events. The circle slider not only extends the UI feature of the elm_slider, but also replaces the functionalities of the elm_slider in a circular design.

          + +

          Figure: Circle Slider

          +

          Circle Slider

          + +

          Adding an Eext Slider Object

          + +

          To create a circle slider, use the eext_circle_object_slider_add() function.

          +
          +Evas_Object *circle_slider = NULL;
          +circle_slider = eext_circle_object_slider_add(parent, surface);
          +
          + +

          Activating a Rotary Event

          + +

          You can activate or deactivate the circle slider by using the eext_rotary_object_event_activated_set() function. If the second parameter is EINA_TRUE, the circle slider can receive the rotary event. Otherwise, the circle slider cannot receive the rotary event.

          +
          +eext_rotary_object_event_activated_set(circle_slider, EINA_TRUE);
          +
          + +

          Using the Circle Slider Property

          + +

          A circle slider has the following styles:

          +
            +
          • default
          • +
          + +

          When created, the circle slider has default style automatically.

          +

          Circle slider objects support the following circle object API calls:

          +
            +
          • eext_circle_object_value_min_max_set()
          • +
          • eext_circle_object_value_min_max_get()
          • +
          • eext_circle_object_value_set()
          • +
          • eext_circle_object_value_get()
          • +
          • eext_circle_object_angle_min_max_set()
          • +
          • eext_circle_object_angle_min_max_get()
          • +
          • eext_circle_object_angle_offset_set()
          • +
          • eext_circle_object_angle_offset_get()
          • +
          • eext_circle_object_angle_set()
          • +
          • eext_circle_object_angle_get()
          • +
          • eext_circle_object_line_width_set()
          • +
          • eext_circle_object_line_width_get()
          • +
          • eext_circle_object_radius_set()
          • +
          • eext_circle_object_radius_get()
          • +
          • eext_circle_object_color_set()
          • +
          • eext_circle_object_color_get()
          • +
          • eext_circle_object_disabled_set()
          • +
          • eext_circle_object_disabled_get()
          • +
          +

          A circle slider has the following items:

          +
            +
          • default: Default circle item, It draws slider bar.
          • +
          • bg: Background circle item.
          • +
          +

          You can change the properties of the items by using eext_circle_object_item* APIs.

          +

          For more information, see the Efl Extension Circle Slider API.

          + +

          Configuring the Circle Slider

          + +

          The circle slider step value is used when the rotary event increases or decreases the circle slider value. It can be set with the eext_circle_object_slider_step_set() function.

          +

          Here, the step value is set to 0.5.

          +
          +eext_circle_object_slider_step_set(circle_slider, 0.5);
          +
          +

          Before using the circle slider, its minimum and maximum values are set with eext_circle_object_value_min_max_set(). The current value is set with eext_circle_object_value_set().

          +

          Here, the minimum value is set to 0.0, the maximum value to 15.0, and the current value to 3.0.

          +
          +eext_circle_object_value_min_max_set(circle_slider, 0.0, 15.0);
          +eext_circle_object_value_set(circle_slider, 3.0);
          +
          +

          You can retrieve the current value of the circle slider with the eext_circle_object_value_get() function.

          +
          +double value = eext_circle_object_value_get(circle_slider);
          +
          + +

          Using Circle Slider Callbacks

          + +

          The circle slider emits the following signal:

          +
            +
          • value,changed: The rotary event changes the circle slider value.
          • +
          +

          For this signal, event_info is NULL.

          +

          This is how to register a callback on the value,changed signal.

          +
          +{
          +   evas_object_smart_callback_add(slider, "value,changed", _value_changed_cb, data);
          +}
          +
          +// Callback function for the "value,changed" signal
          +// This callback is called when a value of the circle slider is changed
          +static void
          +_value_changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Circle slider value changed. \n");
          +}
          +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_spinner_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_spinner_wn.htm new file mode 100644 index 0000000..f7d2cf4 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_spinner_wn.htm @@ -0,0 +1,117 @@ + + + + + + + + + + + + + Circle Spinner + + + + + +
          +

          Circle Spinner

          + +

          This feature is supported in wearable applications only.

          + +

          The circle spinner extends elm_spinner by visualizing the value of elm_spinner. If a rotary event is activated by the eext_rotary_object_event_activated_set() function, the circle spinner increases or decreases the value of elm_spinner through a clockwise or counter-clockwise rotary event.

          + +

          Figure: Circle Spinner

          +

          Circle Spinner

          + +

          Adding an Eext Spinner Object

          + +

          To create a circle spinner:

          +
          1. Create an elm_spinner object.
          2. +
          3. Set the object style as "circle".
          4. +
          5. Create an eext_spinner object using the eext_circle_object_spinner_add() function.
          + +
          +Evas_Object *spinner, *circle_spinner;
          +spinner = elm_spinner_add(parent);
          +elm_object_style_set(spinner, "circle");
          +circle_spinner = eext_circle_object_spinner_add(spinner, surface);
          +
          + +

          Activating a Rotary Event

          + +

          You can activate and deactivate the circle spinner by using the eext_rotary_object_event_activated_set() function. If its second parameter is set to EINA_TRUE, the circle spinner can receive rotary events.

          +
          +eext_rotary_object_event_activated_set(circle_spinner, EINA_TRUE);
          +
          + +

          Configuring the Circle Spinner

          + +

          The circle spinner shows the elm_spinner value through a marker, which indicates the value in the round. It has internal minimum and maximum spinner values, and calculates the min and max angles in order to draw the marker. The current value of the circle spinner is calculated internally as well.

          + +

          To handle the circle spinner value, use the elm_spinner functions. They are synchronized automatically with the user values. You can also use the elm_spinner callback functions.

          + +

          If you want to customize the angle offset of the marker (not to follow the internally-calculated system value), use the eext_circle_object_spinner_angle_set() function. For example, to set the circle spinner angle value with 2.0:

          +
          +eext_circle_object_spinner_angle_set(circle_spinner, 2.0);
          +
          + +

          The formula for calculating the default angle offset of the circle spinner is:

          +
          (360/ max - min) * step
          +

          After calling the eext_circle_object_spinner_angle_set() function, the calculation formula for the angle offset is changed:

          +
          (360/ max - min) * step * 2.0
          + +

          You can also use the same above function to give the angle offset per each rotary callback.

          + +

          Using the Circle Spinner Properties

          + +

          A circle spinner has the default style, which is applied automatically. It also has a default item, which draws a marker.

          + +

          You can set and get various circle spinner properties with circle object functions, such as eext_circle_object_value_min_max_set(), eext_circle_object_value_min_max_get(), eext_circle_object_value_set(), and eext_circle_object_value_get().

          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_circ_surface_wn.htm b/org.tizen.ui.practices/html/native/efl/component_circ_surface_wn.htm new file mode 100644 index 0000000..ea82de6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_circ_surface_wn.htm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + Circle Surface + + + + + +
          +

          Circle Surface

          + +

          This feature is supported in wearable applications only.

          + +

          The circle surface manages and renders circle objects. Multiple circle objects can be connected to one circle surface as candidates of an object to be rendered. When one of circle objects is set as visible, the surface renders the circle object and hides the others.

          + +

          Creating a Circle Surface

          + +

          To create a new circle surface:

          +
          +Eext_Circle_Surface *surface;
          +Evas_Object *conformant;
          +
          +conformant = elm_conformant_add(parent);
          +surface = eext_circle_surface_conformant_add(conformant);
          +
          + +

          The eext_circle_surface_conformant_add() function creates a circle surface in the conformant layer. If you want to create a circle surface in the layout layer, use the eext_circle_surface_layout_add() function:

          +
          +Eext_Circle_Surface *surface;
          +Evas_Object *layout;
          +
          +layout = elm_layout_add(parent);
          +surface = eext_circle_surface_layout_add(layout); 
          +
          + +

          If you want to create a circle surface in the naviframe layer, use the eext_circle_surface_naviframe_add() function:

          +
          +Eext_Circle_Surface *surface;
          +Evas_Object *naviframe;
          +
          +naviframe = elm_naviframe_add(parent);
          +surface = eext_circle_surface_naviframe_add(naviframe); 
          +
          + + + + + + + + + + +
          Note
          A circle surface is a non-graphical object. It adds no graphics to or around the objects it holds.
          + +

          Adding Circle Objects to the Circle Surface

          + +

          You can add any circle object to a circle surface. The following example shows how to create an eext_slider component and add it to a circle surface in conformant layer:

          +
          +Eext_Circle_Surface *surface;
          +Evas_Object *slider;
          +
          +surface = eext_circle_surface_conformant_add(conformant);
          +slider = eext_circle_object_slider_add(parent, surface);
          +
          + +

          Deleting the Circle Surface

          + +

          Deleting an Evas object automatically deletes the circle surface in the same layer. However, you can explicitly use the eext_circle_surface_del() function to delete a circle surface.

          +
          +eext_circle_surface_del(surface);
          +
          + + + + + + + + + + +
          Note
          The eext_circle_surface_del() function does not delete the connected circle objects.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_colorselector_mn.htm b/org.tizen.ui.practices/html/native/efl/component_colorselector_mn.htm new file mode 100644 index 0000000..3ddb0af --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_colorselector_mn.htm @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + Colorselector + + + + + + +
          +

          Colorselector

          + +

          This feature is supported in mobile applications only.

          + +

          The colorselector component provides a color selection solution to the user. There are different modes available, each of them showing a different configuration of the colorselector component.

          + +

          Currently only the Palette mode is available in Tizen.

          +
            +
          • ELM_COLORSELECTOR_PALETTE
          • +
          + +

          The Palette mode displays several color items that enable the user to choose a color in the items displayed. It is possible to add new items, or to update the color of the current item. The list of color items is called a palette, and it is associated with a unique identifier. This enables the developers to create new series of colors (a new palette) and save it under another identifier. By default, the color palette is using the default identifier.

          + +

          This UI component inherits from the layout component, so all functions concerning the layout component can also be used on the colorselector component.

          + + +

          Figure: Colorselector component

          +

          Colorselector component

          + +

          Figure: Colorselector hierarchy

          +

          Colorselector hierarchy

          + +

          Adding a Colorselector Component

          + +

          The following example shows how to create a colorselector object.

          + +
          +Evas_Object *colorsel, *parent;
          +
          +colorsel = elm_colorselector_add(parent);
          +
          + +

          Setting the Colorselector Modes

          + +

          The following example shows how to set the mode of the colorselector to the palette mode.

          + +
          +elm_colorselector_mode_set(colorsel, ELM_COLORSELECTOR_PALETTE);
          +
          + +

          The following example shows how to create a new palette called mypalette. This new palette is saved by elementary config and you can to load it again later. You then add three colors in mypalette: red, green, and blue.

          + +
          +elm_colorselector_palette_name_set(colorsel, "mypalette");
          +elm_colorselector_palette_color_add(colorsel, 255, 0, 0, 255);
          +elm_colorselector_palette_color_add(colorsel, 0, 255, 0, 255);
          +elm_colorselector_palette_color_add(colorsel, 0, 0, 255, 255);
          +
          + +

          The default palette already contains 14 colors.

          + +
          +elm_colorselector_palette_name_set(colorsel, "default");
          +
          + +

          When the user clicks on the color elements, the element changes the color that is set to the colorselector component. You can use the following function to retrieve the current selected color.

          +
          +int r, g, b, a;
          +
          +elm_colorselector_color_get(colorsel, &r, &g, &b, &a);
          +
          + +

          Using the Colorselector Callbacks

          + +

          You can register callbacks on the following signals:

          + +
            +
          • changed - The color value changes on the selector. event_info is NULL.
          • +
          • color,item,selected - The user clicks on a color item. The event_info parameter of the callback is the selected color item.
          • +
          • color,item,longpressed - The user long presses on a color item. The event_info parameter of the callback contains the selected color item.
          • +
          + +

          The following example shows how to register a callback on the changed signal.

          +
          +{
          +   evas_object_smart_callback_add(colorselector, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the colorselector value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The color has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_ctxpopup_mn.htm b/org.tizen.ui.practices/html/native/efl/component_ctxpopup_mn.htm new file mode 100644 index 0000000..c9fbc12 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_ctxpopup_mn.htm @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + Ctxpopup + + + + + + +
          +

          Ctxpopup

          + +

          This feature is supported in mobile applications only.

          + +

          Ctxpopup is a contextual popup that can show a list of items.

          + +

          Figure: Context popup component

          +

          Context popup component

          + +

          Figure: Context popup hierarchy

          +

          Context popup hierarchy

          + +

          Adding a Ctxpopup Component

          + +

          A ctxpopup can be created with the elm_ctxpopup_add() function, and when shown, it automatically chooses an area inside its parent object's view (set using elm_ctxpopup_hover_parent_set()) to optimally fit into it.

          + +
          +Evas_Object *ctxpopup, *parent;
          +
          +// Create a ctxpopup 
          +ctxpopup = elm_ctxpopup_add(parent);
          +
          + +

          Modifying the Ctxpopup Style

          + +

          The following styles are available:

          + +
            +
          • dropdown/list
          • +
          • dropdown/label
          • +
          • more/default
          • +
          + +

          Figure: Context popup more/default style

          +

          Context popup more/default style

          + +

          Figure: Context popup dropdown/list

          +

          Context popup dropdown/list

          + +

          Figure: Context popup dropdown/label

          +

          Context popup dropdown/label

          + +

          The following example shows how to set the more/default style.

          + +
          +elm_object_style_set(ctxpopup, "more/default");
          +
          + +

          Configuring the Ctxpopup

          + +

          The context popup orientation can be set with elm_ctxpopup_horizontal_set(). Here it is set to horizontal.

          +
          +elm_ctxpopup_horizontal_set(ctxpopup, EINA_TRUE);
          +
          + +

          Auto hide is enabled by default. You can also disable auto hiding if you want the ctxpopup never to be hidden.

          +
          +elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
          +
          + +

          Managing the Ctxpopup Items

          + +

          The ctxpopup can contain a small number of items. Each of them can have a label and an icon. The following example shows how to append an item with the Test label and no icon.

          +
          +Elm_Object_Item *it;
          +
          +it = elm_ctxpopup_item_append(ctxpopup, "test", NULL, _ctxpopup_item_cb,
          +                  NULL);
          +
          + +

          The _ctxpopup_item_cb() callback is called when the item is clicked. The following example shows how to write the definition of this callback.

          +
          +static void
          +_ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "ctxpopup item selected\n");
          +}
          +
          + +

          After that the item label is set to New label.

          + +
          elm_object_item_part_text_set(it, "default", "New label");
          +
          + +

          And its icon is modified to the standard home icon.

          + +
          +Evas_Object *home_icon = elm_icon_add(ctxpopup);
          +elm_icon_standard_set(home_icon, "home");
          +
          +elm_object_item_part_content_set(it, "icon", home_icon);
          +
          + +

          Using the Ctxpopup Callbacks

          + +

          The context popup emits the dismissed signal when it is dismissed. You can register a callback to this signal. The event_info parameter is NULL.

          + +
          +{
          +   evas_object_smart_callback_add(ctxpopup, "dismissed", dismissed_cb, data);
          +}
          +
          +// Callback function for the "dismissed" signal
          +// This callback is called when the ctxpopup is dismissed
          +void dismissed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Ctxpopup dismissed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_ctxpopup_wn.htm b/org.tizen.ui.practices/html/native/efl/component_ctxpopup_wn.htm new file mode 100644 index 0000000..d371cd0 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_ctxpopup_wn.htm @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + Ctxpopup + + + + + + +
          +

          Ctxpopup

          + +

          This feature is supported in wearable applications only.

          + +

          Ctxpopup is a contextual popup that can show a list of items.

          + +

          Figure: Context popup component

          +

          Context popup component

          + +

          Figure: Context popup hierarchy

          +

          Context popup hierarchy

          + +

          Adding a Ctxpopup Component

          + +

          A ctxpopup can be created with the elm_ctxpopup_add() function, and when shown, it automatically chooses an area inside its parent object's view (set using elm_ctxpopup_hover_parent_set()) to optimally fit into it.

          + +
          +Evas_Object *ctxpopup, *parent;
          +
          +// Create a ctxpopup 
          +ctxpopup = elm_ctxpopup_add(parent);
          +
          + +

          Modifying the Ctxpopup Style

          + +

          The following styles are available for the rectangular UI component:

          +
            +
          • default
          • +
          +

          The following styles are available for the circular UI component:

          +
            +
          • select_mode
          • +
          • select_mode/top, select_mode/bottom (These two styles can be used as a pair.)
          • +
          + + +

          The following example shows how to set the default style.

          +
          +elm_object_style_set(ctxpopup, "default");
          +
          + +

          Configuring the Ctxpopup

          + +

          The context popup orientation can be set with elm_ctxpopup_horizontal_set(). Here it is set to horizontal.

          +
          +elm_ctxpopup_horizontal_set(ctxpopup, EINA_TRUE);
          +
          + +

          Auto hide is enabled by default. You can also disable auto hiding if you want the ctxpopup never to be hidden.

          +
          +elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
          +
          + +

          Managing the Ctxpopup Items

          + +

          The ctxpopup can contain a small number of items. Each of them can have a label and an icon. The following example shows how to append an item with the Test label and no icon.

          +
          +Elm_Object_Item *it;
          +
          +it = elm_ctxpopup_item_append(ctxpopup, "test", NULL, _ctxpopup_item_cb, 
          +                  NULL);
          +
          + +

          The _ctxpopup_item_cb() callback is called when the item is clicked. The following example shows how to write the definition of this callback.

          +
          +static void
          +_ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "ctxpopup item selected\n");
          +}
          +
          + +

          After that the item label is set to New label.

          +
          elm_object_item_part_text_set(it, "default", "New label");
          +
          + +

          And its icon is modified to the standard home icon.

          +
          +Evas_Object *home_icon = elm_icon_add(ctxpopup);
          +elm_icon_standard_set(home_icon, "home");
          +
          +elm_object_item_part_content_set(it, "icon", home_icon);
          +
          + +

          Using the Ctxpopup Callbacks

          + +

          The context popup emits the dismissed signal when it is dismissed. You can register a callback to this signal. The event_info parameter is NULL.

          + +
          +{
          +   evas_object_smart_callback_add(ctxpopup, "dismissed", dismissed_cb, data);
          +}
          +
          +// Callback function for the "dismissed" signal
          +// This callback is called when the ctxpopup is dismissed
          +void dismissed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Ctxpopup dismissed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_custom_n.htm b/org.tizen.ui.practices/html/native/efl/component_custom_n.htm new file mode 100644 index 0000000..477f0ab --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_custom_n.htm @@ -0,0 +1,560 @@ + + + + + + + + + + + + + Customizing Components + + + + + +
          + +

          Customizing Components

          + + +

          Elementary UI components use the Edje library EDC themes to manage their look.

          + +

          Elementary Theme

          + +

          An Elementary theme is an Edje EDC file that contains groups composed of parts and programs. For more information about Edje, see Theme.

          + +

          Using Theme Styles

          + +

          Elementary UI components provide a way to modify only some parts of the styles using the default theme. A style is a part of the EDC theme (a group) that concerns only one UI component. For example, you can create a new style for a button component to change its appearance without modifying the default theme.

          + + + + + + + + + + +
          Note
          When creating a new style, knowledge of how each UI component is themed is required, because setting another style always replaces the entire group used by the UI component. Important signals and parts must be there for the object to behave properly.
          + +

          When several styles are loaded in the current theme, you can set a different style to a specific UI component using the elm_object_style_set() function. It is also possible to see the current style with the elm_object_style_get() function.

          + +

          The default theme specifies several styles for the button component. The code below shows how to set the "anchor" style of a newly created button component.

          + +
          +Evas_Object *parent, *button;
          +
          +// Create a button object 
          +button = elm_button_add(parent);
          +
          +// Set its style to "anchor""
          +elm_object_style_set(button, "anchor");
          +
          + +

          Loading Theme Styles

          + +

          Once written and compiled with Edje tools, the Elementary provides two methods to load the style in the application theme:

          +
            +
          • overlays
          • +
          • extensions
          • +
          + +

          When looking for a theme, the Elementary checks the list of overlays, if any are defined. Then it takes the default theme, and if it cannot find a theme for the UI component, it looks at the extensions list.

          + +

          Overlay

          + +

          An overlay can replace the look of all UI components by overriding the default style. If we create a new style called "default" for the button component and add it as an overlay, the Elementary uses the overlay for all button components overriding the default theme.

          + +

          Here is how to add an overlay to your application's theme.

          + +
          +elm_theme_overlay_add(NULL, "./theme_button.edj");
          +
          + + + + + + + + + + +
          Note
          Here we assume that the "theme_button.edj" file only contains a new theme for the button component.
          + + + + + + + + + + +
          Note
          Doing this is not recommended. Adding a file as an overlay makes the Elementary use the new theme for all the button components defined in the application. You must make sure that the "theme_button.edj" file reimplements everything that was previously defined in the default theme concerning the button component.
          + +

          This is how to remove the previously added overlay to return to the default theme.

          + +
          +elm_theme_overlay_del(NULL, "./theme_button.edj");
          +
          + +

          Extension

          + +

          With extensions, we can write styles that we can apply to some UI components (not all of them) by using the elm_object_style_set() function.

          + +

          The application adds a theme to the list of extensions with the following call.

          + +
          +elm_theme_extension_add(NULL, "./theme_button_style_custom.edj");
          +
          + + + + + + + + + + +
          Note
          Here we assume that the "theme_button_style_custom.edj" file contains a new button style called "custom".
          + +

          This is how to use the new "custom" style on a button component.

          + +
          +Evas_Object *parent, *button;
          +
          +// Create a button object 
          +button = elm_button_add(parent);
          +
          +// Set its style to "custom" 
          +elm_object_style_set(button, "custom");
          +
          + + + + + + + + + + +
          Note
          When using elm_theme_extension_add or elm_theme_overlay_add to add a new theme extension or overlay to a Theme object (here called the default theme), the Elementary calls the elm_theme_flush function to flush Elementary theme caches. Thus, the theme of all UI components that use the default theme is reloaded.
          + +

          Creating a New Theme

          + +

          This is how to create a new theme object.

          + +
          +Elm_Theme *new_theme = elm_theme_new();
          +
          + +

          This function creates an empty specific theme that only uses the default theme. It has its own private set of extensions and overlays (which are empty by default). Specific themes do not fall back to the themes of parent objects. They are not intended for this use.

          + +

          This is how to apply this theme to a UI component and its children (a button, for example).

          + +
          +// Create a button component 
          +Evas_Object *button = elm_button_add();
          +
          +// Set the new theme to the button component 
          +elm_object_theme_set(button, new_theme);
          +
          + +

          Customizing a UI Component Style

          + +

          UI component themes are written in Edje EDC source files (.edc). These files are compiled with Edje tools to make an .edj file that is used by the application. For more information on using the EDC language, see Theme.

          + +

          A new Edje style can be added for a UI component. The best way is to copy the existing "default" style, rename it, and update it to your needs.

          + +

          Creating a Customized Style for the Check Component

          + +

          As an example, we show how to create a new style for the check component. The aim is to update the background and the main pictures of this UI component with custom pictures.

          + +

          The EDC source file concerning the check component (check.edc file) is composed of several groups.

          + +
          +group 
          +{
          +   name: "elm/check/base/default";
          +}
          +
          +group 
          +{
          +   name: "elm/check/base/toggle";
          +}
          +
          + +

          Those two groups define two different styles for the check component (the "default" style and the "toggle" style).

          + +

          We copy the group corresponding to the "default" style in a new file to create a new style called "custom". This new style is saved in the "check_custom.edc" file.

          + +
          +group 
          +{
          +   name: "elm/check/base/custom";
          +   // Here is the copy of the content of "default" style 
          +}
          +
          + +

          In the new group ("elm/check/base/custom"), we have to find the parts we want to modify. Here, the appropriate parts are "bg" and "check" parts.

          + +
          +part 
          +{
          +   name: "bg";
          +   mouse_events: 0;
          +   scale: 1;
          +   description 
          +   {
          +      state: "default" 0.0;
          +      rel1.offset: 1 1;
          +      rel2.relative: 0.0 1.0;
          +      rel2.offset: 1 -2;
          +      align: 0.0 0.5;
          +      min: 16 16;
          +      max: 16 16;
          +      aspect: 1.0 1.0;
          +      aspect_preference: VERTICAL;
          +      image 
          +      {
          +         normal: "check_base.png";
          +         border: 5 5 5 5;
          +         middle: 0;
          +      }
          +      fill.smooth: 0;
          +   }
          +}
          +part 
          +{
          +   name: "check";
          +   mouse_events: 0;
          +   scale: 1;
          +   description 
          +   { 
          +      state: "default" 0.0;
          +      rel1 
          +      {
          +         to: "bg";
          +         offset: 1 1;
          +      }
          +      rel2 
          +      {
          +         to: "bg";
          +         offset: -2 -2;
          +      }
          +      visible: 0;
          +      color: 255 255 255 255;
          +      image.normal: "check.png";
          +   }
          +   description 
          +   {
          +      state: "visible" 0.0;
          +      inherit: "default" 0.0;
          +      visible: 1;
          +   }
          +   description 
          +   {
          +      state: "disabled" 0.0;
          +      inherit: "default" 0.0;
          +      visible: 0;
          +      color: 128 128 128 128;
          +   }
          +   description 
          +   {
          +      state: "disabled_visible" 0.0;
          +      inherit: "default" 0.0;
          +      color: 128 128 128 128;
          +      visible: 1;
          +   }
          +}
          +
          + +

          We do not detail all the options that can be modified here, but assume that the user is familiar with Edje and knows Edje basics.

          + +

          Our custom pictures filenames are:

          +
            +
          • check_base_custom.png for the bg part
          • +
          • check_custom.png for the check part
          + +

          We must update the image.normal attribute in both parts with our custom pictures filenames to modify the pictures of this style.

          + +
          +part 
          +{
          +   name: "bg";   
          +   description 
          +   {
          +      state: "default" 0.0;
          +
          +      image 
          +      {
          +         normal: "check_base_custom.png";
          +         border: 5 5 5 5;
          +         middle: 0;
          +      }
          +                
          +   }
          +}
          +part 
          +{
          +   name: "check";
          +        
          +   description 
          +   {
          +      state: "default" 0.0;
          +            
          +      image.normal: "check_custom.png";
          +   }
          +        
          +}
          +
          + + + + + + + + + + +
          Note
          Here, we assume that the custom images are the same size as the "default" images.
          + +

          Adding the Theme File to Your Project

          + +

          Once written, the check_custom.edc file is put in the /res/edje/. directory of the application project in the SDK.

          + +

          When building the application, the SDK calls the Edje tools automatically to build the final check_custom.edj file. This file can be loaded from our application.

          + +

          Using the New Style

          + +

          This is how to add the new theme file as an extension in the application.

          + +
          +char edj_path[PATH_MAX] = {0, };
          +
          +// Get the full path of the edj file 
          +app_get_resource("/edje/check_custom.edj", edj_path, (int)PATH_MAX);
          +
          +// Load check custom style as an extension 
          +elm_theme_extension_add(NULL, edj_path);
          +
          + +

          Use the "custom" style on a new check component.

          + +
          +Evas_Object *parent, *check;
          +
          +// Create a check object 
          +check = elm_check_add(parent);
          +
          +// Set its style to "custom" 
          +elm_object_style_set(check, "custom");
          +
          + +

          Special Theme Parts

          + +

          Some parts of the EDC file can be interacted with the Elementary. The content of parts of the type TEXT are modified using the elm_object_part_set_text() function. The content of SWALLOW parts is updated using the elm_object_part_content_set() function.

          + +

          Swallow Parts

          + +

          In the previous example (the check component "default" style), there is a part called "elm.swallow.content" that is of the type SWALLOW.

          + +
          +part 
          +{
          +   name: "elm.swallow.content";
          +   type: SWALLOW;
          +   scale: 1;
          +   description 
          +   {
          +      state: "default" 0.0;
          +      fixed: 1 0;
          +      visible: 0;
          +      align: 0.0 0.5;
          +      rel1.to_x: "bg";
          +      rel1.relative: 1.0 0.0;
          +      rel1.offset: 1 1;
          +      rel2.to_x: "bg";
          +      rel2.offset: 1 -2;
          +      rel2.relative: 1.0 1.0;
          +   }
          +   description
          +   {
          +      state: "visible" 0.0;
          +      inherit: "default" 0.0;
          +      fixed: 1 0;
          +      visible: 1;
          +      aspect: 1.0 1.0;
          +      min: 16 16;
          +   }
          +   description 
          +   {
          +      state: "disabled" 0.0;
          +      inherit: "default" 0.0;
          +      color: 255 255 255 128;
          +   }
          +   description 
          +   {
          +      state: "disabled_visible" 0.0;
          +      inherit: "default" 0.0;
          +      color: 255 255 255 128;
          +      fixed: 1 0;
          +      visible: 1;
          +      aspect: 1.0 1.0;
          +   }
          +}
          +
          + +

          We can push content (Evas_Object) to this part from the application anytime. The size and position of the content pushed is controlled by the EDC theme.

          + +
          +Evas_Object *parent, *check1, *content;
          +
          +// Create a check object 
          +check1 = elm_check_add(parent);
          +
          +// Set the content of the check object 
          +elm_object_part_content_set(check1, "elm.swallow.content", content);
          +
          + + + + + + + + + + +
          Note
          We can add new SWALLOW parts when customizing a UI component's style, if we want to be able to control more content from the application. Note that removing existing SWALLOW parts changes the UI component's behavior.
          + +

          Text Parts

          + +

          The same is done with parts of the type TEXT. The check "default" style contains a part named "elm.text".

          + +
          +part 
          +{
          +   name: "elm.text";
          +   type: TEXT;
          +   mouse_events: 0;
          +   scale: 1;
          +   description
          +   {
          +      state: "default" 0.0;
          +      visible: 0;
          +      rel1.to_x: "elm.swallow.content";
          +      rel1.relative: 1.0 0.0;
          +      rel1.offset: 1 1;
          +      rel2.relative: 1.0 1.0;
          +      rel2.offset: -2 -2;
          +      color: 0 0 0 255;
          +      text 
          +      {
          +         font: "Sans,Edje-Vera";
          +         size: 10;
          +         min: 0 1;
          +         align: -1.0 0.5;
          +      }
          +   }
          +   description
          +   {
          +      state: "visible" 0.0;
          +      inherit: "default" 0.0;
          +      visible: 1;
          +      text.min: 1 1;
          +   }
          +   description 
          +   {
          +      state: "disabled" 0.0;
          +      inherit: "default" 0.0;
          +      color: 0 0 0 128;
          +      color3: 0 0 0 0;
          +   }
          +   description
          +   {
          +      state: "disabled_visible" 0.0;
          +      inherit: "default" 0.0;
          +      color: 0 0 0 128;
          +      color3: 0 0 0 0;
          +      visible: 1;
          +      text.min: 1 1;
          +   }
          +}
          +
          + +

          This is how to modify the content of the "elm.text" part from the application. The position of the text, its size, color, look and feel are managed by the EDC theme.

          + +
          +Evas_Object *parent, *check2;
          +
          +// Create a check object 
          +check2 = elm_check_add(parent);
          +
          +// Set the text of the check object 
          +elm_object_part_text_set(check2, "elm.text", "Test text");
          +
          + + +

          For more details about customizing the look and feel of the UI components with custom styles, which are not provided as defaults, see the ThemeExtension sample.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm b/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm new file mode 100644 index 0000000..79d12e0 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + Datetime + + + + + + +
          +

          Datetime

          + +

          This feature is supported in mobile applications only.

          + +

          The datetime component displays and adds date and time values.

          + +

          Figure: Datetime selection

          +

          Datetime selection

          + +

          Figure: Datetime hierarchy

          +

          Datetime hierarchy

          + +

          Adding a Datetime Component

          + +

          The UI component is created with elm_datetime_add(). It is possible to select the visible fields with elm_datetime_field_visible_set(). The following fields can be controlled:

          +
            +
          • ELM_DATETIME_YEAR: the year field
          • +
          • ELM_DATETIME_MONTH: the month field
          • +
          • ELM_DATETIME_DATE: the date field
          • +
          • ELM_DATETIME_HOUR: the hour field
          • +
          • ELM_DATETIME_MINUTE: the minute field
          • +
          • ELM_DATETIME_AMPM: the AM/PM field
          • +
          + +

          The following example shows how to create a datetime component and set the HOUR and MINUTE fields visible.

          + +
          +Evas_Object *datetime, *parent;
          +
          +datetime = elm_datetime_add(parent);
          +
          +elm_datetime_field_visible_set(datetime, ELM_DATETIME_HOUR, EINA_TRUE);
          +elm_datetime_field_visible_set(datetime, ELM_DATETIME_MINUTE, EINA_TRUE);
          +
          +elm_datetime_field_visible_set(datetime, ELM_DATETIME_YEAR, EINA_FALSE);
          +elm_datetime_field_visible_set(datetime, ELM_DATETIME_MONTH, EINA_FALSE);
          +elm_datetime_field_visible_set(datetime, ELM_DATETIME_DATE, EINA_FALSE);
          +elm_datetime_field_visible_set(datetime, ELM_DATETIME_AMPM, EINA_FALSE);
          +
          + +

          Using the Datetime Styles

          + +

          The following styles are available:

          +
            +
          • date_layout
          • +
          • time_layout
          • +
          • time_layout_24h
          • +
          + +

          The following example creates the date_layout style:

          + +
          +elm_object_style_set(datetime, "date_layout");
          +
          + +

          Setting the Datetime Format

          + +

          The format of the date and time can be configured with elm_datetime_format_set() using a combination of allowed Libc date format specifiers. In the following example the format is set to HH : MM.

          + +
          +elm_datetime_format_set(datetime, "%H : %M");
          +
          + +

          Please refer to the API documentation for a complete list of all the options available.

          + +

          Using the Datetime Callbacks

          + +

          A callback can be registered on the changed signal to detect when the Datetime field values are changed. The event_info parameter is NULL.

          + +
          +{
          +   evas_object_smart_callback_add(datetime, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the datetime fields change
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Datetime field changed. \n");
          +}
          + +

          The language,changed signal is emitted when the system locale changes.

          + + +

          UX Issue in Tizen 2.3

          + +
            +
          • date_layout (default): Year, Month, Day
          • +
          • time_layout: Hour, Minute, AM/PM button
          • +
          • time_layout_24hr: Hour, Minute
          • +
          + +

          Basically, the elm_datetime component needs a full-length format that includes the Year, Month, Day, Hour, Minute, and AM/PM. Each style then shows specific fields according their style, limited by the UX concept. If you call the elm_datetime_field_visible_set() function for a field that is not supported in the style, it does not work.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_datetime_wn.htm b/org.tizen.ui.practices/html/native/efl/component_datetime_wn.htm new file mode 100644 index 0000000..ab58ada --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_datetime_wn.htm @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + Datetime + + + + + + +
          +

          Datetime

          + +

          This feature is supported in wearable applications only.

          + +

          The datetime component displays and adds date and time values.

          + + +

          Figure: Datetime selection

          +

          Datetime selection

          + +

          Figure: Datetime hierarchy

          +

          Datetime hierarchy

          + +

          Adding a Datetime Component

          + +

          The UI component is created with elm_datetime_add().

          +

          The following fields can be controlled:

          +
            +
          • ELM_DATETIME_YEAR: the year field
          • +
          • ELM_DATETIME_MONTH: the month field
          • +
          • ELM_DATETIME_DATE: the date field
          • +
          • ELM_DATETIME_HOUR: the hour field
          • +
          • ELM_DATETIME_MINUTE: the minute field
          • +
          • ELM_DATETIME_AMPM: the AM/PM field
          • +
          + +

          Using the Datetime Styles

          + +

          The following styles are available:

          +
            +
          • datepicker_layout
          • +
          • timepicker_layout
          • +
          + +

          The following example creates the datepicker_layout style:

          +
          +elm_object_style_set(datetime, "datepicker_layout");
          +
          + +

          Setting the Datetime Format

          + +

          The format of the date and time can be configured with elm_datetime_format_set() using a combination of allowed Libc date format specifiers. In the following example the format is set to HH : MM.

          +
          +elm_object_style_set(datetime, "timepicker_layout");
          +elm_datetime_format_set(datetime, "%d/%b/%Y%I:%M");
          +
          +

          Please refer to the API documentation for a complete list of all the options available.

          + +

          Using the Datetime Callbacks

          + +

          A callback can be registered on the changed signal to detect when the Datetime field values are changed. The event_info parameter is NULL.

          +
          +{
          +   evas_object_smart_callback_add(datetime, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the datetime fields change
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Datetime field changed. \n");
          +}
          + +

          The language,changed signal is emitted when the system locale changes.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_entry_mn.htm b/org.tizen.ui.practices/html/native/efl/component_entry_mn.htm new file mode 100644 index 0000000..201db3b --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_entry_mn.htm @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + Entry + + + + + + +
          +

          Entry

          + +

          This feature is supported in mobile applications only.

          + +

          The entry component is a box where the user can enter text. It supports the following features:

          +
            +
          • text wrapping
          • +
          • multiline
          • +
          • scrolling
          • +
          • formatted markup text
          • +
          • password mode
          • +
          • filtering text
          • +
          • read/write from a file
          • +
          • theme style overrides
          • +
          + +

          Figure: Entry component

          +

          Entry component

          + +

          Figure: Entry component

          +

          Entry component

          + +

          Figure: Entry hierarchy

          +

          Entry hierarchy

          + +

          Adding an Entry Component

          + +

          The entry component is created with the elm_entry_add() function, and the text inside the entry can be set with elm_entry_entry_set().

          + +
          +Evas_Object *entry, *parent;
          +
          +entry = elm_entry_add(parent);
          +elm_entry_entry_set(entry, "A short text.");
          +
          + +

          Using the Text Editor

          + +

          You can append text to the end of existing content.

          + +
          +elm_entry_entry_append(entry, "END");
          +
          + +

          You can also insert text at the current cursor position.

          + +
          +elm_entry_entry_insert(entry, "CURSOR");
          +Eina_Bool Empty = elm_entry_is_empty(entry);
          +
          + +

          Call elm_entry_is_empty() to see whether the entry is empty. Here, the boolean variable Empty returns EINA_FALSE.

          + +

          By default, the user can enter text in the entry component when it is in focus. It is possible to prevent the user from editing text if needed.

          + +
          +elm_entry_editable_set(entry, EINA_FALSE);
          +
          + + + + + + + + + + +
          Note
          It is still possible to use the previous functions to modify the text of a non-editable entry.
          + +

          Setting the Password Mode

          + +

          When dealing with password content, the password mode activates to hide what the user is typing. In this mode, the display of any text is replaced by asterisks (*), and the entry is single line (there is no line wrap).

          + +
          +elm_entry_password_set(entry, EINA_TRUE);
          +
          + +

          Entry Line Modes And Wrapping

          + +

          The entry component has two line modes:

          +
            +
          • single line mode
          • +
          • multiline mode
          • +
          + +

          First, set the entry in single line mode.

          + +
          +elm_entry_single_line_set(entry, EINA_TRUE);
          +
          + +

          In this mode, the text does not wrap when reaching the edge, but the entry grows horizontally instead. Pressing the Enter key in this mode generates an activate event instead of adding a new line.

          + +

          When the entry is set to multiline mode (single line off), the text wraps at the end of the entry and pressing Enter creates a new line.

          + +
          +elm_entry_single_line_set(entry, EINA_FALSE);
          +elm_entry_line_wrap_set(entry, ELM_WRAP_WORD);
          +
          + +

          In multiline entries, elm_entry_line_wrap_set() provides a way to cut the text implicitly into a new line when it reaches the far edge of the UI component. The following wrap modes are available:

          +
            +
          • ELM_WRAP_NONE: No wrap
          • +
          • ELM_WRAP_CHAR: Wrap between characters
          • +
          • ELM_WRAP_WORD: Wrap in allowed wrapping points (as defined in the unicode standard)
          • +
          • ELM_WRAP_MIXED: Word wrap, and if that fails, char wrap
          • +
          + +

          Selecting Text

          + +

          Text selections can be made with different functions:

          +
            +
          • To select all the content of the entry component: +
            +elm_entry_select_all(entry);
            +
            +
          • + +
          • To deselect the current selection: +
            +elm_entry_select_none(entry);
            +
            +
          • + +
          • To select part of the text, use elm_entry_select_region_set(). The following code selects the first twenty characters of the entry content. +
            +elm_entry_select_region_set(entry, 0, 20);
            +
            +
          • + +
          • To retrieve the currently selected text in an entry: +
            +const char *selection;
            +
            +selection = elm_entry_selection_get(entry);
            +
            +
          • +
          + +

          If the entry text is empty, elm_entry_selection_get() returns NULL.

          + +

          You can copy or cut the selection to the clipboard.

          +
          +elm_entry_selection_cut(entry);
          +
          + +

          The selection can be pasted in the same or a different entry.

          +
          +elm_entry_selection_paste(entry);
          +
          + +

          Controlling the Cursor

          + +

          The cursor represents the current position in the entry, where the next action, for example, text insertion or deletion, is done. Usually, the cursor is represented as a blinking character, but its appearance depends on the theme configuration. The cursor position can be modified by using several functions.

          +
            +
          • To move the cursor to the beginning of the entry: +
            +elm_entry_cursor_begin_set(entry);
            +
            +
          • + +
          • To move the cursor to the end of the entry: +
            +elm_entry_cursor_end_set(entry);
            +
            +
          • + +
          • To move the cursor one line down or up: +
            +elm_entry_cursor_down(entry);
            +elm_entry_cursor_up(entry);
            +
            +
          • +
          • To move the cursor one character to the left or right: +
            +elm_entry_cursor_prev(entry);
            +elm_entry_cursor_next(entry);
            +
            +
          • + +
          • To set the cursor at a specific position (15th character, for example): +
            +elm_entry_cursor_pos_set(entry, 15);
            +
            +
          • +
          + +

          It is possible to start a selection at the current cursor position, move five characters to the right and end the selection.

          + +
          +elm_entry_cursor_selection_begin(entry);
          +
          +for (i = 0; i < 5; i++)
          +{
          +   elm_entry_cursor_next(entry);
          +}
          +
          +elm_entry_cursor_selection_end(entry);
          +
          + +

          Formatting Text

          + +

          Text within an entry can be formatted by using markups tags that are defined in the theme. The following markups are available:

          +
            +
          • <br>: Inserts a line break.
          • +
          • <ps>: Inserts a paragraph separator. This is preferred over line breaks.
          • +
          • <tab>: Inserts a tab.
          • +
          • <em>...</em>: Emphasis. Sets the oblique style for the enclosed text.
          • +
          • <b>...</b>: Sets the bold style for the enclosed text.
          • +
          • <link>...</link>: Underlines the enclosed text.
          • +
          • <hilight>...</hilight>: Highlights the enclosed text.
          • +
          + +

          Using Special Markups

          + +

          Special markups can be added within the text of the entry:

          +
            +
          • <a href = ..>...</a>: Anchors
          • +
          • <item size = .. vsize = .. href = ..>...</item>: Items
          • +
          + +

          The anchors generate an anchor,clicked signal when the user clicks on them. The href attribute is used to identify the anchor. It also reacts to the anchor,in (mouse in), anchor,out (mouse out), anchor,down (mouse down), and anchor,up (mouse up) events.

          + +

          The item markup provides a way to insert any Evas_Object in the text. The Evas_Object name has to be specified in the href attribute.

          + +

          Overriding Style

          + +

          To tweak the style of the text within the entry component, it is possible to override parts of the theme style to the textblock object by using elm_entry_text_style_user_push(). This function pushes a new style on top of the user style stack that overrides the current style. Remove the style in the top of user style stack with elm_entry_text_style_user_pop().

          + +

          Filtering Text

          + +

          Text within an entry can be filtered in size. The following example sets the maximum number of characters allowed in the entry to 8.

          + +
          +static Elm_Entry_Filter_Limit_Size limit_size = 
          +{
          +   .max_char_count = 8,
          +   .max_byte_count = 0
          +};
          +
          +// Append a new callback to the list, this function is called each time
          +// a text is inserted in the entry. Pass the limit_size struct previously
          +// created to set the maximum number of characters allowed to 8
          + 
          +elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, limit_size);
          +
          + +

          The content can be filtered by passing an Elm_Entry_Filter_Accept_Set structure. This structure contains the accepted characters and rejected characters. The following example shows how to reject the '+', '-', '*', and '/' characters.

          +
          +static Elm_Entry_Filter_Accept_Set accept_set = 
          +{
          +   .accepted = NULL,
          +   .rejected = "+*-/"
          +};
          +
          +elm_entry_markup_filter_append(entry, elm_entry_filter_accept_set, accept_set);
          +
          + +

          Loading and Saving Files

          + +

          The entry content can be saved to a file (/tmp/test.txt, for example).

          + +
          +// Set the file in which the entry text is saved. This function
          +// implicitly loads the existing file content 
          +elm_entry_file_set(entry, "/tmp/test.txt", ELM_TEXT_FORMAT_MARKUP_UTF8);
          +
          + +

          Autosave is activated by default and changes are written back to the file after a short delay. This feature can be deactivated and you can manually save the content when needed.

          + +
          +// Disable autosaving 
          +elm_entry_autosave_set(entry, EINA_FALSE);
          +
          +// Trigger saving when needed 
          +elm_entry_file_save(entry);
          +
          + +

          Using Entry Theme Content

          + +

          Two content parts of the default theme are available: icon and end. The following example shows how to set an icon in the end content part.

          +
          +Evas_Object *icon;
          +
          +ic = elm_icon_add(entry);
          +elm_image_file_set(ic, "icon.png", NULL);
          +elm_object_part_content_set(entry, "end", icon);
          +
          + +

          Using Entry Theme Texts

          + +

          The default theme allows the use of the following text parts:

          +
            +
          • default - text of the entry
          • +
          • guide - placeholder of the entry
          • +
          + +

          The following example shows how to set the placeholder text of the entry to Hello World.

          + +
          +elm_object_part_text_set(entry, "Hello World");
          +
          + +

          Using Entry Callbacks

          + +

          The entry component emits the following signals:

          +
            +
          • aborted: The escape key is pressed on a single line entry.
          • +
          • activated: The enter key is pressed on a single line entry.
          • +
          • anchor,clicked: An anchor is clicked. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,down: Mouse button is pressed on an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,hover,opened: The anchor is clicked. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,in: Mouse cursor is moved into an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,out: Mouse cursor is moved out of an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,up: Mouse button is unpressed on an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • changed: The text within the entry is changed.
          • +
          • changed,user: The text within the entry is changed because of user interaction. event_info points to an object of the type Edje_Entry_Change_Info.
          • +
          • clicked: The entry is clicked (mouse press and release).
          • +
          • clicked,double: The entry is double clicked.
          • +
          • clicked,triple: The entry is triple clicked.
          • +
          • cursor,changed: The cursor position is changed.
          • +
          • cursor,changed,manual: The cursor position is changed manually.
          • +
          • focused: The entry receives focus. event_info points to an object of the type Elm_Focus_Info.
          • +
          • unfocused: The entry loses focus.
          • +
          • language,changed: Program language is changed.
          • +
          • longpressed: A mouse button is pressed and held for a couple of seconds.
          • +
          • maxlength,reached: A maximum length is reached.
          • +
          • preedit,changed: The preedit string is changed.
          • +
          • press: A mouse button is pressed on the entry.
          • +
          • redo,request: The request is redone.
          • +
          • selection,changed: The current selection is changed.
          • +
          • selection,cleared: The current selection is cleared.
          • +
          • selection,copy: A copy of the selected text into the clipboard is requested.
          • +
          • selection,cut: A cut of the selected text into the clipboard is requested.
          • +
          • selection,paste: A paste of the clipboard contents is requested.
          • +
          • selection,start: A selection is begun and no previous selection exists.
          • +
          • text,set,done: The whole text is set to the entry.
          • +
          • theme,changed: The theme is changed.
          • +
          • undo,request: The request is undone.
          • +
          + +

          For signals, where event_info has not been explicitly described, it is set to NULL.

          + +

          The following example shows how to register a callback to the focused signal.

          + +
          +{
          +   evas_object_smart_callback_add(entry, "focused", focused_cb, data);
          +}
          +
          +// Callback function for the "focused" signal
          +// This callback is called when the entry receive the focus
          +void focused_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Entry focused\n");
          +} 
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_entry_wn.htm b/org.tizen.ui.practices/html/native/efl/component_entry_wn.htm new file mode 100644 index 0000000..d22e00d --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_entry_wn.htm @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + Entry + + + + + + +
          +

          Entry

          + +

          This feature is supported in wearable applications only.

          + +

          The entry component is a box where the user can enter text. It supports the following features:

          +
            +
          • text wrapping
          • +
          • multiline
          • +
          • scrolling
          • +
          • formatted markup text
          • +
          • password mode
          • +
          • filtering text
          • +
          • read/write from a file
          • +
          • theme style overrides
          • +
          + + +

          Figure: Entry component

          +

          Entry component

          + +

          Figure: Entry component

          +

          Entry component

          + +

          Figure: Entry hierarchy

          +

          Entry hierarchy

          + +

          Adding an Entry Component

          + +

          The entry component is created with the elm_entry_add() function, and the text inside the entry can be set with elm_entry_entry_set().

          +
          +Evas_Object *entry, *parent;
          +
          +entry = elm_entry_add(parent);
          +elm_entry_entry_set(entry, "A short text.");
          +
          + +

          Using the Text Editor

          + +

          You can append text to the end of existing content.

          +
          +elm_entry_entry_append(entry, "END");
          +
          + +

          You can also insert text at the current cursor position.

          +
          +elm_entry_entry_insert(entry, "CURSOR");
          +Eina_Bool Empty = elm_entry_is_empty(entry);
          +
          + +

          Call elm_entry_is_empty() to see whether the entry is empty. Here, the boolean variable Empty returns EINA_FALSE.

          +

          The user can enter text in the entry component when it is in focus. It is possible to prevent the user from editing text if needed.

          +
          +elm_entry_editable_set(entry, EINA_FALSE);
          +
          + + + + + + + + + + +
          Note
          It is still possible to use the previous functions to modify the text of a non-editable entry.
          + +

          Setting the Password Mode

          + +

          When dealing with password content, the password mode activates to hide what the user is typing. In this mode, the display of any text is replaced by asterisks (*), and the entry is single line (there is no line wrap).

          + +
          +elm_entry_password_set(entry, EINA_TRUE);
          +
          + +

          Entry Line Modes And Wrapping

          + +

          The entry component has two line modes:

          +
            +
          • single line mode
          • +
          • multiline mode
          • +
          + +

          First, set the entry in single line mode.

          + +
          +elm_entry_single_line_set(entry, EINA_TRUE);
          +
          + +

          In this mode, the text does not wrap when reaching the edge, but the entry grows horizontally instead. Pressing the Enter key in this mode generates an activate event instead of adding a new line.

          + +

          When the entry is set to multiline mode (single line off), the text wraps at the end of the entry and pressing Enter creates a new line.

          + +
          +elm_entry_single_line_set(entry, EINA_FALSE);
          +elm_entry_line_wrap_set(entry, ELM_WRAP_WORD);
          +
          + +

          In multiline entries, elm_entry_line_wrap_set() provides a way to cut the text implicitly into a new line when it reaches the far edge of the UI component. The following wrap modes are available:

          +
            +
          • ELM_WRAP_NONE: No wrap
          • +
          • ELM_WRAP_CHAR: Wrap between characters
          • +
          • ELM_WRAP_WORD: Wrap in allowed wrapping points (as defined in the unicode standard)
          • +
          • ELM_WRAP_MIXED: Word wrap, and if that fails, char wrap
          • +
          + +

          Selecting Text

          + +

          Text selections can be made with different functions:

          +
            +
          • To select all the content of the entry component: +
            +elm_entry_select_all(entry);
            +
            +
          • + +
          • To deselect the current selection: +
            +elm_entry_select_none(entry);
            +
            +
          • + +
          • To select part of the text, use elm_entry_select_region_set(). The following code selects the first twenty characters of the entry content. +
            +elm_entry_select_region_set(entry, 0, 20);
            +
            +
          • + +
          • To retrieve the currently selected text in an entry: +
            +const char *selection;
            +
            +selection = elm_entry_selection_get(entry);
            +
            +
          • +
          + +

          If the entry text is empty, elm_entry_selection_get() returns NULL.

          + +

          You can copy or cut the selection to the clipboard.

          +
          +elm_entry_selection_cut(entry);
          +
          + +

          The selection can be pasted in the same or a different entry.

          +
          +elm_entry_selection_paste(entry);
          +
          + +

          Controlling the Cursor

          + +

          The cursor represents the current position in the entry, where the next action, for example, text insertion or deletion, is done. Usually, the cursor is represented as a blinking character, but its appearance depends on the theme configuration. The cursor position can be modified by using several functions.

          +
            +
          • To move the cursor to the beginning of the entry: +
            +elm_entry_cursor_begin_set(entry);
            +
            +
          • + +
          • To move the cursor to the end of the entry: +
            +elm_entry_cursor_end_set(entry);
            +
            +
          • + +
          • To move the cursor one line down or up: +
            +elm_entry_cursor_down(entry);
            +elm_entry_cursor_up(entry);
            +
            +
          • +
          • To move the cursor one character to the left or right: +
            +elm_entry_cursor_prev(entry);
            +elm_entry_cursor_next(entry);
            +
            +
          • + +
          • To set the cursor at a specific position (15th character, for example): +
            +elm_entry_cursor_pos_set(entry, 15);
            +
            +
          • +
          + +

          It is possible to start a selection at the current cursor position, move five characters to the right and end the selection.

          +
          +elm_entry_cursor_selection_begin(entry);
          +
          +for (i = 0; i < 5; i++)
          +{
          +   elm_entry_cursor_next(entry);
          +}
          +
          +elm_entry_cursor_selection_end(entry);
          +
          + +

          Formatting Text

          + +

          Text within an entry can be formatted by using markups tags that are defined in the theme. The following markups are available in the default theme:

          +
            +
          • <br>: Inserts a line break.
          • +
          • <ps>: Inserts a paragraph separator. This is preferred over line breaks.
          • +
          • <tab>: Inserts a tab.
          • +
          • <em>...</em>: Emphasis. Sets the oblique style for the enclosed text.
          • +
          • <b>...</b>: Sets the bold style for the enclosed text.
          • +
          • <link>...</link>: Underlines the enclosed text.
          • +
          • <hilight>...</hilight>: Highlights the enclosed text.
          • +
          + +

          Using Special Markups

          + +

          Special markups can be added within the text of the entry:

          +
            +
          • <a href = ..>...</a>: Anchors
          • +
          • <item size = .. vsize = .. href = ..>...</item>: Items
          • +
          + +

          The anchors generate an anchor,clicked signal when the user clicks on them. The href attribute is used to identify the anchor. It also reacts to the anchor,in (mouse in), anchor,out (mouse out), anchor,down (mouse down), and anchor,up (mouse up) events.

          + +

          The item markup provides a way to insert any Evas_Object in the text. The Evas_Object name has to be specified in the href attribute.

          + +

          Overriding Style

          + +

          To tweak the style of the text within the entry component, it is possible to override parts of the theme style to the textblock object by using elm_entry_text_style_user_push(). This function pushes a new style on top of the user style stack that overrides the current style. Remove the style in the top of user style stack with elm_entry_text_style_user_pop().

          + +

          Filtering Text

          + +

          Text within an entry can be filtered in size. The following example sets the maximum number of characters allowed in the entry to 8.

          +
          +static Elm_Entry_Filter_Limit_Size limit_size = 
          +{
          +   .max_char_count = 8,
          +   .max_byte_count = 0
          +};
          +
          +// Append a new callback to the list, this function is called each time
          +// a text is inserted in the entry. Pass the limit_size struct previously
          +// created to set the maximum number of characters allowed to 8
          + 
          +elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, limit_size);
          +
          + +

          The content can be filtered by passing an Elm_Entry_Filter_Accept_Set structure. This structure contains the accepted characters and rejected characters. The following example shows how to reject the '+', '-', '*', and '/' characters.

          + +
          +static Elm_Entry_Filter_Accept_Set accept_set = 
          +{
          +   .accepted = NULL,
          +   .rejected = "+*-/"
          +};
          +
          +elm_entry_markup_filter_append(entry, elm_entry_filter_accept_set, accept_set);
          +
          + +

          Loading and Saving Files

          + +

          The entry content can be saved to a file (/tmp/test.txt, for example).

          + +
          +// Set the file in which the entry text is saved. This function
          +// implicitly loads the existing file content 
          +elm_entry_file_set(entry, "/tmp/test.txt", ELM_TEXT_FORMAT_MARKUP_UTF8);
          +
          + +

          Autosave is activated by default and changes are written back to the file after a short delay. This feature can be deactivated and you can manually save the content when needed.

          +
          +// Disable autosaving 
          +elm_entry_autosave_set(entry, EINA_FALSE);
          +
          +// Trigger saving when needed 
          +elm_entry_file_save(entry);
          +
          + +

          Using Entry Theme Content

          + +

          Two content parts of the default theme are available: icon and end. The following example shows how to set an icon in the end content part.

          + +
          +Evas_Object *icon;
          +
          +ic = elm_icon_add(entry);
          +elm_image_file_set(ic, "icon.png", NULL);
          +elm_object_part_content_set(entry, "end", icon);
          +
          + +

          Using Entry Theme Texts

          + +

          The default theme allows the use of the following text parts:

          +
            +
          • elm.text - text of the entry
          • +
          • elm.guide - placeholder of the entry
          • +
          + +

          The following example shows how to set the placeholder text of the entry to Hello World.

          +
          +elm_object_part_text_set(entry, "elm.guide", "Hello World");
          +
          + +

          Using Entry Callbacks

          + +

          The entry component emits the following signals:

          +
            +
          • aborted: The escape key is pressed on a single line entry.
          • +
          • activated: The enter key is pressed on a single line entry.
          • +
          • anchor,clicked: An anchor is clicked. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,down: Mouse button is pressed on an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,hover,opened: The anchor is clicked. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,in: Mouse cursor is moved into an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,out: Mouse cursor is moved out of an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • anchor,up: Mouse button is unpressed on an anchor. event_info points to an object of the type Elm_Entry_Anchor_Info.
          • +
          • changed: The text within the entry is changed.
          • +
          • changed,user: The text within the entry is changed because of user interaction. event_info points to an object of the type Edje_Entry_Change_Info.
          • +
          • clicked: The entry is clicked (mouse press and release).
          • +
          • clicked,double: The entry is double clicked.
          • +
          • clicked,triple: The entry is triple clicked.
          • +
          • cursor,changed: The cursor position is changed.
          • +
          • cursor,changed,manual: The cursor position is changed manually.
          • +
          • focused: The entry receives focus. event_info points to an object of the type Elm_Focus_Info.
          • +
          • unfocused: The entry loses focus.
          • +
          • language,changed: Program language is changed.
          • +
          • longpressed: A mouse button is pressed and held for a couple of seconds.
          • +
          • maxlength,reached: A maximum length is reached.
          • +
          • preedit,changed: The preedit string is changed.
          • +
          • press: A mouse button is pressed on the entry.
          • +
          • redo,request: The request is redone.
          • +
          • selection,changed: The current selection is changed.
          • +
          • selection,cleared: The current selection is cleared.
          • +
          • selection,copy: A copy of the selected text into the clipboard is requested.
          • +
          • selection,cut: A cut of the selected text into the clipboard is requested.
          • +
          • selection,paste: A paste of the clipboard contents is requested.
          • +
          • selection,start: A selection is begun and no previous selection exists.
          • +
          • text,set,done: The whole text is set to the entry.
          • +
          • theme,changed: The theme is changed.
          • +
          • undo,request: The request is undone.
          • +
          + +

          For signals, where event_info has not been explicitly described, it is set to NULL.

          + +

          The following example shows how to register a callback to the focused signal.

          +
          +{
          +   evas_object_smart_callback_add(entry, "focused", focused_cb, data);
          +}
          +
          +// Callback function for the "focused" signal
          +// This callback is called when the entry receive the focus
          +void focused_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Entry focused\n");
          +} 
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_flip_mn.htm b/org.tizen.ui.practices/html/native/efl/component_flip_mn.htm new file mode 100644 index 0000000..ff32149 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_flip_mn.htm @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + Flip + + + + + + +
          +

          Flip

          + +

          This feature is supported in mobile applications only.

          + +

          The flip component can hold two Evas_Objects and allows the user flip between them using several pre-defined animations.

          + +

          Figure: Flip hierarchy

          +

          Flip hierarchy

          + +

          Adding a Flip Component

          + +

          The following example shows how to create a flip component.

          + +
          +Evas_Object *flip, *parent, *content1, *content2;
          +flip = elm_flip_add(parent);
          +
          + +

          You can add content to the flip component. content1 is set to the front content and content2 is set to the back mode.

          + +
          +elm_object_part_content_set(flip, "front", content1);
          +elm_object_part_content_set(flip, "back", content2);
          +
          + +

          Configuring Flip Animation

          + +

          Now you can run an flip animation.

          +
          +elm_flip_go(flip, ELM_FLIP_CUBE_UP);
          +
          + +

          This animation flips up the front content object as if it was on a side of a cube, letting the down facing side of the cube appear with the back content object. Several animations are available:

          +
            +
          • ELM_FLIP_ROTATE_X_CENTER_AXIS: Rotate the content around a horizontal axis.
          • +
          • ELM_FLIP_ROTATE_Y_CENTER_AXIS: Rotate the content around a vertical axis.
          • +
          • ELM_FLIP_ROTATE_XZ_CENTER_AXIS: Rotate the content around a diagonal axis.
          • +
          • ELM_FLIP_ROTATE_YZ_CENTER_AXIS: Rotate the content around a diagonal axis.
          • +
          • ELM_FLIP_CUBE_LEFT: Rotate the content left as if it was on a side of a cube.
          • +
          • ELM_FLIP_CUBE_RIGHT: Rotate the content right as if it was on a side of a cube.
          • +
          • ELM_FLIP_CUBE_UP: Rotate the content up as if it was on a side of a cube.
          • +
          • ELM_FLIP_CUBE_DOWN: Rotate the content down as if it was on a side of a cube.
          • +
          • ELM_FLIP_PAGE_LEFT: Move the content to the left as if the flip was a book.
          • +
          • ELM_FLIP_PAGE_RIGHT: Move the content to the right as if the flip was a book.
          • +
          • ELM_FLIP_PAGE_UP: Move the content up as if the flip was a book.
          • +
          • ELM_FLIP_PAGE_DOWN: Move the content down as if the flip was a book.
          • +
          + +

          Interacting With the User

          + +

          By default, the user cannot interact with the flip. You can set the interaction to be possible, but you have to choose which animation appears on the interaction (rotation has been selected in the following example).

          + +
          +elm_flip_interaction_set(flip, ELM_FLIP_INTERACTION_ROTATE);
          +
          + +

          The available modes of interaction are

          +
            +
          • ELM_FLIP_INTERACTION_NONE: No interaction is allowed
          • +
          • ELM_FLIP_INTERACTION_ROTATE: Interaction causes a rotating animation
          • +
          • ELM_FLIP_INTERACTION_CUBE: Interaction causes a cube animation
          • +
          • ELM_FLIP_INTERACTION_PAGE: Interaction causes a page animation
          • +
          + +

          You must also choose which interaction directions are enabled. Only right and left are enabled in the following example.

          + +
          +elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_LEFT, EINA_TRUE);
          +elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_RIGHT, EINA_TRUE);
          +
          + +

          You can also set the amount of the flip that is sensitive to user interaction. In the following example, it is set to the entire flip (1) to make the flip easy to interact with.

          + +
          +elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_LEFT, 1);
          +elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_RIGHT, 1);
          +
          + +

          Using the Flip Callbacks

          + +

          Two signals are emitted by the flip: one when an animation starts and one when it ends. For these signals, event_info parameter is NULL.

          + +
          +"animate,begin" - A flip animation is started
          +"animate,done" - A flip animation is finished
          +
          + +

          You can register a callback on the "animation,begin" signal.

          + +
          +{
          +   evas_object_smart_callback_add(entry, "animate,begin", anim_start_cb, data);
          +}
          +
          +// Callback function for the "animate,begin" signal
          +// This callback is called when the flip animation starts
          +void anim_start_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Animation starts\n");
          +}
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_focus_n.htm b/org.tizen.ui.practices/html/native/efl/component_focus_n.htm new file mode 100644 index 0000000..6efd6cb --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_focus_n.htm @@ -0,0 +1,174 @@ + + + + + + + + + + + + + Managing Component Focus + + + + + +
          + +

          Managing Component Focus

          + + +

          Focus is a graphical user interface concept. A component, for example, a UI component, has a focus when it is selected to receive input from the user. The input can be an event, such as mouse button click or key press. A UI component application has, at all times, one (and only one) focused object. This is what determines where the input event goes to within the application window. Also, focused objects can be decorated differently, in order to signal to the user where the input is at any given moment.

          + +

          Focusing can be immediate (selected by the touchscreen or mouse) or relative (selected by a key press). There are mainly 2 ways to set focus on a graphical elements:

          + +
            +
          • Direct selection: this is done by clicking on the element. +

            Direct selection does not really need any kind of special treatment as the user explicitly selects the UI component to interact with.

          • +
          • Relative selection: this is done by moving the selection from a UI component to another, such as going to the previous or next one; this is done with a keyboard. +

            Relative selection' default order is the one in which the UI components have been added to the canvas. That may not be appropriate, if they are added programmatically in a different order than they appear on-screen.

          • +
          + + +

          Moving Focus

          + +

          Concept of Focus Chain

          +

          The order the focus goes from a UI component to another is called the focus chain. As said before, the default focus chain is set to the order the UI components have been added to the canvas.

          + +

          Focusable Objects

          +

          An object can be focused if the following conditions apply:

          + +
            +
          • object is visible
          • +
          • object is enabled
          • +
          • object accepts focus
          • +
          • object's subtree (if any) is focusable
          • +
          • all of object's parents have their subtrees focusable
          • +
          + +

          If any of these conditions do not apply, the object is unfocusable.

          + +

          Handling Key Input

          + +

          Handling of the keys is done automatically by Elementary. According to which key the user pressed, Elementary switches the focus in the selected direction. For example, using the Tab key the focus goes to the next object in the natural order, whereas using the direction keys the focus goes to the next object in the requested direction.

          + +

          Hiding, Deleting or Disabling a Focused Object

          + +

          When a UI component is hidden, deleted, or disabled, it becomes unfocusable.

          + +

          When a focused object is unfocusable, the focus is moved to another object.

          + +

          Selecting Next Object

          + +

          When the user wants to switch the focus to the next object (i.e. cycle focus), Elementary searches the first object which is focusable.

          + +

          If there is a disabled or read-only object in the focus chain, the focus goes to the following object in the requested direction.

          + +

          Customizing Focus

          + +

          There are several reasons why to customize the focus chain of an application, for example:

          + +
            +
          • If you have created a form with labels and text entries next to them, the focus moves to the entry field when the user clicks on the associated label.
          • +
          • If you have created an interface with several columns (table), set the focus chain as you wish, for example, going horizontally instead of going vertically, regardless whatever the order the UI components are added.
          • +
          + +

          Customizing Object's Focus Exit Chain

          + +

          Set the object to focus after other object in a specific direction using elm_object_focus_next_object_set(object, next, direction). Use the following directions:

          + +
            +
          • ELM_FOCUS_NEXT: next UI component in natural order
          • +
          • ELM_FOCUS_PREVIOUS: previous UI component in natural order
          • +
          • ELM_FOCUS_UP: UI component to focus when going up
          • +
          • ELM_FOCUS_DOWN: UI component to focus when going down
          • +
          • ELM_FOCUS_RIGHT: UI component to focus when going right
          • +
          • ELM_FOCUS_LEFT: UI component to focus when going left
          • +
          + +

          Set the object next to another in a specific direction using elm_object_focus_next_object_get(object, direction).

          + +

          Customizing Whole Application's Focus Chain

          + +

          To customize the application's custom chain:

          + +
          +Evas_Object *main, obj1, obj2, obj3, obj4, obj5;
          +
          +Eina_List *focus_chain = NULL;
          +focus_chain = eina_list_append(focus_chain, obj3);
          +focus_chain = eina_list_append(focus_chain, obj2);
          +// The chain is obj3, then obj2. Set the chain.
          +elm_object_focus_custom_chain_set(main, focus_chain);
          +// Prepend obj5 at the beginning of the chain
          +elm_object_focus_chain_prepend(main, NULL, obj5);
          +// Append obj1 after obj3
          +elm_object_focus_chain_append(main, obj3, obj1);
          +// Prepend obj4 before obj1
          +elm_object_focus_chain_prepend(main, obj1, obj4);
          +
          + +

          The focus chain is obj5, obj3, obj4, obj1, obj2.

          + +

          This actually applies to any container: it is possible to set the focus chain of, for example, a box.

          + +

          Customizing Collision of Both

          + +

          If an object is part of a focus chain and has the next focused object defined, the next object takes precedence over the focus chain.

          + +

          Following on the previous example, if obj4 has obj5 defined as its next object, the actual focus chain is obj5, obj3, obj4, and loop back to obj5.

          + +

          Focus on UI Component

          + +

          If your Evas object has several sub-objects, set its focus chain using the same functions as for the application. Elementary first follows the main focus chain, and then the focus chain of each UI component if applicable.

          + +

          Use elm_object_focus_get(object) to set whether a specific object has the focus. Set the focus to an object using elm_object_focus_set(object, set), where set is a Boolean value. If it is set to EINA_TRUE, the focus is set to that given object. If it is set to EINA_False, the focus is unset and passed back to the previous element in the focus chain. Set the focus only after the object is shown, that is, after evas_object_show(object) has been called. Call the function back when the object receives or loses focus by registering on smart event "focused" or "unfocused"

          + +

          Use elm_object_tree_focus_allow_set(object, focusable) to tell Elementary whether an object and its children are focusable, where focusable is a Boolean value. Get the current value using elm_object_tree_focus_allow_get(object).

          + +

          The similar functions for a specific object are elm_object_focus_allow_set(object, focusable) and elm_object_focus_allow_get(object).

          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_gengrid_mn.htm b/org.tizen.ui.practices/html/native/efl/component_gengrid_mn.htm new file mode 100644 index 0000000..76ed154 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_gengrid_mn.htm @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + Gengrid + + + + + + +
          +

          Gengrid

          + +

          This feature is supported in mobile applications only.

          + +

          Gengrid component is based on the same idea as the genlist. It aims at displaying objects on a grid layout and rendering only the visible ones. As for the genlist, callbacks are called at item creation or deletion.

          + +

          This UI component inherits from the layout component and implements the scroller interface. Because of this, the scroller and layout functions can be used with this UI component.

          + +

          A gengrid can display its items using a horizontal or vertical layout. In the first layout, the items are displayed in columns from top to bottom, starting a new column when the space for the current column is filled. In the second one, items are set in rows from left to right.

          + + +

          Figure: Gengrid component

          +

          Gengrid component

          + +

          Figure: Gengrid hierarchy

          +

          Gengrid hierarchy

          + +

          Adding a Gengrid Component

          + +

          You can add a gengrid component with the following code.

          +
          +Evas_Object *gengrid, *parent;
          +gengrid = elm_gengrid_add(parent);
          +
          + +

          Gengrid Items

          + +

          A gengrid item is composed of 0 or more texts, 0 or more contents and 0 or more boolean states. The number of the text and content depends on the theme used for gengrid items. In the default Tizen gengrid item theme, items can have two content parts that can be set with the elm.swallow.icon and elm.swallow.end part names.

          + +

          Creating and Deleting Items

          + +

          As with genlists, the items are allocated and deleted on the go, while the user is scrolling the gengrid. The following example shows how to declare a Elm_Gengrid_Item_Class structure to inform the gengrid how to manage items.

          +
          +static Elm_Gengrid_Item_Class *gic = elm_gengrid_item_class_new();
          +gic->item_style = "default";
          +gic->func.text_get = _grid_label_get;
          +gic->func.content_get = _grid_content_get;
          +gic->func.state_get = _grid_state_get;
          +gic->func.del = _grid_del;
          +
          + +

          The parameters of this structure are not be detailed here, because they are very similar to that of the genlist. Please refer to the genlist component page for more detailed information.

          + +

          Managing Items

          + +

          As with genlists, items can be added with the elm_gengrid_item_append(), elm_gengrid_item_prepend(), elm_gengrid_item_insert_before(), and elm_gengrid_item_insert_after() functions. With the gengrid, there is no need to pass the type parameters. They can be cleared with the elm_gengrid_clear() function.

          + +

          You can set the multiselection mode on.

          +
          +elm_gengrid_multi_select_set(gengrid, EINA_TRUE);
          +
          + +

          When the multiselection mode is on, the selected items are retrieved with the elm_gengrid_selected_items_get() function. The function returns a list of all the selected items.

          + +

          When the content of an item changes, you can call elm_gengrid_item_update() to ask the gengrid to update this item's content.

          + +

          It is also possible to select or disable some items manually with the elm_gengrid_item_selected_set() and elm_object_item_disabled_set() functions.

          + +

          Using Gengrid Callbacks

          + +

          The gengrid component emits the following signals:

          +
            +
          • activated: The user has double-clicked or pressed (enter | return | spacebar) on an item. The event_info parameter is the gengrid item that is activated.
          • +
          • clicked,double: The user has double-clicked an item. The event_info parameter is the gengrid item that is double-clicked.
          • +
          • longpressed: The item is pressed for a certain amount of time. By default it is one second.
          • +
          • selected: The user has selected an item. The event_info parameter is the gengrid item that is selected.
          • +
          • unselected: The user has unselected an item. The event_info parameter is the gengrid item that is unselected.
          • +
          • realized: The item in the gengrid has its implementing Evas object instantiated, de facto. event_info is the gengrid item that is created. The object can be deleted at any time, so it is strongly advisable not to use the object pointer returned from elm_gengrid_item_object_get(), because it can point to freed objects.
          • +
          • unrealized: The implementing Evas object for this item is deleted. event_info is the gengrid item that is deleted.
          • +
          • changed: An item is added, removed, resized or moved and the gengrid is resized or has horizontal property changes.
          • +
          • scroll,anim,start: Scrolling animation starts.
          • +
          • scroll,anim,stop: Scrolling animation stops.
          • +
          • drag,start,up: The item in the gengrid is dragged (not scrolled) up.
          • +
          • drag,start,down: The item in the gengrid has dragged (not scrolled) down.
          • +
          • drag,start,left: The item in the gengrid is dragged (not scrolled) left.
          • +
          • drag,start,right: The item in the gengrid is dragged (not scrolled) right.
          • +
          • drag,stop: The item in the gengrid stops being dragged.
          • +
          • drag: The item in the gengrid is dragged.
          • +
          • scroll: The content is scrolled (moved).
          • +
          • scroll,drag,start: Dragging the content starts.
          • +
          • scroll,drag,stop: Dragging the content stops.
          • +
          • edge,top: The gengrid is scrolled to the top edge.
          • +
          • edge,bottom: The gengrid is scrolled to the bottom edge.
          • +
          • edge,left: The gengrid is scrolled to the left edge.
          • +
          • edge,right: The gengrid is scrolled to the right edge.
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_genlist_mn.htm b/org.tizen.ui.practices/html/native/efl/component_genlist_mn.htm new file mode 100644 index 0000000..1a0fad3 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_genlist_mn.htm @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + Genlist + + + + + + +
          +

          Genlist

          + +

          This feature is supported in mobile applications only.

          + +

          Genlist is a UI component that displays a scrollable list of items. It allows a lot of entries while being fast and has a low memory footprint, as only the visible items are allocated in the memory.

          + +

          For more information, see Creating Mobile Genlists.

          + +

          Figure: Genlist component

          +

          Genlist component

          + +

          Figure: Genlist hierarchy

          +

          Genlist hierarchy

          + +

          Genlist Item Style

          + +

          An item can have 0 or more texts, 0 or more contents, and 0 or more boolean states. This is defined in the Edje item theme style. Genlist looks for data items named respectively labels, contents, and states in the Edje file. The default item style provides one text part (elm.text), two content parts (elm.swallow.icon and elm.swallow.end) and no state parts.

          + +

          The following item styles are available:

          +
            +
          • default
          • +
          • full
          • +
          • one_icon
          • +
          • end_icon
          • +
          • group_index
          • +
          • double_label
          • +
          + +

          Here are some examples of the item styles.

          + +

          Figure: Default item style

          +

          Default item style

          + +

          Figure: end_icon item style

          +

          end_icon item style

          + +

          Figure: double_label item style

          +

          double_label item style

          + +

          For more information on creating a new genlist item style, see Customizing Components.

          + +

          Adding a Genlist Component

          + +

          A genlist component is added with the elm_genlist_add() function.

          +
          +Evas_Object *genlist, *parent;
          +genlist = elm_genlist_add(parent);
          +
          + +

          Creating and Deleting Items

          + +

          To save up memory, genlist allocates and deletes items on the go, while the user is scrolling the list. To enable that, the user creates and fills a Elm_Genlist_Item_Class structure that informs the genlist component which callbacks to call when an item is created or deleted.

          + +
          +Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
          +
          +itc->item_style = "default";
          +itc->decorate_item_style = NULL;
          +itc->decorate_all_item_style = NULL;
          +itc->func.text_get = _item_label_get;
          +itc->func.content_get = _item_content_get;
          +itc->func.state_get = _item_state_get;
          +itc->func.del = _item_del;
          +
          + +

          The item_style, decorate_item_style, and decorate_all_item_style attributes define the names of the item style, the decorate mode item style and the decorate all item style.

          + +

          The func structure contains pointers to functions that are called when an item is going to be created or deleted. All of them receive a data parameter that points to the same data passed to the elm_genlist_item_append() and related item creation functions, and an obj parameter that points to the genlist object itself.

          +
            +
          • text_get +

            This function receives a PART parameter that is the name string of one of the existing text parts in the Edje group implementing the item's theme. It has to return a string (duplicated with the strdup() function) corresponding to the PART parameter. The caller is in charge of freeing the string when done.

          • + +
          • content_get +

            The PART parameter is the name string of one of the existing swallow parts in the Edje group. When no content is desired, it must return NULL, or otherwise, a valid object handle. The object is deleted by the genlist on its deletion or when the item is unrealized.

          • + +
          • state_get +

            The PART parameter is the name string of one of the state parts in the Edje group implementing the item's theme. It returns EINA_FALSE for false/off or EINA_TRUE for true/on. The default is false. Genlists emit a signal to the PART parameter's theming Edje object with elm,state,xxx,active as emission and elm as source argument, when the state is true. xxx is the name of the (state) part.

          • + +
          • del +

            This function is called when the genlist item is deleted. It deletes any data that is allocated at the item creation.

          • +
          + +

          Managing Items

          + +

          To add an item, several functions can be used. elm_genlist_item_append() adds an item to the end of the list, or if there is a parent list, to the end of all the child items of the parent list. elm_genlist_item_prepend() is otherwise the same but adds to the beginning of the list or children lists. elm_genlist_item_insert_before() inserts an item before the indicated item and elm_genlist_item_insert_after() inserts an item after the indicated item.

          + +

          The previous functions take a type parameter that can be one of the following.

          +
            +
          • ELM_GENLIST_ITEM_NONE
          • +
          • ELM_GENLIST_ITEM_TREE
          • +
          • ELM_GENLIST_ITEM_GROUP
          • +
          + +

          If ELM_GENLIST_ITEM_TREE is set, this item is displayed as being able to expand and have child items. If ELM_GENLIST_ITEM_GROUP is set, this item is a group index item that is displayed at the top until the next group appears.

          + +

          Figure: Genlist tree

          +

          Genlist tree

          + +

          The application clears the list with elm_genlist_clear(), which deletes all the items in the list. elm_object_item_del() deletes a specific item. elm_genlist_item_subitems_clear() clears all items that are children of the indicated parent item.

          + +

          To help inspect the list items, move to the item at the top of the list with elm_genlist_first_item_get(), which returns the item pointer. elm_genlist_last_item_get() moves to the item at the end of the list. elm_genlist_item_next_get() and elm_genlist_item_prev_get() move to the next and previous items relative to the indicated item. Using these calls you can go through the entire item list or tree.

          + + + + + + + + + + +
          Note
          As a tree, the items are flattened on the list, so elm_genlist_item_parent_get() gives you the name of the parent item (even to skip them if needed).
          + +

          elm_genlist_item_show() scrolls the scroller to show the desired item as visible.

          +

          elm_object_item_data_get() returns the data pointer set by the item creation functions.

          + +

          If an item changes (state, boolean, text or content change), use elm_genlist_item_update() for the genlist to update the item. Genlist re-realizes the item and calls the functions in the _Elm_Genlist_Item_Class for it.

          + +

          Selection

          + +

          Items are manually selected or deselected with elm_genlist_item_selected_set() or disabled with elm_object_item_disabled_set(). In case there is a tree or a group item, the elm_genlist_item_expanded_set() function is used to expand or contract the item.

          + + + + + + + + + + +
          Note
          Calling this function does not show or hide any child of an item (if it is a parent). You must manually delete and create them on the callbacks of the expanded or contracted signals.
          + +

          By default, the genlist is in single-selection mode: only one item can be selected at a time. You can use elm_genlist_multi_select_set() to select multiple items. In the single-selection mode, the elm_genlist_selected_item_get() function can be called to retrieve the selected item. If several items are selected, the elm_genlist_selected_items_get() returns a list of the current selected items.

          + +

          In the following figure, there is a genlist in multi-selection mode with two items selected (#4 and #5) and one item disabled (#2).

          + +

          Figure: Genlist component

          +

          Genlist component

          + +

          Using Genlist Callbacks

          + +

          The genlist component emits the following signals:

          +
            +
          • activated: The user has double-clicked or pressed (enter | return | spacebar) on an item. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • clicked,double: The user has double-clicked an item. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • selected: The user selects an item. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • unselected: The user unselects an item. event_info in the callback function points at an object of type Elm_Object_Item that contains the activated item.
          • +
          • expanded: The item is to be expanded with elm_genlist_item_expanded_set(). This callback fills in the child items. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • contracted: The item is to be contracted with elm_genlist_item_expanded_set(). This callback deletes the child items. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • expand,request: The user wants to expand a tree branch item. The callback decides if the item can expand (if it has any children) and calls elm_genlist_item_expanded_set() to set the state. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • contract,request: The user wants to contract a tree branch item. The callback decides if the item can contract (if it has any children) and calls elm_genlist_item_expanded_set() to set the state. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • realized: The item is created as a real evas object. event_info in the callback function points at an object of the type Elm_Object_Item, that contains the activated item.
          • +
          • unrealized: An item is going to be unrealized. Content objects provided are deleted and the item object is deleted or put into a floating cache. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,up: The item in the list is dragged (not scrolled) up. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,down: The item in the list is dragged (not scrolled) down. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,left: The item in the list is dragged (not scrolled) left. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,right: The item in the list is dragged (not scrolled) right. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,stop: The item in the list has stopped being dragged. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag: The item in the list is being dragged. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • longpressed: The item is pressed for a certain amount of time. The default specified time is one second. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • scroll,anim,start: The scrolling animation is started. event_info is NULL.
          • +
          • scroll,anim,stop: The scrolling animation is stopped. event_info is NULL.
          • +
          • scroll,drag,start: Dragging the content is started. event_info is NULL.
          • +
          • scroll,drag,stop: Dragging the content is stopped. event_info is NULL.
          • +
          • edge,top: The genlist is scrolled to the top edge. event_info is NULL.
          • +
          • edge,bottom: The genlist is scrolled to the bottom edge. event_info is NULL.
          • +
          • edge,left: The genlist is scrolled to the left edge. event_info is NULL.
          • +
          • edge,right: The genlist is scrolled to the right edge. event_info is NULL.
          • +
          • multi,swipe,left: The genlist is multi-touch swiped left. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,swipe,right: The genlist is multi-touch swiped right. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,swipe,up: The genlist is multi-touch swiped up. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,swipe,down: The genlist is multi-touch swiped down. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,pinch,out: The genlist is multi-touch pinched out. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,pinch,in: The genlist is multi-touch pinched in. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • swipe: The genlist is swiped. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • moved: A genlist item is moved in the reorder mode. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • moved,after: A genlist item is moved after another item in the reorder mode. To access the relative previous item, use elm_genlist_item_prev_get(). This signal is called along with the moved signal. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • moved,before: A genlist item is moved before another item in the reorder mode. To access the relative previous item, use elm_genlist_item_next_get(). This signal is called along with the moved signal. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • language,changed The program's language is changed. event_info is NULL.
          • +
          • tree,effect,finished: A genlist tree effect is finished. event_info is NULL.
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_genlist_wn.htm b/org.tizen.ui.practices/html/native/efl/component_genlist_wn.htm new file mode 100644 index 0000000..29ed748 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_genlist_wn.htm @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + Genlist + + + + + + +
          +

          Genlist

          + +

          This feature is supported in wearable applications only.

          + +

          Genlist is a UI component that displays a scrollable list of items. It allows a lot of entries while being fast and has a low memory footprint, as only the visible items are allocated in the memory.

          + +

          For more information, see Creating Wearable Genlists.

          + +

          Figure: Genlist component

          +

          Genlist component

          + +

          Figure: Genlist hierarchy

          +

          Genlist hierarchy

          + +

          Genlist Item Style

          + +

          An item can have 0 or more texts, 0 or more contents, and 0 or more boolean states. This is defined in the Edje item theme style. Genlist looks for data items named respectively labels, contents, and states in the Edje file. The default item style provides one text part (elm.text), two content parts (elm.swallow.icon and elm.swallow.end) and no state parts.

          + +

          The following item styles are available:

          +
            +
          • default
          • +
          • groupindex
          • +
          • 1text
          • +
          • 1text.1icon
          • +
          • 2text
          • +
          • 2text.1
          • +
          • 1text.1icon.divider
          • +
          • 1text.1icon.1
          • +
          • 2text.1icon.1
          • +
          • multiline/1text
          • +
          • multiline/2text
          • +
          + +

          Here are some examples of the item styles.

          + +

          Figure: 1text item style

          +

          1 text item style

          + +

          Figure: 1text.1icon.1 item style

          +

          1text.1icon.1 item style

          + +

          Figure: 2text.1icon.1 item style

          +

          2text.1icon.1 item style

          + +

          For more information on creating a new genlist item style, see Customizing Components.

          + +

          Adding a Genlist Component

          + +

          A genlist component is added with the elm_genlist_add() function.

          +
          +Evas_Object *genlist, *parent;
          +genlist = elm_genlist_add(parent);
          +
          + +

          Creating and Deleting Items

          + +

          To save up memory, genlist allocates and deletes items on the go, while the user is scrolling the list. To enable that, the user creates and fills a Elm_Genlist_Item_Class structure that informs the genlist component which callbacks to call when an item is created or deleted.

          +
          +Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
          +
          +itc->item_style = "default";
          +itc->decorate_item_style = NULL;
          +itc->decorate_all_item_style = NULL;
          +itc->func.text_get = _item_label_get;
          +itc->func.content_get = _item_content_get;
          +itc->func.state_get = _item_state_get;
          +itc->func.del = _item_del;
          +
          + +

          The item_style, decorate_item_style, and decorate_all_item_style attributes define the names of the item style, the decorate mode item style and the decorate all item style.

          + +

          The func structure contains pointers to functions that are called when an item is going to be created or deleted. All of them receive a data parameter that points to the same data passed to the elm_genlist_item_append() and related item creation functions, and an obj parameter that points to the genlist object itself.

          +
            +
          • text_get +

            This function receives a PART parameter that is the name string of one of the existing text parts in the Edje group implementing the item's theme. It has to return a string (duplicated with the strdup() function) corresponding to the PART parameter. The caller is in charge of freeing the string when done.

          • + +
          • content_get +

            The PART parameter is the name string of one of the existing swallow parts in the Edje group. When no content is desired, it must return NULL, or otherwise, a valid object handle. The object is deleted by the genlist on its deletion or when the item is unrealized.

          • + +
          • state_get +

            The PART parameter is the name string of one of the state parts in the Edje group implementing the item's theme. It returns EINA_FALSE for false/off or EINA_TRUE for true/on. The default is false. Genlists emit a signal to the PART parameter's theming Edje object with elm,state,xxx,active as emission and elm as source argument, when the state is true. xxx is the name of the (state) part.

          • + +
          • del +

            This function is called when the genlist item is deleted. It deletes any data that is allocated at the item creation.

          • +
          + +

          Managing Items

          + +

          To add an item, several functions can be used. elm_genlist_item_append() adds an item to the end of the list, or if there is a parent list, to the end of all the child items of the parent list. elm_genlist_item_prepend() is otherwise the same but adds to the beginning of the list or children lists. elm_genlist_item_insert_before() inserts an item before the indicated item and elm_genlist_item_insert_after() inserts an item after the indicated item.

          + +

          The previous functions take a type parameter that can be one of the following.

          +
            +
          • ELM_GENLIST_ITEM_NONE
          • +
          • ELM_GENLIST_ITEM_TREE
          • +
          • ELM_GENLIST_ITEM_GROUP
          • +
          + +

          If ELM_GENLIST_ITEM_TREE is set, this item is displayed as being able to expand and have child items. If ELM_GENLIST_ITEM_GROUP is set, this item is a group index item that is displayed at the top until the next group appears.

          + +

          Figure: Genlist tree

          +

          Genlist tree

          + +

          The application clears the list with elm_genlist_clear(), which deletes all the items in the list. elm_object_item_del() deletes a specific item. elm_genlist_item_subitems_clear() clears all items that are children of the indicated parent item.

          + +

          To help inspect the list items, move to the item at the top of the list with elm_genlist_first_item_get(), which returns the item pointer. elm_genlist_last_item_get() moves to the item at the end of the list. elm_genlist_item_next_get() and elm_genlist_item_prev_get() move to the next and previous items relative to the indicated item. Using these calls you can go through the entire item list or tree.

          + + + + + + + + + + +
          Note
          As a tree, the items are flattened on the list, so elm_genlist_item_parent_get() gives you the name of the parent item (even to skip them if needed).
          + +

          elm_genlist_item_show() scrolls the scroller to show the desired item as visible.

          +

          elm_object_item_data_get() returns the data pointer set by the item creation functions.

          + +

          If an item changes (state, boolean, text or content change), use elm_genlist_item_update() for the genlist to update the item. Genlist re-realizes the item and calls the functions in the _Elm_Genlist_Item_Class for it.

          + +

          Selection

          + +

          Items are manually selected or deselected with elm_genlist_item_selected_set() or disabled with elm_object_item_disabled_set(). In case there is a tree or a group item, the elm_genlist_item_expanded_set() function is used to expand or contract the item.

          + + + + + + + + + + +
          Note
          Calling this function does not show or hide any child of an item (if it is a parent). You must manually delete and create them on the callbacks of the expanded or contracted signals.
          + +

          By default, the genlist is in single-selection mode: only one item can be selected at a time. You can use elm_genlist_multi_select_set() to select multiple items. In the single-selection mode, the elm_genlist_selected_item_get() function can be called to retrieve the selected item. If several items are selected, the elm_genlist_selected_items_get() returns a list of the current selected items.

          + +

          In the following figure, there is a genlist in multi-selection mode with two items selected (#4 and #5) and one item disabled (#2).

          + +

          Figure: Genlist component

          +

          Genlist component

          + +

          Using Genlist Callbacks

          + +

          The genlist component emits the following signals:

          +
            +
          • activated: The user has double-clicked or pressed (enter | return | spacebar) on an item. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • clicked,double: The user has double-clicked an item. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • selected: The user selects an item. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • unselected: The user unselects an item. event_info in the callback function points at an object of type Elm_Object_Item that contains the activated item.
          • +
          • expanded: The item is to be expanded with elm_genlist_item_expanded_set(). This callback fills in the child items. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • contracted: The item is to be contracted with elm_genlist_item_expanded_set(). This callback deletes the child items. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • expand,request: The user wants to expand a tree branch item. The callback decides if the item can expand (if it has any children) and calls elm_genlist_item_expanded_set() to set the state. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • contract,request: The user wants to contract a tree branch item. The callback decides if the item can contract (if it has any children) and calls elm_genlist_item_expanded_set() to set the state. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • realized: The item is created as a real evas object. event_info in the callback function points at an object of the type Elm_Object_Item, that contains the activated item.
          • +
          • unrealized: An item is going to be unrealized. Content objects provided are deleted and the item object is deleted or put into a floating cache. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,up: The item in the list is dragged (not scrolled) up. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,down: The item in the list is dragged (not scrolled) down. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,left: The item in the list is dragged (not scrolled) left. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,start,right: The item in the list is dragged (not scrolled) right. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag,stop: The item in the list has stopped being dragged. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • drag: The item in the list is being dragged. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • longpressed: The item is pressed for a certain amount of time. The default specified time is one second. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • scroll,anim,start: The scrolling animation is started. event_info is NULL.
          • +
          • scroll,anim,stop: The scrolling animation is stopped. event_info is NULL.
          • +
          • scroll,drag,start: Dragging the content is started. event_info is NULL.
          • +
          • scroll,drag,stop: Dragging the content is stopped. event_info is NULL.
          • +
          • edge,top: The genlist is scrolled to the top edge. event_info is NULL.
          • +
          • edge,bottom: The genlist is scrolled to the bottom edge. event_info is NULL.
          • +
          • edge,left: The genlist is scrolled to the left edge. event_info is NULL.
          • +
          • edge,right: The genlist is scrolled to the right edge. event_info is NULL.
          • +
          • multi,swipe,left: The genlist is multi-touch swiped left. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,swipe,right: The genlist is multi-touch swiped right. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,swipe,up: The genlist is multi-touch swiped up. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,swipe,down: The genlist is multi-touch swiped down. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,pinch,out: The genlist is multi-touch pinched out. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • multi,pinch,in: The genlist is multi-touch pinched in. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • swipe: The genlist is swiped. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • moved: A genlist item is moved in the reorder mode. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • moved,after: A genlist item is moved after another item in the reorder mode. To access the relative previous item, use elm_genlist_item_prev_get(). This signal is called along with the moved signal. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • moved,before: A genlist item is moved before another item in the reorder mode. To access the relative previous item, use elm_genlist_item_next_get(). This signal is called along with the moved signal. event_info in the callback function points at an object of the type Elm_Object_Item that contains the activated item.
          • +
          • language,changed The program's language is changed. event_info is NULL.
          • +
          • tree,effect,finished: A genlist tree effect is finished. event_info is NULL.
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_glview_mn.htm b/org.tizen.ui.practices/html/native/efl/component_glview_mn.htm new file mode 100644 index 0000000..06fd018 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_glview_mn.htm @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + GLView + + + + + + +
          +

          GLView

          + +

          This feature is supported in mobile applications only.

          + + +

          The GLView component renders OpenGL in an elementary object, which hides Evas GL complexity. For more information, see OpenGL ES.

          + +

          Figure: GLView gears example

          +

          GLView gears example

          + +

          Figure: GLView hierarchy

          +

          GLView hierarchy

          + +

          Adding a GLView Component

          + +

          Create a GLView component with the elm_glview_add() function.

          +
          +Evas_Object *glview, *parent;
          +
          +glview = elm_glview_add(parent);
          +
          + +

          In this example, the size of the GLView is set to 200x200 pixels.

          +
          +elm_glview_size_set(glview, 200, 200);
          +
          + +

          Using the GLView API

          + +

          You can configure the GLView rendering mode by activating the following rendering modes:

          + +
            +
          • ELM_GLVIEW_ALPHA: Alpha channel rendering mode
          • +
          • ELM_GLVIEW_DEPTH: Depth buffer rendering mode
          • +
          • ELM_GLVIEW_STENCIL: Stencil buffer rendering mode
          • +
          • ELM_GLVIEW_DIRECT: Direct rendering mode
          • +
          • ELM_GLVIEW_CLIENT_SIDE_ROTATION: The client handles the GL view rotation if direct rendering is enabled
          • +
          + +

          In the following example, the alpha channel and depth buffer rendering mode are enabled.

          +
          +elm_glview_mode_set(glview, ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH);
          +
          + +

          The following example shows how to decide what to do with the GL surface when the GLView component is resized.

          +
          +elm_glview_resize_policy_set(glview, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
          +
          + +

          The GL surface is destroyed and recreated to the new size (default function). The resize policy can also be set to ELM_GLVIEW_RESIZE_POLICY_SCALE. In that case, only the image object is scaled, not the underlying GL surface.

          + +

          The following example shows how to set the GLView rendering policy.

          +
          +elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ALWAYS);
          +
          + +

          The GLView object is always redrawn during the rendering loop. It can also be set to ELM_GLVIEW_RENDER_POLICY_ON_DEMAND (default function), where the GLView component is redrawn only when it is visible.

          + +

          Register the callbacks:

          + +
          elm_glview_init_func_set(glview, _init_gl_cb);
          +elm_glview_del_func_set(glview, _del_gl_cb);
          +elm_glview_resize_func_set(glview, _resize_gl_cb);
          +elm_glview_render_func_set(glview, _draw_gl_cb);
          +
          + +
            +
          • elm_glview_init_func_set() registers an init callback that is called at the GLView object creation.
          • +
          • elm_glview_del_func_set() registers a del function that is called when the GLView object is deleted.
          • +
          • elm_glview_resize_func_set() registers the resize function that is called during the rendering loop when the GLView object is resized.
          • +
          • elm_glview_render_func_set() registers the render function that is called when the GLView object must be redrawn.
          • +
          + +

          Using GLView Callbacks

          + +

          The GLView component emits the following signals:

          + +
            +
          • focused: The Glview component is focused. The event_info parameter points at an object of the type Elm_Focus_Info.
          • +
          • unfocused: The GLView object is unfocused.
          • +
          + +

          To register a callback:

          +
          +{
          +   evas_object_smart_callback_add(glview, "focused", focused_cb, data);
          +}
          +
          +// Callback function for the "focused" signal
          +// This callback is called when the GLView is focused
          +void focused_cb(void *data, Evas_Object *obj, void  *event_info)
          +{
          +   Elm_Focus_Info *fi = event_info;
          +
          +   dlog_print(DLOG_INFO, LOG_TAG, "GLView is focused\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_glview_wn.htm b/org.tizen.ui.practices/html/native/efl/component_glview_wn.htm new file mode 100644 index 0000000..e32c5bb --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_glview_wn.htm @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + GLView + + + + + + +
          +

          GLView

          + +

          This feature is supported in wearable applications only.

          + + +

          The GLView component renders OpenGL in an elementary object, which hides Evas GL complexity. For more information, see OpenGL ES.

          + + +

          Figure: GLView example

          +

          GLView example

          + +

          Figure: GLView hierarchy

          +

          GLView hierarchy

          + +

          Adding a GLView Component

          + +

          Create a GLView component with the elm_glview_add() function.

          +
          +Evas_Object *glview, *parent;
          +
          +glview = elm_glview_add(parent);
          +
          + +

          In this example, the size of the GLView is set to 200x200 pixels.

          +
          +elm_glview_size_set(glview, 200, 200);
          +
          + +

          Using the GLView API

          + +

          You can configure the GLView rendering mode by activating the following rendering modes:

          +
            +
          • ELM_GLVIEW_ALPHA: Alpha channel rendering mode
          • +
          • ELM_GLVIEW_DEPTH: Depth buffer rendering mode
          • +
          • ELM_GLVIEW_STENCIL: Stencil buffer rendering mode
          • +
          • ELM_GLVIEW_DIRECT: Direct rendering mode
          • +
          • ELM_GLVIEW_CLIENT_SIDE_ROTATION: The client handles the GL view rotation if direct rendering is enabled
          • +
          + +

          In the following example, the alpha channel and depth buffer rendering mode are enabled.

          +
          +elm_glview_mode_set(glview, ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH);
          +
          + +

          The following example shows how to decide what to do with the GL surface when the GLView component is resized.

          +
          +elm_glview_resize_policy_set(glview, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
          +
          + +

          The GL surface is destroyed and recreated to the new size (default function). The resize policy can also be set to ELM_GLVIEW_RESIZE_POLICY_SCALE. In that case, only the image object is scaled, not the underlying GL surface.

          + +

          The following example shows how to set the GLView rendering policy.

          +
          +elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ALWAYS);
          +
          + +

          The GLView object is always redrawn during the rendering loop. It can also be set to ELM_GLVIEW_RENDER_POLICY_ON_DEMAND (default function), where the GLView component is redrawn only when it is visible.

          + +

          Register the callbacks:

          +
          elm_glview_init_func_set(glview, _init_gl_cb);
          +elm_glview_del_func_set(glview, _del_gl_cb);
          +elm_glview_resize_func_set(glview, _resize_gl_cb);
          +elm_glview_render_func_set(glview, _draw_gl_cb);
          +
          + +
            +
          • elm_glview_init_func_set() registers an init callback that is called at the GLView object creation.
          • +
          • elm_glview_del_func_set() registers a del function that is called when the GLView object is deleted.
          • +
          • elm_glview_resize_func_set() registers the resize function that is called during the rendering loop when the GLView object is resized.
          • +
          • elm_glview_render_func_set() registers the render function that is called when the GLView object must be redrawn.
          • +
          + +

          Using GLView Callbacks

          + +

          The GLView component emits the following signals:

          +
            +
          • focused: The GlView component is focused. The event_info parameter points at an object of the type Elm_Focus_Info.
          • +
          • unfocused: The GLView object is unfocused.
          • +
          + +

          To register a callback:

          +
          +{
          +   evas_object_smart_callback_add(glview, "focused", focused_cb, data);
          +}
          +
          +// Callback function for the "focused" signal
          +// This callback is called when the GLView is focused
          +void focused_cb(void *data, Evas_Object *obj, void  *event_info)
          +{
          +   Elm_Focus_Info *fi = event_info;
          +
          +   dlog_print(DLOG_INFO, LOG_TAG, "GLView is focused\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_icon_mn.htm b/org.tizen.ui.practices/html/native/efl/component_icon_mn.htm new file mode 100644 index 0000000..025d772 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_icon_mn.htm @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + Icon + + + + + + +
          +

          Icon

          + +

          This feature is supported in mobile applications only.

          + +

          The icon component inherits from the image component. It is used to display images in an icon context.

          + +

          Figure: Icon component

          +

          Icon component

          + +

          Figure: Icon hierarchy

          +

          Icon hierarchy

          + +

          Adding an Icon Component

          + +

          You can create an icon and set it as a freedesktop.org Home standard icon.

          + +
          +Evas_Object *icon, *parent;
          +icon = elm_icon_add(parent);
          +elm_icon_standard_set(icon, "Home");
          +
          + +

          Changing Image File

          + +

          You can change the image by using an image in the filesystem (for example, /tmp/Home.png).

          +
          +elm_image_file_set(icon, "/tmp/Home.png", NULL);
          +
          + +

          You can also use a group in an Edje file (for example, /tmp/Home.edj).

          +
          +elm_image_file_set(icon, "/tmp/Home.edj", "elm/icon/Home/default");
          +
          + +

          A thumbnail can be generated and cached for future use. For this, you need the Ethumb library support.

          + +
          +elm_icon_thumb_set(icon, "/tmp/Home.png", NULL);
          +
          + +

          This function sets the file in the icon and enables the use of a cached thumbnail if it already exists. Otherwise, it creates a new thumbnail and caches it for future use.

          + +

          Using Icon Callbacks

          + +

          The icon component emits the following signals:

          +
            +
          • thumb,done: elm_icon_thumb_set() is completed with success.
          • +
          • thumb,error: elm_icon_thumb_set() fails.
          • +
          + +

          In both cases, event_info is NULL.

          + + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_icon_wn.htm b/org.tizen.ui.practices/html/native/efl/component_icon_wn.htm new file mode 100644 index 0000000..c670b68 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_icon_wn.htm @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + Icon + + + + + + +
          +

          Icon

          + +

          This feature is supported in wearable applications only.

          + +

          The icon component inherits from the image component. It is used to display images in an icon context.

          + + +

          Figure: Icon hierarchy

          +

          Icon hierarchy

          + +

          Adding an Icon Component

          + +

          You can create an icon and set it as a freedesktop.org Home standard icon.

          + +
          +Evas_Object *icon, *parent;
          +icon = elm_icon_add(parent);
          +elm_icon_standard_set(icon, "Home");
          +
          + +

          Changing Image File

          + +

          You can change the image by using an image in the filesystem (for example, /tmp/Home.png).

          +
          +elm_image_file_set(icon, "/tmp/Home.png", NULL);
          +
          + +

          You can also use a group in an Edje file (for example, /tmp/Home.edj).

          +
          +elm_image_file_set(icon, "/tmp/Home.edj", "elm/icon/Home/default");
          +
          + +

          A thumbnail can be generated and cached for future use. For this, you need the Ethumb library support.

          + +
          +elm_icon_thumb_set(icon, "/tmp/Home.png", NULL);
          +
          + +

          This function sets the file in the icon and enables the use of a cached thumbnail if it already exists. Otherwise, it creates a new thumbnail and caches it for future use.

          + +

          Using Icon Callbacks

          + +

          The icon component emits the following signals:

          +
            +
          • thumb,done: elm_icon_thumb_set() is completed with success.
          • +
          • thumb,error: elm_icon_thumb_set() fails.
          • +
          + +

          In both cases, event_info is NULL.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_image_mn.htm b/org.tizen.ui.practices/html/native/efl/component_image_mn.htm new file mode 100644 index 0000000..34f438d --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_image_mn.htm @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + Image + + + + + + +
          +

          Image

          + +

          This feature is supported in mobile applications only.

          + +

          The image component can load and display an image from a disk file or a memory region.

          + +

          Figure: Image component

          +

          Image component

          + +

          Figure: Image hierarchy

          +

          Image hierarchy

          + +

          Adding an Image Component

          + +

          This object is created with elm_image_add().

          + +
          +Evas_Object *image, *parent;
          +image = elm_image_add(parent);
          +
          + +

          Configuring the Image Component

          + +

          Various properties of the image can be tuned. First, you can disable the elementary scaling so that the image does not scale but resizes on both directions.

          +
          +elm_image_no_scale_set(image, EINA_TRUE);
          +elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
          +
          + +

          When scaling images, the smooth scaling algorithm can be used. It provides a better quality image but is slower than the default algorithm.

          +
          +elm_image_smooth_set(image, EINA_TRUE);
          +
          + +

          Preloading is used to load images without blocking the user interface. This preserves the reactivity of the user experience. The image is loaded in a thread. It can be disabled if desired.

          +
          +elm_image_preload_disabled_set(image, EINA_TRUE);
          +
          + +

          The image can be rotated or flipped. Here the image is rotated 180 degrees.

          +
          +elm_image_orient_set(image, ELM_IMAGE_ROTATE_180);
          +
          + +

          The following orientations are available:

          +
            +
          • ELM_IMAGE_ORIENT_0: No orientation change
          • +
          • ELM_IMAGE_ROTATE_90: Rotate the image 90 degrees clockwise
          • +
          • ELM_IMAGE_ROTATE_180: Rotate the image 180 degrees clockwise
          • +
          • ELM_IMAGE_ROTATE_270: Rotate the image 90 degrees counter-clockwise
          • +
          • ELM_IMAGE_FLIP_HORIZONTAL: Flip the image horizontally
          • +
          • ELM_IMAGE_FLIP_VERTICAL: Flip the image vertically
          • +
          • ELM_IMAGE_FLIP_TRANSPOSE: Flip the image along the bottom-left to top-right line
          • +
          • ELM_IMAGE_FLIP_TRANSVERSE: Flip the image along the top-left to bottom-right line
          • +
          + +

          If you want to keep the original aspect ration when resizing the image, you must define how the image fits into the object's area.

          +
          +// Tell the image to keep original aspect ratio 
          +elm_image_aspect_fixed_set(image, EINA_TRUE);
          +// Then let the image fill the entire object 
          +elm_image_fill_outside_set(image, EINA_TRUE);
          +
          + +

          In this configuration, part of the image can go outside the object. If elm_image_fill_outside_set is set to EINA_FALSE, the image stays inside the limits of the parent object.

          + +

          Using Image Callbacks

          + +

          The image component emits the following signals:

          +
            +
          • drop: The user drops an image typed object onto the object in question - the event info argument is the path to that image file
          • +
          • clicked: The user clicks the image. event_info is NULL.
          • +
          + +

          To register a callback when a user clicks on the image:

          +
          +{
          +   evas_object_smart_callback_add(image, "clicked", clicked_cb, data);
          +}
          +
          +// Callback function for the "clicked" signal
          +// This callback is called when the image is clicked
          +void clicked_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Image clicked\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_image_wn.htm b/org.tizen.ui.practices/html/native/efl/component_image_wn.htm new file mode 100644 index 0000000..1e74051 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_image_wn.htm @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + Image + + + + + + +
          +

          Image

          + +

          This feature is supported in wearable applications only.

          + +

          The image component can load and display an image from a disk file or a memory region.

          + +

          Figure: Image component

          +

          Image component

          + +

          Figure: Image hierarchy

          +

          Image hierarchy

          + +

          Adding an Image Component

          + +

          This object is created with elm_image_add().

          + +
          +Evas_Object *image, *parent;
          +image = elm_image_add(parent);
          +
          + +

          Configuring the Image Component

          + +

          Various properties of the image can be tuned. First, you can disable the elementary scaling so that the image does not scale but resizes on both directions.

          +
          +elm_image_no_scale_set(image, EINA_TRUE);
          +elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
          +
          + +

          When scaling images, the smooth scaling algorithm can be used. It provides a better quality image but is slower than the default algorithm.

          +
          +elm_image_smooth_set(image, EINA_TRUE);
          +
          + +

          Preloading is used to load images without blocking the user interface. This preserves the reactivity of the user experience. The image is loaded in a thread. It can be disabled if desired.

          +
          +elm_image_preload_disabled_set(image, EINA_TRUE);
          +
          + +

          The image can be rotated or flipped. Here the image is rotated 180 degrees.

          +
          +elm_image_orient_set(image, ELM_IMAGE_ROTATE_180);
          +
          + +

          The following orientations are available:

          +
            +
          • ELM_IMAGE_ORIENT_0: No orientation change
          • +
          • ELM_IMAGE_ROTATE_90: Rotate the image 90 degrees clockwise
          • +
          • ELM_IMAGE_ROTATE_180: Rotate the image 180 degrees clockwise
          • +
          • ELM_IMAGE_ROTATE_270: Rotate the image 90 degrees counter-clockwise
          • +
          • ELM_IMAGE_FLIP_HORIZONTAL: Flip the image horizontally
          • +
          • ELM_IMAGE_FLIP_VERTICAL: Flip the image vertically
          • +
          • ELM_IMAGE_FLIP_TRANSPOSE: Flip the image along the bottom-left to top-right line
          • +
          • ELM_IMAGE_FLIP_TRANSVERSE: Flip the image along the top-left to bottom-right line
          • +
          + +

          If you want to keep the original aspect ration when resizing the image, you must define how the image fits into the object's area.

          +
          +// Tell the image to keep original aspect ratio 
          +elm_image_aspect_fixed_set(image, EINA_TRUE);
          +// Then let the image fill the entire object 
          +elm_image_fill_outside_set(image, EINA_TRUE);
          +
          + +

          In this configuration, part of the image can go outside the object. If elm_image_fill_outside_set is set to EINA_FALSE, the image stays inside the limits of the parent object.

          + +

          Using Image Callbacks

          + +

          The image component emits the following signals:

          +
            +
          • drop: The user drops an image typed object onto the object in question - the event info argument is the path to that image file
          • +
          • clicked: The user clicks the image. event_info is NULL.
          • +
          + +

          To register a callback when a user clicks on the image:

          +
          +{
          +   evas_object_smart_callback_add(image, "clicked", clicked_cb, data);
          +}
          +
          +// Callback function for the "clicked" signal
          +// This callback is called when the image is clicked
          +void clicked_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Image clicked\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_index_mn.htm b/org.tizen.ui.practices/html/native/efl/component_index_mn.htm new file mode 100644 index 0000000..e1325b1 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_index_mn.htm @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + Index + + + + + + +
          +

          Index

          + +

          This feature is supported in mobile applications only.

          + +

          An index component gives you an index for fast access to whichever group of other UI items you have. The index component is by default hidden, but it appears when the user clicks over its reserved area in the canvas. In the default theme, it is a one finger wide area on the right side of the index component's container. Generally, an index is used together with lists, generic lists, or generic grids.

          + +

          Figure: Index component

          +

          Index component

          + +

          Figure: Index hierarchy

          +

          Index hierarchy

          + +

          Adding an Index Component

          + +

          Call the elm_index_add() function to create a new index component.

          +
          +Evas_Object *index, *parent;
          +index = elm_index_add(parent);
          +
          + +

          Adding Items

          + +

          The following example shows how to add the listitem object at the letter A, calling the smart callback it_select_cb() when this item is selected.

          +
          +Elm_Object_Item *list_item1, *list_item2;
          +elm_index_item_append(index, "A", it_select_cb, list_item1);
          +
          + +

          The following example shows how to define the smart callback.

          +
          +// Callback function called when the list_item1 object
          +// is selected
          +void it_select_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Item1 selected\n");
          +}
          +
          + +

          In the previous case, the indexes are appended to the existing ones. It is also possible to prepend index items with elm_index_item_prepend().

          + +

          Sorting Index Items

          + +

          You can insert index items using a sorting function. Indexes can be sorted, for example, by alphabetic order.

          + +

          You must write a compare function that returns a positive int, 0 or a negative int when the data2 item parameter is respectively greater than, equal to or lower than the data1 parameter.

          + +
          +static int
          +_index_icmp(const void *data1,
          +      const void *data2)
          +{
          +   int result;
          +
          +   // Code that does the item comparison is written here
          +
          +   return result;
          +}
          +
          + +

          This example shows how to add a new item at the B index using the compare function to sort the indexes.

          + +
          +elm_index_item_sorted_insert(index, "B", NULL, list_item2, _index_icmp, NULL);
          +
          + +

          Using Index Callbacks

          + +

          The index component emits the following signals:

          +
            +
          • changed: The selected index item changes. event_info is the selected item's data pointer.
          • +
          • delay,changed: The selected index item changes, but after a small idling period. event_info is the selected item's data pointer.
          • +
          • selected: The user releases a mouse button and selects an item. event_info is the selected item's data pointer.
          • +
          • level,up: The user moves a finger from the first level to the second level.
          • +
          • level,down: The user moves a finger from the second level to the first level.
          • +
          + +

          When the user selects an item in the index, the selected signal is emitted. The developer can then implement the associated callback to do the appropriate action (to show a given area or child object depending on the index item selected, for example). Here is an example of such a callback.

          +
          +static void
          +_index_selected_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Object_Item *lit = event_info;
          +
          +   // Code that does the desired action
          +}
          +
          + +

          After that, the callback to the selected signal is registered.

          +
          +evas_object_smart_callback_add(index, "selected", _index_selected_cb, NULL);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_index_wn.htm b/org.tizen.ui.practices/html/native/efl/component_index_wn.htm new file mode 100644 index 0000000..0ac1f02 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_index_wn.htm @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + Index + + + + + + +
          +

          Index

          + +

          This feature is supported in wearable applications only.

          + +

          An index component gives you an index for fast access to whichever group of other UI items you have. The index component is by default hidden, but it appears when the user clicks over its reserved area in the canvas. In the default theme, it is a one finger wide area on the right side of the index component's container. Generally, an index is used together with lists, generic lists, or generic grids.

          + + +

          Figure: Index component

          +

          Index component

          + +

          Figure: Index hierarchy

          +

          Index hierarchy

          + +

          Adding an Index Component

          + +

          Call the elm_index_add() function to create a new index component.

          +
          +Evas_Object *index, *parent;
          +index = elm_index_add(parent);
          +
          + +

          Adding Items

          + +

          The following example shows how to add the listitem object at the letter A, calling the smart callback it_select_cb() when this item is selected.

          +
          +Elm_Object_Item *list_item1, *list_item2;
          +elm_index_item_append(index, "A", it_select_cb, list_item1);
          +
          + +

          The following example shows how to add item objects, calling the smart callback it_select_cb() when the item is selected.

          +
          +Elm_Object_Item *it[5];
          +for (i = 0; i < 5; ++i)
          +{
          +   it[i] = elm_index_item_append(index, NULL, it_select_cb, (void *) i);
          +}
          + +

          The following example shows how to define the smart callback.

          +
          +// Callback function called when the list_item1 object
          +// is selected
          +void it_select_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Item1 selected\n");
          +}
          +
          + +

          In the previous case, the indexes are appended to the existing ones. It is also possible to prepend index items with elm_index_item_prepend().

          + + +

          Using Index Callbacks

          + +

          The index component emits the following signals:

          +
            +
          • changed: The selected index item changes. event_info is the selected item's data pointer.
          • +
          • delay,changed: The selected index item changes, but after a small idling period. event_info is the selected item's data pointer.
          • +
          • selected: The user releases a mouse button and selects an item. event_info is the selected item's data pointer.
          • +
          • level,up: The user moves a finger from the first level to the second level.
          • +
          • level,down: The user moves a finger from the second level to the first level.
          • +
          + +

          When the user selects an item in the index, the selected signal is emitted. The developer can then implement the associated callback to do the appropriate action (to show a given area or child object depending on the index item selected, for example). Here is an example of such a callback.

          +
          +static void
          +_index_selected_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Object_Item *lit = event_info;
          +
          +   // Code that does the desired action
          +}
          +
          + +

          After that, the callback to the selected signal is registered.

          +
          +evas_object_smart_callback_add(index, "selected", _index_selected_cb, NULL);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_infra_n.htm b/org.tizen.ui.practices/html/native/efl/component_infra_n.htm new file mode 100644 index 0000000..274b9a2 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_infra_n.htm @@ -0,0 +1,69 @@ + + + + + + + + + + + + + UI Component Infrastructure Modules: Managing Component Properties + + + + + +
          + +

          UI Component Infrastructure Modules: Managing Component Properties

          + +

          The Elementary library is composed of many UI components to support Tizen native applications. While using UI components, you must manage their common properties. To meet this requirement, Elementary creates some infrastructure modules in order to support many UI components. Currently, Elementary provides following infrastructure modules:

          +
          • Component focus +

            A UI component application always has 1 focused object, which is selected to receive input from the user. The focus can change between objects, and the focused object can be decorated on the screen to make it easily visible.

          • +
          • Handling touch gestures for components +

            UI components generally handle basic touch inputs, such as press, release and moving. However, in some use cases (for example, when the accessibility Assistive Technology (AT) client is working), handling for a variety of touch gesture events (such as tap, double-tap, triple-tap, double-tap and hold, and left/right/up/down swipe) is needed. Elementary can also create new touch gesture patterns according to application use cases.

            +
          • +
          • Customizing components +

            Elementary provides basic UI components based on the Tizen UX styles which you can use. Usually, you can use the supported UI components themselves to make your application. However, if you need to use other styles than the basic ones, you must customize the UI component style.

          • +
          • UI mirroring +

            Elementary provides UI mirroring, which allows you to set UI mirroring on specific UI components or the whole interface. This facility is very useful to support applications which need both right-to-left and left-to-right languages.

          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/component_label_mn.htm b/org.tizen.ui.practices/html/native/efl/component_label_mn.htm new file mode 100644 index 0000000..295beea --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_label_mn.htm @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + Label + + + + + + +
          +

          Label

          + +

          This feature is supported in mobile applications only.

          + +

          The label component displays text with simple html-like markup.

          + + +

          Figure: Label component

          +

          Label component

          + +

          Figure: Label hierarchy

          +

          Label hierarchy

          + +

          Adding a Label Component

          + +

          To add a label and set the text in it, use the following functions.

          + +
          +Evas_Object *label = elm_label_add(win);
          +
          +elm_object_text_set(label, "Some long text for our label, that is not so long");
          +
          + +

          Using the Label Styles

          + +

          Label displays the text with several predefined styles.

          +
            +
          • default: No animation
          • +
          • marker: The text is centered and bolded.
          • +
          • slide_long: The text appears from the right of the screen and slides until it disappears in the left of the screen(reappearing on the right again).
          • +
          • slide_short: The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the position is reset.
          • +
          • slide_bounce: The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown, the animation reverses, moving the text to the left.
          • +
          + +

          Here the style is set to slide_long.

          + +
          +elm_object_style_set(label, "slide_long");
          +
          + +

          Configuring the Label

          + +

          The duration of the animation and the slide mode can be set with the following functions.

          +
          +elm_label_slide_duration_set(label, 3);
          +elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_ALWAYS);
          +
          + +

          Use the following function to modify the style.

          +
          +elm_object_style_set(label, "slide_bounce");
          +
          + +

          Using the Label Callbacks

          + +

          This UI component emits the following signals:

          +
            +
          • language,changed: The program's language changes.
          • +
          • slide,end: The slide reaches the end.
          • +
          • anchor,clicked: The anchor is clicked. event_info points to an object of the type Elm_Label_Anchor_Info.
          • +
          • anchor,mouse,down event_info points to an object of the type Elm_Label_Anchor_Info.
          • +
          • anchor,mouse,up event_info points to an object of the type Elm_Label_Anchor_Info.
          • +
          + +

          The following example registers a callback on the slide,end signal.

          + +
          +{
          +   evas_object_smart_callback_add(label, "slide,end", slide_end_cb, data);
          +}
          +
          +// Callback function for the "slide,end" signal
          +// This callback is called when the label slide reaches the end
          +void slide_end_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Slide has reach the end.\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_label_wn.htm b/org.tizen.ui.practices/html/native/efl/component_label_wn.htm new file mode 100644 index 0000000..e41947a --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_label_wn.htm @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + Label + + + + + + +
          +

          Label

          + +

          This feature is supported in wearable applications only.

          + +

          The label component displays text with simple html-like markup.

          + +

          Figure: Label component

          +

          Label component

          + +

          Figure: Label hierarchy

          +

          Label hierarchy

          + +

          Adding a Label Component

          + +

          To add a label and set the text in it, use the following functions.

          + +
          +Evas_Object *label = elm_label_add(win);
          +
          +elm_object_text_set(label, "Some long text for our label, that is not so long");
          +
          + +

          Using the Label Styles

          + +

          Label displays the text with several predefined styles.

          +
            +
          • default: No animation
          • +
          • marker: The text is centered and bolded.
          • +
          • slide_long: The text appears from the right of the screen and slides until it disappears in the left of the screen(reappearing on the right again).
          • +
          • slide_roll: The text appears from the left of the label and slides to the right to show the overflow, and then appears from the right of the label again.
          • +
          • slide_short: The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the position is reset.
          • +
          • slide_bounce: The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown, the animation reverses, moving the text to the left.
          • +
          + +

          Here the style is set to slide_roll.

          + +
          +elm_object_style_set(label, "slide_roll");
          +
          + +

          Configuring the Label

          + +

          The duration of the animation and the slide mode can be set with the following functions.

          +
          +elm_label_slide_duration_set(label, 3);
          +elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_ALWAYS);
          +
          + +

          Use the following function to modify the style.

          +
          +elm_object_style_set(label, "slide_bounce");
          +
          + +

          Using the Label Callbacks

          + +

          This UI component emits the following signals:

          +
            +
          • language,changed: The program's language changes.
          • +
          • slide,end: The slide reaches the end.
          • +
          • anchor,clicked: The anchor is clicked. event_info points to an object of the type Elm_Label_Anchor_Info.
          • +
          • anchor,mouse,down event_info points to an object of the type Elm_Label_Anchor_Info.
          • +
          • anchor,mouse,up event_info points to an object of the type Elm_Label_Anchor_Info.
          • +
          + +

          The following example registers a callback on the slide,end signal.

          + +
          +{
          +   evas_object_smart_callback_add(label, "slide,end", slide_end_cb, data);
          +}
          +
          +// Callback function for the "slide,end" signal
          +// This callback is called when the label slide reaches the end
          +void slide_end_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Slide has reach the end.\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_list_mn.htm b/org.tizen.ui.practices/html/native/efl/component_list_mn.htm new file mode 100644 index 0000000..fae75d3 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_list_mn.htm @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + List + + + + + + +
          +

          List

          + +

          This feature is supported in mobile applications only.

          + + +

          This UI component is a very simple type of a list component. It is not to be used to manage a lot of items. For that, genlists are a better option.

          + +

          The list items can contain a text and two contents (start and end). These are set with the elm_object_item_*() functions.

          + + +

          Figure: List component

          +

          List component

          + +

          Figure: List hierarchy

          +

          List hierarchy

          + +

          Adding a List Component

          + +
          +Evas_Object *list, *parent;
          +
          +// Create a list 
          +list = elm_list_add(parent);
          +
          + +

          Using the List

          + +

          This UI component implements the scrollable interface, so the scroller component functions can be used on it. For example, if you want to change the bounce property of the scroller or the scrolling policy:

          + +
          +Evas_Object *list;
          +
          +// Change the scroller policy to fix the scroll only vertically
          +elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_OFF);
          +// Enable bounce effect when the list reaches the upper and lower limits 
          +elm_scroller_bounce_set(list, EINA_TRUE, EINA_TRUE);
          +
          + +

          The elm_list_multi_select_set() function can be called to enable multi-selection of items. Each time an item is clicked, the state changes to selected.

          + +
          +Evas_Object *list;
          +
          +// Activate multi selection 
          +elm_list_multi_select_set(list, EINA_TRUE);
          +
          + +

          Adding Items to the List

          + +

          Items are added with elm_list_item_append() or elm_list_item_prepend(). Here an example of adding ten items with text and one icon on the front: The last two arguments are the callback function when the created item is clicked and the data passed to the callback function.

          + +
          +Evas_Object *list;
          +int i;
          +
          +// This function is called when the list item is selected 
          +static void _selected_item_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
          +   Eina_Bool selected = elm_list_item_selected_get(list_it);
          +   dlog_print(DLOG_INFO, LOG_TAG, "item is %s\n", selected? "selected": "unselected");
          +}
          +
          +for (i = 0; i < 10; i++)
          +{
          +   Evas_Object *ic;
          +   char tmp[8];
          +   snprintf(tmp, sizeof(tmp), "Item %02d", i);
          +   // Create an icon 
          +   ic = elm_icon_add(win);
          +   // Set the file to the icon file 
          +   elm_image_file_set(ic, "path/to/file", NULL);
          +   // Add item to the list 
          +   elm_list_item_append(list, tmp, ic, NULL, _selected_item_cb, NULL);
          +}
          +
          +
          + +

          Changing the Text or Icon of an Item

          + +

          If you want to change the state of an item, you can do it by using all the functions relative to Elm_Object_Item. Each item of the list contains two instances of an evas_object. Give those as the third and the fourth arguments when you append or prepend the item in the list. The evas_object instances are changed with elm_object_item_part_content_set. The first object is referenced as the start object in the theme, whereas the second one is referenced as the end object. Give these names when you use the elm_object_item_part_content_set. The label of the item is changed by using elm_object_item_text_set.

          + +
          +Evas_Object *list;
          +Eina_List *l;
          +Elm_Object_Item *it;
          +
          +// Retrieve the current selected item 
          +it = elm_list_selected_item_get(list);
          +if (!it)
          +   return;
          +
          +ic = elm_icon_add(win);
          +// Set the file to the icon file 
          +elm_image_file_set(ic, "path/to/file", NULL);
          +// Change the first icon 
          +elm_object_item_part_content_set(it, "start", ic);
          +// Change the second icon 
          +elm_object_item_part_content_set(it, "end", ic);
          +// Change the label 
          +elm_object_item_text_set(it, "I've been selected !");
          +
          + +

          Retrieving Selected Items

          + +

          The list of the currently selected items is retrieved with elm_list_selected_items_get(). If the multiselect mode is false, you can retrieve the only selected item with elm_list_selected_item_get(). For example, this is how to unselect all previously selected items.

          + +
          +Evas_Object *list; Eina_List *l;
          +Eina_List *selected_items;
          +// List of Elm_Object_Item 
          +Elm_Object_Item *it;
          +
          +selected_items = elm_list_selected_items_get(list);
          +EINA_LIST_FOREACH(selected_items, l, it)
          +   elm_list_item_selected_set(it, EINA_FALSE);
          +
          + +

          List Item Operations

          + +

          To find out if an item is selected, call elm_list_item_selected_get. This function returns EINA_TRUE if the item is selected, otherwise EINA_FALSE.

          + +

          Elementary list provides two functions for sliding a list to a specific item. elm_list_item_show shows the item passed as an argument, whereas elm_list_item_bring_in shows the item, but only after animating the slide.

          + +

          You can go to the item immediately preceding a specific item with the function elm_list_item_prev, or to the one immediately following a specific item with the function elm_list_item_next.

          + +

          The following example shows selecting the item immediately following the currently selected one, unselecting it, selecting the next one and bringing it to the screen.

          + +
          +Evas_Object *list;
          +Elm_Object_Item *current, *next;
          +current = elm_list_selected_item_get(list);
          +elm_list_item_selected_set(current, EINA_FALSE);
          +next = elm_list_item_next(current);
          +elm_list_item_selected_set(next, EINA_TRUE);
          +elm_list_item_bring_in(next);
          +
          + +

          Using List Callbacks

          + +

          The list emits the following signals:

          +
            +
          • activated: The user double-clicks or presses (enter | return | spacebar) on an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • clicked,double: The user double-clicks an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • selected: The user selects an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • unselected: The user unselects an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • longpressed: The user long-presses an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • edge,top: The list is scrolled to the top edge.
          • +
          • edge,bottom: The list is scrolled to the bottom edge.
          • +
          • edge,left: The list is scrolled to the left edge.
          • +
          • edge,right: The list is scrolled to the right edge.
          • +
          • highlighted: The user highlights an item on the list. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • unhighlighted: The user unhighlights an item in the list. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          + +

          You can register to the clicked,double signal with the following code. Note that the currently double-clicked item can be retrieved using the event_info pointer. This code registers to the double,clicked signal and unselects the item that has been double-clicked.

          + +
          +{
          +   Evas_Object *list;
          +
          +   evas_object_smart_callback_add(list, "clicked,double", double_clicked_cb, data);
          +}
          +
          +// Callback function for the "clicked" signal
          +// This callback is called when the button is clicked by the user
          +void double_clicked_cb(void *data, Evas_Object *obj, void  *event_info)
          +{
          +   elm_Object_Item *it = event_info;
          +   elm_list_selected_item_set(it,  EINA_FALSE);
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_list_wn.htm b/org.tizen.ui.practices/html/native/efl/component_list_wn.htm new file mode 100644 index 0000000..345f52d --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_list_wn.htm @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + List + + + + + + +
          +

          List

          + +

          This feature is supported in wearable applications only.

          + +

          This UI component is a very simple type of a list component. It is not to be used to manage a lot of items. For that, genlists are a better option.

          + +

          The list items can contain a text and two contents (start and end). These are set with the elm_object_item_*() functions.

          + + +

          Figure: List component

          +

          List component

          + +

          Figure: List hierarchy

          +

          List hierarchy

          + +

          Adding a List Component

          + +
          +Evas_Object *list, *parent;
          +
          +// Create a list 
          +list = elm_list_add(parent);
          +
          + +

          Using the List

          + +

          This UI component implements the scrollable interface, so the scroller component functions can be used on it. For example, if you want to change the bounce property of the scroller or the scrolling policy:

          + +
          +Evas_Object *list;
          +
          +// Change the scroller policy to fix the scroll only vertically
          +elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
          +// Enable bounce effect when the list reaches the upper and lower limits 
          +elm_scroller_bounce_set(list, EINA_FALSE, EINA_TRUE);
          +
          + +

          The elm_list_multi_select_set() function can be called to enable multi-selection of items. Each time an item is clicked, the state changes to selected.

          + +
          +Evas_Object *list;
          +
          +// Activate multi selection 
          +elm_list_multi_select_set(list, EINA_FALSE);
          +
          + +

          Adding Items to the List

          + +

          Items are added with elm_list_item_append() or elm_list_item_prepend(). Here an example of adding ten items with text and one icon on the front: The last two arguments are the callback function when the created item is clicked and the data passed to the callback function.

          + +
          +Evas_Object *list;
          +int i;
          +
          +// This function is called when the list item is selected 
          +static void _selected_item_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
          +   Eina_Bool selected = elm_list_item_selected_get(list_it);
          +   dlog_print(DLOG_INFO, LOG_TAG, "item is %s\n", selected? "selected": "unselected");
          +}
          +
          +for (i = 0; i < 10; i++)
          +{
          +   Evas_Object *ic;
          +   char tmp[8];
          +   snprintf(tmp, sizeof(tmp), "Item %02d", i);
          +   // Create an icon 
          +   ic = elm_icon_add(win);
          +   // Set the file to the icon file 
          +   elm_image_file_set(ic, "path/to/file", NULL);
          +   // Add item to the list 
          +   elm_list_item_append(list, tmp, ic, NULL, _selected_item_cb, NULL);
          +}
          +
          +
          + +

          Changing the Text or Icon of an Item

          + +

          If you want to change the state of an item, you can do it by using all the functions relative to Elm_Object_Item. Each item of the list contains two instances of an evas_object. Give those as the third and the fourth arguments when you append or prepend the item in the list. The evas_object instances are changed with elm_object_item_part_content_set. The first object is referenced as the start object in the theme, whereas the second one is referenced as the end object. Give these names when you use the elm_object_item_part_content_set. The label of the item is changed by using elm_object_item_text_set.

          + +
          +Evas_Object *list;
          +Eina_List *l;
          +Elm_Object_Item *it;
          +
          +// Retrieve the current selected item 
          +it = elm_list_selected_item_get(list);
          +if (!it)
          +   return;
          +
          +ic = elm_icon_add(win);
          +// Set the file to the icon file 
          +elm_image_file_set(ic, "path/to/file", NULL);
          +// Change the first icon 
          +elm_object_item_part_content_set(it, "start", ic);
          +// Change the second icon 
          +elm_object_item_part_content_set(it, "end", ic);
          +// Change the label 
          +elm_object_item_text_set(it, "I've been selected !");
          +
          + +

          Retrieving Selected Items

          + +

          The list of the currently selected items is retrieved with elm_list_selected_items_get(). If the multiselect mode is false, you can retrieve the only selected item with elm_list_selected_item_get(). For example, this is how to unselect all previously selected items.

          + +
          +Evas_Object *list; Eina_List *l;
          +Eina_List *selected_items;
          +// List of Elm_Object_Item 
          +Elm_Object_Item *it;
          +
          +selected_items = elm_list_selected_items_get(list);
          +EINA_LIST_FOREACH(selected_items, l, it)
          +   elm_list_item_selected_set(it, EINA_FALSE);
          +
          + +

          List Item Operations

          + +

          To find out if an item is selected, call elm_list_item_selected_get. This function returns EINA_TRUE if the item is selected, otherwise EINA_FALSE.

          + +

          Elementary list provides two functions for sliding a list to a specific item. elm_list_item_show shows the item passed as an argument, whereas elm_list_item_bring_in shows the item, but only after animating the slide.

          + +

          You can go to the item immediately preceding a specific item with the function elm_list_item_prev, or to the one immediately following a specific item with the function elm_list_item_next.

          + +

          The following example shows selecting the item immediately following the currently selected one, unselecting it, selecting the next one and bringing it to the screen.

          + +
          +Evas_Object *list;
          +Elm_Object_Item *current, *next;
          +current = elm_list_selected_item_get(list);
          +elm_list_item_selected_set(current, EINA_FALSE);
          +next = elm_list_item_next(current);
          +elm_list_item_selected_set(next, EINA_TRUE);
          +elm_list_item_bring_in(next);
          +
          + +

          Using List Callbacks

          + +

          The list emits the following signals:

          +
            +
          • activated: The user double-clicks or presses (enter | return | spacebar) on an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • clicked,double: The user double-clicks an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • selected: The user selects an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • unselected: The user unselects an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • longpressed: The user long-presses an item. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • edge,top: The list is scrolled to the top edge.
          • +
          • edge,bottom: The list is scrolled to the bottom edge.
          • +
          • edge,left: The list is scrolled to the left edge.
          • +
          • edge,right: The list is scrolled to the right edge.
          • +
          • highlighted: The user highlights an item on the list. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          • unhighlighted: The user unhighlights an item in the list. The event_info parameter of the callback function contains a pointer to the item activated.
          • +
          + +

          You can register to the clicked,double signal with the following code. Note that the currently double-clicked item can be retrieved using the event_info pointer. This code registers to the double,clicked signal and unselects the item that has been double-clicked.

          + +
          +{
          +   Evas_Object *list;
          +
          +   evas_object_smart_callback_add(list, "clicked,double", double_clicked_cb, data);
          +}
          +
          +// Callback function for the "clicked" signal
          +// This callback is called when the button is clicked by the user
          +void double_clicked_cb(void *data, Evas_Object *obj, void  *event_info)
          +{
          +   elm_Object_Item *it = event_info;
          +   elm_list_selected_item_set(it,  EINA_FALSE);
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_map_mn.htm b/org.tizen.ui.practices/html/native/efl/component_map_mn.htm new file mode 100644 index 0000000..668b5d8 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_map_mn.htm @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + Map + + + + + + +
          +

          Map

          + +

          This feature is supported in mobile applications only.

          + +

          The map component displays a geographic map. The default map data are provided by the OpenStreetMap project (http://www.openstreetmap.org/). Custom providers can also be added.

          + +

          This UI component supports:

          +
            +
          • Zooming
          • +
          • Scrolling
          • +
          • Markers with content to be displayed when the user clicks over them
          • +
          • Group of markers
          • +
          • Routes
          • +
          + +

          The map component implements the scroller interface so that all the functions that work with the scroller component also work with maps.

          + +

          Figure: Map hierarchy

          +

          Map hierarchy

          + +

          Adding a Map Component

          + +

          Once created with the elm_map_add() function, zoom level x12 can be set.

          + +
          +Evas_Object *map, *parent;
          +
          +map = elm_map_add(parent);
          +elm_map_zoom_mode_set(map, ELM_MAP_ZOOM_MODE_MANUAL);
          +elm_map_zoom_set(map, 12);
          +
          + +

          Here the zoom mode is set to manual, but it can also be set to the ELM_MAP_ZOOM_MODE_AUTO_FIT mode and the ELM_MAP_ZOOM_MODE_AUTO_FILL mode. In that case however, the elm_map_zoom_set() function cannot be used.

          + +

          Playing with the Map

          + +

          If you have coordinates of a specific area (2 2 N, 48 8 E), it can be shown on the map.

          +
          +elm_map_region_show(map, 2.2, 48.8);
          +
          + +

          This shows the desired coordinates. The location can also be shown with a bring-in animation.

          +
          +elm_map_region_bring_in(map, 2.2, 48.8);
          +
          + +

          The map is rotated 90 degrees around the current position.

          +
          +elm_map_rotate_set(map, 90, 2.2, 48.8);
          +
          + +

          Drawing Overlays

          + +

          Overlays are markers that can be placed anywhere on the map. They can represent any object you want to put on the map.

          + +

          Creating an Overlay Class

          + +

          Overlay classes can be created if several objects are of the same type. For example, you can create a forest overlay class to represent the forests visible on the map. To do this, set the minimum zoom level at which this class is visible. The forest class overlay is visible when the zoom level is superior to eight.

          + +

          Set an icon ("Home" icon) to the forest class. This icon is displayed in place of the forest class on the map.

          +
          +Evas_Object *icon;
          +Elm_Map_Overlay *forest_class = elm_map_overlay_class_add(map);
          +
          +// Set min zoom level at which class is displayed
          +elm_map_overlay_displayed_zoom_min_set(forest_class, 8);
          +
          +// Create a Home icon object and set it to the forest class 
          +icon = elm_icon_add(map);
          +elm_icon_standard_set(icon, "home");
          +elm_map_overlay_icon_set(forest_class, icon);
          +
          + +

          Adding Overlays to a Class

          + +

          After creating a forest class, it is possible to add overlay objects to it. Here an overlay for the Meudon forest is created. The data is linked to the overlay with the elm_map_overlay_data_set() function. Set the name of the forest in the data. The icon can be set to the overlay with the elm_map_overlay_icon_set() function.

          + + + + + + + + + + +
          Note
          Do not use the same icon object for two different overlays. Create a new icon object each time you need one.
          + +
          +Elm_Map_Overlay *ovl;
          +const char* data_meudon = "Meudon forest";
          +const char* data_fausses = "Fausse forest";
          +
          +// Add an overlay
          +ovl = elm_map_overlay_add(map, 2.20718, 48.79759);
          +icon = elm_icon_add(map);
          +elm_icon_standard_set(icon, "stop");
          +elm_map_overlay_icon_set(ovl, icon);
          +elm_map_overlay_data_set(ovl, &data_meudon);
          +
          +// Add the new ovl object to the forest class 
          +elm_map_overlay_class_append(forest_class, ovl);
          +
          +// Add another overlay next to the first one 
          +ovl = elm_map_overlay_add(map, 2.1699, 48.8189);
          +icon = elm_icon_add(map);
          +elm_icon_standard_set(icon, "stop");
          +elm_map_overlay_icon_set(ovl, icon);
          +elm_map_overlay_data_set(ovl, &data_fausses);
          +elm_map_overlay_class_append(forest_class, ovl);
          +
          + +

          If you add another overlay to the forest class, the two overlays can be grouped under the forest class icon on certain zoom level conditions. You can define on which zoom level items are grouped.

          +
          +elm_map_overlay_class_zoom_max_set(forest_class, 8);
          +
          + +

          In this case, overlay members of the forest class are grouped when the map is displayed at less than zoom level eight.

          + +

          Creating Bubbles Following Overlays

          + +

          The following example shows how to set a content in a bubble following an overlay.

          + +
          +// Add an overlay bubble object 
          +Elm_Map_Overlay *bubble = elm_map_overlay_bubble_add(map);
          +
          +// Set it to follow a specific overlay (the last created one here) 
          +elm_map_overlay_bubble_follow(bubble, ovl);
          +
          + +

          Once following an overlay, the bubble appears, moves or hides following the parent overlay's behavior.

          + +

          Content is added to the bubble with the elm_map_overlay_bubble_content_append() function.

          + +

          Adding Other Overlays

          + +

          You can draw a circle on the map with coordinates and a radius size.

          +
          +Elm_Map_Overlay *circle = elm_map_overlay_circle_add(map, 2.2, 48.8, 0.02);
          +
          + +

          You can also add a scale at the 200x0 coordinate (in pixels).

          +
          +Elm_Map_Overlay *scale = elm_map_overlay_scale_add(map, 200, 0);
          +
          + +

          You can also draw a line, a polygon, or a route. For a full description of these functions, see the Map API.

          + +

          Calculating Routes

          + +

          A route between a starting point and an ending point is calculated with the elm_map_route_add() call. The type of transport and the routing calculation method can be provided so as to have the desired result.

          + +

          The following example shows how to get a route calculation between the first and the second overlay. It is configured to use the bicycle, and to find the fastest route possible.

          + +
          +Elm_Map_Route *route = elm_map_route_add(map,
          +         ELM_MAP_ROUTE_TYPE_BICYCLE,
          +         ELM_MAP_ROUTE_METHOD_FASTEST,
          +         2.20718, 48.79759,
          +         2.1699, 48.8189,
          +         NULL, NULL);
          +
          +// Add a callback to when the route has been calculated and loaded 
          +evas_object_smart_callback_add(map, "route,loaded", _route_loaded_cb, route);
          +
          + +

          Once the route is calculated, create a route overlay object and change its color. In this example, the route,loaded callback is used.

          +
          +static void
          +_route_loaded_cb(void *data, Evas_Object *obj, void *ev)
          +{
          +   Elm_Map_Route *route = data;
          +
          +   Elm_Map_Overlay *route_ovl = elm_map_overlay_route_add(obj, route);
          +   elm_map_overlay_color_set(route_ovl, 0, 255, 0, 255);
          +}
          +
          + +

          Using Map Callbacks

          + +

          The map component emits the following callbacks:

          +
            +
          • clicked: The user has clicked the map without dragging around.
          • +
          • clicked,double: The user has double-clicked the map.
          • +
          • press: The user has pressed down on the map.
          • +
          • longpressed: The user has pressed down on the map for a long time without dragging around.
          • +
          • scroll: The content is scrolled (moved).
          • +
          • scroll,drag,start: Dragging the contents around starts.
          • +
          • scroll,drag,stop: Dragging the contents around stops.
          • +
          • scroll,anim,start: Scrolling animation starts.
          • +
          • scroll,anim,stop: Scrolling animation stops.
          • +
          • zoom,start: Zoom animation starts.
          • +
          • zoom,stop: Zoom animation stops.
          • +
          • zoom,change: The zoom is changed when using an auto zoom mode.
          • +
          • tile,load: A map tile image load begins.
          • +
          • tile,loaded: A map tile image load ends.
          • +
          • tile,loaded,fail: A map tile image load fails.
          • +
          • route,load: Route request begins.
          • +
          • route,loaded: Route request ends.
          • +
          • route,loaded,fail: Route request fails.
          • +
          • name,load: Name request begins.
          • +
          • name,loaded: Name request ends.
          • +
          • name,loaded,fail: Name request fails.
          • +
          • overlay,clicked: An overlay is clicked.
          • +
          • loaded: The map is loaded.
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_notify_mn.htm b/org.tizen.ui.practices/html/native/efl/component_notify_mn.htm new file mode 100644 index 0000000..4c98e96 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_notify_mn.htm @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + Notify + + + + + + +
          +

          Notify

          + +

          This feature is supported in mobile applications only.

          + +

          The notify component displays a container in a particular region of the parent object. It can receive some content, and can be automatically hidden after a certain amount of time.

          + + +

          Figure: Notify hierarchy

          +

          Notify hierarchy

          + +

          Adding a Notify Component

          + +

          The following example shows how to create a notify object.

          + +
          +Evas_Object *notify, *parent;
          +notify = elm_notify_add(parent);
          +
          + +

          Configuring the Notify Component

          + +

          Create a label and add it to the notify object.

          + +
          +Evas_Object *content;
          +
          +// Create the label and set some text to it 
          +content = elm_label_add(parent);
          +
          +elm_object_text_set(content, "A label text");
          +evas_object_show(content);
          +
          +// Add the label object to the notify component
          +elm_object_content_set(notify, content);
          +
          + +

          In the following example the notify object is shown on the bottom left corner of the parent object.

          + +
          +elm_notify_align_set(notify, 1.0, 1.0);
          +evas_object_show(notify);
          +
          + +

          Set a timeout interval, after which the notify component is hidden. In the following example the timeout interval is five seconds.

          + +
          +elm_notify_timeout_set(notify, 5.0);
          +
          + +

          Using Notify Callbacks

          + +

          The notify component emits the following signals:

          +
            +
          • timeout: The timeout count ends and the notify component is hidden
          • +
          • block,clicked: The user clicks outside of the notify component
          • +
          + +

          For both these signals event_info is NULL.

          + +

          The following example shows how to register a callback on the timeout signal.

          + +
          +{
          +   evas_object_smart_callback_add(notify, "timeout", timeout_cb, data);
          +}
          +
          +// Callback function for the "timeout" signal
          +// The timeout expires and the notify object is hidden
          + 
          +void timeout_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Notify is hidden\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_notify_wn.htm b/org.tizen.ui.practices/html/native/efl/component_notify_wn.htm new file mode 100644 index 0000000..19dab41 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_notify_wn.htm @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + Notify + + + + + + +
          +

          Notify

          + +

          This feature is supported in wearable applications only.

          + +

          The notify component displays a container in a particular region of the parent object. It can receive some content, and can be automatically hidden after a certain amount of time.

          + +

          Figure: Notify hierarchy

          +

          Notify hierarchy

          + +

          Adding a Notify Component

          + +

          The following example shows how to create a notify object.

          +
          +Evas_Object *notify, *parent;
          +notify = elm_notify_add(parent);
          +
          + +

          Configuring the Notify Component

          + +

          Create a label and add it to the notify object.

          +
          +Evas_Object *content;
          +
          +// Create the label and set some text to it 
          +content = elm_label_add(parent);
          +
          +elm_object_text_set(content, "A label text");
          +evas_object_show(content);
          +
          +// Add the label object to the notify component
          +elm_object_content_set(notify, content);
          +
          + +

          In the following example the notify object is shown on the bottom left corner of the parent object.

          +
          +elm_notify_align_set(notify, 1.0, 1.0);
          +evas_object_show(notify);
          +
          + +

          Set a timeout interval, after which the notify component is hidden. In the following example the timeout interval is five seconds.

          +
          +elm_notify_timeout_set(notify, 5.0);
          +
          + +

          Using Notify Callbacks

          + +

          The notify component emits the following signals:

          +
            +
          • timeout: The timeout count ends and the notify component is hidden
          • +
          • block,clicked: The user clicks outside of the notify component
          • +
          + +

          For both these signals event_info is NULL.

          + +

          The following example shows how to register a callback on the timeout signal.

          + +
          +{
          +   evas_object_smart_callback_add(notify, "timeout", timeout_cb, data);
          +}
          +
          +// Callback function for the "timeout" signal
          +// The timeout expires and the notify object is hidden
          + 
          +void timeout_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Notify is hidden\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_panel_mn.htm b/org.tizen.ui.practices/html/native/efl/component_panel_mn.htm new file mode 100644 index 0000000..1071152 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_panel_mn.htm @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + Panel + + + + + + +
          +

          Panel

          + +

          This feature is supported in mobile applications only.

          + + +

          The panel component is an animated object that can contain subobjects. It can be expanded or contracted by clicking on the button on its edge.

          + +

          Panel inherits from layout component, so the layout API can be used on this UI component.

          + +

          Figure: Panel hierarchy

          +

          Panel hierarchy

          + +

          Adding a Panel Component

          + +

          The following example shows how to add a panel and set its orientation to the left.

          + +
          +Evas_Object *panel, *parent;
          +
          +panel = elm_panel_add(parent);
          +elm_panel_orient_set(panel, ELM_PANEL_ORIENT_LEFT);
          +
          + +

          Using the Panel

          + +

          The panel can be manually hidden.

          +
          +elm_panel_hidden_set(pan, EINA_TRUE);
          +
          + +

          The panel can be toggled if you do not know the hidden state of the UI component.

          +
          +elm_panel_toggle(pan);
          +
          + +

          The panel can be set scrollable.

          +
          +elm_panel_scrollable_set(pan, EINA_TRUE);
          +
          + +

          Creating a Drawer

          + +

          Tizen SDK has implemented a layout theme to add a drawer in the application. This example shows how to add a new Elementary layout object and set the theme of this layout to the drawer.

          + +
          +Evas_Object *layout;
          +
          +// Create a new layout object 
          +layout = elm_layout_add(parent);
          +
          +// Set the "drawer" group theme and "panel" style to it 
          +elm_layout_theme_set(layout,"layout", "drawer", "panel");
          +
          +// Show the new layout
          +evas_object_show(layout);
          +
          + +

          Once the panel object is created, it can be swallowed in the new layout.

          + +
          +elm_object_part_content_set(layout, "elm.swallow.left", pan);
          +
          + +

          You can set content to the elm.swallow.bg and elm.swallow.content parts of the layout.

          +
          +// Panel Background (Dimmed Area) 
          +Evas_Object *bg = create_bg(layout);
          +elm_object_part_content_set(layout, "elm.swallow.bg", bg);
          +
          +// Add content to the drawer 
          +Evas_Object *content;
          +elm_object_part_content_set(layout, "elm.swallow.content", content);
          +
          + +

          Using Panel Callbacks

          + +

          You can register a callback on the scroll signal, when the user scrolls the panel. The event_info parameter is of the type Elm_Panel_Scroll_Info.

          + +
          +{
          +   evas_object_smart_callback_add(pan, "scroll", scroll_cb, data);
          +}
          +// Callback function for the "scroll" signal
          +// This callback is called when the user scrolls the panel
          +void scroll_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Panel_Scroll_Info *scrollinfo = event_info;
          +   dlog_print(DLOG_INFO, LOG_TAG, "The panel was scrolled.\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_photocam_mn.htm b/org.tizen.ui.practices/html/native/efl/component_photocam_mn.htm new file mode 100644 index 0000000..161d139 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_photocam_mn.htm @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + Photocam + + + + + + +
          +

          Photocam

          + +

          This feature is supported in mobile applications only.

          + +

          The photocam component displays high resolution photos taken from digital cameras. It provides a way to zoom in the photo, load it fast, and fit it nicely on the screen. It is optimized for .jpeg images format and has a low memory footprint.

          + +

          This UI component implements the scroller interface, so all the functions concerning the scroller can be used with the photocam component.

          + + +

          Figure: Photocam hierarchy

          +

          Photocam hierarchy

          + +

          Adding a Photocam Component

          + +

          The following example shows how to create a photocam component and set an image file on it.

          + +
          +Evas_Object *photocam;
          +photocam = elm_photocam_add(win);
          +elm_photocam_file_set(photocam, "/tmp/photo.jpeg");
          +
          + +

          Using Photocam Zoom

          + +

          You can choose between two automatic zoom modes and a manual zoom mode. In the following example the zoom mode is set to manual and a double zoom is requested.

          +
          +elm_photocam_zoom_mode_set(photocam, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
          +elm_photocam_zoom_set(photocam, 2.0);
          +
          + +

          The zoom mode can be set to ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT. In this case, the photo fits exactly inside the scroll frame with no pixels outside this region. The zoom mode can also be set to ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL to fill all the pixels of the photocam component.

          + +

          Multi-touch zooming is activated by enabling gestures.

          +
          +elm_photocam_gesture_enabled_set(photocam, EINA_TRUE);
          +
          + +

          You can zoom in a specific region. The following example shows how to zoom in the region starting at the coordinates (200x200), with a width of 400px and a height of 300px.

          + +
          +elm_photocam_image_region_bring_in(photocam, 200, 200, 400, 300);
          +
          + +

          Using Photocam Callbacks

          + +

          The photocam component emits the following signals:

          +
            +
          • clicked: The user has clicked the photo without dragging around.
          • +
          • press: The user has pressed down on the photo.
          • +
          • longpressed: The user has pressed down on the photo for a long time without dragging around.
          • +
          • clicked,double: The user has double-clicked the photo.
          • +
          • load: The photo load begins.
          • +
          • loaded: The image file load is complete for the first view (a low resolution blurry version).
          • +
          • load,detail: A photo detailed data load begins.
          • +
          • loaded,detail: The image file load is complete for the detailed image data (full resolution is needed).
          • +
          • zoom,start: Zoom animation starts.
          • +
          • zoom,stop: Zoom animation stops.
          • +
          • zoom,change: The zoom is changed when using an auto zoom mode.
          • +
          • scroll: The content is scrolled.
          • +
          • scroll,anim,start: Scrolling animation starts.
          • +
          • scroll,anim,stop: Scrolling animation stops.
          • +
          • scroll,drag,start: Dragging the content around starts.
          • +
          • scroll,drag,stop: Dragging the content around stops.
          • +
          + +

          For all these signals, event_info is NULL.

          + +

          The following example shows how to register a callback on the loaded signal.

          + +
          +void message_port_cb(int local_port_id, const char *remote_app_id, bundle *message)
          +{
          +   evas_object_smart_callback_add(photocam, "loaded", loaded_cb, data);
          +}
          +
          +// Callback function for the "loaded" signal
          +// The photocam has loaded the photo file in a low resolution
          + 
          +void loaded_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The photo has been loaded\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_plug_mn.htm b/org.tizen.ui.practices/html/native/efl/component_plug_mn.htm new file mode 100644 index 0000000..75445e5 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_plug_mn.htm @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + Plug + + + + + + +
          +

          Plug

          + +

          This feature is supported in mobile applications only.

          + +

          The plug component shows an Evas_Object created by an other process. It can be used anywhere the same way as any other elementary UI component.

          + + +

          Figure: Plug hierarchy

          +

          Plug hierarchy

          + +

          Adding a Plug Component

          + +

          The following example shows how to create a plug.

          + +
          +Evas_Object *plug, *parent;
          +plug = elm_plug_add(parent);
          +
          + +

          Using the Plug

          + +

          The socket image provides the service where to connect the plug object with the elm_plug_connect() function. In this process, use the service name and number set by the socket you want to connect to.

          + +

          As an example, connect to a service named plug_test on the number 0.

          + +
          +elm_plug_connect(plug, "plug_test", 0, EINA_FALSE);
          +
          + +

          The Evas_Object corresponding to the distant image is retrieved with the elm_plug_image_object_get() function.

          + +
          +Evas_Object *plug_img = elm_plug_image_object_get(plug);
          +
          + + + + + + + + + + +
          Note
          The socket to connect to must be started with the elm_win_socket_listen() function in the other process on the remote window object (it is called remote_win here).
          + +
          +// Create a remote window in the other process 
          +Elm_Win *remote_win = elm_win_add(NULL, "Window Socket",
          +                                  ELM_WIN_SOCKET_IMAGE);
          +// Create a socket named "plug_test" and listen to it
          +elm_win_socket_listen(remote_win, "plug_test", 0, EINA_FALSE);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_plug_wn.htm b/org.tizen.ui.practices/html/native/efl/component_plug_wn.htm new file mode 100644 index 0000000..aaa1140 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_plug_wn.htm @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + Plug + + + + + + +
          +

          Plug

          + +

          This feature is supported in wearable applications only.

          + +

          The plug component shows an Evas_Object created by an other process. It can be used anywhere the same way as any other elementary UI component.

          + +

          Figure: Plug hierarchy

          +

          Plug hierarchy

          + +

          Adding a Plug Component

          + +

          The following example shows how to create a plug.

          +
          +Evas_Object *plug, *parent;
          +plug = elm_plug_add(parent);
          +
          + +

          Using the Plug

          + +

          The socket image provides the service where to connect the plug object with the elm_plug_connect() function. In this process, use the service name and number set by the socket you want to connect to.

          + +

          As an example, connect to a service named plug_test on the number 0.

          + +
          +elm_plug_connect(plug, "plug_test", 0, EINA_FALSE);
          +
          + +

          The Evas_Object corresponding to the distant image is retrieved with the elm_plug_image_object_get() function.

          + +
          +Evas_Object *plug_img = elm_plug_image_object_get(plug);
          +
          + + + + + + + + + + +
          Note
          The socket to connect to must be started with the elm_win_socket_listen() function in the other process on the remote window object (it is called remote_win here).
          + +
          +// Create a remote window in the other process 
          +Elm_Win *remote_win = elm_win_add(NULL, "Window Socket",
          +                                  ELM_WIN_SOCKET_IMAGE);
          +// Create a socket named "plug_test" and listen to it
          +elm_win_socket_listen(remote_win, "plug_test", 0, EINA_FALSE);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_popup_mn.htm b/org.tizen.ui.practices/html/native/efl/component_popup_mn.htm new file mode 100644 index 0000000..d0a0837 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_popup_mn.htm @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + Popup + + + + + + +
          +

          Popup

          + +

          This feature is supported in mobile applications only.

          + +

          The popup component shows a popup area that can contain:

          +
            +
          • a title area (optional)
          • +
          • a content area
          • +
          • an action area (optional)
          • +
          + +

          The optional title area can contain an icon and text, the action area can contain up to three buttons.

          + + +

          Figure: Popup component

          +

          Popup component

          + +

          Figure: Popup hierarchy

          +

          Popup hierarchy

          + +

          Adding a Popup Component

          + +

          The following example shows how to create a popup component.

          +
          +Evas_Object *popup, *parent;
          +
          +// Create a popup 
          +popup = elm_popup_add(parent);
          +
          + +

          Using Popup Styles

          + +

          The following item styles are available for the popup:

          + +
            +
          • popup
          • +
          • toast
          • +
          + +

          The following example sets the style of the popup to toast.

          + +
          elm_object_style_set(popup, "toast");
          + +

          Setting the Popup Areas

          + +

          Configure the title area. Set the icon object using the part name title,icon. Set the title text to Test popup using the partname title,text.

          + +
          +Evas_Object *icon;
          +
          +// Add an icon to the title area 
          +elm_object_part_content_set(popup, "title,icon", icon);
          +
          +// Set the title text 
          +elm_object_part_text_set(popup, "title,text", "Test popup");
          +
          + +

          Set the content of the popup. The content can be simple text.

          + +
          +elm_object_part_text_set(popup, "default", "Test popup");
          +
          + +

          The content can also be an Evas object.

          + +
          +Evas_Object *content;
          +
          +elm_object_content_set(popup, content);
          +
          + +

          Set the buttons of the action area by creating an OK button, a Cancel button, and a Help button.

          + +
          +Evas_Object *button1, *button2, *button3;
          +
          +// Create the 3 buttons 
          +
          +button1 = elm_button_add(popup);
          +elm_object_text_set(button1, "OK");
          +
          +button2 = elm_button_add(popup);
          +elm_object_text_set(button2, "Cancel");
          +
          +button3 = elm_button_add(popup);
          +elm_object_text_set(button3, "Help");
          +
          +// Set the buttons to the action area 
          +elm_object_part_content_set(popup, "button1", button1);
          +elm_object_part_content_set(popup, "button2", button2);
          +elm_object_part_content_set(popup, "button3", button3);
          +
          + +

          Using Popup Callbacks

          +

          The popup emits the following signals:

          +
            +
          • timeout: The popup is closed as a result of timeout.
          • +
          • block,clicked: The user clicks on the Blocked Event area.
          • +
          + +

          elm_popup_timeout_set() is used to hide the popup after a certain time. In this example, the timeout is set to five seconds.

          + +
          +elm_popup_timeout_set(popup, 5.0);
          +
          + +

          When the timeout expires, the timeout signal is sent to the user.

          + +
          +{
          +   evas_object_smart_callback_add(popup, "timeout", _timeout_cb, data);
          +}
          +
          +static void
          +_timeout_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Timeout \n");
          +}
          +
          + +

          The visible region of the popup is surrounded by a translucent region called Blocked Event area. By clicking on this area, the signal block,clicked is sent to the application.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_popup_wn.htm b/org.tizen.ui.practices/html/native/efl/component_popup_wn.htm new file mode 100644 index 0000000..fb8f950 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_popup_wn.htm @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + Popup + + + + + + +
          +

          Popup

          + +

          This feature is supported in wearable applications only.

          + +

          The popup component shows a popup area that can contain:

          +
            +
          • a title area (optional)
          • +
          • a content area
          • +
          • an action area (optional)
          • +
          + +

          The optional title area can contain an icon and text, the action area can contain up to three buttons.

          + +

          Figure: Popup component

          +

          Popup component

          + +

          Figure: Popup hierarchy

          +

          Popup hierarchy

          + +

          Adding a Popup Component

          + +

          The following example shows how to create a popup component.

          +
          +Evas_Object *popup, *parent;
          +
          +// Create a popup 
          +popup = elm_popup_add(parent);
          +
          + +

          Using Popup Styles

          + +

          The following item styles are available for the rectangular UI component:

          +
            +
          • popup
          • +
          • toast
          • +
          +

          The following item styles are available for the circular UI component:

          +
            +
          • circle
          • +
          • toast/circle
          • +
          +

          The following layout styles are available for the circular UI component:

          +
            +
          • content/circle
          • +
          • content/circle/buttons1
          • +
          • content/circle/buttons2
          • +
          + +

          The following example sets the style of the popup to toast.

          +
          +elm_object_style_set(popup, "toast");
          +
          + + +

          Setting the Popup Areas for Rectangular UI Components

          +

          Configure the title area. Set the title text to Test popup using the partname title,text.

          + +
          +elm_object_part_text_set(popup, "title,text", "Test popup");
          +
          +

          Set the content of the popup. The content can be simple text.

          +
          +elm_object_text_set(popup, "simple text");
          +
          +

          The content can also be an Evas object.

          +
          +Evas_Object *content;
          +
          +elm_object_content_set(popup, content);
          +
          +

          Set the buttons of the action area by creating an OK button and a Cancel button.

          +
          +Evas_Object *button1, *button2;
          +
          +// Create the two buttons 
          +button1 = elm_button_add(popup);
          +elm_object_style_set(button1, "popup");
          +evas_object_size_hint_weight_set(button1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_object_text_set(button1, "Cancel");
          +
          +button2 = elm_button_add(popup)
          +elm_object_style_set(button2, "popup");
          +evas_object_size_hint_weight_set(button2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_object_text_set(button2, "OK");
          +
          +evas_object_show(popup);
          +
          +// Set the buttons to the action area 
          +elm_object_part_content_set(popup, "button1", button1);
          +elm_object_part_content_set(popup, "button2", button2);
          +
          + +

          Setting the Popup Areas for Circular UI Components

          +

          Set the circle style and the layout of the popup.

          +
          +// Setting the style
          +elm_object_style_set(popup, "circle");
          +
          +// Setting the layout
          +layout = elm_layout_add(popup);
          +elm_layout_theme_set(layout, "layout", "popup", "content/circle/buttons2");
          +
          + +

          To configure the title area, set the title text to Test popup using the partname elm.text.title.

          +
          +// Setting the title text 
          +elm_object_part_text_set(layout, "elm.text.title", "Text popup");
          +
          + +

          Set the content of the popup. The content can be simple text.

          +
          elm_object_part_text_set(layout, "elm.text.content", "Test popup");
          +
          + +

          The content of the popup can also be an Evas object.

          +
          +Evas_Object *content;
          +
          +elm_object_content_set(layout, content);
          +
          +

          Set the popup content.

          +
          +elm_object_content_set(popup, layout);
          +
          + +

          Set the buttons of the action area by creating an OK button, a Cancel button, and a Help button.

          + +
          +Evas_Object *button1, *button2, *icon;
          +
          +// Create the 2 buttons 
          +
          +button1 = elm_button_add(popup);
          +elm_object_style_set(button1, "popup/circle/left");
          +icon = elm_image_add(button1);
          +elm_image_file_set(icon, ICON_DIR"/b_option_list_icon_share.png", NULL);
          +evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_object_part_content_set(button1, "elm.swallow.content", icon);
          +evas_object_show(icon);
          +
          +button2 = elm_button_add(popup);
          +elm_object_style_set(button2, "popup/circle/right");
          +icon = elm_image_add(button2);
          +elm_image_file_set(icon, ICON_DIR"/b_option_list_icon_delete.png", NULL);
          +evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_object_part_content_set(button2, "elm.swallow.content", icon);
          +evas_object_show(icon);
          +
          +// Set the buttons to the action area 
          +elm_object_part_content_set(popup, "button1", button1);
          +elm_object_part_content_set(popup, "button2", button2);
          +
          +
          + +

          Using Popup Callbacks

          +

          The popup emits the following signals:

          +
            +
          • timeout: The popup is closed as a result of timeout.
          • +
          • block,clicked: The user clicks on the Blocked Event area.
          • +
          + +

          elm_popup_timeout_set() is used to hide the popup after a certain time. In the following example the timeout is set to five seconds.

          +
          elm_popup_timeout_set(popup, 5.0);
          + +

          When the timeout expires, the timeout signal is sent to the user.

          +
          +{
          +   evas_object_smart_callback_add(popup, "timeout", _timeout_cb, data);
          +}
          +
          +static void
          +_timeout_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Timeout \n");
          +}
          +
          + +

          The visible region of the popup is surrounded by a translucent region called Blocked Event area. By clicking on this area, the signal block,clicked is sent to the application.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_progressbar_mn.htm b/org.tizen.ui.practices/html/native/efl/component_progressbar_mn.htm new file mode 100644 index 0000000..0fd1cdb --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_progressbar_mn.htm @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + Progressbar + + + + + + +
          +

          Progressbar

          + +

          This feature is supported in mobile applications only.

          + +

          The progressbar component is used to display the progress status of a given job. It inherits from the layout component, so all function concerning the layout component is used on the progressbar component.

          + +

          Figure: Progressbar component

          +

          Progressbar component

          + +

          Figure: Progressbar hierarchy

          +

          Progressbar hierarchy

          + + +

          Adding a Progressbar Component

          + +

          The following example shows how to create a progressbar component.

          + +
          +Evas_Object *pb = elm_progressbar_add(win);
          +
          + +

          Using the Progressbar Styles

          + +

          The progressbar has several styles:

          +
            +
          • default
          • +
          • pending_list
          • +
          • process_large
          • +
          • process_medium
          • +
          • process_small
          • +
          + +

          Set the style of the progressbar to pending_list.

          + +
          elm_object_style_set(pb, "pending_list");
          + +

          Using the Progressbar

          + +

          By default, the progressbar does not show a label or an icon, and the unit label is set to %.0f %%.

          + +

          The following example shows how to set a label. In this example it is named Test label.

          + +
          +elm_object_text_set(pb, "Test label");
          +
          + +

          An icon is set with elm_object_part_content_set() using the partname icon.

          +
          +elm_object_part_content_set(pb, "icon", icon_object);
          +
          + +

          The unit label format string can be modified using a printf style format. Set it to be a float number with two decimals.

          +
          +elm_progressbar_unit_format_set(pb, "%1.2f%%");
          +
          + +

          Configuring the Progressbar

          + +

          The progressbar pulse mode is activated to make the progressbar loop infinitely between the start and end position.

          +
          +elm_progressbar_pulse_set(pb, EINA_TRUE);
          +elm_progressbar_pulse(pb, EINA_TRUE);
          +
          + +

          The progressbar can be inverted. In that mode, the values are inverted so that the high values are on the left and the low values on the right.

          +
          +elm_progressbar_inverted_set(pb, EINA_TRUE);
          +
          + +

          The progressbar emits the changed signal when the progress value changes. The value is changed with the elm_progressbar_value_set() function. Here the pb progress value is set to 20%.

          +
          +elm_progressbar_value_set(pb, 0.2);
          +
          + +

          The current value can be read.

          +
          +double value = elm_progressbar_value_get(pb);
          +
          + +

          You can set the orientation of the progressbar to vertical instead of the default horizontal orientation.

          +
          +elm_progressbar_horizontal_set(pb, EINA_FALSE);
          +
          + +

          Using the Progressbar Callbacks

          + +

          The changed signal is the only signal specifically emitted by the progressbar component.

          + +

          The following example shows how to register a callback on this signal.

          + +
          +{
          +   evas_object_smart_callback_add(pb, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the progressbar value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_progressbar_wn.htm b/org.tizen.ui.practices/html/native/efl/component_progressbar_wn.htm new file mode 100644 index 0000000..f8c18e3 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_progressbar_wn.htm @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + Progressbar + + + + + + +
          +

          Progressbar

          + +

          This feature is supported in wearable applications only.

          + +

          The progressbar component is used to display the progress status of a given job. It inherits from the layout component, so all function concerning the layout component is used on the progressbar component.

          + +

          Figure: Progressbar component

          +

          Progressbar component

          + +

          Figure: Progressbar hierarchy

          +

          Progressbar hierarchy

          + +

          Adding a Progressbar Component

          + +

          The following example shows how to create a progressbar component.

          +
          +Evas_Object *pb = elm_progressbar_add(win);
          +
          + +

          Using the Progressbar Styles

          + +

          The progressbar has several styles for the rectangular UI components:

          +
            +
          • default
          • +
          • pending_list
          • +
          • process
          • +
          • process/groupindex
          • +
          • process/popup/small
          • +
          +

          The progressbar has several styles for the circular UI components:

          +
            +
          • process
          • +
          • process/small
          • +
          + +

          Set the style of the progressbar to pending_list.

          + +
          +elm_object_style_set(pb, "pending_list");
          +
          + +

          Configuring the Progressbar for Rectangular UI Components

          + +

          The progressbar pulse mode is activated to make the progressbar loop infinitely between the start and end position.

          +
          elm_progressbar_pulse_set(pb, EINA_TRUE);
          +elm_progressbar_pulse(pb, EINA_TRUE);
          +
          + +

          The progressbar can be inverted. In that mode, the values are inverted so that the high values are on the left and the low values on the right.

          +
          elm_progressbar_inverted_set(pb, EINA_TRUE);
          + +

          The progressbar emits the changed signal when the progress value changes. The value is changed with the elm_progressbar_value_set() function. Here the pb progress value is set to 20%.

          +
          elm_progressbar_value_set(pb, 0.2);
          + +

          It is possible to read the current value.

          +
          double value = elm_progressbar_value_get(pb);
          + +

          Configuring the Progressbar for Circular UI Components

          +

          The progressbar emits the changed signal when the progress value changes. The value is changed with the elm_progressbar_value_set() function. Here the pb progress value is set to 20%.

          + +
          +elm_progressbar_value_set(pb, 0.2);
          +
          +

          The current value can be read.

          +
          +double value = elm_progressbar_value_get(pb);
          +
          + + +

          Using the Progressbar Callbacks

          + +

          The changed signal is the only signal specifically emitted by the progressbar component.

          +

          The following example shows how to register a callback on this signal.

          + +
          +{
          +   evas_object_smart_callback_add(pb, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the progressbar value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_radio_mn.htm b/org.tizen.ui.practices/html/native/efl/component_radio_mn.htm new file mode 100644 index 0000000..ddef1f7 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_radio_mn.htm @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + Radio + + + + + + +
          +

          Radio

          + +

          This feature is supported in mobile applications only.

          + +

          This UI component displays one or more options, but the user can only select one of them. It is composed of an indicator (selected or unselected), an optional icon and an optional label. Even though it is usually grouped with two or more other radio objects, it can also be used alone.

          +

          The radio component inherits from the layout component. All the layout functions can be used with radio objects.

          + +

          Figure: Radio component

          +

          Radio component

          + +

          Figure: Radio hierarchy

          +

          Radio hierarchy

          + +

          Adding a Radio Component

          + +

          Create a radio component and set a label to it.

          +
          +Evas_Object *radio, *parent;
          +
          +// Create a radio
          +radio = elm_radio_add(parent);
          +
          +// Set a label to it
          +elm_object_text_set(radio, "Radio component");
          +
          + +

          Set an icon to the radio object.

          +
          +// Create a Home icon 
          +Evas_Object *icon;
          +
          +icon = elm_icon_add(parent);
          +elm_icon_standard_set(icon, "home");
          +
          +// Set it to the radio component 
          +elm_object_part_content_set(radio, "icon", icon);
          +
          + +

          Changing the Radio Value

          + +

          The user can select one of a set of values with the radio component. Each radio object from a group of radio objects represents an integer value. Here the value 1 is set to the new radio object.

          +
          +elm_radio_state_value_set(radio, 1);
          +
          + +

          Managing the Radio Groups

          + +

          The following example shows how to create a group of radio objects with at least two radio components.

          + +
          +// Create another radio object 
          +Evas_Object *radio2 = elm_radio_add(parent);
          +elm_radio_state_value_set(radio2, 2);
          +
          +// Create a group composed of radio and radio2
          +Evas_Object *group = radio;
          +elm_radio_group_add(radio2, group);
          +
          + +

          Now that a group composed of two radio objects has been created, you can choose which one is selected. In this example radio2 is selected.

          + +
          +elm_radio_value_set(group, 2);
          +
          + +

          You can use elm_radio_value_get() to see the currently selected radio of the group.

          + +

          Using the Radio Callbacks

          + +

          When the state of a radio is modified in a group of radio objects, the changed signal is emitted.

          +

          The following example shows how to register a callback on this signal.

          + +
          +{
          +   evas_object_smart_callback_add(radio, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the radio value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_radio_wn.htm b/org.tizen.ui.practices/html/native/efl/component_radio_wn.htm new file mode 100644 index 0000000..084f687 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_radio_wn.htm @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + Radio + + + + + + +
          +

          Radio

          + +

          This feature is supported in wearable applications only.

          + +

          This UI component displays one or more options, but the user can only select one of them. It is composed of an indicator (selected or unselected). Even though it is usually grouped with two or more other radio objects, it can also be used alone. +

          +

          The radio component inherits from the layout component. All the layout functions can be used with radio objects.

          + +

          Figure: Radio component

          +

          Radio component

          + +

          Figure: Radio hierarchy

          +

          Radio hierarchy

          + +

          Adding a Radio Component

          + +

          Create a radio component.

          +
          +Evas_Object *radio, *parent;
          +
          +// Create a radio
          +radio = elm_radio_add(parent);
          +
          + +

          Changing the Radio Value

          + +

          The user can select one of a set of values with the radio component. Each radio object from a group of radio objects represents an integer value. Here the value 1 is set to the new radio object.

          +
          +elm_radio_state_value_set(radio, 1);
          +
          + +

          Managing the Radio Groups

          + +

          The following example shows how to create a group of radio objects with at least two radio components.

          + +
          +// Create another radio object 
          +Evas_Object *radio2 = elm_radio_add(parent);
          +elm_radio_state_value_set(radio2, 2);
          +
          +// Create a group composed of radio and radio2
          +Evas_Object *group = radio;
          +elm_radio_group_add(radio2, group);
          +
          + +

          Now that a group composed of two radio objects has been created, you can choose which one is selected. In this example radio2 is selected.

          + +
          elm_radio_value_set(group, 2);
          + +

          You can use elm_radio_value_get() to see the currently selected radio of the group.

          + +

          Using the Radio Callbacks

          + +

          This UI component emits the following signals:

          +
          • changed: The state of a radio is modified in a group of radio objects.
          + +

          The following example shows how to register a callback on this signal.

          +
          +{
          +   evas_object_smart_callback_add(radio, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the radio value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n");
          +}
          +
          + +

          Using the Radio Callbacks with Circular UI Components

          + +

          This UI component emits the following signals:

          +
            +
          • changed: The user changes the slider value.
          • +
          • clicked: Radio was clicked.
          • +
          + +

          The following example shows how to register a callback on this signal.

          +
          +{
          +   evas_object_smart_callback_add(radio, "clicked", clicked_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the radio value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "This radio was clicked\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_segmentcontrol_mn.htm b/org.tizen.ui.practices/html/native/efl/component_segmentcontrol_mn.htm new file mode 100644 index 0000000..25e7cf8 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_segmentcontrol_mn.htm @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Segmentcontrol + + + + + + +
          +

          Segmentcontrol

          + +

          This feature is supported in mobile applications only.

          + + +

          This UI component consists of several segment items. A segment item is similar to a discrete two state button. Any time, only one segment item can be selected. A segment item is composed of a label (text) and an icon.

          +

          This UI component inherits from the layout component, so all the layout components API can be used on segmentcontrol objects.

          + +

          Figure: Segmentcontrol with text

          +

          Segmentcontrol with text

          + +

          Figure: Segmentcontrol with icons

          +

          Segmentcontrol with icons

          + +

          Figure: Segmentcontrol hierarchy

          +

          Segmentcontrol hierarchy

          + +

          Adding a Segmentcontrol Component

          + +

          The following example shows how to add a segmentcontrol component.

          + +
          +Evas_Object *segcontrol, *parent;
          +
          +segcontrol = elm_segment_control_add(parent);
          +
          + +

          Adding Items

          + +

          You can add items to the UI component. In the following example four items containing only text labels (no icons) are added.

          +
          +Elm_Object_Item *it;
          +
          +elm_segment_control_item_add(segcontrol, NULL, "item1");
          +elm_segment_control_item_add(segcontrol, NULL, "item2");
          +elm_segment_control_item_add(segcontrol, NULL, "item3");
          +it = elm_segment_control_item_add(segcontrol, NULL, "item4");
          +
          + +

          You can also:

          +
            +
          • Insert an item at a specific position starting at 0. +
            +elm_segment_control_item_insert_at(segcontrol, NULL, "item7", 2);
            +
          • + +
          • Delete an item. +
            +elm_segment_control_item_del_at(segcontrol, 2);
            +
          • + +
          • Set the selected state of an item manually. +
            +elm_segment_control_item_selected_set(it, EINA_TRUE);
            +
          • +
          • Disable the whole segment control. +
            elm_object_disabled_set(segcontrol, EINA_TRUE);
          • +
          + +

          Using the Segmentcontrol Callbacks

          + +

          This is how to register a callback on the changedsignal. It is called when the user clicks on a segment item which is not previously selected. The event_info parameter is the segment item pointer.

          +
          +{
          +   evas_object_smart_callback_add(segcontrol, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the segcontrol selected item changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Segment_Item *it = event_info;
          +
          +   dlog_print(DLOG_INFO, LOG_TAG, "The selected segment item has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_slider_mn.htm b/org.tizen.ui.practices/html/native/efl/component_slider_mn.htm new file mode 100644 index 0000000..0cc0cca --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_slider_mn.htm @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + Slider + + + + + + +
          +

          Slider

          + +

          This feature is supported in mobile applications only.

          + +

          The slider component is a draggable bar that is used to select a value within a certain range.

          + + +

          Figure: Slider component

          +

          Slider component

          + +

          Figure: Slider hierarchy

          +

          Slider hierarchy

          + +

          Adding a Slider Component

          + +

          The following example shows how to create a slider object.

          +
          +Evas_Object *slider, *parent;
          +
          +slider = elm_slider_add(parent);
          +
          + +

          Using the Slider Styles

          + +

          A slider has the following styles:

          +
            +
          • default
          • +
          • center_point
          • +
          + +

          The following example sets the style to center_point.

          +
          +elm_object_style_set(slider, "center_point");
          +
          + +

          With this style, the slider 0 point is in the middle of the UI component.

          + +

          Configuring the Slider

          + +

          The orientation is set with the elm_slider_horizontal_set() function, and it is inverted the same way as the progressbar component. In the following example it is set to vertical and inverted.

          +
          +elm_slider_horizontal_set(slider, EINA_FALSE);
          +elm_slider_inverted_set(slider, EINA_TRUE);
          +
          + +

          The slider can contain icons (icon and end partnames), a label, a unit label, and an indicator label.

          +
          +Evas_Object *icon1, *icon2;
          +
          +// Set the icons 
          +elm_object_part_content_set(slider, "icon", icon1);
          +elm_object_part_content_set(slider, "end", icon2);
          +
          +// Set the label 
          +elm_object_part_text_set(slider, "default", "slider label");
          +
          +// Set the unit format 
          +elm_slider_unit_format_set(slider, "%1.2f meters");
          +
          + +

          Before using the slider, its minimum and maximum values are set with elm_slider_min_max_set(). The current value is set with (elm_slider_value_set()). The following example sets the minimum value to 0, the maximum value to 100, and the current value to 50.

          +
          +elm_slider_min_max_set(slider, 0.0, 100.0);
          +elm_slider_value_set(slider, 50.0);
          +
          + +

          The span of the slider represents its length horizontally or vertically. It is set with elm_slider_span_size_set() and is scaled by the object or applications scaling factor.

          +

          You can retrieve the current value of the slider anytime.

          +
          +double value = elm_slider_value_get(slider);
          +
          + +

          By default, the slider indicator becomes bigger when the user drags it. This can be disabled if you want the slider indicator to keep its default size. The following example sets the state of the indicator enlargement and then inverts the behavior.

          +
          +// Get the current state of the indicator 
          +Eina_Bool enlarge = elm_slider_indicator_show_get(slider);
          +
          +// Invert the behavior 
          +elm_slider_indicator_show_set(slider, !enlarge);
          +
          + +

          Using the Slider Callbacks

          + +

          This UI component emits the following signals:

          +
            +
          • changed: The user changes the slider value.
          • +
          • slider,drag,start: Dragging the slider indicator around starts.
          • +
          • slider,drag,stop: Dragging the slider indicator around stops.
          • +
          • delay,changed: A short time after the user changes the value. This is called only when the user stops dragging for a very short period or when releases the finger or mouse, so that it avoids possibly expensive reactions to the value change.
          • +
          + +

          For all these signals, event_info is NULL.

          +

          The following example shows how to register a callback on the changed signal.

          +
          +{
          +   evas_object_smart_callback_add(slider, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the slider value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The slider has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_slider_wn.htm b/org.tizen.ui.practices/html/native/efl/component_slider_wn.htm new file mode 100644 index 0000000..7817148 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_slider_wn.htm @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + Slider + + + + + + +
          +

          Slider

          + +

          This feature is supported in wearable applications only.

          + +

          The slider component contains a draggable bar that is used to select a value within a certain range. It is used with rectangular UI components.

          + +

          Figure: Slider component

          +

          Slider component

          + +

          Figure: Slider hierarchy

          +

          Slider hierarchy

          + +

          Adding a Slider Component

          + +

          The following example shows how to create a slider object.

          +
          +Evas_Object *slider, *parent;
          +
          +slider = elm_slider_add(parent);
          +
          + +

          Using the Slider Styles

          + +

          A slider has the following styles:

          +
            +
          • default
          • +
          + +

          Configuring the Slider

          + +

          It can contain icons (elm.swallow.icon partname), a label, a unit label and an indicator label.

          +
          +Evas_Object *icon1, *icon2;
          +
          +// Set the icons 
          +elm_object_part_content_set(slider, "elm.swallow.icon", icon1);
          +
          +// Set the unit format 
          +elm_slider_unit_format_set(slider, "%1.2f meters");
          +
          + +

          Before using the slider, its minimum and maximum values are set with elm_slider_min_max_set(). The current value is set with (elm_slider_value_set()). The following example sets the minimum value to 0, the maximum value to 100, and the current value to 50.

          +
          +elm_slider_min_max_set(slider, 0.0, 100.0);
          +elm_slider_value_set(slider, 50.0);
          +
          + +

          The span of the slider represents its length horizontally. It is set with elm_slider_span_size_set() and is scaled by the object or applications scaling factor.

          +

          You can retrieve the current value of the slider anytime.

          +
          +double value = elm_slider_value_get(slider);
          +
          + +

          By default, the slider indicator becomes bigger when the user drags it. This can be disabled if you want the slider indicator to keep its default size. The following example sets the state of the indicator enlargement and then inverts the behavior.

          +
          +// Get the current state of the indicator 
          +Eina_Bool enlarge = elm_slider_indicator_show_get(slider);
          +
          +// Invert the behavior 
          +elm_slider_indicator_show_set(slider, !enlarge);
          +
          + +

          Using the Slider Callbacks

          + +

          This UI component emits the following signals:

          +
            +
          • changed: The user changes the slider value.
          • +
          • slider,drag,start: Dragging the slider indicator around starts.
          • +
          • slider,drag,stop: Dragging the slider indicator around stops.
          • +
          • delay,changed: A short time after the user changes the value. This is called only when the user stops dragging for a very short period or when releases the finger or mouse, so that it avoids possibly expensive reactions to the value change.
          • +
          + +

          For all these signals, event_info is NULL.

          +

          The following example shows how to register a callback on the changed signal.

          +
          +{
          +   evas_object_smart_callback_add(slider, "changed", changed_cb, data);
          +}
          +
          +// Callback function for the "changed" signal
          +// This callback is called when the slider value changes
          +void changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The slider has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_spinner_mn.htm b/org.tizen.ui.practices/html/native/efl/component_spinner_mn.htm new file mode 100644 index 0000000..d162a77 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_spinner_mn.htm @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + Spinner + + + + + + +
          +

          Spinner

          + +

          This feature is supported in mobile applications only.

          + +

          The spinner component increases or decreases a numeric value with the arrow buttons.

          + +

          This UI component inherits from the layout component, so all functions concerning the layout component are used on the spinner component.

          + + +

          Figure: Spinner component

          +

          Spinner component

          + +

          Figure: Spinner hierarchy

          +

          Spinner hierarchy

          + +

          Adding a Spinner Component

          +

          The following example shows how to create a spinner object.

          + +
          +Evas_Object *spin, *parent;
          +
          +spin = elm_spinner_add(parent);
          +
          + +

          Configuring the Spinner

          + +

          The label format is set to a different value:

          +
          +elm_spinner_label_format_set(spin, "%1.2f meters");
          +
          + +

          You can determine the result of clicking the arrow buttons. In this example, a click on an arrow increases or decreases with 2.0 units:

          +
          +elm_spinner_step_set(spin, 2.0);
          +
          +

          The wrapping mode is activated. In this mode, the spinner wraps when it reaches its minimum or maximum value.

          +
          +elm_spinner_wrap_set(spin, EINA_TRUE);
          +
          + +

          You can set the minimum and maximum values of the spinner.

          +
          +elm_spinner_min_max_set(spin, -25.0, 100.0);
          +
          + +

          The spinner object can be set vertical, and the change interval when the user presses the arrows long can be modified so that it changes faster.

          +
          +elm_object_style_set(spin, "vertical");
          +elm_spinner_interval_set(spin, 0.1);
          +
          + +

          If the user has to select between text values instead of numerical values, it is possible to add our own text labels. Here spin2 object shows three numbers written in text characters.

          +
          Evas_Object *spin2 = elm_spinner_add(parent);
          +elm_spinner_min_max_set(spin2, 1, 3);
          +elm_spinner_special_value_add(spin2, 1, "One");
          +elm_spinner_special_value_add(spin2, 2, "Two");
          +elm_spinner_special_value_add(spin2, 3, "Three");
          +
          + +

          Using the Spinner Callbacks

          + +

          This UI component emits the following signals:

          +
            +
          • changed: The spinner value changes.
          • +
          • delay,changed: A short time after the user changes the value. This is called only when the user stops dragging for a very short period or releases the finger or mouse, so that it avoids possibly expensive reactions to the value change.
          • +
          + +

          The following example shows how to register a callback on the delay,changed signal.

          + +
          +{
          +   evas_object_smart_callback_add(spin, "delay,changed", delay_changed_cb, data);
          +}
          +
          +// Callback function for the "delay,changed" signal
          +// This callback is called a short time after the spinner value changes
          +void delay_changed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "The spinner value has changed\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_toolbar_mn.htm b/org.tizen.ui.practices/html/native/efl/component_toolbar_mn.htm new file mode 100644 index 0000000..5a2903c --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_toolbar_mn.htm @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + Toolbar + + + + + + +
          +

          Toolbar

          + +

          This feature is supported in mobile applications only.

          + + +

          This UI component is a scrollable list of items and shows a menu when an item is selected. Only one item can be selected at a time.

          + + +

          Figure: Toolbar component

          +

          toolbar component

          + +

          Figure: Toolbar hierarchy

          +

          Toolbar hierarchy

          + +

          Adding a Toolbar Component

          + +

          Use the following function to create a toolbar.

          +
          +Evas_Object *toolbar, *parent;
          +
          +toolbar = elm_toolbar_add(parent);
          +
          + +

          Using the Toolbar Styles

          +

          The toolbar has the following styles:

          +
            +
          • default
          • +
          • tabbar
          • +
          • tabbar_with_title
          • +
          • navigationbar
          • +
          +

          The following example sets the style to navigationbar.

          +
          +elm_object_style_set(toolbar, "navigationbar");
          +
          + +

          Configuring the Toolbar

          +

          The toolbar displays its items in one of the following options.

          +
            +
          • ELM_TOOLBAR_SHRINK_NONE: The toolbar sets a minimum size to its items so that all of them fit without scrolling.
          • +
          • ELM_TOOLBAR_SHRINK_HIDE: The toolbar does not scroll or show the items that do not fit in.
          • +
          • ELM_TOOLBAR_SHRINK_SCROLL: The toolbar scrolls to show the items that do not fit in.
          • +
          • ELM_TOOLBAR_SHRINK_MENU: The toolbar creates a button to popup hidden items.
          • +
          + +

          Here the toolbar is set to ELM_TOOLBAR_SHRINK_NONE.

          +
          +elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_NONE);
          +
          +

          By default, the toolbar displays items homogeneously. Items with long labels occupy a lot of space. To avoid that, you can disable the homogeneous mode.

          +
          +elm_toolbar_homogeneous_set(toolbar, EINA_FALSE);
          +
          + +

          Adding Items to the Toolbar

          +

          The following example shows how to add two items and choose the associated icon, label, and function to call when the item is clicked.

          +
          +{
          +   Elm_Object_Item *home_it, *help_it;
          +
          +   home_it = elm_toolbar_item_append(toolbar, "home", "Home",
          +                                    _home_item_pressed_cb, NULL);
          +   help_it = elm_toolbar_item_append(toolbar, "help", "Help",
          +                                    _help_item_pressed_cb, NULL);
          +}
          +
          +static void
          +_home_item_pressed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Home item clicked \n");
          +}
          +
          +static void
          +_help_item_pressed_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Help item clicked \n");
          +}
          +
          + +

          An item can be disabled. This is how to disable the help item. The disabled item does not receive input and, if the theme supports it, is themed differently (usually greyed out) from its normal state.

          +
          +elm_object_item_disabled_set(help_it, EINA_TRUE);
          +
          + +

          Adding Items with States

          +

          Items have two or more states. Each state has its own icon, label, and function to call when an item is clicked. The following example shows how to create two states to the help item with the same icon but two different labels.

          +
          +elm_toolbar_item_state_add(help_it, "help", "Help state 1",
          +                           _help_item_pressed_cb, NULL);
          +elm_toolbar_item_state_add(help_it, "help", "Help state 2",
          +                           _help_item_pressed_cb, NULL);
          +
          +

          It is possible to cycle through the states of the help item by using the following code.

          +
          +elm_toolbar_item_state_set(help_it, elm_toolbar_item_state_next(help_it));
          +
          + +

          Using the Toolbar Callbacks

          +

          This UI component emits the following signals:

          +
            +
          • clicked: The user clicks on a toolbar item, which is selected. event_info is an object of the type Elm_Toolbar_Item.
          • +
          • clicked,double: The user double-clicks on a toolbar item. event_info is an object of the type Elm_Toolbar_Item.
          • +
          • longpressed: The toolbar is pressed for a certain amount of time. event_info is an object of the type Elm_Toolbar_Item.
          • +
          • language,changed: The program language changes.
          • +
          • item,focused: The item is highlighted. event_info is an object of the type Elm_Toolbar_Item.
          • +
          • item,unfocused: The highlight is removed from the item. event_info is an object of the type Elm_Toolbar_Item.
          • +
          • scroll: The toolbar scrolls. event_info is NULL.
          • +
          • scroll,anim,start: The toolbar scrolling animation starts. event_info is NULL.
          • +
          • scroll,anim,stop: The toolbar scrolling animation stops. event_info is NULL.
          • +
          • scroll,drag,start: The user starts dragging the toolbar. event_info is NULL.
          • +
          • scroll,drag,stop: The user stops dragging the toolbar. event_info is NULL.
          • +
          +

          The following example shows how to register a callback on the clicked signal.

          +
          +{
          +   evas_object_smart_callback_add(toolbar, "clicked", clicked_cb, data);
          +}
          +
          +// Callback function for the "clicked" signal
          +// This callback is called when a toolbar item is clicked
          +void clicked_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   Elm_Toolbar_Item * item = event_info;
          +
          +   dlog_print(DLOG_INFO, LOG_TAG, "Item clicked\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_tooltip_mn.htm b/org.tizen.ui.practices/html/native/efl/component_tooltip_mn.htm new file mode 100644 index 0000000..96e85c9 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_tooltip_mn.htm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + Tooltip + + + + + + +
          +

          Tooltip

          + +

          This feature is supported in mobile applications only.

          + + +

          The tooltip component is a smart object that shows a content in a frame when mouse hovers a parent object. The UI component provides tips or information about the parent object.

          + +

          Adding a Tooltip

          +

          The tooltip component cannot be created with the elm_tooltip_add() function. This component is already contained in a parent component when it is created. You can only activate or disable it.

          + +

          Activating the Tooltip

          +

          To activate the tooltip on a parent object, you can set a tooltip text to the parent object.

          +
          +Evas_Object *parent;
          +
          +elm_object_tooltip_text_set(parent, "The tooltip text";
          +
          +

          You can also set a content to the parent object.

          +
          +{
          +   elm_object_tooltip_content_cb_set(parent, tooltip_content_cb, NULL, tooltip_content_del_cb);
          +}
          +
          +Evas_Object*
          +tooltip_content_cb(void*data, Evas_Object *obj, Evas_Object *tooltip)
          +{
          +   // Create the tooltip content 
          +}
          +
          +void tooltip_content_del_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   // Destroy the tooltip content 
          +}
          +
          + +

          When passing content to the tooltip, the tooltip_content_cb function is called each time the tooltip is showed. The role of this function is to create the content to set in the tooltip. It returns a pointer to an Evas_Object.

          +

          When the tooltip disappears, the tooltip_content_del_cb function is called. This function is in charge of deleting the previously allocated Evas_Object.

          +

          Once set, the tooltip can be manually hidden or shown.

          + +
          +elm_object_tooltip_hide(parent);
          +elm_object_tooltip_show(parent);
          +
          + +

          The tooltip can be removed from the parent object when it is not needed.

          +
          +elm_object_tooltip_unset(parent);
          +
          + + + + + + + + + + +
          Note
          When content is set into the tooltip object, unsetting it calls the callback provided as del_cb to notify that the tooltip cannot be used any longer.
          + +

          A tooltip object is not a UI component, so it does not emit signals. There are no registered callbacks for it.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_win_mn.htm b/org.tizen.ui.practices/html/native/efl/component_win_mn.htm new file mode 100644 index 0000000..4ab5ae2 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_win_mn.htm @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + Win + + + + + + +
          +

          Win

          + +

          This feature is supported in mobile applications only.

          + +

          The window component is the root UI component that is often used in an application. It allows the developer create content in it, and it is handled by the window manager.

          +

          The window component is created with the elm_win_add() or elm_win_util_standard_add() function. The content can be added in the window with elm_win_resize_object_add() so that a window resize also resizes the content inside.

          + + +

          Figure: Win hierarchy

          +

          Win hierarchy

          + +

          Adding a Window Component

          + +

          Create a new window and change the title.

          +
          +Evas_Object *window;
          +
          +// Create a window 
          +window = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          +
          +// Change the window title 
          +elm_win_title_set(window, "Example Window");
          +
          + +

          The first element of elm_win_add() is the parent window. For example, for a dialog you want to have the main window as the parent. Here, it is NULL, meaning there is no parent. main is the name of the window used by the window manager for identifying the window uniquely amongst all the windows within this application (and all instances of the application). The type is a basic window (the final parameter).

          + +

          Create a new window with a title and a background. This API is a shortcut of the previous one. It also creates a standard background to the window with elm_bg_add(). The window created is of the type ELM_WIN_BASIC.

          + +
          +Evas_Object *window;
          +
          +// Create a standard window 
          +window = elm_win_util_standard_add("main", "Example Window");
          +
          + +

          Closing a Window

          +

          When the user closes the window outside of the program control, a delete,request signal is emitted to indicate that this event occurred. The developer can take any action, for example, destroy the window object.

          +

          When the autodel parameter is set, the window is automatically destroyed after the signal is emitted. If autodel is EINA_FALSE, the window is not destroyed and the program does so when required. The default is EINA_FALSE, where the window is not destroyed automatically.

          +

          The autodel is set using the following call:

          +
          +elm_win_autodel_set(window, EINA_TRUE);
          +
          + +

          To close the window, use the evas_object_del() function. The window is destroyed and the signal delete,request is sent.

          + +

          Using the Window Callbacks

          +

          The window component emits the following signals:

          +
            +
          • focus,in: The window received focus.
          • +
          • focus,out: The window lost focus.
          • +
          • moved: The window that holds the canvas is moved.
          • +
          • withdrawn: The window is managed normally but is removed from the view.
          • +
          • iconified: The window is minimized (for example, into an icon or a taskbar).
          • +
          • normal: The window is in the normal state (not withdrawn or iconified).
          • +
          • stick: The window shows on all desktops.
          • +
          • unstick: The window shows only on one desktop.
          • +
          • fullscreen: The window is fullscreen.
          • +
          • unfullscreen: The window stops being fullscreen.
          • +
          • maximized: The window is maximized.
          • +
          • unmaximized: The window is diminished.
          • +
          • wm,rotation,changed: The rotation of the window is changed by the Windows Manager.
          • +
          • ioerr: A low-level I/O error occurred in the display system.
          • +
          +

          With all these signals, event_info is NULL.

          +

          The following example registers a callback function called on the fullscreen signal.

          +
          +{
          +   evas_object_smart_callback_add(window, "fullscreen", fullscreen_cb, data);
          +}
          +
          +// Callback function for the "fullscreen" signal
          +// This callback is called when the window becomes fullscreen
          +void fullscreen_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Window fullscreen\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/component_win_wn.htm b/org.tizen.ui.practices/html/native/efl/component_win_wn.htm new file mode 100644 index 0000000..b7fcad3 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/component_win_wn.htm @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + Win + + + + + + +
          +

          Win

          + +

          This feature is supported in wearable applications only.

          + +

          The window component is the root UI component that is often used in an application. It allows the developer create content in it, and it is handled by the window manager.

          +

          The window component is created with the elm_win_add() or elm_win_util_standard_add() function. The content can be added in the window with elm_win_resize_object_add() so that a window resize also resizes the content inside.

          + + +

          Figure: Win hierarchy

          +

          Win hierarchy

          + +

          Adding a Window Component

          + +

          Create a new window and change the title.

          +
          +Evas_Object *window;
          +
          +// Create a window 
          +window = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          +
          +// Change the window title 
          +elm_win_title_set(window, "Example Window");
          +
          + +

          The first element of elm_win_add() is the parent window. For example, for a dialog you want to have the main window as the parent. Here, it is NULL, meaning there is no parent. main is the name of the window used by the window manager for identifying the window uniquely amongst all the windows within this application (and all instances of the application). The type is a basic window (the final parameter).

          + +

          Create a new window with a title and a background. This API is a shortcut of the previous one. It also creates a standard background to the window with elm_bg_add(). The window created is of the type ELM_WIN_BASIC.

          + +
          +Evas_Object *window;
          +
          +// Create a standard window 
          +window = elm_win_util_standard_add("main", "Example Window");
          +
          + +

          Closing a Window

          +

          When the user closes the window outside of the program control, a delete,request signal is emitted to indicate that this event occurred. The developer can take any action, for example, destroy the window object.

          +

          When the autodel parameter is set, the window is automatically destroyed after the signal is emitted. If autodel is EINA_FALSE, the window is not destroyed and the program does so when required. The default is EINA_FALSE, where the window is not destroyed automatically.

          +

          The autodel is set using the following call:

          +
          +elm_win_autodel_set(window, EINA_TRUE);
          +
          + +

          To close the window, use the evas_object_del() function. The window is destroyed and the signal delete,request is sent.

          + +

          Using the Window Callbacks

          +

          The window component emits the following signals:

          +
            +
          • delete,request: The window is requested delete.
          • +
          • focus,in: The window received focus.
          • +
          • focus,out: The window lost focus.
          • +
          • moved: The window that holds the canvas is moved.
          • +
          • withdrawn: The window is managed normally but is removed from the view.
          • +
          • iconified: The window is minimized (for example, into an icon or a taskbar).
          • +
          • normal: The window is in the normal state (not withdrawn or iconified).
          • +
          • stick: The window shows on all desktops.
          • +
          • unstick: The window shows only on one desktop.
          • +
          • fullscreen: The window is fullscreen.
          • +
          • unfullscreen: The window stops being fullscreen.
          • +
          • maximized: The window is maximized.
          • +
          • unmaximized: The window is diminished.
          • +
          • wm,rotation,changed: The rotation of the window is changed by the Windows Manager.
          • +
          • ioerr: A low-level I/O error occurred in the display system.
          • +
          • indicator,prop,changed: The property or indicator mode and indicator opacity are changed.
          • +
          • rotation,changed: The rotation of the window is changed.
          • +
          • profile,changed: The profile of the window is changed.
          • +
          • aux,hint,allowed: aux_hint of the window free.
          • +
          • access,changed: The access function of the window is changed.
          • +
          +

          With all these signals, event_info is NULL.

          +

          The following example registers a callback function called on the fullscreen signal.

          +
          +{
          +   evas_object_smart_callback_add(window, "fullscreen", fullscreen_cb, data);
          +}
          +
          +// Callback function for the "fullscreen" signal
          +// This callback is called when the window becomes fullscreen
          +void fullscreen_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Window fullscreen\n");
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + + diff --git a/org.tizen.ui.guides/html/native/efl/components_mn.htm b/org.tizen.ui.practices/html/native/efl/components_mn.htm old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/native/efl/components_mn.htm rename to org.tizen.ui.practices/html/native/efl/components_mn.htm diff --git a/org.tizen.ui.guides/html/native/efl/components_wn.htm b/org.tizen.ui.practices/html/native/efl/components_wn.htm old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/native/efl/components_wn.htm rename to org.tizen.ui.practices/html/native/efl/components_wn.htm diff --git a/org.tizen.ui.practices/html/native/efl/containers_n.htm b/org.tizen.ui.practices/html/native/efl/containers_n.htm new file mode 100644 index 0000000..a0e1fe0 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/containers_n.htm @@ -0,0 +1,607 @@ + + + + + + + + + + + + + + Using Container UI Components + + + + + + +
          +

          Using Container UI Components

          + +

          Box

          + + +

          Figure: Box container

          +

          Box container

          + + +

          Most of the time, you want to display UI components on the screen in a specific order. In a form container, for example, the user information is arranged vertically. This basic container is called a box. There is no theme for a box layout. It is just a linear method of arranging UI components horizontally or vertically.

          +

          Creating a Box

          +

          To create a new horizontal box:

          +
          Evas_Object *vbox;
          +
          +vbox = elm_box_add(parent);
          +
          +

          By default, the elm_box_add() function creates a vertical box. If you want to create a horizontal box, use the elm_box_horizontal_set() function:

          +
          Evas_Object *hbox;
          +
          +hbox = elm_box_add(parent);
          +elm_box_horizontal_set(hbox, EINA_TRUE);
          +
          + + + + + + + + + + +
          Note
          A box is a non-graphical object. It adds no graphics to or around the objects it holds.
          + +

          Adding Objects to the Box

          +

          You can add any Evas object to the box. Here, we create 5 button components and add them to a box:

          +
          int i;
          +Evas_Object *bt;
          +Evas_Object *vbox;
          +
          +vbox = elm_box_add(parent);
          +
          +for (i = 0; i < 5; i++)
          +{
          +   char tmp[16];
          +   snprintf(tmp, sizeof(tmp), "Button %d", i);
          +   bt = elm_button_add(vbox);
          +   elm_object_text_set(bt, tmp);
          +   elm_box_pack_end(vbox, bt);
          +   evas_object_show(bt);
          +}
          +evas_object_show(vbox);
          +
          +

          The most important function in the above code is elm_box_pack_end(), which is used to add the button component to the end of the box.

          + +

          Setting the Padding

          +

          You can set the padding between the objects in a box by using the elm_box_padding_set() function. The padding values are the number of pixels horizontally and vertically.

          +
          elm_box_padding_set(vbox, 16, 64);
          +
          + +

          Handling Element Size

          +

          You can add different-size elements to a container. For example, to add an image with a size of 128x128 pixels as the first element in a box, use the elm_box_pack_start() function:

          +
          ic = elm_icon_add(vbox);
          +elm_image_file_set(ic, "./c1.png", NULL);
          +evas_object_size_hint_min_set(ic, 128, 128);
          +evas_object_show(ic);
          +elm_box_pack_start(vbox, ic);
          +
          +

          We ask Evas to set the size hint for the icon object by using the elm_object_size_hint_min_set() function. Evas will try to set the minimum size of this object accordingly.

          +

          If you want to create a homogeneous box, where all objects have the same height or width, depending on the orientation of the box, use the elm_box_homogeneous_set() function:

          +
          elm_box_homogeneous_set(vbox, EINA_TRUE);
          +
          +

          Elementary will set the height of the tallest object as the height of all objects, or the width of the widest element as the width of all objects.

          +

          Setting the Alignment

          +

          You can set the alignment of UI components inside a box using the elm_box_align_set() function. The function takes two doubles values, a horizontal value and a vertical value, representing the percentage between 0 and 1.0 of the alignment in the horizontal and vertical axes. When you add a UI component with the elm_box_pack_end() or elm_box_pack_start() function, Elementary computes the global size of the box. If the global size is bigger than the size of the box's parent, the box will take up all the space occupied by the parent, and the size of the parent may be extended to hold the box. If the global size is smaller than the parent's size, the alignment values will set the position of the box inside the parent.

          + +

          Figure: Alignment

          +

          Alignment

          + +

          Here, we set an alignment of 0.8 vertically:

          +
          elm_box_align_set(vbox, 0.0, 0.8);
          +
          + + + + + + + + + + +
          Note
          The alignment only takes effect in the opposite direction than the one defined with the elm_box_horizontal_set() function.
          + + +

          The elm_box_layout_transition() function provides the ability to animate the motion of the objects in a box when switching from one layout to another.

          +

          Using Size Hints

          +

          Size hints are a set of functions that can be used on any Evas object. You request Evas to take care of various properties, and Evas will honor these requests if it can. This is why they are called "hints". The size hint functions are:

          +
            +
          • evas_object_size_hint_min_set()
          • +
          • evas_object_size_hint_max_set()
          • +
          • evas_object_size_hint_aspect_set()
          • +
          • evas_object_size_hint_align_set()
          • +
          • evas_object_size_hint_weight_set()
          • +
          +

          You can also use the respective get functions to get the current hint values.

          +

          In case of the evas_object_size_hint_min_set() function, you ask Evas to respect the minimum size you define for the object. For example, to set the minimum size of an icon to 64x46 pixels:

          +
          evas_object_size_hint_min_set(ic, 64, 64);
          +
          +

          You can also set a maximum size for the same icon:

          +
          evas_object_size_hint_max_set(ic, 128, 128);
          +
          +

          When you resize the parent of the icon, if there are no constraints to the parent, the minimum size of the parent will be the minimum hint size of the icon. If you increase the parent size, the icon will grow larger until its maximum hint size is reached. After this point, the icon will not grow any larger and there will be empty space around the icon within the parent.

          +

          When the aspect size hint is set, Evas tries to fix the dimensional proportions of the object. Here, the proportion of the icon is respected, and the width will be the same as the height:

          +
          evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
          +
          +

          Here, the width will be twice the height:

          +
          evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 2, 1);
          +
          +

          If we want to change the alignment of the icon relative to the parent, we can use the evas_object_size_hint_align() function. By default, the icon is centered, so it is aligned with a value of 0.5. You can change the alignment as follows:

          +
          evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +
          +

          In the above case, the icon is aligned to the bottom left corner of the parent.

          +

          We can also play with the size of the icon inside its container by using the weight size hint. By default, the weight is not set, so the size of the icon will be the minimum size. But if you set this value to 1, the icon will be expand as much as it can inside the container:

          +
          evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +
          +

          You can also use the alignment and weight hints together. Here, we want the icon to take up all the space in its parent:

          +
          evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +
          + + +

          Conformant

          + +

          Figure: Conformant container

          +

          Conformant container

          + +

          A conformant is a container UI component that accounts for the space taken by the indicator, virtual keyboard, and softkey windows. The content area of the conformant is resized and positioned based on the space available. When the virtual keyboard is displayed, the content area is not resized.

          + +

          Creating a Conformant

          +

          To create a conformant, use the elm_conformant_add() function:

          +
          +Evas_Object *conformant;
          +
          +conformant = elm_conformant_add(parent);
          +
          + +

          Adding Content to the Conformant

          +

          To add content to the conformant, use the elm_object_content_set() function:

          +
          elm_object_content_set(conformant, main_view);
          +
          + +

          Signals

          +

          To receive notifications about the state of the virtual keyboard and clipboard, listen to the following Evas signals:

          +
            +
          • "virtualkeypad,state,on": The virtual keyboard has been switched on.
          • +
          • "virtualkeypad,state,off": The virtual keyboard has been switched off.
          • +
          • "virtualkeypad,size,changed": The virtual keyboard size has changed.
          • +
          • "clipboard,state,on": The clipboard has been switched on.
          • +
          • "clipboard,state,off": The clipboard has been switched off.
          • +
          + + +

          Grid

          + +

          In a grid, objects are placed at specific positions along a fixed grid, where the position of each object is given as a percentage of the full width and height of the grid. By default, the size of the grid is 100 x 100 pixels.

          + +

          Creating a Grid

          +

          To create a grid, use the elm_grid_add() function:

          +
          Evas_Object *grid;
          +
          +grid = elm_grid_add(parent);
          +

          Adding Items to the Grid

          +

          To add an item to the grid, use the elm_grid_pack_set() function. Provide the X and Y coordinates, and the width and height in the grid as parameters. The following code adds 12 icons in a circle formation:

          +
          for (i = 0; i < 12; i++)
          +{
          +   ic = elm_icon_add(grid);
          +   elm_image_file_set(ic, "c1.png", NULL);
          +   evas_object_size_hint_min_set(ic, 128, 128);
          +   evas_object_show(ic);
          +   x = 40 * cos(2.0 * M_PI / 12 * i);
          +   y = 40 * sin(2.0 * M_PI / 12 * i);
          +   elm_grid_pack(grid, ic,  40 + x,  40 + y,  20 , 20);
          +}
          +evas_object_show(grid);
          +
          + +

          Changing Position and Size

          +

          To change the position of an item in the grid, use the elm_grid_pack_set() function. The first parameter is the item you want to move, and the following parameters are the same as for the elm_grid_pack() function.

          +

          To change the size of the grid, use the elm_grid_size_set() function. You can set the new width and height for the grid. The position and size of the items in the grid are changed accordingly.

          +

          Clearing the Grid

          +

          To clear the grid, use the elm_grid_clear() function. All items are removed from the grid. If you set the clear parameter, all the items are also deleted, with the evas_object_del() function called on each item.

          + + +

          Layout

          + +

          A layout is a container that takes a standard Edje design file and wraps it very thinly in a UI component. Layouts are the basis of a lot of graphics components used in Elementary.

          + +

          An Edje design file describes how the elements of the UI are positioned and how they behave when interacted with. For more information about Edje, see Themes.

          + +

          Creating a Layout

          + +

          To create a new layout, use the elm_layout_add() function:

          +
          Evas_Object *layout;
          +
          +layout = elm_layout_add(parent);
          +
          +

          In Tizen, the layout component is extended to support different kinds of layouts. Rather than define layouts yourself, you can use the following predefined default layouts:

          +
            +
          • application/default: This layout can be used to display content inside a window.
          • +
          • drawer/panel: This layout can be used to create a 2-panel view.
          • +
          • nocontents/default: This layout can be used when there is no content to display, such as in a contact or email.
          • +
          +

          To use the application/default layout:

          +
          Evas_Object *ly;
          +
          +ly = elm_layout_add(parent);
          +elm_layout_theme_set(ly, "layout", "application", "default");
          +
          + +

          Adding Objects to the Layout

          +

          To add an Evas object to the layout:

          +
          elm_object_part_content_set(ly, "elm.swallow.content" view);
          +
          +

          elm.swallow.content is the swallow part of the application layout, and with this call you integrate the view inside the swallow object of the layout.

          +

          The drawer/panel layout can display 2 different views, the background and the main content:

          +
          Evas_Object *ly;
          +
          +ly = elm_layout_add(parent);
          +elm_layout_theme_set(ly, "layout", "drawer", "panel");
          +
          +

          To swallow an object inside the main content and background views:

          +
          elm_object_part_content_set(ly, "elm.swallow.content", main_view);
          +elm_object_part_content_set(ly, "elm.swallow.background", background);
          +
          +

          The nocontents/default layout is a special layout in that it does not contain any swallows. You can only set the text part. There are two different texts zones: elm.text and elm.help.text. To change the text:

          +
          elm_object_part_text_set(ly, "elm.text", "Hi All :)");
          +elm_object_part_text_set(ly, "elm.help.text", "Hi All :)");
          +
          +

          Using Layout Themes

          +

          The layout component supports the following predefined default themes:

          +
            +
          • toolbar-content: For applications with a toolbar and main content area.
          • +
          • toolbar-content-back: For applications with a toolbar, main content area (with a back button), and title area.
          • +
          • toolbar-content-back-next: For applications with a toolbar, main content area (with back and next buttons), and title area.
          • +
          • content-back: For applications with main content (with a back button) and title areas.
          • +
          • content-back-next: For applications with main content (with back and next buttons) and title areas.
          • +
          • toolbar-vbox: For applications with a toolbar and main content area as a vertical box.
          • +
          • toolbar-table: For applications with a toolbar and main content area as a table.
          • +
          +

          To set a theme to the layout, use the elm_layout_theme_set() function.

          + + +

          Mapbuf

          + +

          Figure: Mapbuf hierarchy

          +

          Mapbuf hierarchy

          + +

          A mapbuf component is a container UI component that uses an Evas map to hold a content object. This component is used to improve the moving and resizing performance of complex UI components.

          + +

          The content object is treated as a single image by the Evas map. If you have a content object containing several child objects, frequently moving the mapbuf component will be faster than frequently moving the content object.

          + +

          The mapbuf component inherits all the functions of the container class.

          + +

          Creating a Mapbuf

          +

          To create a mapbuf component, use the elm_mapbuf_add() function:

          +
          Evas_Object *mapbuf, *parent, *content;
          +
          +// Creating a mapbuf
          +mapbuf = elm_mapbuf_add(parent);
          +
          +

          Adding Content to the Mapbuf

          +

          To add content to the mapbuf component, use the elm_object_content_set() function with the "default" part:

          +
          elm_object_content_set(mapbuf, content);
          + + + + + + + + + + +
          Note
          Calling elm_object_content_set(mapbuf, content) is equivalent to calling elm_object_part_content_set(mapbuf, "default", content).
          + + +

          To activate smooth map rendering and alpha rendering for the mapbuf component:

          +
          elm_mapbuf_smooth_set(mapbuf, EINA_TRUE);
          +elm_mapbuf_alpha_set(mapbuf, EINA_TRUE);
          +
          + +

          Activating the Mapbuf

          +

          Finally, to use the mapbuf component, you must activate it:

          +
          elm_mapbuf_enabled_set (mapbuf, EINA_TRUE);
          + +

          Signals

          +

          The mapbuf component does not emit any signals and therefore does not provide any callbacks that you can register.

          + + + + +

          A naviframe component consists of a stack of views. New views are pushed on top of previous ones, and only the top-most view on the stack is displayed. The previous views are not deleted. A previous view is displayed when the view on top of it is popped. Transitions can be animated on a push or a pop, depending on the theme applied to the UI component.

          + +

          Creating a Naviframe

          +

          To create a naviframe, use the elm_naviframe_add() function:

          +
          Evas_Object *nav;
          +
          +nav = elm_naviframe_add(parent);
          +
          +

          Adding and Deleting Views

          +

          The naviframe is a stack of views. A new view is always pushed to the top of the stack. The top-most view is deleted by popping it.

          +

          To add a new view to the naviframe:

          +
          Elm_Object_Item *nav_it;
          +
          +nav_it = elm_naviframe_item_push(nav, NULL, NULL, NULL, view, NULL);
          +// In Tizen 2.3, the back button is not supported in the naviframe 
          +
          +

          When you push a new view to the stack, you receive an Elm_Object_Item for the view. You can use this item to modify the view.

          +

          To pop and delete the top-most view:

          +
          elm_naviframe_item_pop(nav);
          +
          + +

          Adding Fixed Content

          +

          The naviframe can also display fixed content on top of the current (top-most) view. Use the elm_object_item_part_content_set() function to set this content. Use the following part names to specify the location of the content:

          +
            +
          • "default": The main content area of the current view.
          • +
          • "title_left_btn": A button on the left side of the naviframe.
          • +
          • "title_right_btn": A button on the right side of the naviframe.
          • +
          +

          For example, to add a button to the naviframe:

          +
          btn = elm_button_add(nav);
          +elm_object_style_set(btn, "naviframe/title_cancel");
          +elm_object_item_part_content_set(nav_it, "title_left_btn", btn);
          +
          +

          To set the title labels of the naviframe, use the elm_object_item_part_text_set() function and specify one of the following label locations:

          +
            +
          • "default": Sets the title label in the title area of the current view.
          • +
          • "subtitle": Sets the subtitle label in the title area of the current view.
          • +
          +

          Signals

          +

          The naviframe emits the following signals:

          +
            +
          • "transition,finished": The transition has finished changing the view.
          • +
          • "title,transition,finished": The title area transition has finished changing the state of the title.
          • +
          • "title,clicked": The user has clicked the title area.
          • +
          + + + +

          Panes in Mobile Applications

          + +

          Figure: Panes component

          +

          Panes component

          + +

          A panes component adds a draggable bar between two sections of content. The sections are resized when the bar is dragged.

          + +

          Creating Panes

          +

          To create a panes component, use the elm_panes_add() function:

          +
          Evas_Object *panes;
          +
          +panes = elm_panes_add(parent);
          +
          + +

          Adding Content to the Panes

          +

          To add content to the panes, use the elm_object_part_content_set() function. The following code adds an object to the left pane:

          +
          elm_object_part_content_set(panes, "left", obj);
          +
          + +

          Setting Panes Options

          +

          To set the orientation of the panes, use the elm_panes_horizontal_set() function.

          + +

          To set the size of the panes, use the elm_panes_content_left_size_set() and elm_panes_content_right_size_set() functions.

          + +

          Signals

          +

          The panes component emits the following signals:

          +
            +
          • "press": The panes component has been pressed (but the press has not been released yet).
          • +
          • "unpress": The press has been released.
          • +
          • "clicked": The panes component has been clicked.
          • +
          • "clicked,double": The panes component has been double-clicked.
          • +
          + + +

          Scroller

          + +

          A scroller holds (and clips) a single object and allows you to scroll across it. This means that the user can use a scroll bar or their finger to drag the viewable region across the object, moving through a much larger area than is contained in the viewport. The scroller will always have a default minimum size that is not limited by its contents.

          +

          The scroller component inherits all the functions of the Layout.

          +

          Creating a Scroller

          +

          To create a scroller, use the elm_scroller_add() function:

          +
          +Evas_Object *scroller;
          +
          +scroller = elm_scroller_add(parent);
          +
          +

          Adding Objects to the Scroller

          +

          To add an object to the scroller, use the elm_object_content_set() function:

          +
          Evas_Object *image;
          +
          +image = elm_image_add(parent);
          +elm_image_file_set(image, "image.png", NULL);
          +evas_object_show(image);
          +evas_object_size_hint_min_set(image, 2560, 1600);
          +elm_object_content_set(scroller, image);
          +
          +

          In the above code, we set a minimum size of 2560 x 1600 pixels for the image. The scroller is smaller than the image, so you can scroll across the image.

          +

          If you want to be informed when the user begins scrolling the image, use the following code:

          +
          +evas_object_smart_callback_add(scroller, "scroll,drag,start", _scroll_start_cb, NULL);
          +
          +// Callback function for the "animate,begin" signal
          +// This callback is called when the user begins scrolling the image
          +void _scroll_start_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   printf("Scroll starts\n");
          +}
          + +

          Managing the Properties of the Scroller

          +

          When scrolling content, the scroller may "bounce" when reaching the edge of the content. This is a visual way of indicating that there is no more content to scroll in that direction. Bounce is enabled by default for both axes. To enable or disable the bounce for either or both axes, use the elm_scroller_bounce_set() function. The following code disables the bounce for the horizontal axis and enables it for the vertical axis:

          + +
          elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
          +
          +

          The scroller can limit the scrolling to "pages". In this case, the scrolling occurs in page-sized chunks of content rather than in a purely continuous fashion, with the scroller displaying a single "page" at a time. This feature sets the size of the page relative to the viewport of the scroller. A size of 1.0 equals 1 viewport (horizontally or vertically). A size of 0.0 disables paging for that axis. These settings are mutually exclusive with page size (see the elm_scroller_page_size_set() function). A size of 0.5 equals half a viewport. Usable size values are normally between 0.0 and 1.0, including 1.0. If you only want a single axis to scroll in pages, use 0.0 for the other axis.

          + +

          Signals

          + +

          The scroller emits the following signals, which you can catch in your application:

          + +
            +
          • "edge,left": The left edge of the content has been reached.
          • +
          • "edge,right": The right edge of the content has been reached.
          • +
          • "edge,top": The top edge of the content has been reached.
          • +
          • "edge,bottom": The bottom edge of the content has been reached.
          • +
          • "scroll": The content has been scrolled (moved).
          • +
          • "scroll,anim,start": The scrolling animation has started.
          • +
          • "scroll,anim,stop": The scrolling animation has stopped.
          • +
          • "scroll,drag,start": Dragging the contents has started.
          • +
          • "scroll,drag,stop": Dragging the contents has stopped.
          • +
          • "vbar,drag": The vertical scroll bar has been dragged.
          • +
          • "vbar,press": The vertical scroll bar has been pressed.
          • +
          • "vbar,unpress": The vertical scroll bar has been unpressed.
          • +
          • "hbar,drag": The horizontal scroll bar has been dragged.
          • +
          • "hbar,press": The horizontal scroll bar has been pressed.
          • +
          • "hbar,unpress": The horizontal scroll bar has been unpressed.
          • +
          • "scroll,page,changed": The visible page has changed.
          • +
          + +

          Example

          +

          A good example of the scroller is a picture slideshow: we add images to the scroller and limit the scrolling to pages (one picture at a time). In the following code, we disable the scroll bars for both axes, limit the scrolling to pages by using the elm_scroller_page_scroll_limit_set() function, and lock the scrolling on the Y axis by using the elm_object_scroll_lock_y_set() function:

          +
          elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
          +elm_scroller_page_scroll_limit_set(scroller, 1, 0);
          +elm_object_scroll_lock_y_set(scroller, EINA_TRUE);
          +
          +

          We create a horizontal box, which will contain all the images, and which itself will be contained by the scroller:

          +
          box = elm_box_add(scroller);
          +elm_box_horizontal_set(box, EINA_TRUE);
          +elm_object_content_set(scroller, box);
          +evas_object_show(box);
          +
          +

          We then create all the images and add them to the horizontal box:

          +
          img = elm_image_add(scroller);
          +snprintf(buf, sizeof(buf), IMAGE_DIR"/%d.jpg", i);
          +elm_image_file_set(img, buf, NULL);
          +evas_object_show(img);
          +pages = eina_list_append(pages, img);
          +elm_box_pack_end(box, img);
          +
          +

          We store references to the images in an eina_list for easy retrieval later.

          +

          Finally, we display the first page of the scroller:

          +
          elm_scroller_page_show(scroller, 0, 0);
          +
          +

          The size of the scroller depends on the size of the parent. When the parent changes, for example when the window is resized or rotated, the scroller is also resized. Since we need to be informed when the scroller is resized, we add a callback on the EVAS_CALLBACK_RESIZE event for the scroller:

          +
          evas_object_event_callback_add(scroller, EVAS_CALLBACK_RESIZE, _scroller_resize_cb, NULL);
          +

          The callback retrieves the new size of the scroller by using the evas_object_geometry_get() function on the object pointer. The pointer is relative to the object that has been resized, which in our case is the scroller itself. We can then iterate through the images of the scroller and set the minimum size to fit the scroller size:

          +
          EINA_LIST_FOREACH(images, l, page)
          +{
          +   evas_object_size_hint_min_set(page, w, h);
          +}
          +
          +

          Finally, we set the page size of the scroller to match the scroller size and display the first page:

          +
          elm_scroller_page_size_set(obj, w, h);
          +elm_scroller_page_show(obj, 0, 0);
          + +

          Table

          + +

          A table is like a box but with 2 dimensions. You have the same kind of APIs as with boxes. An item inside the table can span multiple columns and rows, and even overlap with other items (and it can then be raised or lowered accordingly to adjust stacking if there is overlap).

          + +

          Creating a Table

          + +

          To create a table, use the elm_table_add() function:

          +
          Evas_Object *table;
          +table = elm_table_add(parent);
          + +

          Adding Items to the Table

          + +

          Items are added to the table with the elm_table_pack() function. This function takes as parameters the table, the item to add to the table, and the position where to add the item: column, row, and the size of the item in number of rows and columns (colspan and rowspan). If we want to create an icon that takes 3 columns and rows and a button that only takes 1 row and column, the code will look like this:

          +
          ic = elm_icon_add(table);
          +elm_image_file_set(ic, "icon.png", NULL);
          +evas_object_show(ic);
          +elm_table_pack(table, ic, 0, 0, 3, 3);
          +
          +btn = elm_button_add(table);
          +elm_object_text_set(btn, "Click me i'm famous");
          +evas_object_show(btn);
          +elm_table_pack(table, btn, 3, 1, 1, 1);
          +evas_object_show(table);
          +
          + +

          Managing the Items

          + +

          If you want to change the position of the item after adding it, use the elm_table_pack_set() function. This function takes as parameters the item whose position to change, the new column, the new row, and the size of the item in number of rows and columns (colspan and rowspan).

          + +

          To add padding around the item, use the elm_table_padding_set() function. The second parameter is the padding between columns, and the third parameter is the padding between rows:

          +
          elm_table_padding_set(table, 10, 10);
          + +

          To change the alignment and size of an item, use the evas_object_size_hint parameters. They are used in the same way as with boxes. You can set the same size and weight to each item by using the homogeneous parameter:

          +
          elm_table_homogeneous_set(table, EINA_TRUE);
          +
          + +

          Clearing the Table

          + +

          To clear the table, use the elm_table_clear() function. If the clear parameter is EINA_TRUE, the table items are deleted. The evas_object_del() function will be called on each item.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/core_loop_n.htm b/org.tizen.ui.practices/html/native/efl/core_loop_n.htm new file mode 100644 index 0000000..98c7a23 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/core_loop_n.htm @@ -0,0 +1,87 @@ + + + + + + + + + + + + + Core Loop and OS Interfacing: Handling the Main Loop and Threads + + + + + +
          + +

          Core Loop and OS Interfacing: Handling the Main Loop and Threads

          +

          The Ecore library provides convenience functions, which allow you to manage the application main loop and threading.

          + +

          Tizen applications developed with EFL use the EDA (Event-driven Architecture) pattern. In EDA, applications reiterate the routine that checks input events, processes the events, and then displays the outputs. The main loop is the entity handling this sequence. It is the heart of any GUI based on EDA.

          + +

          Most applications start and end the main loop, which is used in special situations, such as propagation of events to UI components for handling and updating application appearance and state. That guarantees the delivery of all events received from low-level input devices and provides the accurate and speedy render event loop for synchronizing the application UI with events.

          + +

          The Ecore library provides main loop abstraction with a clean and tiny event loop library. Applications mainly deal with file descriptors handling, event handling, and timer handling from the beginning of the main loop.

          + +

          In addition, Ecore provides several modules related to, for example, Audio, Cocoa, Connection, Drm, FrameBuffer, Input, IPC, Wayland, Win32, and X11 with convenient methods to communicate with underlying operating systems, such as Ubuntu, Windows®, or Mac OS® X.

          + +

          There are 2 types of threads in Tizen applications:

          +
            +
          • Main thread that contains the main loop
          • +
          • Worker threads that support concurrent processing. In parallel processing, applications must keep the GUI updating while processing the data related to the UI.
          • +
          + +

          The Ecore library provides these concurrent processing mechanisms through Ecore threads. An Ecore thread is not a simple wrapper for standard POSIX threads. It is not meant to be used to run parallel tasks throughout the entire duration of the application, especially when these tasks are performance-critical. Ecore manages these tasks using a pool of threads based on system configuration, such as the number of processors the system has, and the maximum amount of concurrent threads set for the application.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/data_types_n.htm b/org.tizen.ui.practices/html/native/efl/data_types_n.htm new file mode 100644 index 0000000..636dcb6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/data_types_n.htm @@ -0,0 +1,1695 @@ + + + + + + + + + + + + + Data Types + + + + + +
          + +

          Data Types

          + +

          The Eina library is a central part of the EFL. It implements an API for data types, and allows you to create and manipulate several data types:

          + +
            +
          • Inline Array: standard array of inlined members
          • +
          • Array: standard array of void* data
          • +
          • Hash Table: standard hash of void* data
          • +
          • Inline List: list with nodes inlined into the user type
          • +
          • Compact List
          • +
          • List: standard list of void* data
          • +
          • Iterator Functions
          • +
          • Sparse Matrix: sparse matrix of void* data
          • +
          • Red-Black tree: red-black tree with nodes inlined into the user type
          • +
          • String Buffer: mutable string to prepend, insert, or append strings to a buffer
          • +
          • Stringshare: shares read-only string references
          • +
          • Tiler split: merges and navigates into 2D tiled regions
          • +
          • Trash: container of unused but allocated data
          • +
          • Generic Value Storage: container for generic value storage and access
          • +
          • Data Model API: container for data with a user-defined hierarchy or structure
          • +
          + + +

          Iterator Functions

          +

          Eina provides a set of iterator functions to manipulate data types, such as arrays.

          +

          These functions allow access to container elements in a generic way, without knowing which container is used (similar to iterators in the C++ STL). Iterators only allow sequential access (that is, from one element to the next one). For random access, Eina provides accessor functions.

          +

          Getting an iterator to access elements of a given container is done through the functions of that particular container. There is no function to create a generic iterator as iterators absolutely depend on the container. Note that all iterators, regardless of the container type, are always deleted with the same eina_iterator_free() function.

          +

          To get the data and iterate, use the eina_iterator_next() function. To call a function on every single element of a container, use the eina_iterator_foreach() function.

          +

          In addition to iterator functions, each data type also owns a set of macros that provide the iterators, such as FOREACH or REVERSE_FOREACH.

          + +

          Strings

          + +

          Stringshare

          + +

          The Eina_Stringshare data type functions allow you to store a single copy of a string and use it in multiple places throughout your program. This way you can save a lot of strings with less memory. It improves string creation and destruction speed, reduces memory use, and decreases memory fragmentation.

          +

          With this data type you can reduce the number of duplicated strings kept in memory. It is common for the same strings to be dynamically allocated repeatedly between applications and libraries, especially in circumstances where you can have multiple copies of a structure that allocates the string. Rather than duplicating and freeing these strings, request a read-only pointer to an existing string and only incur the overhead of a hash lookup. This can sound like micro-optimizing, but profiling has shown that this can have a significant impact as the number of copies grows.

          + +

          To manage stringshares:

          +
            +
          1. To create a stringshare, declare a string variable and call the eina_stringshare_add() function: +
            +const char *mystr;
            +const char *prologue = "Enlightenment is not just a window manager for Linux/X11 and others"
            +
            +mystr = eina_stringshare_add(prologue);
            +
          2. + +
          3. To retrieve or modify the string data: +
              +
            • Retrieve a string for use in a program from a format string using the eina_stringshare_printf() function. If you have a "format" string to pass to a function like printf, you can store it as a stringshare as well. +

              The following example produces "1 desktop manager to rule them all".

              +
              +const char *myfmtstr = "%d desktop manager to rule them all";
              +const char *str;
              +
              +str = eina_stringshare_printf(myfmtstr, 1);
              +
              +print(str)
              +
              +
            • + +
            • Replace the value of a stringshare with the eina_stringshare_replace() function. Pass the pointer address and the new value to the function. +
              +eina_stringshare_replace(&str,"One desktop manager to rule them all");
              +
              +
            • + +
            • Retrieve the length of the stringshare value with the eina_stringshare_strlen() function. +
              +printf("length: %d\n", eina_stringshare_strlen(str));
              +
              +
            • +
            +
          4. +
          5. When the string is no longer needed, delete it using the eina_stringshare_del() function: +
            +eina_stringshare_del(mystr);
            +
            +
          6. +
          + + + +

          String Buffer

          +

          The string buffer data type is designed to be a mutable string, allowing you to append, prepend or insert a string to a buffer. It allows easy handling of buffers in your applications.

          +

          To manage string buffers:

          +
            +
          1. Initialize the Eina_Strbuf instance and create the buffer: +
            +Eina_Strbuf *buf;
            +mybuffer = eina_strbuf_new();
            +
            +
          2. +
          3. Manage the buffer content: +
              +
            • To append characters to the buffer: +
                +
              • +

                For basic strings, use the eina_strbuf_append() function:

                +
                +eina_strbuf_append(mybuffer, "This is my string.");
                +
                +
              • +
              • To append 1 character to your buffer, use the eina_strbuf_append_char() function. You can also append a sized string to the buffer using the eina_strbuf_append_length() function. +
                +eina_strbuf_append_length(mybuffer, "Buffe", 5);
                +eina_strbuf_append_char(mybuffer, 'r');
                +
                +
              • +
              • To handle "printf" format strings, use the eina_strbuf_append_printf() function to add formatted strings to the buffer: +
                +eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
                +
                +
              • +
              +
            • + +
            • To remove characters from one position to another, use the eina_strbuf_remove() function. The first parameter is the buffer, the second is the start position of the characters you want to delete, and the last the end position. +

              This example removes the first 19 characters of the buffer:

              +
              +eina_strbuf_remove(buf, 0, 18);
              +
              +
            • + +
            • To replace characters: + +
              • +eina_strbuf_replace() replaces a specific occurrence of a given string in the buffer with another string.
              • +
              • +eina_strbuf_replace_all() replaces all occurrences of a given string in the buffer with another string. +
              • +
              +
              +eina_strbuf_append(mybuffer, "buffer buffer buffer");
              +
              +// Replacing one occurrence of "buffer" by "B-U-F-F-E-R"
              +eina_strbuf_replace(mybuffer, "buffer", "B-U-F-F-E-R", 1);
              +
              +// Replacing all the occurrences of "buffer" by "B-U-F-F-E-R"
              +eina_strbuf_replace_all(mybuffer, "buffer", "B-U-F-F-E-R");
              +
              +// Replacing all the occurrences of "B-U-F-F-E-R" by "Buffer"
              +eina_strbuf_replace_all(mybuffer, "B-U-F-F-E-R", "Buffer");
              +
              +
            • +
            • To insert a string at the specified position, use the eina_strbuf_insert() function. Use the eina_strbuf_insert_printf() function with formatted strings. +
              +eina_strbuf_insert(mybuffer, "More buffer", 10);
              +
              +// Using eina_strbuf_length_get to get the buffer length
              +eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf));
              +
              +
            • + +
            • To get the complete length of the string and the buffer, use the eina_strbuf_string_get() and eina_strbuf_length_get() functions: +
              +printf("%s : %d\n", eina_strbuf_string_get(mybuffer), eina_strbuf_length_get(buf));
              +
              +
            • +
            +
          4. + +
          5. When no longer needed, free the buffer with the eina_strbuf_free() function. You can also free the content of Eina_Strbuf without freeing the buffer itself using the eina_strbuf_string_free() function. +
            +eina_strbuf_free(mybuffer);
            +
            +
          6. +
          + +

          Arrays

          +

          An array is a data type which describes an ordered collection of values. The values are accessed by their index.

          +
          +INDEX | VALUE
          +--------------
          +0     | value0
          +1     | value1
          +2     | value2
          +3     | value3
          +4     | value4
          +5     | value5
          +6     | value6
          +7     | value7
          +
          +

          Eina provides 2 array types: the classic array and an inline array.

          + +

          Creating and Destroying a Classic Array

          + +

          The eina_array_new() function creates a new array. You can store strings or objects in the created array. The function returns a new array, or if memory allocation fails, NULL.

          +

          The first parameter of the eina_array_new() function defines the size of the array allocation step. For example, if you set it to 4, the function returns an array of 4 elements and the next time you grow the array it grows by 4 elements. Unless you have pushed 4 elements inside, it does not grow. But once you add the 5th element, it grows again and becomes an array of 8 elements. The allocation step feature is very useful for optimizing performance, and it also reduces memory fragmentation by having a size that fits the array usage. If you set the step to 0, the function sets a default safe value.

          + +

          To create an array to store strings:

          +
            +
          1. Create the array: +
            +// Strings to store in the array 
            +const char* strings[] = 
            +{
            +   "helo", "hera", "starbuck", "kat", "boomer",
            +   "hotdog", "longshot", "jammer", "crashdown", "hardball",
            +   "duck", "racetrack", "apolo", "husker", "freaker",
            +   "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
            +};
            +// Declaring the array (type Eina_Array)
            +Eina_Array *array;
            +unsigned int i;
            +
            +// Creating the array
            +array = eina_array_new(20);
            +
            +// Inserting elements in the array
            +for (i = 0; i < 20; i++)
            +   eina_array_push(array, strdup(strings[i]));
            +
            +
          2. +
          3. To change the allocation step, use the eina_array_step_set() function: +
            • The first parameter is the array you want to change.
            • +
            • The second parameter is the size of that specific array (retrieved with the sizeof() function).
            • +
            • The last parameter is the new step size.
            +

            In this example, the array step changes from 20 to 30.

            +
            +eina_array_step_set(array, sizeof(*array), 30);
            +
            +
          4. +
          5. When no longer used, use the eina_array_free() function to free the array. It first calls the eina_array_flush() function and frees the memory of the pointer. It does not free the memory allocated for the elements of the array. To free them, use a while statement with the eina_array_pop function. +
            +// Freeing the array elements
            +while (eina_array_count(array))
            +   free(eina_array_pop(array));
            +
            +// Freeing the array itself
            +eina_array_free(array);
            +
            +
          6. +
          + +

          Modifying Classic Array Content

          + +

          To modify classic array content:

          +
            +
          • To set the data of an element, use the eina_array_data_set() function. The first parameter is the array, the second is the index of the element you want to set, and the last one is the data. You must first get the related pointer if you need to free it, as this function replaces the previously held data. Be careful, as there is no array or index check. If the value is NULL or invalid, the application can crash. +
            +free(eina_array_data_get(array, 0));
            +eina_array_data_set(array, 0, strdup(strings[3]);
            +
            +
          • +
          • To add elements to the end of the array, use the eina_array_push() function. The function returns EINA_TRUE on success, and EINA_FALSE on failure. The first parameter is the array to store the element, the second one is the data you want to store. If you store strings, remember to allocate the memory first. The example uses the strdup function to duplicate the string contained in strings[]. This function allocates the memory of the returned string, so you do not have to do it yourself. +
            +for (i = 0; i < 20; i++)
            +   eina_array_push(array, strdup(strings[i]));
            +
            +
          • + +
          • To remove the last element of an array, use the eina_array_pop() function. It takes the array as a parameter, and if the operation is successful, returns a pointer to the data of the removed element. +
            +while (eina_array_count(array))
            +   free(eina_array_pop(array));
            +
            +
          • + +
          • To rebuild the array by specifying the data to be kept, use the eina_array_remove() function: +
            • The first parameter is the array to be changed.
            • +
            • The second parameter is the function which selects the data to keep in the rebuilt array.
            • +
            • The last parameter is the data to pass to the selector function defined as the second parameter.
            +

            The selector function has to return an Eina_Bool, EINA_TRUE if the element stays, and EINA_FALSE if it has to be removed.

            +

            The following example shows how to remove all the elements of the array that are longer than 5.

            +
            +// Selector function 
            +Eina_Bool keep(void *data, void *gdata)
            +{
            +   if (strlen((const char*)data) <= 5)
            +      return EINA_TRUE;
            +
            +   return EINA_FALSE;
            +}
            +
            +int remove_array()
            +{
            +   Eina_Array *array;
            +   Eina_Array_Iterator iterator;
            +   const char *item;
            +   unsigned int i;
            +
            +   // Creating and populating an array
            +
            +   // Removing the undesired elements 
            +   eina_array_remove(array, keep, NULL);
            +
            +   // Flushing and freeing the array
            +
            +   return 0;
            +}
            +
            +
          • +
          • To completely wipe an array out, use the eina_array_flush() function. This function sets the count and total members of an array to 0, and frees and sets its data members to NULL. For performance reasons, there is no array check. If the value is NULL or invalid, the program can crash. The only parameter of this function is a pointer to the Eina_Array array you want to flush. +
            +eina_array_flush(array);
            +
            +
          • +
          • To empty an array quickly, use the eina_array_clean() function. This function sets the counting of members in the array to 0. It does not free any space so you have to use it carefully. For performance reasons, there is no array check. If the value is NULL or invalid, the program can crash. +
            +eina_array_clean(array);
            +
            +
          • +
          + +

          Accessing Classic Array Data

          + +

          To access classic array data:

          +
            +
          • To access the data in the array, use the eina_array_data_get() function with the array and the index of the element you want to get. The function returns a pointer to the data. +
            +// Getting the data of the first element 
            +char *mydata;
            +mydata = eina_array_data_get(array, 0);
            +
            +
          • + + +
          • To get the number of elements in an array, use the eina_array_count() function. The first parameter is a pointer to the array variable returned by the eina_array_new() function. +

            The function returns the number of elements.

            +
            +unsigned int nb_elm;
            +nb_elm = eina_array_count(array);
            +
            +
          • + +
          • To iterate through an array, you can use various methods: +
              +
            • Use the Eina_Array iterator called ITER_NEXT. +

              You can use the iterator by calling the macro EINA_ARRAY_ITER_NEXT(). It takes the array to iterate as the first parameter, a counter for the current index during the iteration, and a variable of the same type as the item data and an Eina_Iterator. To use it, declare an Eina_Iterator, an int counter, and, for example, a char * item if your array contains any strings.

              +
              +Eina_Array_Iterator iterator;
              +const char *item;
              +unsigned int i;
              +
              +EINA_ARRAY_ITER_NEXT(array, i, item, iterator)
              +   printf("item #%d: %s\n", i, item);
              +
              +
            • +
            • Use the eina_array_foreach() function to iterate over the array. +

              The first parameter is the array to iterate, the second is a callback function which determines whether the iteration can continue,and the last is the data passed to the callback function.

              +

              To iterate over the array and to print the data of each array element:

              +
              +// Callback function 
              +static Eina_Bool
              +elm_print(const void *container, void *data, void *fdata)
              +{
              +   printf("%s\n", (char *)data);
              +
              +   return EINA_TRUE;
              +}
              +
              +int iterating_array()
              +{
              +   Eina_Array *array;
              +   unsigned int i;
              +
              +   // Creating and populating an array
              +
              +   // Iterating over the array and calling elm_print on each element
              +   eina_array_foreach(array, elm_print, NULL);
              +
              +   // Freeing the element data and array
              +
              +   return 0;
              +}
              +
              +
            • + +
            • Use the eina_array_iterator_new() function to create an iterator for the array.

              The function returns a newly allocated iterator associated with the array. If the array is NULL or the count of the array members is less than or equal to 0, the function returns NULL. If the memory cannot be allocated, NULL is returned and EINA_ERROR_OUT_OF_MEMORY is thrown. Otherwise, a valid iterator is returned.

              +

              Pass to this function the array for which you want to create a new iterator. The iterator is used to run a sequential walk through the array, just like the eina_array_foreach() function.

              +

              To create an iterator and use it to print the data of each array element:

              +
              +static Eina_Bool
              +print_one(const void *container, void *data, void *fdata)
              +{
              +   printf("%s\n", (char*)data);
              +
              +   return EINA_TRUE;
              +}
              +
              +int new_iterator()
              +{
              +   Eina_Array *array;
              +   Eina_Iterator *it;
              +   unsigned short int i;
              +   void *uninteresting;
              +   Eina_Bool rt;
              +
              +   // Creating and populating an array
              +
              +   it = eina_array_iterator_new(array);
              +
              +   it = eina_iterator_next(it, &uninteresting);
              +   eina_iterator_foreach(it, print_one, NULL);
              +   eina_iterator_free(it);
              +
              +   return 0;
              +}
              +
              +
            • +
            • Use the eina_array_accessor_new() function to get random access to the array elements. +

              The function returns a newly allocated accessor associated with the array. If the array is NULL or the counting of array members is less than or equal to 0, this function returns NULL. If the memory cannot be allocated, NULL is returned and EINA_ERROR_OUT_OF_MEMORY is thrown. Otherwise, a valid accessor is returned.

              +

              To use the accessor to retrieve and print the data of every other array element:

              +
              +int random_access()
              +{
              +   // Declaration of the array 
              +   Eina_Array *array;
              +   // Declaration of the accessor
              +   Eina_Accessor *acc;
              +
              +   // Generic counter
              +   unsigned short int i;
              +
              +   // Variable to put the data retrieved from an array element
              +   void *data;
              +
              +   // Creating and populating an array
              +
              +   // Creating the array accessor
              +   acc = eina_array_accessor_new(array);
              +
              +   // Random access to the data of the array elements
              +   for(i = 1; i < 10; i += 2)
              +   {
              +      // Putting the data in the variable 'data'
              +      eina_accessor_data_get(acc, i, &data);
              +      printf("%s\n", (const char *)data);
              +   }
              +
              +   // Freeing the accessor
              +   eina_accessor_free(acc);
              +
              +   // Freeing the array
              +
              +   return 0;
              +}
              +
              +
            • +
            +
          • +
          + + +

          Creating and Destroying an Inline Array

          + +

          An inline array is a container that stores the data itself, not the pointers to the data. This means there is no memory fragmentation, and for small data types, such as char, short, and int, it is more memory-efficient. This is because the data is stored in the cache and is faster to access. The bigger the data gets, however, the less likely it is and the less interesting it becomes.

          +

          To create an inline array, use the eina_inarray_new() function:

          +
          • The first parameter is the size of the value. In this example, only the characters are stored, and because of that, only sizeof(char) is passed to the function.
          • +
          • The second parameter defines the size of the array allocation step. For example, if you set it to 4, the function returns an inline array of 4 elements, and the next time you grow the inline array, it grows by 4 elements and becomes an array of 8 elements. If you set the step to 0, the function sets a default safe value. +

            The step can be changed later on using the eina_inarray_step_set() function.

          + +

          The eina_inarray_new() function returns a pointer to the new Eina_Inarray variable.

          +
          +int inline_array() 
          +{
          +   // Declare an inline array variable of the type Eina_Inarray
          +   Eina_Inarray *iarr;
          +
          +   // Create an inline array of "char"
          +   iarr = eina_inarray_new(sizeof(char), 0);
          +
          +   // When no longer needed, free the array memory
          +   eina_inarray_free(iarr);
          +
          +   return 0;
          +}
          +
          + +

          Modifying Inline Array Content

          + +

          To modify inline array content:

          +
            +
          • +

            To add data as the last element of the inline array, use the eina_inarray_push() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The second parameter is the data you want to push to the inline array.

            +

            If everything runs fine, the function returns the index of the new element. If something goes wrong, it returns -1.

            +
            +ch = 'a';
            +eina_inarray_push(iarr, &ch);
            +
            +
          • +
          • +

            To insert data to a given position of the inline array, use the eina_inarray_insert_at() function:

            +
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • +
            • The second parameter is the index of the element you want to add to the inline array.
            • +
            • The last parameter is a pointer to the content to be added.
            +

            The content of the pointer is copied to the given position in the inline array. All the members from the position to the end of the array are shifted towards the end. If the position is equal to the end of the array, the member is appended. If the position is bigger than the array length, the function fails.

            +
            +ch = 'a';
            +eina_inarray_push(iarr, &ch);
            +ch = 'b';
            +eina_inarray_push(iarr, &ch);
            +ch = 'd';
            +eina_inarray_push(iarr, &ch);
            +
            +// Adding data on position 3
            +ch = 'c';
            +eina_inarray_insert_at(iarr, 2, &ch)
            +
            +
          • +
          • +

            To insert data with your own position criteria, use the eina_inarray_insert() or eina_inarray_insert_sorted() function. The only difference between these functions is that the eina_inarray_insert_sorted() function assumes that the array is already sorted and consequently optimizes the insertion position by doing a binary search.

            +

            In both functions:

            +
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • +
            • The second parameter is the data you want to push to the inline array.
            • +
            • The last parameter is the callback comparison function. +

              The Eina_Compare_Cb callback function compares data1 and data2. data1 is the value contained in the inline array and data2 is the data you pass to the eina_inarray_insert() or eina_inarray_insert_sorted() function as the second parameter. If data1 is less than data2, -1 must be returned, if it is greater, 1 must be returned, and if they are equal, 0 must be returned.

            +

            The following example shows how to insert a value before a greater value:

            +
            +// Defining the comparison function with the position criteria
            +Eina_Compare_Cb cmp(const void *a, const void *b)
            +{
            +   return *(int*)a > *(int*)b;
            +}
            +
            +int inline_insert()
            +{
            +   Eina_Inarray *iarr;
            +   char ch, *ch3;
            +   int a, *b;
            +
            +   // Creating an inline array
            +
            +   // Adding data to the inline array
            +   a = 97;
            +   eina_inarray_push(iarr, &a);
            +   a = 98;
            +   eina_inarray_push(iarr, &a);
            +   a = 100;
            +   eina_inarray_push(iarr, &a);
            +
            +   // Inserting data with the criteria
            +   a = 99;
            +   eina_inarray_insert_sorted(iarr, &a, cmp);
            +
            +   eina_inarray_free(iarr);
            +}
            +
            +
          • +
          • +

            To remove the last element of the inline array, use the eina_inarray_pop() function. The only parameter is a pointer to the array variable returned by the eina_inarray_new() function. This function returns the data removed from the inline array.

            +
            +eina_inarray_pop(iarr);
            +
            +
          • +
          • +

            To remove specific data from an inline array, use the eina_inarray_remove() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The second parameter is the data you want to remove from the inline array.

            + +

            The eina_inarray_remove() function finds the data and removes the matching members from the array. The data can be an existing member of an inline array for optimized usage. In other cases, the content is matched using the memcmp() function.

            + + +

            The eina_inarray_remove() function returns the index of the removed member, or -1 if failed.

            +
            +iarr = eina_inarray_new(sizeof(char), 0);
            +
            +ch = 'a';
            +eina_inarray_push(iarr, &ch);
            +
            +// Removing data from the array
            +eina_inarray_remove(iarr, &ch);
            +
            +
          • + +
          • +

            To remove data from a defined position in an inline array, use the eina_inarray_remove_at() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The second parameter is the index of the element you want to remove from the inline array.

            +

            The function returns EINA_TRUE on success and EINA_FALSE if something goes wrong. The member is removed from the inline array and any members after it are moved towards the array's head.

            +
            +// Removing data from position 2
            +eina_inarray_remove_at(iarr, 2);
            +
            +
          • +
          • To remove all the elements of the array, use the eina_inarray_flush() function. The first parameter is a pointer to the array variable returned by the eina_inarray_new() function. The function removes every member from the array.

            +
            +eina_inarray_flush(iarr);
            +
            +
          • + +
          • +

            To replace values in the inline array, use the eina_inarray_replace_at() function, which copies the data over the given position:

            +
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • +
            • The second parameter is the index of the element you want to remove from the inline array.
            • +
            • The last parameter is the data you want to copy in place of the current data.
            +

            The function returns EINA_TRUE on success, and EINA_FALSE on failure. The given pointer content is copied to the given position in the array. The pointer is not referenced, instead its contents are copied to the member's array using the previously defined member_size. If the position does not exist, the function fails.

            +
            +// Replacing the member at position 3 
            +ch = 'd';
            +eina_inarray_replace_at(iarr, 3, &ch);
            +
            +
          • + +
          • +

            To sort an inline array, use the eina_inarray_sort() function, which applies a quick sorting algorithm to the inline array:

            +
            • The first parameter is a pointer to the array returned by the eina_inarray_new() function.
            • +
            • The last parameter is the Eina_Compare_Cb callback comparison function, which compares data1 and data2. +

              data1 and data2 are values contained in the inline array. If the data matches, the function must return 0, if data1 is less than data2, -1 must be returned and if it is greater, 1 must be returned.

            +
            +static int
            +short_cmp(const void *pa, const void *pb)
            +{
            +   const short *a = pa, *b = pb;
            +
            +   return *a - *b;
            +}
            +
            +int sorting_inline_array()
            +{
            +   Eina_Inarray *array;
            +   int i;
            +
            +   // Creating and populating the inline array
            +
            +   eina_inarray_sort(array, short_cmp);
            +   eina_inarray_free(array);
            +}
            +
            + +

            Be careful, the data given to the compare function is the pointer to the member memory itself. Do not change it.

            +
          • +
          + +

          Accessing Inline Array Data

          + +

          To access inline array data:

          +
            +
          • +

            To search a member in an inline array, use the eina_inarray_search() function that runs a linear walk looking for the given data:

            + +
            • The first parameter is a pointer to the array variable returned by the eina_inarray_new() function.
            • +
            • The second parameter is the data used by the callback function to run the comparison.
            • +
            • The last parameter is the Eina_Compare_Cb callback comparison function, which compares data1 and data2. +

              data1 is the value contained in the inline array and data2 is the data you pass to the eina_inarray_search() function as the second parameter. If the data matches, the function must return 0, if data1 is less than data2, -1 must be returned and if it is greater, 1 must be returned.

            +

            The function returns the member index, or -1 if not found.

            +
            +Eina_Compare_Cb
            +compare(const void *pa, const void *pb)
            +{
            +   const short *a = pa, *b = pb;
            +   if (*a == *b)
            +   {
            +      return EINA_TRUE;
            +   }
            +
            +   return EINA_FALSE;
            +}
            +
            +int search_inline_array()
            +{
            +   Eina_Inarray *array;
            +   int i;
            +   int elm_index;
            +   int to_search = 3;
            +
            +   // Creating and populating the inline array
            +
            +   elm_index = eina_inarray_search(array, &to_search, compare);
            +   eina_inarray_free(array);
            +}
            +
            + +

            Be careful, the data given to the compare function is the pointer to the member memory itself. Do not change it.

            +

            The eina_inarray_search_sorted() function does exactly the same as eina_inarray_search(), but uses a binary search for the given data.

            +
          • + +
          • +

            To get the number of elements in an inline array, use the eina_inarray_count(). The first parameter is a pointer to the array returned by the eina_inarray_new() function. The function returns an unsigned int, the number of elements.

            +
            +printf("Inline array of integers with %d elements:\n", eina_inarray_count(iarr));
            +
            +
          • + +
          • To iterate through an inline array, you can use various methods: +
              +
            • You can use the iterator macros for the inline arrays: FOREACH and REVERSE_FOREACH.

            • +
            • +

              To run a linear walk over an array of elements, use the EINA_INARRAY_FOREACH() macro. The first parameter is a pointer to the array variable returned by eina_inarray_new(), and the second parameter is the variable into which the current value is put during the walk. The EINA_INARRAY_REVERSE_FOREACH() macro does the same thing but starts from the last element.

              + +

              The following example illustrates the printing of each element and its pointer:

              +
              +iarr = eina_inarray_new(sizeof(char), 0);
              +int a, *b;
              +
              +a = 97;
              +eina_inarray_push(iarr, &a);
              +a = 98;
              +eina_inarray_push(iarr, &a);
              +a = 99;
              +eina_inarray_push(iarr, &a);
              +
              +EINA_INARRAY_FOREACH(iarr, b)
              +  printf("int: %d(pointer: %p)\n", *b, b);
              +
              +
            • +
            • To process the array data, use the eina_inarray_foreach() function, which invokes the given function on each element of the array with the given data: +
              • The first parameter is a pointer to the array variable returned by eina_inarray_new().
              • +
              • The second parameter is the function to run on each element. +

                The function must return EINA_TRUE as long as you want to continue iterating. By returning EINA_FALSE, you stop the iteration and make the eina_inarray_foreach() function return EINA_FALSE.

                +

                The data given to the function is the pointer to the member itself.

              • +
              • The last parameter is the data passed to the function called on each element.
              +

              The eina_inarray_foreach() function returns EINA_TRUE if it successfully iterates through all items of the array. Call the function for every given data in the array. This is a safe way to iterate over an array.

              +
              +static Eina_Bool
              +array_foreach(const void *array __UNUSED__, void *p, void *user_data __UNUSED__)
              +{
              +   short *member = p;
              +   int *i = user_data;
              +   (*p)++;
              +   (*i)++;
              +
              +   return EINA_TRUE;
              +}
              +
              +int inline_array_foreach()
              +{
              +   Eina_Inarray *iarr;
              +   iarr = eina_inarray_new(sizeof(char), 1);
              +   int i;
              +
              +   for (i = 0; i < numbers_count; i++)
              +   {
              +      short val = i;
              +      eina_inarray_push(iarr, &val);
              +   }
              +
              +   i = 0;
              +   eina_inarray_foreach(iarr, array_foreach, &i);
              +
              +   eina_inarray_free(iarr);
              +
              +   return 0;
              +}
              +
              +
            • + +
            • To remove some elements based on your own criteria, use the eina_inarray_foreach_remove() function, which walks through the array and, if the value matches in the callback function, removes the element: +
              • The first parameter is a pointer to the array returned by eina_inarray_new() function.
              • +
              • The second parameter is the callback function to run on each element. +

                The callback function returns EINA_TRUE if the value matches, or EINA_FALSE if it does not match.

              • +
              • The last parameter is the data passed to the callback function.
              +

              The function returns the number of removed entries or -1 if something goes wrong.

              +
              +static Eina_Bool
              +array_foreach(const void *array __UNUSED__, void *p, void *user_data __UNUSED__)
              +{
              +   short *member = p;
              +   int *i = user_data;
              +   if (*i == *p) 
              +   { 
              +      return EINA_TRUE;
              +   }
              +
              +   return EINA_FALSE;
              +}
              +
              +int inline_array_foreach_remove()
              +{
              +   Eina_Inarray *iarr;
              +   iarr = eina_inarray_new(sizeof(char), 1);
              +   int i;
              +
              +   for (i = 0; i < numbers_count; i++)
              +   {
              +      short val = i;
              +      eina_inarray_push(iarr, &val);
              +   }
              +
              +   i = 6;
              +   eina_inarray_foreach_remove(iarr, array_foreach, &i);
              +
              +   eina_inarray_free(iarr);
              +
              +   return 0;
              +}
              +
              + +
            • +
            +
          • +
          + + +

          Hash Tables

          +

          The Eina_Hash provides a way to store values in association with a key. For example, if you want to store some tuples into a table, you can do it using the Eina_Hash.

          +

          The Eina_Hash is implemented using an array of "buckets" where each bucket is a pointer to a structure that is the head of a red-black tree. This implementation makes it very robust against week keys as in the worst case scenario, you can still depend on an efficient binary tree implementation.

          + +

          Creating a Hash Table

          + +

          To create the hash table, use the eina_hash_new() function:

          +
            +
          • The first parameter is the function called when getting the size of the key.
          • +
          • The second parameter is the function called when comparing the keys.
          • +
          • The third parameter is the function called when getting the values.
          • +
          • The fourth parameter is the function called on each value when the hash table is freed, or when an item is deleted from it. NULL can be passed as the callback.
          • +
          • The last parameter is the size of the buckets.
          • +
          +

          When you create an Eina_Hash instance, you have to create 4 potentially long callback functions. To make the functions shorter, Eina_Hash offers some predefined functions to create the following kinds of hash tables:

          +
            +
          • eina_hash_string_djb2_new() creates a new hash table using the djb2 algorithm for strings.
          • +
          • eina_hash_string_superfast_new() creates a new hash table for use with strings (better with long strings).
          • +
          • eina_hash_string_small_new() creates a new hash table for use with strings with a small bucket size.
          • +
          • eina_hash_int32_new() and eina_hash_int64_new() create a new hash table for use with 32-bit and 64-bit integers.
          • +
          • eina_hash_pointer_new() creates a new hash table for use with pointers.
          • +
          • eina_hash_stringshared_new() creates a new hash table for use with shared strings.
          • +
          +

          All these predefined functions require only one parameter, which is the function to free the data you store in the hash table.

          +

          The following example shows how to manage a small phone book using the eina_hash_string_superfast_new() function to create the hash table.

          +
            +
          1. Create the phone book structure and some static data:

            +
            +struct _Phone_Entry 
            +{
            +   const char *name; // Full name
            +   const char *number; // Phone number
            +};
            +
            +typedef struct _Phone_Entry Phone_Entry;
            +
            +static Phone_Entry _start_entries[] = 
            +{
            +   { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
            +   { "Ludwig van Beethoven", "+12 34 567-89101" },
            +   { "Richard Georg Strauss", "+23 45 678-91012" },
            +   { "Heitor Villa-Lobos", "+34 56 789-10123" },
            +   { NULL, NULL }
            +};
            +
            +
          2. + +
          3. Create the callback to free the data:

            +
            +static void
            +_phone_entry_free_cb(void *data)
            +{
            +   free(data);
            +}
            +
            +

            The free callback can be changed later using the eina_hash_free_cb_set() function. You need to pass the hash and the new callback function.

            +
          4. + +
          5. Create and destroy the hash table.

            +

            The eina_hash_free_buckets() function frees all hash table buckets. It empties the hash but does not destroy it, and you can still use it for another purpose. When eina_hash_free() is called, the space allocated for the hash is freed.

            +
            +int free_data()
            +{
            +   Eina_Hash *phone_book = NULL;
            +   phone_book = eina_hash_string_superfast_new(_phone_entry_free_cb);
            +
            +   // Empty the phone book without destroying it
            +   eina_hash_free_buckets(phone_book);
            +   eina_hash_free(phone_book);
            +}
            +
            +
          6. +
          + + + + +

          Modifying Hash Table Content

          + +

          To modify hash table content:

          +
            +
          • +

            To add some data to a hash, use the eina_hash_add() function. This function takes the hash, the key to access the data, and the data as its parameters.

            +

            The following example shows how to add the initial data declared earlier to the hash:

            +
            +for (i = 0; _start_entries[i].name != NULL; i++)
            +{
            +   eina_hash_add(phone_book, _start_entries[i].name, strdup(_start_entries[i].number));
            +}
            +
            + +

            The Eina_Hash offers various ways to add elements to a hash, such as the eina_hash_direct_add() function, which adds the entry without duplicating the string key. The key is stored in the struct, so this function can be used with eina_stringshare to avoid key data duplication.

            +
            +for (i = 0; _start_entries[i].name != NULL; i++)
            +{
            +   // Allocating memory for the phone entry
            +   Phone_Entry *e = malloc(sizeof(Phone_Entry));
            +
            +   // Creating an eina_stringshare for the name and the phone number
            +   e->name = eina_stringshare_add(_start_entries[i].name);
            +   e->number = eina_stringshare_add(_start_entries[i].number);
            +
            +   // Adding the entry to the hash 
            +   eina_hash_direct_add(phone_book, e->name, e);
            +}
            +
            +
          • +
          • +

            To modify an entry, use eina_hash_modify() function passing the hash, the key of the data to change, and the new data. The function returns the old data on success.

            +

            The eina_hash_set() function does the same work as eina_hash_modify(), but if the entry does not exist, the function creates a new one.

            +
            +char *old_phone = NULL;
            +char *phone = NULL;
            +// Replace the phone number of Richard Strauss
            +old_phone = eina_hash_modify(phone_book, "Richard Georg Strauss", strdup("+23 45 111-11111"));
            +phone = eina_hash_set(phone_book, "Philippe de Magalhães", strdup("+33 6 111-11111"));
            +eina_hash_set(phone_book, "Richard Georg Strauss", strdup("+23 45 111-117711"));
            +
            +
          • +
          • +

            To change the key associated with the data without freeing and creating a new entry, use the eina_hash_move() function. You only have to pass the hash, the old key, and the new key. If the operation succeeds, the function returns EINA_TRUE, if not, it returns EINA_FALSE.

            +
            +Eina_Bool res;
            +res = eina_hash_move(phone_book, "Philippe de Magalhães", "Filipe de Magalhães");
            +
            +
          • +
          • +

            To delete entries from a hash table:

            +
            • Use the eina_hash_del() function to remove the entry identified by a key or data from the given hash table: +
              +Eina_Bool r;
              +const char *entry_name = "Heitor Villa-Lobos";
              +r = eina_hash_del(phone_book, entry_name, NULL);
              +
            • +
            • Use the eina_hash_del_by_key() function to remove an entry based on the key: +
              +r = eina_hash_del_by_key(phone_book, "Richard Georg Strauss");
              +
              +
            • +
            • +

              Use the eina_hash_del_by_data() function to remove an entry based on the data:

              +
              +r = eina_hash_del_by_data(phone_book, "+12 34 567-89101");
              +
              +
            • +
          + +

          Accessing Hash Table Data

          +

          To find hash table elements and get data based on the key name:

          +
            +
          • +

            To retrieve an entry based on its key, use the eina_hash_find() function by passing the hash and the key you are looking for:

            +
            +char *phone = NULL;
            +const char *entry_name = "Heitor Villa-Lobos";
            +
            +// Look for a specific entry and get its phone number
            +phone = eina_hash_find(phone_book, entry_name);
            +
            +
          • +
          • +

            To get the number of entries in a hash, use the eina_hash_population() function. Pass the hash as the only argument.

            +
            +unsigned int nb_elm;
            +nb_elm = eina_hash_population(phone_book);
            +
            +
          • + +
          • To iterate through a hash table, you can use various methods: +
              + +
            • to iterate over the hash table, use the eina_hash_foreach() function: + +
              • The first parameter is the hash.
              • +
              • The second parameter is the callback function called on each iteration. +

                The callback function has to return an Eina_Bool, EINA_TRUE if the iteration has to continue and EINA_FALSE if the iteration has to stop.

              • +
              • The last parameter one is the data passed to the callback function.
              + +

              The following example prints the key and the data of the hash entry (the name and the phone number):

              + +
              +static Eina_Bool
              +pb_foreach_cb(const Eina_Hash *phone_book, const void *key, void *data, void *fdata)
              +{
              +   const char *name = key;
              +   const char *number = data;
              +   printf("%s: %s\n", name, number);
              +
              +   // Return EINA_FALSE to stop this callback from being called
              +   return EINA_TRUE;
              +}
              +
              +printf("List of phones:\n");
              +
              +// Running the callback on the hash called phone_book 
              +eina_hash_foreach(phone_book, pb_foreach_cb, NULL);
              +printf("\n");
              +
              +
            • +
            • To iterate over the keys, use the eina_hash_iterator_key_new() function: +
              +// Declaration of the Eina_Iterator
              +Eina_Iterator *it;
              +
              +// Variable to handle the current iteration "data"
              +void *data;
              +
              +// Iterate over the keys (names)
              +printf("List of names in the phone book:\n");
              +
              +it = eina_hash_iterator_key_new(phone_book);
              +
              +// Use the generic eina_iterator_next()
              +while (eina_iterator_next(it, &data))
              +{
              +   const char *name = data;
              +   printf("%s\n", name);
              +}
              +
              +// Free the iterator
              +eina_iterator_free(it);
              +
              +
            • + +
            • To iterate over the hash data, use the eina_hash_iterator_data_new() function the same way as eina_hash_iterator_key_new(): +
              +// Declaration of the Eina_Iterator
              +Eina_Iterator *it;
              +
              +// Variable to handle the current iteration "data"
              +void *data;
              +
              +// Iterate over hash data 
              +printf("List of numbers in the phone book:\n");
              +
              +it = eina_hash_iterator_data_new(phone_book);
              +while (eina_iterator_next(it, &data))
              +{
              +   const char *number = data;
              +   printf("%s\n", number);
              +}
              +
              +// Free the iterator
              +eina_iterator_free(it);
              +
              +
            • +
            • To iterate over a tuple composed of keys and data, use the eina_hash_iterator_tuple_new() function: +
              +// Declaration of the Eina_Iterator
              +Eina_Iterator *tit;
              +
              +// Variable to handle the current iteration "data"
              +void *tuple;
              +
              +printf("List of phones:\n");
              +tit = eina_hash_iterator_tuple_new(phone_book);
              +while (eina_iterator_next(tit, &tuple))
              +{
              +   Eina_Hash_Tuple *t = tuple;
              +   const char *name = t->key;
              +   const char *number = t->data;
              +   printf("%s: %s\n", name, number);
              +}
              +
              +// Always free the iterator after its use
              +eina_iterator_free(tit); 
              +
              +
            • +
            +
          • +
          + + +

          Lists

          + +

          The Eina_List is a double-linked list that can store data of any type as void pointers. It provides a set of functions to create and manipulate the list to avoid the access to the struct's fields, similar to a self-made double-link list.

          +

          In addition to the previous and next node and its data, the Eina_List nodes keep a reference to an accounting structure. The accounting structure is used to improve the performance of some functions. The structure is private and must not be modified.

          + +

          In an Eina_List, everything is a "list": the list itself is a list where each node is a list as well.

          + +

          Eina provides 2 list types: the classic list (Eina_List) and an inline list (Eina_Inlist).

          + +

          Creating and Destroying a List

          +

          To use an Eina_List:

          + +
          1. Declare the list with NULL as the default value: +
            +int list()
            +{
            +   // Declaration of the Eina_List with NULL as default value;
            +   Eina_List *list = NULL;
            +
          2. + +
          3. Call the eina_list_append() function with the list and the data you want to append as parameters. +

            The list must be a pointer to the first element of the list (or NULL). The function returns a pointer to the list.

            +
            +   // Creating the first element of the list 
            +   list = eina_list_append(list, "watch");
            +
            +   // Adding more elements
            +   list = eina_list_append(list, "phone");
            +   list = eina_list_append(list, "ivi");
            +   list = eina_list_append(list, "notebook");
            +
          4. + +
          5. When you no longer need the list, free it: +
            +   // Free the Eina_List
            +   eina_list_free(list);
            +
            +   return 0;
            +}
            +
          6. +
          + + +

          Modifying List Content

          + +

          To modify list content:

          +
            +
          • +

            To add data to a list:

            + +
              +
            • To add data at the end of the list, use the eina_list_append() function. To add data at the top of the list, use eina_list_prepend(). The functions work in the same way, only adding the data to different places. +
              +list = eina_list_prepend(list, "set-top box");
              +
              +
            • + +
            • To insert data into the list after a specified data, use the eina_list_append_relative() function. As the last parameter, define the element after which the data is added. +

              For example to append data after the "phone" element:

              +
              +list = eina_list_append_relative(list, "single-board computer", "phone");
              +
              +
            • + +
            • To add a new entry before a specified data, use the eina_list_prepend_relative() function. It is similar to the eina_list_append_relative() function. +
              +list = eina_list_prepend_relative(list, "ultrabook", "ivi");
              +
              +
            • + +
            • To append a list node to a linked list after a specified member, use the eina_list_append_relative_list() function. To prepend a list node to a linked list before a specified member, use the Eina_List * eina_list_prepend_relative_list() function. +
            • +
            +
          • + +
          • To set data in a list member, use the eina_list_data_set() function. Pass the "list" (node) as the first argument and the data to set as the second. + +

            The following example also shows the usage of the eina_list_last() function, which returns the last element of an Eina_List.

            + +
            +// Setting new data for the last element
            +eina_list_data_set(eina_list_last(list), eina_stringshare_add("Boris"));
            +
            +
          • + +
          • To remove a node from the list, use the eina_list_remove() function. This function removes the first instance of the specified data from the given list. +
            +list = eina_list_remove(list, "ultrabook");
            +
            +

            You can also remove a "list" (node) from a list using the eina_list_remove_list() function. Pass the list you want to delete an element from and a 'list' (node) you want to delete.

            +
            +Eina_List *app_list = NULL;
            +Eina_List *to_remove = NULL;
            +
            +// Adding some elements to the list (using stringshares)
            +app_list = eina_list_append(app_list, eina_stringshare_add("enna"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("ebird"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("calaos"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("rage"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("terminology"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("enlightenment"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("eyelight"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("ephoto"));
            +
            +// Finding the "list" to remove 
            +to_remove = eina_list_data_find_list(list, eina_string_share_add("enlightenment"));
            +
            +list = eina_list_remove_list(list, to_remove);
            +
            +
          • + +
          • To move elements in a list, you can use various function, such as eina_list_promote_list() that promotes an element to the top of the list or eina_list_demote_list() that puts the specified element at the end of the list. Remember that everything is a list so the second parameter represents the "list" (node) you want to move. Use the functions just like the eina_list_remove_list() function. +
            +list = eina_list_promote_list(list, eina_list_data_find_list(list, "ivi"));
            +
            +
          • +
          • To reverse all the elements of a list, use the eina_list_reverse() function. To obtain a reversed copy of the list while keeping the initial list unchanged, use the eina_list_reverse_clone() function. +
            +Eina_List *rev_copy;
            +
            +app_list = eina_list_reverse(app_list);
            +rev_copy = eina_list_reverse_clone(app_list);
            +
            +
          • +
          • To sort a list, use the eina_list_sort() function. This function takes a list which needs to be sorted, the maximum number of elements to be sorted, and a callback function that compares data. To sort all list elements, set the maximum number of elements to 0. +
            +int sort_cb(const void *d1, const void *d2)
            +{
            +   const char *txt = d1;
            +   const char *txt2 = d2;
            +   if(!txt) return(1);
            +   if(!txt2) return(-1);
            +
            +   return(strcmp(txt, txt2));
            +}
            +
            +extern Eina_List *list;
            +list = eina_list_sort(list, 0, sort_cb);
            +
            +
          • +
          • To merge 2 list into 1, use the eina_list_merge() function. The eina_list_sorted_merge() function merges 2 sorted lists according to the ordering function that you pass as the last argument. +
            +int sort_cb(void *d1, void *d2)
            +{
            +   const char *txt = NULL;
            +   const char *txt2 = NULL;
            +   if(!d1) return(1);
            +   if(!d2) return(-1);
            +
            +   return(strcmp((const char*)d1, (const char*)d2));
            +}
            +
            +Eina_List *sorted1;
            +Eina_List *sorted2;
            +Eina_List *newlist;
            +
            +// Insert some values and sort your lists
            +
            +// Simply merge 2 lists without any process
            +newlist = eina_list_merge(sorted1, sorted2);
            +
            +newlist = eina_list_sorted_merge(sorted1, sorted2, sort_cb);
            +
            +
          • +
          • To split a list, use the eina_list_split_list() function: +
            • The first parameter is the list to split.
            • +
            • The second parameter is the "list" (element) after which the list is split.
            • +
            • The last parameter is the head of the second list.
            +
            +// Original list (left list)
            +Eina_List *list = NULL;
            +
            +// New list (right list)
            +Eina_List *other_list = NULL;
            +
            +// Eina_List (element)
            +Eina_List *l;
            +
            +list = eina_list_append(list, "super tux");
            +list = eina_list_append(list, "frozen bubble");
            +list = eina_list_append(list, "lincity-ng");
            +
            +// Sorting the list (just for fun)
            +list = eina_list_sort(list, 0, cmp_func);
            +
            +// Looking for the 'split' element
            +l = eina_list_search_sorted_list(list, cmp_func, "frozen bubble");
            +
            +// Splitting the list
            +list = eina_list_split_list(list, l, &other_list);
            +
            +
          • +
          • To copy a list, use the eina_list_clone() function. The function copies all the elements in the list in the exact same order. +
            +Eina_List *app_list_copy;
            +
            +app_list_copy = eina_list_clone(app_list);
            +
            +
          • + +
          + + +

          Accessing List Data

          +

          To access list data:

          +
            +
          • To find some data on your list, use the eina_list_data_find() function. Pass the list containing your data as the first parameter and the data you are looking for as the last one. The function returns the found member data pointer if found, NULL otherwise. +

            The eina_list_data_find() function searches the list from the beginning to the end for the first member for which the data pointer is data. If it is found, the data is returned, otherwise NULL is returned. The function only compares pointers, which is why using Eina_Stringshare is very useful with lists, because it always returns the same pointer for the same string.

            +
            +Eina_List *app_list = NULL;
            +const char *res_str;
            +
            +// Adding some elements to the list (using stringshares)
            +app_list = eina_list_append(app_list, eina_stringshare_add("enna"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("ebird"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("calaos"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("rage"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("terminology"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("enlightenment"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("eyelight"));
            +app_list = eina_list_append(app_list, eina_stringshare_add("ephoto"));
            +
            +// Finding the data
            +res_str = eina_list_data_find(list, eina_string_share_add("enlightenment"));
            +if (res_str == eina_stringshare_add("enlightenment"))
            +   printf("Data is present");
            +else
            +   printf("Data not present");
            +
            + +

            The above example returns "Data is present".

            +

            The eina_list_data_find_list() function does the same thing as eina_list_data_find(), but returns an Eina_List. For an example, see the eina_list_remove_list() function.

            +

            You can access the data or a "list" (node) of an Eina_List using the eina_list_nth() and eina_list_nth_list() functions. The first one returns a pointer to the data of the "n" element and the second a pointer to the "list". To access the data of the 3rd element of an Eina_List:

            +
            +const char *res;
            +Eina_List *res_lst;
            +
            +res = eina_list_nth(app_list, 2);
            +res_lst = eina_list_nth_list(app_list, 2);
            +
            + +

            The res variable contains the pointer to the string "calaos". The res_lst variable is the list containing "calaos".

            +
          • + +
          • To search for data in a list, select your function based on whether the list is sorted or unsorted. +
              +
            • To search in an unsorted list, use the eina_list_search_unsorted() function: +
              • The first parameter is the list.
              • +
              • The second parameter is a callback function for comparison.
              • +
              • The last parameter is the data you are looking for.
              + +

              The eina_list_search_unsorted_list() function does the same but returns an "Eina_List".

              + + +

              The following example shows 2 searches using both the eina_list_search_unsorted() and eina_list_search_unsorted_list() functions:

              +
              +int search_list()
              +{
              +   // Declaring the list
              +   Eina_List *list = NULL; 
              +   Eina_List *l;
              +   // Little trick to use strcmp as Eina_Compare_Cb 
              +   Eina_Compare_Cb cmp_func = (Eina_Compare_Cb)strcmp;
              +
              +   void *data;
              +   int cmp_result;
              +
              +   list = eina_list_append(list, "debian");
              +   list = eina_list_append(list, "archlinux");
              +   list = eina_list_append(list, "centos");
              +
              +   data = eina_list_search_unsorted(list, cmp_func, "archlinux");
              +   l = eina_list_search_unsorted_list(list, cmp_func, "archlinux");
              +   if (l->data != data)
              +   {
              +      eina_list_free(list);
              +
              +      return 1;
              +   }
              +
              +   eina_list_free(list);
              +
              +   return 0;
              +}
              +
              + +
            • +
            • To search in sorted lists, use the eina_list_search_sorted_list() and eina_list_search_sorted() functions. They work similarly as the eina_list_search_unsorted() function. +
            • +
            +
          • + + +
          • To get data from a list element, use the eina_list_data_get() function. The function returns the data contained in the given list. + +

            The following example uses the eina_list_next() function to move through the list in a statement.

            +
            +int list_data_set()
            +{
            +   // Declaring the list
            +   Eina_List *list = NULL;
            +   // Eina_List in which to place the elements or lists
            +   Eina_List *l;
            +
            +   void *list_data;
            +
            +   list = eina_list_append(list, eina_stringshare_add("Bertrand"));
            +   list = eina_list_append(list, eina_stringshare_add("Cedric"));
            +   list = eina_list_append(list, eina_stringshare_add("Nicolas"));
            +   list = eina_list_append(list, eina_stringshare_add("Vincent"));
            +   list = eina_list_append(list, eina_stringshare_add("Raoul"));
            +   list = eina_list_append(list, eina_stringshare_add("Fabien"));
            +   list = eina_list_append(list, eina_stringshare_add("Philippe"));
            +   list = eina_list_append(list, eina_stringshare_add("billiob"));
            +
            +   for(l = list; l; l = eina_list_next(l))
            +      // Printing the data returned by eina_list_data_get
            +      printf("%s\n", (char*)eina_list_data_get(l));
            +
            +   EINA_LIST_FREE(list, list_data)
            +      eina_stringshare_del(list_data);
            +
            +   return 0;
            +}
            +
            +
          • + +
          • To move in a list, use the eina_list_last(), eina_list_next(), or eina_list_prev() functions to move to the last, next, or previous element in the list. +

            The following example scrolls backwards starting from the end of the list:

            +
            +for(l = eina_list_last(list); l; l = eina_list_prev(l))
            +   printf("%s\n", (char*)eina_list_data_get(l));
            +
            + +
          • + +
          • To count the list elements, use the eina_list_count() function. The function returns the number of items in a list. +
            +printf("List size: %d\n", eina_list_count(list));
            +
            +
          • +
          • To iterate through an array, you can use various iterators: +
              +
            • To iterate over a list from the beginning to the end, use the EINA_LIST_FOREACH macro: +
              • The first parameter is the list to iterate.
              • +
              • The second parameter is an Eina_List * to hold the current "List" (node).
              • +
              • The last parameter receives the current data during the run.
              + +

              The following example prints the data of each "List" (node) of the list:

              +
              +Eina_List *list = NULL;
              +Eina_List *l;
              +void *list_data;
              +
              +list = eina_list_append(list, "ls");
              +list = eina_list_append(list, "top");
              +list = eina_list_append(list, "rmdir");
              +list = eina_list_append(list, "uname");
              +
              +EINA_LIST_FOREACH(list, l, list_data)
              +   printf("%s\n", (char*)list_data);
              +
              +eina_list_free(list);
              +
              +
            • +
            • To iterate from the last element to the first, use the EINA_LIST_REVERSE_FOREACH macro. It works similarly as EINA_LIST_FOREACH(). +
            • +
            • To iterate over a list from the beginning to the end, you can also use the EINA_LIST_FOREACH_SAFE macro. It is called safe, because it stores the next "List" (node), so you can safely remove the current "List" (node) and continue the iteration. +
              +Eina_List *list;
              +Eina_List *l;
              +Eina_List *l_next;
              +char *data;
              +
              +list = eina_list_append(list, "tizen");
              +list = eina_list_append(list, "tizen");
              +list = eina_list_append(list, "tizen");
              +list = eina_list_append(list, "tizen");
              +
              +// Using EINA_LIST_FOREACH_SAFE to free the elements that match "tizen"
              +
              +EINA_LIST_FOREACH_SAFE(list, l, l_next, data)
              +   if (strcmp(data, "tizen") == 0) 
              +   {
              +      free(data);
              +      list = eina_list_remove_list(list, l);
              +   }
              +
              +
            • + + +
            • To remove each list element while having access to the node's data, use the EINA_LIST_FREE macro. Pass the list and a pointer to hold the current data. +
              +Eina_List *list;
              +char *data;
              +
              +// List is filled
              +
              +EINA_LIST_FREE(list, data)
              +   free(data);
              +
              +
            • +
            +
          • +
          + +

          Using an Inline List

          +

          The Eina_Inlist is a special data type drawn to store nodes pointers in the same memory as data. This way the memory is less fragmented, but operations, such as sort and count, are slower. The Eina_Inlist has its own purpose, but if you do not understand what the purpose is, use the regular Eina_List instead.

          + +

          The Eina_Inlist nodes can be part of a regular Eina_List, simply added with the eina_list_append() or eina_list_prepend() functions.

          + +

          To use the inline list:

          +
            +
          1. Define the structure of the data before creating the inline list: +
            +struct my_struct 
            +{
            +   EINA_INLIST;
            +   int a, b;
            +};
            +
            + +

            The structure is composed of 2 integers, the real data, and the EINA_INLIST type which is composed of 3 pointers defining the inline list structure:

            + +
              +
            • Eina_Inlist * next: next node
            • +
            • Eina_Inlist * prev: previous node
            • +
            • Eina_Inlist * last: last node
            • +
          2. + +
          3. +

            To create the inlist nodes, allocate the memory and use the eina_inlist_append() function:

            +
            • The first parameter is the existing list head or NULL to create a new list. +

              The following example passes NULL to create a new list.

            • +
            • The second parameter is the new list node, and it must not be NULL. +

              You must use the EINA_INLIST_GET() macro to get the inlist object of the datastruct.

            +
            +struct my_struct *d, *cur;
            +Eina_Inlist *list, *itr, *tmp;
            +
            +d = malloc(sizeof(*d));
            +d->a = 1;
            +d->b = 10;
            +
            +list = eina_inlist_append(NULL, EINA_INLIST_GET(d));
            +
            + +

            Repeat this operation for every new node:

            +
            +d = malloc(sizeof(*d));
            +d->a = 2;
            +d->b = 20;
            +list = eina_inlist_append(list, EINA_INLIST_GET(d));
            +
            +
          4. + +
          5. To add data to the inline list: +
            • Put data at the end of the inline list with the eina_inlist_prepend() function: +
              +d = malloc(sizeof(*d));
              +d->a = 3;
              +d->b = 30;
              +list = eina_inlist_prepend(list, EINA_INLIST_GET(d));
              +
              +
            • + +
            • Add a node before or after a given node with the eina_inlist_prepend_relative() and eina_inlist_append_relative() functions. +

              In both functions, the first parameter is the target list, the second is the element you want to add, and the last is the reference element to place data after (in this case). Similarly as in a regular Eina_List, everything is a list, so the last parameter is an Eina_Inlist typed variable.

              +
              d = malloc(sizeof(*d));
              +d->a = 4;
              +d->b = 40;
              +list = eina_inlist_append_relative(list, EINA_INLIST_GET(d), list);
              +
              +
          6. + +
          7. To sort and iterate an inline list, to find and move list elements, and to perform other inline list operations, see the Inline List API.
          8. + +
          9. When the inline list is no longer needed, destroy it by looping over the list to free each EINA_INLIST structure and the data using allocated memory. Use the eina_inlist_remove() function on each node. + +

            In the following example, the EINA_INLIST_CONTAINER_GET() macro returns the container object of an inlist (the EINA_INLIST of my_struct), and the list element is removed and the allocated memory of the container "object" is freed.

            + +
            while (list)
            +{
            +   struct my_struct *aux = EINA_INLIST_CONTAINER_GET(list, struct my_struct);
            +
            +   // Remove the current list element 
            +   list = eina_inlist_remove(list, list);
            +   free(aux);
            +}
            +
            +
          10. + + +
          + +

          Generic Value

          + +

          The Eina_Value object provides generic data storage and access, allowing you to store what you want in one single type of Eina_Value. It is meant for simple data types, providing uniform access and release functions, useful to exchange data preserving their types. The Eina_Value comes with predefined types for numbers, array, list, hash, blob, and structs, and it can convert between data types, including string.

          + +

          The Eina_Value can handle the following types:

          +
            +
          • EINA_VALUE_TYPE_UCHAR: unsigned char
          • +
          • EINA_VALUE_TYPE_USHORT: unsigned short
          • +
          • EINA_VALUE_TYPE_UINT: unsigned int
          • +
          • EINA_VALUE_TYPE_ULONG: unsigned long
          • +
          • EINA_VALUE_TYPE_TIMESTAMP: unsigned long used for timestamps
          • +
          • EINA_VALUE_TYPE_UINT64: unsigned integer of 64 bits
          • +
          • EINA_VALUE_TYPE_CHAR: char
          • +
          • EINA_VALUE_TYPE_SHORT: short
          • +
          • EINA_VALUE_TYPE_INT: int
          • +
          • EINA_VALUE_TYPE_LONG: long
          • +
          • EINA_VALUE_TYPE_INT64: integer of 64 bits
          • +
          • EINA_VALUE_TYPE_FLOAT: float
          • +
          • EINA_VALUE_TYPE_DOUBLE: double
          • +
          • EINA_VALUE_TYPE_STRINGSHARE: stringshared string
          • +
          • EINA_VALUE_TYPE_STRING: string
          • +
          • EINA_VALUE_TYPE_ARRAY: array
          • +
          • EINA_VALUE_TYPE_LIST: list
          • +
          • EINA_VALUE_TYPE_HASH: hash
          • +
          • EINA_VALUE_TYPE_TIMEVAL: 'struct timeval'
          • +
          • EINA_VALUE_TYPE_BLOB: blob of bytes
          • +
          • EINA_VALUE_TYPE_STRUCT: struct
          • +
          + + +

          To set up a generic value:

          +
            +
          1. Declare the necessary variables: +
            +// The Eina_Value itself
            +Eina_Value v;
            +// An integer 
            +int i;
            +// And a char *
            +char *newstr;
            +
            +
          2. + +
          3. To set up an Eina_Value for an integer, use the eina_value_setup() function. The first argument is the Eina_Value and the second is the type. +
            +eina_value_setup(&v, EINA_VALUE_TYPE_INT);
            +
            +
          4. +
          +

          To manage the generic value:

          +
            +
          • To set an integer, use the eina_value_set() function: +
            +eina_value_set(&v, 123);
            +
            +
          • + +
          • To get the value, use the eina_value_get() function. Pass the Eina_Value as the first argument, and a pointer to a variable to store the value (the target variable must have the same type as the Eina_Value). +
            +eina_value_get(&v, &i);
            +printf("v=%d\n", i);
            +
            +

            The above example prints "v=123".

            +
          • + +
          • To store an Eina_List, use the Eina_Value that corresponds to the EINA_VALUE_TYPE_LIST type. +
          • +
          • To create an Eina_Value_List, use the eina_value_list_setup() function. The function initializes a generic value storage of the list type. The first parameter is the "object" value, and the second one is the type (how to manage the stored list members). +
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/data_types_tools_n.htm b/org.tizen.ui.practices/html/native/efl/data_types_tools_n.htm new file mode 100644 index 0000000..9dc4da1 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/data_types_tools_n.htm @@ -0,0 +1,78 @@ + + + + + + + + + + + + + Data Types and Tools: Using Eina Resources + + + +
          +
          +

          Mobile native Wearable native

          +
          + + +
          + +
          + +

          Data Types and Tools: Using Eina Resources

          + +

          UI toolkits, such as Qt and Gtk, generally support their own data types, structures, functions, and macros in order for you to easily and efficiently make their applications. EFL, as one of Tizen native UI toolkits, provides data types and useful tools as well.

          + +

          The Eina library in EFL implements APIs for data types and structures easy to use and optimized in an efficient way. It also provides some useful tools, such as opening shared libraries, error management, type conversion, time accounting, and memory pool to help convenient application development.

          + +

          The main features of Eina are:

          +
            +
          • Data Types

            The Eina library is a central part of the EFL. It implements an API for data types, and allows you to create and manipulate several data types.

          • +
          • Tools

            Eina provides a number of tools, such as string manipulation, that make your life easier when coding applications.

          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/datetime_tutorial_wn.htm b/org.tizen.ui.practices/html/native/efl/datetime_tutorial_wn.htm new file mode 100644 index 0000000..07e14c5 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/datetime_tutorial_wn.htm @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + Creating Wearable Datetimes + + + + + + +
          +

          Creating Wearable Datetimes

          + + +

          This tutorial explains how you can create UI components that allow the user to select a date or time.

          + +

          This feature is supported in wearable applications only.

          + + +

          Creating a Date Picker

          + +

          Use the elm_datetime component to add a date picker style (Year : Month : Day).

          +

          The following example creates the datepicker-styled Datetime and adds it in the conform.

          + +
          +// Add a datepicker style Datetime component
          +datetime = elm_datetime_add(ad->win);
          +evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5);
          +evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, 1.0);
          +elm_object_style_set(datetime, "datepicker_layout");
          +evas_object_show(datetime);
          +
          +elm_object_content_set(ad->conform, datetime);
          +
          + +

          Creating a Time Picker

          +

          Use the elm_datetime component to add a time picker style (Hour(12) : Min : AM/PM, or Hour(24) : Min).

          +

          The following example creates the timepicker-styled Datetime and adds it in the conform.

          + +
          +// Add a timepicker style Datetime component
          +datetime = elm_datetime_add(ad->win);
          +evas_object_size_hint_align_set(datetime, EVAS_HINT_FILL, 0.5);
          +evas_object_size_hint_weight_set(datetime, EVAS_HINT_EXPAND, 1.0);
          +elm_object_style_set(datetime, "timepicker_layout");
          +evas_object_show(datetime);
          +
          +elm_object_content_set(ad->conform, datetime);
          +
          + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/ecore_animation_n.htm b/org.tizen.ui.practices/html/native/efl/ecore_animation_n.htm new file mode 100644 index 0000000..6e8e665 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ecore_animation_n.htm @@ -0,0 +1,451 @@ + + + + + + + + + + + + + Ecore Animations + + + + + +
          + +

          Ecore Animations

          + +

          Ecore provides a facility for animations called Ecore_Animator. Ecore animators use the Ecore main loop for creating animations, running a specific action on each tick of a timer in the main loop.

          + +

          To create an Ecore animation:

          +
            +
          1. Determine the duration of the animation.
          2. +
          3. Define a callback function that performs the animation with that duration.
          4. +
          + +

          To use Ecore animators in your application, you must include the <Ecore.h> file. This file is included by default if you are already using the <Elementary.h> file in your application. You then declare an Ecore_Animator* variable and use the variable in the ecore_animator_* functions.

          + +

          The following example shows how to create a simple animation with a finite duration:

          + +
          +static Eina_Bool
          +_do_animation(void *data, double pos)
          +{
          +   evas_object_move(data, 100 * pos, 100 * pos);
          +   // Do some more animating...
          +}
          +ecore_animator_timeline_add(2, _do_animation, my_evas_object);
          +
          + +

          In the above example, we create a linear transition to move my_evas_object from position (0,0) to position (100,100) in 2 seconds.

          + +

          Creating an Animation with a Finite Duration

          + +

          Most of the time, you will want to create animations that last for a predefined time.

          + +

          The ecore_animator_timeline_add() function allows you to define an animator that is automatically deleted after the animation is finished:

          + +
          ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data)
          + +
            +
          • The first argument is the duration of the animation in seconds. The duration is not affected by frame rate.
          • +
          • The second argument is the callback function that performs the animation.
          • +
          • The third argument is the parameter passed to the callback function. This is usually the Evas object to animate.
          • +
          + + + + + + + + + + +
          Note
          The callback function can return ECORE_CALLBACK_RENEW to keep the animator running or ECORE_CALLBACK_CANCEL to stop the animator and have it be deleted automatically at any time. The callback function is also passed a timeline position parameter with a value between 0.0 (start) to 1.0 (end) to indicate where along the timeline the animator is running.
          + +

          The following example performs a linear horizontal translation of 500 pixels in 8 seconds:

          +
          +static Eina_Bool
          +_my_animation(void *data, double pos)
          +{
          +   Evas_Object *obj = data; // Get the target object
          +   int x, y, w, h; // Target object geometry
          +   evas_object_geometry_get(obj, &x, &y, &w, &h); // Get current object position and size attributes
          +   evas_object_move(obj, 500 * pos, y); // Linear translation of the Evas object
          +}
          +ecore_animator_timeline_add(8, _my_animation, my_evas_object);
          +
          + +

          Position Mappings

          + +

          The Ecore_Pos_Map position mappings are used to define the evolution of a given position in accordance with the desired effects. The value ranges from 0.0 to 1.0 on a given timeline. This position variation allows you to apply dynamic changes to any attribute of your Evas object, such as position, width, height, scale, angle, and color.

          + +

          Ecore supports the following position mappings (with the listed v1 and v2 parameters):

          + +
            +
          • ECORE_POS_MAP_LINEAR: linear 0.0 - 1.0 +
              +
            • v1: not used
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_ACCELERATE: start slow, then speed up +
              +
            • v1: not used
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_DECELERATE: start fast, then slow down +
              +
            • v1: not used
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_SINUSOIDAL: start slow, speed up, then slow down at the end +
              +
            • v1: not used
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_ACCELERATE_FACTOR: start slow, then speed up +
              +
            • v1: power factor: 0.0 is linear, 1.0 is standard acceleration, 2.0 is a much more pronounced acceleration (squared), 4.0 is cubed, and so on
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_DECELERATE_FACTOR: start fast, then slow down +
              +
            • v1: power factor: 0.0 is linear, 1.0 is standard deceleration, 2.0 is a much more pronounced deceleration (squared), 3.0 is cubed, and so on
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_SINUSOIDAL_FACTOR: start slow, speed up, then slow down at the end +
              +
            • v1: power factor: 0.0 is linear, 1.0 is a standard sinusoidal, 2.1 is a much more pronounced sinusoidal (squared), 3.0 is cubed, and so on
            • +
            • v2: not used
            • +
            +
          • +
          • ECORE_POS_MAP_DIVISOR_INTERP: start at gradient * v1, interpolated via power of v2 curve +
              +
            • v1: multiplication factor for gradient
            • +
            • v2: curve value
            • +
            +
          • +
          • ECORE_POS_MAP_BOUNCE: start at 0.0, then "drop" like a ball bouncing to the ground at 1.0, and bounce v2 times, with a decay factor of v1 +
              +
            • v1: bounce decay factor
            • +
            • v2: number of bounces
            • +
            +
          • +
          • ECORE_POS_MAP_SPRING: start at 0.0, then "wobble" like a spring until rest position at 1.0, and wobble v2 times, with a decay factor of v1 +
              +
            • v1: wobble decay factor
            • +
            • v2: number of wobbles
            • +
            +
          • +
          + +

          Figure: Position mappings

          +

          Position mappings

          + +

          Using Position Mappings

          +

          When using the animation callback function, the animator passes a timeline position parameter with a value between 0.0 (start) and 1.0 (end) to indicate where along the timeline the animator is running.

          + +

          If you want to create a non-linear animation, map the position value to one of several curves and mappings:

          +
          ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2)
          +
            +
          • The first argument is the current position value, which ranges from 0.0 to 1.0.
          • +
          • The second argument is the position mapping you want to apply.
          • +
          • The third argument is the first parameter (v1) to pass to the position mapping.
          • +
          • The fourth argument is the second parameter (v2) to pass to the position mapping.
          • +
          + + + + + + + + + + +
          Note
          The v1 and v2 arguments are specific to the chosen position mapping. For example, if you are using ECORE_POS_MAP_BOUNCE, v1 represents the bouncing level and v2 the number of bounces.
          + +

          The following example performs a transition that bounces 7 times, diminishing by a factor of 1.8 over 5 seconds:

          + +
          static Eina_Bool
          +_my_animation_callback(void *data, double pos)
          +{
          +   Evas_Object *obj = data; // Get the target object
          +   int x, y, w, h; // Target object geometry
          +   double frame = pos; // Actual position variation
          +   // Get frame relative position depending on desired effect
          +   frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.8, 7);
          +   evas_object_geometry_get(obj, &x, &y, &w, &h); // Get current object position and size attributes
          +   evas_object_move(obj, x, 600 * frame); // Move the Evas object according to desired effect
          +
          +   return EINA_TRUE;
          +}
          +ecore_animator_timeline_add(5, _my_animation_callback, my_evas_object);
          + +

          Creating an Infinite Animation

          + +

          If you want the animation to run for an unspecified amount of time, use the ecore_animator_add() function. This function works the same way as the ecore_animation_timeline_add() function, except its interval is based on frame rate. Using frame rate as the basis benefits performance, especially if you define multiple animations, since you may want to have a different timer for each callback function.

          + +
          +ecore_animator_add(Ecore_Task_Cb func, const void *data)
          +
          + +
            +
          • The first argument is the callback function that performs the animation.
          • +
          • The second argument is the parameter passed to the callback function. This is usually the Evas object to animate.
          • +
          + + + + + + + + + + +
          Note
          The function returns a pointer to an Ecore_Animator object, which you can use to adjust the animation.
          + +

          The following example creates a rectangle sliding from left to right and back again. When the rectangle hits one edge of the screen, it changes direction.

          + +
          static Eina_Bool
          +_slide_back_and_forth(void *data)
          +{
          +   typedef enum {LEFT, RIGHT} direction_t; // Direction datatype
          +   static int x = 0; // Initial position
          +   static direction_t direction = RIGHT; // Initial direction
          +   if (x >= 250)
          +      direction = LEFT; // Change direction
          +   else if (x <= 0)
          +      direction = RIGHT; // Change direction
          +   if (direction == RIGHT)
          +      evas_object_move(data, ++x, 350); // Slide to right
          +   else if (direction == LEFT)
          +      evas_object_move(data, --x, 350); // Slide to left
          +
          +   return EINA_TRUE;
          +}
          +int
          +main(int argc, char *argv[])
          +{
          +   // Declarations
          +
          +   // Ecore Evas init
          +
          +   // Draw Evas objects
          +
          +   // Animations go here
          +   anim = ecore_animator_add(_slide_back_and_forth, rectangle);
          +   // Ecore main loop
          +
          +   // Free memory
          +}
          + + + + + + + + + + +
          Note
          To use this code, you have to merge it with the Ecore transition example above.
          + +

          Chaining Animations

          + +

          You may sometimes want to delay animating an object. This can be useful if, for example, you want to start an animation only after another one has finished.

          + +

          You can simply set a delay to the second animation equal to the duration of the first animation:

          + +
          +static int runtime = 5;
          +static int delay = runtime;
          +static Eina_Bool
          +_start_fold_animation(void *data)
          +{
          +   ecore_animator_timeline_add(runtime, _fold_animation, data);
          +
          +   return EINA_FALSE;
          +}
          +static Eina_Bool
          +_start_unfold_animation(void *data)
          +{
          +   ecore_animator_timeline_add(runtime, _unfold_animation, data);
          +
          +   return EINA_FALSE;
          +}
          +_start_fold_animation(my_evas_object);
          +ecore_timer_add(delay, _start_unfold_animation, my_evas_object);
          +
          + +

          Pausing and Resuming Animations

          + +

          You can pause and resume Ecore animations. To pause a running animation, use the ecore_animator_freeze() function:

          + +
          ecore_animator_freeze(Ecore_Animator *animator)
          + +

          The parameter is the Ecore_Animator to pause.

          + +

          To resume the paused animation, use the ecore_animator_thaw() function:

          + +
          ecore_animation_thaw(Ecore_Animator *animator)
          + +

          The parameter is the Ecore_Animator to resume.

          + +

          The following example pauses a transition after 5 seconds and resumes it after 5 more seconds:

          + +
          +static Eina_Bool
          +_freeze_animation(void *data)
          +{
          +   ecore_animator_freeze(data);
          +
          +   return EINA_FALSE;
          +}
          +static Eina_Bool
          +_thaw_animation(void *data)
          +{
          +   ecore_animator_thaw(data);
          +
          +   return EINA_FALSE;
          +}
          +ecore_timer_add(5, _freeze_animation, animator);
          +ecore_timer_add(10, _thaw_animation, animator);
          +
          + +

          Freeing Up Memory

          + +

          When you create an animation that does not have a timeout, you will have to manually free up the memory allocated to the Ecore_Animator object. By comparison, if the animation has a timeout, Ecore implements the mechanisms to automatically delete the animator from the list of pointers: When your animation callback returns 0 or ECORE_CALLBACK_CANCEL, the animator manager takes care of freeing up the allocated memory.

          + +

          To manually free up the memory, delete the pointer by using the ecore_animator_del() function:

          + +
          ecore_animator_del(Ecore_Animator *animator)
          + +

          The argument is the Ecore_Animator whose memory allocation to free up.

          + +

          Regardless of the type of animation, it is good practice to always ensure that the allocated memory is freed up before the program exits:

          + +
          if (animator != NULL)
          +   ecore_animator_del(animator);
          + +

          Frametime

          +

          In most cases, you will want to use the default timer ECORE_ANIMATOR_SOURCE_TIMER. This timer ticks every "frametime" seconds and allows you to perform transitions within a predefined timeline. The timer uses the system clock to tick over every Nth second, with the default being 1/30th of a second.

          + +

          To tweak performance, you can change the frametime value:

          + +
          ecore_animator_frametime_set(double frametime)
          + +

          The argument is the new frametime value.

          + + + + + + + + + + +
          Note
          Too small a value can cause performance issues, whereas too high a value can cause your animation to seem jerky.
          + +

          If you want to get the current frametime value, use the ecore_animator_frametime_get() function.

          + +

          Custom Timer

          + +

          You may want to specify a custom timer to match your animation to third-party events. For example, the filling speed of a progress bar will mainly depend on the time it takes for a task to complete and the velocity at which the remaining time estimation evolves. This kind of animation requires you to use a custom timer.

          + +

          To use a custom timer, first set ECORE_ANIMATOR_SOURCE_CUSTOM as the timer source, and then drive the timer based on an input tick source (such as another application via IPC or a vertical blanking interrupt):

          + +
          ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data)
          + +

          The first argument is the callback function to call on the tick start. The second argument is the data to pass to the callback function.

          + +
          ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data)
          + +

          The first argument is the callback function to call on the tick end. The second argument is the data to pass to the callback function to set the functions that will be called to start and stop the ticking source.

          + +

          Next, trigger a tick over one frame:

          + +
          ecore_animator_custom_tick(void)
          + +

          The following example supposes a progress bar that will be refreshed every time some progress occurs:

          + +
          ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM);
          +void _on_progress_update()
          +{
          +   // Called when some progress occurs
          +   ecore_animator_custom_tick(); // Tick (next frame in progress bar animation)
          +}
          + +

          Finally, to get the current animator source, use the ecore_animator_source_get() function.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/ecore_animation_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/ecore_animation_tutorial_n.htm new file mode 100644 index 0000000..115874a --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ecore_animation_tutorial_n.htm @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + Creating Ecore Animations + + + + + + +
          +

          Creating Ecore Animations

          + + +

          This tutorial demonstrates how you can use Ecore animators to simplify the creation of animations. Using Ecore animators, you can manually create your own animations by changing and manipulating Evas object attributes. Ecore animators work like timers, running callback functions over a given duration (an animation timeline).

          + +

          Setting Up the Animation Target

          + +

          To set up the animation target:

          +
            +
          1. +

            Set up the UI components to use in the application. A Basic UI Application template is used as the basis for the application.

            + +
            +typedef struct 
            +appdata 
            +{
            +   // Main window
            +   Evas_Object *win;
            +   // Application title
            +   Evas_Object *label;
            +
            +   // Buttons
            +   Evas_Object *bt1;
            +   Evas_Object *bt2;
            +   Evas_Object *bt3;
            +
            +   // Animation target
            +   Evas_Object *target;
            +} appdata_s;
            +
            +
          2. +
          3. Create the actual UI components in the create_base_gui() function, starting with the main window and application title:

            + +
            +// Main window
            +ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +if (elm_win_wm_rotation_supported_get(ad->win)) 
            +{
            +   int rots[4] = {0, 90, 180, 270};
            +   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            +}
            +
            +evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            +
            +// Application title
            +ad->label = elm_label_add(ad->win);
            +elm_object_text_set(ad->label, "Ecore Animator Tutorial");
            +evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_win_resize_object_add(ad->win, ad->label);
            +evas_object_show(ad->label);
            +
            +
          4. +
          5. +

            Create the animation target: an Elm_Image Evas object.

            +
              +
            1. +

              Set the image path by calling the elm_image_file_set() function. This function takes as parameters the ad->target Evas object and the path of the image file, built with the snprintf() function and stored in a buffer.

              + +
              +// Set the image path
              +char buf[PATH_MAX];
              +snprintf(buf, sizeof(buf), "/opt/usr/apps/%s/res/images/tizen-logo.png", PACKAGE);
              +// Add the image
              +ad->target = elm_image_add(ad->win);
              +// Set the image path
              +if (!elm_image_file_set(ad->target, buf, NULL))
              +   printf("error: could not load image \"%s\"\n", buf);
              +evas_object_size_hint_weight_set(ad->target, EVAS_HINT_FILL, EVAS_HINT_FILL);
              +
              + +

              The image that is used in the source code is stored in the res/images folder of the application. The image that is used in the EDC file is stored in the edje/images folder.

              +
            2. + +
            3. +

              All images are available in the /opt/usr/apps/<PACKAGE_NAME>/res/images folder of the application. The package name is defined at the begin of the application code.

              + +
              +#if !defined(PACKAGE)
              +#define PACKAGE "org.tizen.ecoreanimator"
              +#endif
              +
            4. + +
            5. +

              You can move and resize the image before showing it:

              + +
              +// Move the image
              +evas_object_move(ad->target, 130, 100);
              +// Resize the image
              +evas_object_resize(ad->target, 200, 100);
              +// Show the image
              +evas_object_show(ad->target);
              +
              +
            +
          6. +
          + +

          Creating a Rotation Effect

          + +

          To create a rotation effect:

          + +
            +
          1. +

            Create a button for triggering the rotation effect. The button is placed and resized, and associated with the _btn_rotate_cb() callback function. This callback function calls the animation on the animation target.

            +
            +// Button 1
            +ad->bt1 = elm_button_add(ad->win);
            +elm_object_text_set(ad->bt1, "Rotate");
            +evas_object_size_hint_weight_set(ad->bt1, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_move(ad->bt1, 25, 0);
            +evas_object_resize(ad->bt1, 90, 70);
            +evas_object_smart_callback_add(ad->bt1, "clicked", _btn_rotate_cb, ad);
            +evas_object_show(ad->bt1);
            +
            +
          2. + +
          3. Create an Ecore animator timeline using the ecore_animator_timeline_add() function. This function adds an animator that runs for a limited time: run the _do_rotate() animation callback function for 1 second on the ad->target Evas object.

            +
            +static void 
            +_btn_rotate_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   ecore_animator_timeline_add(1, _do_rotate, ad->target);
            +}
            +
            + +
          4. +
          5. +

            Define the animation callback function that actually runs the animation. This callback is an Ecore_Timeline_Cb function, meaning it returns an Eina_Bool value and takes as parameters some data and the current position along the animation timeline (pos).

            + +

            To create the rotation animation, use an Evas map. The map handles the necessary map points and allows you to manipulate the target Evas object on the X, Y, and Z axes.

            + +

            In the animation callback function, first declare the Evas map. To implement the rotation, you must set an X and Y center, and because of this, 4 integer variables are created to store the size and position of the target. This information is provided by the evas_object_geometry_get() function, which returns the X and Y coordinates and the width and height of the target Evas object.

            +
            static Eina_Bool
            +_do_rotate(void *data, double pos)
            +{
            +   // Get the animation target
            +   Evas_Object *obj = data;
            +   // Declare Evas_Map
            +   Evas_Map *m;
            +   // Variables to store the target size and position
            +   int x, y, w, h;
            +
            +   // Get the size and position of the target
            +   evas_object_geometry_get(obj, &x, &y, &w, &h);
            +
            + +
          6. +
          7. +

            Create an Evas map consisting of 4 points, and populate these points with the animation target:

            + +
            +   // Create an Evas_Map of 4 points
            +   m = evas_map_new(4);
            +   // Populate the source and destination map points to match object exactly
            +   evas_map_util_points_populate_from_object(m, obj);
            +
            +
          8. +
          9. +

            Define the rotation using the evas_map_util_rotate() function:

            +
            +   // Create a rotation of 360° with x+(w/2) "x" center and y +(h/2) "y" center
            +   evas_map_util_rotate(m, 360.0 * pos, x + (w / 2), y + (h / 2));
            +
            +
          10. +
          11. Call the animation callback function. The function is called at several points along the timeline, which is why the rotation angle (360°) is multiplied by the timeline position (pos) to get the actual animation angle. If this is not done, you never see the animation take place. Join the target object to the map and run the animation:

            + +
            +   // Set the object to "animate" in the Evas_Map
            +   evas_object_map_set(obj, m);
            +   // Start the animation
            +   evas_object_map_enable_set(obj, EINA_TRUE);
            +
            + +

            Each call to the animation callback function rotates the object (360 * timeline position) degrees.

            +
          12. +
          13. +

            When you are finished, free up the memory allocated to the Evas map:

            + +
            +   // Free the used memory
            +   evas_map_free(m);
            +
            +   return EINA_TRUE;
            +}
            +
            +
          14. +
          + +

          Creating a Zoom Effect

          + +

          To create a zoom effect:

          + +
            +
          1. +

            Create a button in the create_base_gui() function:

            + +
            +// Button 2
            +ad->bt2 = elm_button_add(ad->win);
            +elm_object_text_set(ad->bt2, "Zoom");
            +evas_object_size_hint_weight_set(ad->bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_move(ad->bt2, 315, 0);
            +evas_object_resize(ad->bt2, 90, 70);
            +evas_object_smart_callback_add(ad->bt2, "clicked", _btn_zoom_cb, ad);
            +evas_object_show(ad->bt2);
            +
            +
          2. +
          3. +

            Create a button callback function and add a new timeline:

            + +
            +static void 
            +_btn_zoom_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   ecore_animator_timeline_add(1, _do_zoom, ad->target);
            +}
            +
            +
          4. +
          5. +

            Create the _do_zoom() animation callback function. It is almost identical to the _do_rotate() callback function (described in the previous use case), except that the evas_map_util_zoom() function is used to create the animation.

            + +

            In the following example, the horizontal and vertical zoom factor of 2 (second and third parameter), and the X and Y coordinates of the target as the horizontal and vertical center coordinates (fourth and fifth parameter) are used.

            + +
            +static Eina_Bool
            +_do_zoom(void *data, double pos)
            +{
            +   Evas_Object *obj = data;
            +   Evas_Map *m;
            +   int x, y, w, h;
            +
            +   evas_object_geometry_get(obj, &x, &y, &w, &h);
            +   m = evas_map_new(4);
            +   evas_map_util_points_populate_from_object(m, obj);
            +   evas_map_util_zoom(m, 2 * pos, 2 * pos, x , y);
            +   evas_object_map_set(obj, m);
            +   evas_object_map_enable_set(obj, EINA_TRUE);
            +   evas_map_free(m);
            +
            +   return EINA_TRUE;
            +}
            +
            + +

            The _do_zoom() callback function is called at several points along the animation timeline, which is why the horizontal and vertical zoom factor values are multiplied by the timeline position. Each call zooms more than the previous one, thereby creating the animation effect.

            +
          6. +
          + +

          Creating a 3D Rotation Effect

          + +

          To create a 3D rotation:

          +
            +
          1. +

            Create a button and its callback function. In this animation, the Evas object is rotated on all 3 axes (X, Y, Z).

            +
            +// Button 3
            +ad->bt3 = elm_button_add(ad->win);
            +elm_object_text_set(ad->bt3, "3D");
            +evas_object_size_hint_weight_set(ad->bt3, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_move(ad->bt3, 170, 0);
            +evas_object_resize(ad->bt3, 90, 70);
            +evas_object_smart_callback_add(ad->bt3, "clicked", _btn_3d_cb, ad);
            +evas_object_show(ad->bt3);
            +
            + +
            +static void 
            +_btn_3d_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   ecore_animator_timeline_add(1, _do_3d, ad->target);
            +}
            +
            +
          2. + +
          3. +

            Create the _do_3d() animation callback function, which is very similar to the rotate and zoom callback functions described in previous use cases. To create the animation, the evas_map_util_3d_rotate() function is used. This function allows you to rotate any Evas object on all 3 axes.

            + +

            In this example, the map is rotated 360 degrees around each axis (defined in the second, third, and fourth parameter). The horizontal (X) rotation center is the X position of the target plus its width divided by 3 (fifth parameter). The vertical (Y) rotation center is the Y position of the target plus 60 (sixth parameter). The Z rotation center is 0 (seventh parameter).

            +
            +static Eina_Bool
            +_do_3d(void *data, double pos)
            +{
            +   Evas_Object *obj = data;
            +   Evas_Map *m;
            +   int x, y, w, h;
            +
            +   evas_object_geometry_get(obj, &x, &y, &w, &h);
            +   m = evas_map_new(4);
            +   evas_map_util_points_populate_from_object(m, obj);
            +   evas_map_util_3d_rotate(m, pos * 360, pos * 360, pos * 360, x + (w / 3), y + 60, 0);
            +   evas_object_map_set(obj, m);
            +   evas_object_map_enable_set(obj, EINA_TRUE);
            +   evas_map_free(m);
            +
            +   return EINA_TRUE;
            +}
            +
            + +

            As with the rotation and zoom animations, multiply the angles by the timeline position to gently rotate the target on each call to the _do_3d() callback function along the timeline.

            +
          4. +
          +

          Creating Drop and Bounce Effects

          + +

          To create drop and bounce effects:

          + +
            +
          1. +

            Add drop and bounce effects to the buttons at the application start. To do this, create one timeline per button after creating the buttons in the create_base_gui() function:

            + +
            +ecore_animator_timeline_add(2, _do_drop, ad->bt1);
            +ecore_animator_timeline_add(2.3, _do_drop, ad->bt2);
            +ecore_animator_timeline_add(2.5, _do_drop, ad->bt3);
            +
            +
          2. + +
          3. +

            Call the same _do_drop() animation callback function for each timeline. In this callback, instead of using an Evas map, simply change the position of the target using the evas_object_move() function.

            +

            To get the bounce effect, use the ecore_animator_pos_map() function, which maps an input position from 0.0 to 1.0 along the timeline to a position on a different curve. The curve can be of different types, such as LINEAR, SINUSOIDAL, and BOUNCE (defined as the second parameter).

            + + +

            The ECORE_POS_MAP_BOUNCE map used starts at 0.0, then drops like a ball bouncing to the ground at 1.0, bouncing 4 times with a decay factor of 1. The bouncing times and the decay factor as defined as the third and fourth parameter.

            +
            static Eina_Bool
            +_do_drop(void *data, double pos)
            +{
            +   Evas_Object *obj = data;
            +   int x, y, w, h;
            +   double frame = pos;
            +   frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 2, 4);
            +
            +   evas_object_geometry_get(obj, &x, &y, &w, &h);
            +   evas_object_move(obj, x, 600 * frame);
            +
            +   return EINA_TRUE;
            +}
            +
            + +

            The frame is used in the evas_object_move() function to create the animation. The value increases on each _do_drop() call along the timeline, which produces a nice drop of the buttons from their initial position to 600 pixels on the vertical axis.

            +
          4. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/edc_optimization_n.htm b/org.tizen.ui.practices/html/native/efl/edc_optimization_n.htm new file mode 100644 index 0000000..d7e0ac9 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edc_optimization_n.htm @@ -0,0 +1,556 @@ + + + + + + + + + + + + + + Optimizing EDC + + + + + + +
          +

          Optimizing EDC

          + + +

          To optimize EDC:

          + + + +

          Removing Unnecessary Parts

          +

          When you create EDC, there can be obsolete and unnecessary parts. Since they have an effect on performance, remove them.

          + + + + + + + + + + + + + + + +
          BeforeAfter
          +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "bg";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.relative: 0.0 0.0;
          +               rel2.relative: 1.0 1.0;
          +               color: 255 255 255 255;
          +            }
          +         }
          +         part 
          +         { 
          +            name: "new";
          +            type: RECT;
          +            scale: 1;
          +            mouse_events: 1;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 255 255 0 255;
          +               rel1.relative: 0.2 0.2;
          +               rel2.relative: 0.8 0.8;
          +            }
          +         }
          +         part 
          +         { 
          +            name: "old";
          +            type: RECT;
          +            scale: 1;
          +            mouse_events: 1;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 0 0 0 0;
          +               rel1.relative: 0.5 0.5;
          +               rel2.relative: 1.0 1.0;
          +            }
          +         }
          +      }
          +   }
          +}
          +
          +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "bg";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.relative: 0.0 0.0;
          +               rel2.relative: 1.0 1.0;
          +               color: 255 255 255 255;
          +            }
          +         }
          +         part 
          +         { 
          +            name: "new";
          +            type: RECT;
          +            scale: 1;
          +            mouse_events: 1;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 255 255 0 255;
          +               rel1.relative: 0.2 0.2;
          +               rel2.relative: 0.8 0.8;
          +            }
          +         }  
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +       
          +      }
          +   }
          +}
          +
          + +

          Using Text instead of Textblock

          + +

          The following EDCs lead to the same result. However, use TEXT for the simple texts for high performance, except when elements or multiple lines are needed.

          + + + + + + + + + + + + + + + +
          BeforeAfter
          +
          +collections 
          +{
          +   styles 
          +   {
          +      style 
          +      { 
          +         name: "text_style";
          +         base: "font="Sans" font_size=30 text_class=entry 
          +         color=#0088AA style=shadow,bottom 
          +         shadow_color=#00000080 valign=0.5 ellipsis=1.0 
          +         wrap=none align=center";
          +      }
          +   }
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "text";
          +            type: TEXTBLOCK;
          +            scale: 1;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               text 
          +               {
          +                  style: "text_style";
          +                  text: "TEXT";
          +               }
          +            }
          +         }
          +      }
          +   }
          +}
          +
          +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      part 
          +      { 
          +         name: "simple";
          +         type: TEXT;
          +         scale: 1;
          +         effect: SHADOW;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            align: 0.5 0.5;
          +            color: 0 136 170 255;
          +            visible: 1;
          +            text 
          +            {
          +               size: 30;
          +               font: "Sans";
          +               text: "TEXT";
          +            }
          +         }
          +      }
          +   }
          +}
          +
          + +

          Compressing Images and Embedding into EDC

          + +

          When you use a fixed image, it is more efficient to call an image within EDC. This saves time in accessing the image data and is more suitable for the data size.

          + +
          +collections 
          +{
          +   images 
          +   {
          +      image: "logo.png" COMP;
          +   }
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "logo";
          +            type: IMAGE;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.relative: 0.0 0.0;
          +               rel2.relative: 1.0 1.0;
          +               image.normal: "logo.png";
          +               aspect: 1 1;
          +               aspect_preference: BOTH;
          +            }
          +         }
          +      }
          +   }
          +}
          +
          + +

          Using a Spacer

          +

          When you use a part that is invisible but has a size (such as padding), using a spacer is more efficient. Since the spacer is invisible, it does not have the visibility and color options.

          + + + + + + + + + + + + + + + + +
          BeforeAfter
          +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "bg";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 255 255 255 255;
          +            }         
          +         }
          +         part 
          +         { 
          +            name: "padding_left_top";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 0 0 0 0;
          +               rel1.to: "bg";
          +               rel2.to:"bg";
          +               rel2.relative: 0.0 0.0;
          +               align: 0.0 0.0;               
          +               min: 100 100;        
          +            }
          +         }
          +         part 
          +         { 
          +            name: "padding_right_bottom";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 0 0 0 0;
          +               rel1.to: "bg";
          +               rel1.relative: 1.0 1.0;
          +               rel2.to:"bg";
          +               align: 1.0 1.0;               
          +               min: 100 100;
          +            }         
          +         }
          +         part 
          +         { 
          +            name: "content";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 255 255 0 255;
          +               rel1.to: "padding_left_top";
          +               rel1.relative: 1.0 1.0;
          +               rel2.to:"padding_right_bottom";
          +               rel2.relative: 0.0 0.0;
          +            }         
          +         }
          +      }
          +   }
          +}
          +
          +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "bg";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 255 255 255 255;
          +            }         
          +         }
          +         part 
          +         { 
          +            name: "padding_left_top";
          +            type: SPACER;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.to: "bg";
          +               rel2.to:"bg";
          +               rel2.relative: 0.0 0.0;
          +               align: 0.0 0.0;               
          +               min: 100 100;
          +            }         
          +         }
          +         part 
          +         { 
          +            name: "padding_right_bottom";
          +            type: SPACER;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.to: "bg";
          +               rel1.relative: 1.0 1.0;
          +               rel2.to:"bg";
          +               align: 1.0 1.0;               
          +               min: 100 100;
          +            }         
          +         }
          +         part 
          +         { 
          +            name: "content";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               color: 255 255 0 255;
          +               rel1.to: "padding_left_top";
          +               rel1.relative: 1.0 1.0;
          +               rel2.to:"padding_right_bottom";
          +               rel2.relative: 0.0 0.0;
          +            }         
          +         }
          +      }
          +   }
          +}
          +
          + +

          Using the Image Border Feature

          + +

          When you use an image, you can effectively scale it to an optimal size with the image border option.

          + + + + + + + + + + + + + + + + + + + +
          BeforeAfter
          +
          +collections 
          +{
          +   images 
          +   {
          +      image: "test.png" COMP;
          +   }
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "test";
          +            type: IMAGE;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.relative: 0.2 0.2;
          +               rel2.relative: 0.8 0.8;
          +               image.normal: "test.png";
          +
          +            }
          +         }
          +      }
          +   }
          +}
          +
          +
          +collections 
          +{
          +   images 
          +   {
          +      image: "test.png" COMP;
          +   }
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "test";
          +            type: IMAGE;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               rel1.relative: 0.2 0.2;
          +               rel2.relative: 0.8 0.8;
          +               image.normal: "test.png";
          +               image.border: 5 5 5 5;
          +            }
          +         }
          +      }
          +   }
          +}
          +

          Image before

          Image after

          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edc_part_block_n.htm b/org.tizen.ui.practices/html/native/efl/edc_part_block_n.htm new file mode 100644 index 0000000..c613e64 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edc_part_block_n.htm @@ -0,0 +1,2054 @@ + + + + + + + + + + + + + EDJE Data Collection Reference + + + + + +
          + +

          EDJE Data Collection Reference

          + +

          A typical Edje file starts with the following definitions:

          + +
          +images {}
          +fonts {}
          +color_classes {}
          +styles {}
          +collections 
          +{
          +   sounds 
          +   {
          +      tone: "tone-1" 2300;
          +      tone: "tone-2" 2300;
          +      sample 
          +      {
          +         name: "sound1" RAW;
          +         source: "sound_file1.wav";
          +      }
          +   }
          +   group {}
          +   group {}
          +}
          +
          + + + + + + + + + + + + +
          Note
          This reference is based on original work from Andres Blanc (dresb) andresblanc@gmail.com, and it has been heavily expanded and edited since then.
          +

          The following list shows the details of the top-level blocks.

          +
            +
          • images block: + +
            +images 
            +{
            +   image: "filename1.ext" COMP;
            +   image: "filename2.ext" LOSSY 99;
            +   set {}
            +   set {}
            +}
            +
            + +

            The images block is used to list the image files used in the theme. The used compression methods are also defined here. In addition to the top-level, the images blocks can be included inside other blocks, usually collections, group, and part. Using the images block on the top-level makes file list maintenance easier, when the theme is split among multiple files.

            + +
              +
            • image [image file] [compression method] (compression level) +

              This property is included for each image file. The full path to the directory holding the image can be defined later with the edje_cc tool's -id option. The available compression methods are:

              +
                +
              • RAW: Uncompressed
              • +
              • COMP: Lossless compression
              • +
              • LOSSY [0-100]: JPEG lossy compression with quality from 0 to 100
              • +
              • USER: Not embedded in the file, refer to an external file instead
              • +
              + +
            • +
            • images.set block + +
              +set 
              +{
              +   name: "image_name_used";
              +   image {}
              +   image {}
              +}
              +
              + +

              The set block is used to define an image with different content depending on its size. In addition to the top-level, the set blocks can be included inside other blocks, normally collections, group, and part. Using the set block on the top-level makes file list maintenance easier, when the theme is split among multiple files.

              + +
                +
              • name [image name] +

                Sets the name of this image description.

                +
              • + +
              • images.set.image block + +
                +image 
                +{
                +   image: "filename4.ext" COMP;
                +   size: 51 51 200 200;
                +   border: 0 0 0 0;
                +   border_scale_by: 0.0;
                +}
                +
                + +

                The image block defines the characteristics of an image. Every block describes one image and the size rule to use it. For full details, see Image.

                + +
                  +
                • image [image file] [compression method] (compression level) +

                  This property is included for each image file. The full path to the directory holding the image can be defined later with the edje_cc tool's -id option.

                  +
                • +
                • size [minw] [minh] [maxw] [maxh] +

                  Sets the minimum and maximum size that selects a specific image.

                  +
                • +
                • border [left] [right] [top] [bottom] +

                  If set, the width (in pixels) of each side of the image is displayed as a fixed size border, from the side inwards, preventing the corners from being changed on a resize.

                  +
                • +
                • border_scale_by [value] +

                  If border scaling is enabled, normally the output border sizes scale accordingly. For example, if 3 pixels on the left edge are set as a border, then normally at scale 1.0, those 3 columns are always the exact 3 columns of output, or at scale 2.0 they are 6 columns, or 0.33 they merge into a single column. This property multiplies the input scale factor by this multiplier, allowing the creation of supersampled borders to enable higher resolution outputs by always using the highest resolution artwork and then at runtime scaling it down. Valid values are: 0.0 or bigger (0.0 or 1.0 to switch it off).

                  +
                • +
                +
              • +
              +
            • +
          • + +
          • fonts block + +
            +fonts
            +{
            +   font: "filename1.ext" "fontname";
            +   font: "filename2.ext" "otherfontname";
            +}
            +
            + +

            The fonts block is used to list each font file with an alias used later in the theme. As with the images block, additional fonts blocks can be included inside other blocks.

            + +
              +
            • font [font filename] [font alias] +

              This property is included for each font, and it defines the font file and alias. The full path to the directory containing the font files can be defined later with the edje_cc tool's -fd option. +

            • +
            +
          • +
          • data block + +
            +data 
            +{
            +   item: "key" "value";
            +   file: "otherkey" "filename.ext";
            +}
            +
            + +

            The data block behaves in the same way as the data block inside the parts block, but the usage is different: this block is useful for data that covers the whole theme, such as license information, version, and authors.

            +
          • +
          • color_classes block + +
            +color_classes 
            +{
            +   color_class 
            +   {
            +      name: "colorclassname";
            +      color: [0-255] [0-255] [0-255] [0-255];
            +      color2: [0-255] [0-255] [0-255] [0-255];
            +      color3: [0-255] [0-255] [0-255] [0-255];
            +   }
            +}
            +
            + +

            The color_classes block contains one or more color_class blocks. Each color_class block allows you to name an arbitrary group of colors to be used in the theme. The application can use that name to alter the color values at runtime.

            + +
              +
            • name [color class name] +

              Sets the name for the color class, and is used as a reference by both the theme and the application.

              +
            • + +
            • color [red] [green] [blue] [alpha] +

              Sets the main color.

              +
            • + +
            • color2 [red] [green] [blue] [alpha] +

              Used as an outline in text and textblock parts.

              +
            • + +
            • color3 [red] [green] [blue] [alpha] +

              Used as a shadow in text and textblock parts.

              +
            • +
            +
          • + +
          • styles block + +
            +styles 
            +{
            +   style 
            +   {
            +      name: "stylename";
            +      base: "..default style properties..";
            +      tag: "tagname" "..style properties..";
            +   }
            +}
            +
            + +

            The styles block contains one or more style blocks. A style block is used to create style <tags> for advanced textblock formatting.

            + +
              +
            • name [style name] +

              Sets the name of the style to be used as a reference later in the theme.

              +
            • + +
            • base [style properties string] +

              Sets the default style properties applied to the complete text. The following tags can be used in the style property:

              +
                +
              • font
              • +
              • font_size + + + + + + + + + +
                Note
                The font size is a point size, and the size of the rendered text is affected by the ppi information. The system basic ppi is 96, and you can change it in the Emulator menu.
                + +
              • +
              • color
              • +
              • color_class
              • +
              • text_class
              • +
              • ellipsis
              • +
              • wrap
              • +
              • style
              • +
              • valign
              • +
              • align
              • + +
              + +
            • + +
            • tag [tag name] [style properties string] +

              Sets the style to be applied only to text between style <tags>..</tags>. When creating paired tags, like <bold></bold>, a '+' sign must be added at the start of the style properties of the first part (<bold>). If the second part (</bold>) is also defined, a '-' sign must be added to its style properties. This applies only to paired tags; single tags, like <tab>, must not have a starting '+'.

              +
                +
              • br
              • +
              • tab
              • +
              • b
              • +
              • match
              • +
              + + + + +

              The following code is the style sample for the text style:

              + +
              +style 
              +{ 
              +   name: "list_text_main";
              +   base: "font=Tizen:style=Regular font_size=30 color=#ffffff ellipsis=1.0";
              +   tag: "br" "\n";\
              +   tag: "ps" "ps";\
              +   tag: "tab" "\t";\
              +   tag: "b" "+ font_weight=Bold";
              +}
              +
              +
            • +
            +
          • + +
          • collections block + +
            +collections 
            +{
            +   base_scale: 1.8;
            +   sounds 
            +   {
            +      tone: "tone-1" 2300;
            +      tone: "tone-2" 440;
            +      sample 
            +      {
            +         name: "sound_file1" RAW;
            +         source: "sound_file1.wav";
            +      }
            +   }
            +   group 
            +   {
            +      name: "groupname";
            +      alias: "anothername;"
            +      min: width height;
            +      max: width height;
            +      parts {}
            +      scripts {}
            +      limits {}
            +      data {}
            +      programs {}
            +   }
            +}
            +
            + +

            The collections block is used to list the groups that compose the theme. Additional collections blocks do not prevent overriding group names.

            + +
              +
            • base_scale: [scale factor] +

              Sets information about the scale factor in the EDC file.

              + +

              Object scaling must be defined in the config.xml file of the application to show the application in a proper size in other devices. However, the scaling must be based on the scale 1.0. If the application is based on another scale, this scale must be defined in the config.xml file. This predefined scale is called the base scale.

              + +

              The size of a scalable object is multiplied with the device scale value. If the scalable object with the size 10 is created in a device with the scale 1.0, the size of the object is 20 in a device with the scale 2.0, and 40 in a device with the scale 4.0.

              + +

              For more information about supporting multiple screens in one EDC, see the Multiple Screen Support guide.

              +
            • +
            • sounds block +

              The sounds block contains one or more sound sample and tone items.

              +
                +
              • tone [tone name] [frequency] +

                Sets the sound of the given frequency.

                +
              • +
              • sounds.sample block + +

                The sample block defines the sound sample.

                + +
                  +
                • name [sample name] [compression type] (quality) +

                  Used to include each sound file. The full path to the directory holding the sounds can be defined later with the edje_cc tool's -sd option. The valid compression types are:

                  +
                    +
                  • RAW: Uncompressed
                  • +
                  • COMP: Lossless compression
                  • +
                  • LOSSY [-0.1 - 1.0]: Lossy compression with quality from 0.0 to 1.0
                  • +
                  • AS_IS: No compression or encoding, write the file information as it is
                  • +
                  +
                • +
                + +
                  +
                • source [file name] +

                  Sets the sound source file name (mono or stereo WAV file; only files with the 44.1 KHz sample rate are supported for now).

                  +
                • +
                +
              • +
              + +
            • +
            • group block +

              The group block defines Edje Objects.

              +
            • +
            +
          • + + +
          + +

          Group Block

          + +
          +group
          +{
          +   name: "nameusedbytheapplication";
          +   alias: "anothername";
          +   min: width height;
          +   max: width height;
          +   parts 
          +   {
          +      <definitions of parts>
          +   }
          +   script 
          +   {
          +      <embryo script>
          +   }
          +   limits 
          +   {
          +      vertical: "limit_name" height_barrier;
          +      horizontal: "limit_name" width_barrier;
          +   }
          +   data 
          +   {
          +      items: "key" "value";
          +      file: "key" "file";
          +   }
          +   programs {}
          +}
          +
          + +

          The group block contains a list of parts and programs that compose a given Edje Object.

          + +
            +
          • name [group name] +

            Sets the name used by the application to load the resulting Edje object and to identify the group to swallow in a group part. If a group with the same name exists already, it is completely overridden by the new group.

            +
          • + +
          • inherit_only [1 or 0] +

            Flags the group as being used only for inheriting, which inhibits the edje_cc tool from resolving programs and parts that do not exist in this group, but are located in the group which is inheriting this group.

            +
          • + +
          • inherit [parent group name] +

            Sets the parent group name for inheritance. The inherit property is used to inherit any predefined group and change some properties which belong to a part, description, items, or program. The child group has the same properties as its parent group. If you specify the type again in an inherited part, it causes an error.

            + + + + + + + + + +
            Note
            When inheriting any parts, descriptions without state names are not allowed.
            +
          • + +
          • script_recursion [1/0] +

            Determines whether to error on unsafe calls when recursively running Embryo programs. For example, running an Embryo script which calls EDC that has a script{} block is unsafe, and the outer-most (first) Embryo stack is corrupted. It is strongly unadvisable to use this flag.

          • + +
          • alias [additional group name] +

            Sets the additional name to be used as an identifier. Defining multiple aliases is supported.

            +
          • + +
          • min [width] [height] +

            Sets the minimum size for the container defined by the composition of the parts. It is not enforced.

            +
          • + +
          • max [width] [height] +

            Sets the maximum size for the container defined by the totality of the parts. It is not enforced.

            +
          • + +
          • broadcast_signal [on/off] +

            Determines whether a signal gets automatically broadcasted to all sub group parts. The default value is on.

            +
          • + +
          • orientation [AUTO/LTR/RTL] +

            Sets the group orientation. It is useful if you want to match the interface orientation with language.

            +
              +
            • AUTO: Follow system defaults
            • +
            • LTR: Used in the Left To Right Languages (Latin)
            • +
            • RTL: Used in the Right To Left Languages (Hebrew, Arabic)
            • +
            +
          • + +
          • mouse_events [1 or 0] +

            Changes the default value of mouse_events for every part in this group. The default value is 1, to maintain compatibility.

            +
          • + +
          • program_source [source name] +

            Changes the default value of the source in the current group for every program which is declared after this value is set. The value defaults to an unset value to maintain compatibility. The name of the source can be set on every program, but if the name can be defined in the group level, it reduces the effort to indicate it in every program.

            +
          • +
          • group.parts block + +
            +parts 
            +{
            +   part {}
            +   part {}
            +   part {}
            +}
            +
            + +

            The parts block contains one or more part. Each part describes a visual element and has a type, such as text, image, or table.

            +
          • +
          • group.script block + +
            +group 
            +{
            +   script 
            +   {
            +      <embryo script>
            +   }
            +   program 
            +   {
            +      script 
            +      {
            +         <embryo script>
            +      }
            +   }
            +}
            +
            + +

            The script block is used to inject embryo scripts to a given Edje theme. It functions in two modalities: when it is included inside a program block, the script is executed every time the program is run, and when included directly into a group, part, or description block, it is executed once at the load time, in the load order.

            +
          • + +
          • group.limits block + +
            +limits 
            +{
            +   vertical: "limit_name" height_barrier;
            +   horizontal: "limit_name" width_barrier;
            +}
            +
            + +

            The limits block is used to trigger signals when the Edje object is resized.

            +
              +
            • vertical [name] [height barrier] +

              Sends a limit,name,over signal when the object is resized and passes the limit by growing over it. When the object's size is reduced below the limit, the limit,name,below signal is sent. This limit is applied on the Y axis and is given in pixels.

              +
            • +
            • horizontal [name] [width barrier] +

              Sends a limit,name,over signal when the object is resized and passes the limit by growing over it. When the object's size is reduced below the limit, the limit,name,below signal is sent. This limit is applied on the X axis and is given in pixels.

              +
            • +
            +
          • + +
          • group.data block + +
            +data 
            +{
            +   item: "key" "value";
            +   file: "key2" "somefile";
            +}
            +
            + +

            The data block is used to pass arbitrary parameters from the theme to the application. Unlike the images and fonts blocks, additional data blocks can only be included inside the group block.

            + +
              +
            • items: "key" "value"; +

              Sets a new parameter, the value is the string specified next to it.

              +
            • +
            • file: "key" "file"; +

              Sets a new parameter, the value is the content of the specified file formatted as a single string of text. This property only works with plain text files.

              +
            • +
            + + + + + + + + + + +
            Note
            For genlist item styles, keys must be texts and icons, respectively for text parts and swallow parts; values must the names of the parts, separated with spaces.
            +
          • + +
          • group.programs block + +
            +programs 
            +{
            +   program {}
            +   program {}
            +   program {}
            +}
            +
            + +

            The programs group contain one or more program. Each program contains code related to the interaction and animation of the visual elements.

            +
          • +
          + + +

          Part Block

          + +
          +part
          +{
          +   // Inherit all the fields of another part
          +   inherit: "partname";
          +   // Name the part
          +   name: "partname";
          +   // Set the part type
          +   type: IMAGE;
          +   // Enable mouse events on the part
          +   mouse_events: 0/1;
          +   // Repeat the mouse events to the parts below the current one
          +   repeat_events: 0/1;
          +   ignore_flags: NONE;
          +   // Set whether the part sizes scale with the edje scaling factor
          +   scale: 0/1;
          +   // Set whether fully-transparent pixels are taken into account for collision detection
          +   precise_is_inside: 0/1;
          +   // Only render the area of the part that coincides with the given part
          +   clip_to: "anotherpart";
          +   // For group/textblock parts: swallow the given group (for textblock: goes below text)
          +   source: "groupname";
          +   // Same as the source but goes on top of text
          +   source2: "groupname";
          +   // For textblock parts: swallow the given group below the mouse cursor when it hovers over the part
          +   source3: "groupname";
          +   // Same as source3 but goes on top of the cursor
          +   source4: "groupname";
          +   // For textblock parts: swallow the given group below text anchors (<a>...</a>)
          +   source5: "groupname";
          +   // Same as source5 but goes on to top of the anchor
          +   source6: "groupname";
          +   // Add a shadow effect to the part
          +   effect: SOFT_SHADOW (BOTTOM_RIGHT);
          +   // For textblock parts: makes the text editable, possibly with a specific behavior
          +   entry_mode: PASSWORD;
          +   // For textblock parts: change how the text selection is triggered
          +   select_mode: EXPLICIT;
          +   // For editable textblock parts: where to draw the (blinking) cursor
          +   cursor_mode: UNDER;
          +   // For editable textblock parts: allow multiple lines
          +   multiline: 0/1;
          +   // For textblock parts: accessibility features are used
          +   access: 0/1;
          +   // No-one uses that
          +   pointer_mode: AUTOGRAB;
          +   use_alternate_font_metrics: 0/1;
          +   // Remove the given program; useful when it was inherited
          +   program_remove: "programname";
          +   // Remove the given part; useful when it was inherited
          +   part_remove: "partname";
          +   // Insert the current part below the given part, as if it were declared before
          +   insert_before: "partname";
          +   // Insert the current part above the given part, as if it were declared after
          +   insert_after: "partname";
          +   // Define a new part inside this one
          +   part 
          +   {
          +      <part definition>
          +   }
          +   draggable
          +   {
          +      // Confine the current part to the given part
          +      confine: "another part";
          +      // Only start drag when it has moved enough to be outside the given part
          +      threshold: "another part";
          +      // Forward the drag events to the given part instead of handling them
          +      events: "another draggable part";
          +      // Enable the horizontal drag of the part with step_size steps or with steps_count steps
          +      x: 0/1 <step_size> <steps_count>;
          +      // Same as x but vertical
          +      y: 1 0 100;
          +   }
          +   // For box or table parts
          +   box/table 
          +   {
          +      // List of items
          +      items 
          +      {
          +         item 
          +         {
          +            // Define the item type, can only be GROUP
          +            type: GROUP;
          +            // Name the item
          +            name: "name";
          +            // Set the source for this item, or its content
          +            source: "groupname";
          +            // Set the minimum horizontal and vertical item sizes (-1 for expand)
          +            min: -1 -1;
          +            // Set the maximum horizontal and vertical item sizes (-1 for ignore)
          +            max: 100 100;
          +            // Set the item padding in pixels
          +            padding: 2 2 2 2;
          +            spread: 1 1;
          +            // Set the item alignment
          +            align: 0.5 0.5;
          +            // Set a weight hint in the box for the given object
          +            weight: 1 1;
          +            // Set the aspect ratio hint
          +            aspect: 1 1;
          +            aspect_mode: BOTH;
          +            // Set the number of columns and rows the item takes
          +            span: 1 1;
          +         }
          +      }
          +   }
          +   description 
          +   {
          +      // Inherit another description
          +      inherit: "default" 1.0;
          +      // Name the current description
          +      state: "default" 1.0;
          +      // Use another part as content of the current proxy part 
          +      // This description only works in the proxy part and the current part mirrors the rendering content of the source part
          +      source: "partname";
          +      // Make the part (in)visible (invisible parts emit no signals)
          +      visible: 0/1;
          +      // Emit a signal when the given dimension becomes zero or stops being zero
          +      limit: WIDTH;
          +      // Set the horizontal and vertical alignment of the part inside its parent
          +      align: 0.5 0.5;
          +      // Set that the part does not change size
          +      fixed: 0/1 0/1;
          +      // Set the minimum size for the part
          +      min: 200 200;
          +      // Forcibly multiply the minimum sizes by the given factors
          +      minmul: 1.2 1.2;
          +      // Set the maximum size for the part
          +      max: 400 400;
          +      // Make vertical and horizontal resizes happen in steps
          +      step: 0 0;
          +      // Force the aspect ratio to be kept between min and max between resizes
          +      aspect: 0.8 1.2;
          +      // Set the dimension to which the aspect ratio applies
          +      aspect_preference: BOTH;
          +      // Use the given color class which can be used to factor font colors
          +      color_class: "colorclassname";
          +      // Set the text color
          +      color: 255 0 0 255;
          +      // Set the color of the text shadow
          +      color2: 0 255 0 255;
          +      // Set the color of the text outline
          +      color3: 0 0 255 255;
          +      // Define the positions of the top-left (rel1) and bottom-right (rel2) corners
          +      rel1/rel2 
          +      {
          +         // Make relative and offset use the given part for their positioning
          +         to: "partname";
          +         // Position the corner relative to the part given through to (0.0 being axis beginning, 1.0 being its end)
          +         relative: 0.1 0.1;
          +         // Add an absolute offset (in pixels) along each axis
          +         offset: 10 10;
          +         // Same as to but only for the X axis
          +         to_x: "partname";
          +         // Same as to but only for the Y axis
          +         to_y: "partname";
          +      }
          +      // Settings specific to parts of the image type
          +      image 
          +      {
          +         // Set the name (not path) of the regular image
          +         normal: "imagename";
          +         // Set the image to use while transitioning to the normal image; use several times to create animations
          +         tween: "imagename2";
          +         // Set the number of pixels that make up each border of the image, and are not resized with the image
          +         border: 4 4 4 4;
          +         // Hide, strip from its alpha, or show (default) the non-border part of the image
          +         middle: DEFAULT;
          +         border_scale_by: 1.0;
          +         // Set whether to scale the border
          +         border_scale: 0/1;
          +         scale_hint: STATIC;
          +         // Set how the image is going to fill its part
          +         fill: 
          +         {
          +            // Set whether to smooth the image when scaling it
          +            smooth: 0/1;
          +            spread: ??;
          +            // Set whether to scale or tile to fit when resizing the image is needed
          +            type: SCALE/TILE;
          +            // Only display the part of the image that is below and to the right of the given point
          +            origin 
          +            {
          +               // Specify top-left point as relative coordinates
          +               relative: 0.1 0.1;
          +               // Specify top-left point as a pixel offset
          +               offset: 10 10;
          +            }
          +            // Specify bottom-right point as relative coordinates
          +            size 
          +            {
          +               // Specify bottom-right point as relative coordinates
          +               relative: 0.1 0.1;
          +               // Specify bottom-right point as a pixel offset
          +               offset: 10 10;
          +            }
          +         }
          +      }
          +      // Settings specific to parts of the text and textblock type 
          +      text 
          +      {
          +         // Set the part text
          +         text: "some text";
          +         // Set the text font
          +         font: "Tizen Sans";
          +         // Set the text size
          +         size: 14;
          +         // Set the text's class which can be used to factor font and font-size settings
          +         text_class: "classname";
          +         // Set the styles defined in stylename
          +         style: "stylename";
          +         // For textblocks in the password mode, replace characters to hide with this string
          +         repch: "*";
          +         // Set the min and max font sizes allowed when resizing (default is 0 0, or unrestricted)
          +         size_range: 6 18;
          +         // Increase the font size as much as possible while still remaining in the container for both axes
          +         fit: 0/1 0/1;
          +         // Make the min size of the container equal to the min size of the current text (0 0 by default)
          +         min: 0/1 0/1;
          +         // Make the max size of the container equal to the max size of the current text (0 0 by default)
          +         max: 0/1 0/1;
          +         // Set the vertical and horizontal alignments of the text
          +         align: 0.5 0.5;
          +         // Reuse the text of another part
          +         text_source: "partname";
          +         // When the text is too long to fit, set the relative position at which to cut the text and put an ellipsis ("...")
          +         ellipsis: 0.9;
          +      }
          +      // Settings specific to parts of the box type
          +      box 
          +      {
          +         // Set how children are arranged in the box
          +         layout: horizontal_homogeneous;
          +         // Set the vertical and horizontal alignments of the box
          +         align: 0.5 0.5;
          +         // Set the padding between items of the box
          +         padding: 1 1;
          +         // Make the box's min size the min size of its elements (make it shrinkable as much as its items)
          +         min: 0 1;
          +      }
          +      table 
          +      {
          +         // Make items homogeneous
          +         homogeneous: NONE;
          +         // Set the vertical and horizontal alignments of the table
          +         align: 0.5 0.5;
          +         // Set the padding between items of the table
          +         padding: 1 1;
          +         // Make the table's min size the min size of its elements (make it shrinkable as much as its items)
          +         min: 0 1;
          +      }
          +      map 
          +      {
          +         perspective: "partname";
          +         light: "partname";
          +         on: 0/1;
          +         smooth: 0/1;
          +         alpha: 0/1;
          +         backface_cull: 0/1;
          +         perspective_on: 0/1;
          +         color: 0/1;
          +         rotation 
          +         {
          +            center: "partname";
          +            x: 45;
          +            y: 120;
          +            z: 90;
          +         }
          +         perspective 
          +         {
          +            zplane: 0/1;
          +            focal: 20;
          +         }
          +         // Simpler syntax to create transitions to the current part
          +         link 
          +         {
          +            base: "edje,signal" "edje";
          +         }
          +      }
          +   }
          +}
          +
          + +

          The part block is used to represent the most basic design elements of the theme, for example, a part can represent a line in a border or a label on a button.

          + +
            +
          • inherit [part name] +

            Copies all properties except part name from the referenced part into the current part. All existing properties, except part name, are overwritten.

            + + + + + + + + + +
            Note
            When inheriting any parts, descriptions without state names are not allowed.
            +
          • + +
          • program_remove [program name] (program name) (program name) ... +

            Removes the listed programs from an inherited group. Removing non-existing programs is not allowed.

            + + + + + + + + + +
            Note
            This breaks program sequences if a program in the middle of the sequence is removed.
            +
          • + +
          • part_remove [part name] (part name) (part name) ... +

            Removes the listed parts from an inherited group. Removing non-existing parts is not allowed.

            +
          • + +
          • name [part name] +

            Sets the part name is used as a reference in the theme's relative positioning system, by programs and in some cases by the application. The part name must be unique within the group.

            +
          • + +
          • type [TYPE] +

            Sets the type (IMAGE by default). The valid types are:

            +
              +
            • RECT: Rectangle object in the screen
            • +
            • TEXT: Simple text
            • +
            • IMAGE: Image area
            • +
            • SWALLOW: Area where you can add an object
            • +
            • TEXTBLOCK: Complex text with, for example, multiple lines or mark-up elements
            • +
            • GROUP: Part which can include other groups in the same group
            • +
            • BOX: Container object as a container. It has a row or a column.
            • +
            • TABLE: Container object as a container. It has a row and column.
            • +
            • PROXY: Clone of another part in the same group. It shares the memory of the source part.
            • + +
            • SPACER: Rectangle object, but invisible. Recommended for padding, because it does not allocate any memory.
            • + +
            +
          • + +
          • part [part declaration] +

            Sets a nested part that adds hierarchy to Edje. A nested part inherits its location relative to the parent part. To declare a nested part, create a new part within the current part declaration. Define the parent part name before adding nested parts.

            +
            +part 
            +{
            +   name: "parent_rect";
            +   type: RECT;
            +   description {}
            +   part 
            +   {
            +      name: "nested_rect";
            +      type: RECT;
            +      description {}
            +   }
            +}
            +
            +
          • + +
          • insert_before [another part's name] +

            Sets the part's name which this part is inserted before. One part cannot have both insert_before and insert_after. One part cannot refer to more than one part name by insert_before.

            +
          • + +
          • insert_after [another part's name] +

            Sets the part's name which this part is inserted after. One part cannot have both insert_before and insert_after. One part cannot refer to more than one part name by insert_after.

            +
          • + +
          • mouse_events [1 or 0] +

            Determines whether the part emits signals, although it is named mouse_events. Disabling (0) prevents the part from emitting a signal. The default value is 1, or the value set to mouse_events at the group level.

            +
          • + +
          • repeat_events [1 or 0] +

            Determines whether a part echoes a mouse event to other parts below the pointer (1). The default value is 0.

            +
          • + +
          • ignore_flags [FLAG] ... +

            Determines whether events with the given flags are ignored, or do not emit signals to the parts. Multiple flags must be separated by spaces, the effect is ignoring all events with one of the flags specified. Possible flags are:

            +
              +
            • NONE: Event is handled properly (default value)
            • +
            • ON_HOLD: Event is not handled or passed in this part
            • + +
            +
          • + +
          • scale [1 or 0] +

            Determines whether the part scales its size with an Edje scaling factor. This is used to scale properties, such as font size or min/max size of the part, and it can also be used to scale based on DPI of the target device. The reason to be selective is that some parts are scaled well, others are not, so choose what works best. By default the scaling is off (0) and the default scale factor is 1.0, which means no scaling.

            +
          • + +
          • pointer_mode [MODE] +

            Sets the mouse pointer behavior for a given part. The default value is AUTOGRAB. The available modes are:

            +
              +
            • AUTOGRAB: When the part is clicked and the button remains pressed, the part is the source of all future mouse signals emitted, even outside the object, until the button is released
            • +
            • NOGRAB: Effect is limited to the part's container
            • +
            +
          • + +
          • precise_is_inside [1 or 0] +

            Enables precise point collision detection for the part, which is more resource-intensive. This setting is disabled by default.

            +
          • + +
          • use_alternate_font_metrics [1 or 0] +

            Determines whether Edje uses different size measurement functions. This setting only affects text and textblock parts, and is disabled by default.

            +
          • + +
          • clip_to [another part's name] +

            Renders only the area of the part that coincides with another part's container. Overflowing content is not displayed. Note that the part being clipped to can only be a rectangle part.

            +
          • + +
          • source [another group's name] +

            Swallows the specified group into the part's container if the source is a group. If the source is a textblock, it is used for the group to be loaded and used for selection display under the selected text. source2 is used on top of the selected text, if source2 is specified.

            +

            Only available to group or textblock parts.

            +
          • + +
          • source2 [another group's name] +

            Used for the group to be loaded and used for selection display over the selected text. source is used under the selected text, if source is specified.

            +

            Only available to textblock parts.

            +
          • + +
          • source3 [another group's name] +

            Used for the group to be loaded and used for cursor display under the cursor position. source4 is used over the cursor text, if source4 is specified.

            +

            Only available to textblock parts.

            +
          • + +
          • source4 [another group's name] +

            Used for the group to be loaded and used for cursor display over the cursor position. source3 is used under the cursor text, if source3 is specified.

            +

            Only available to textblock parts.

            +
          • + +
          • source5 [another group's name] +

            Used for the group to be loaded and used for anchors display under the anchor position. source6 is used over the anchor text, if source6 is specified.

            +

            Only available to textblock parts.

            +
          • + +
          • source6 [another group's name] +

            Used for the group to be loaded and used for anchor display over the anchor position. source5 is used under the anchor text, if source5 is specified.

            +

            Only available to textblock parts.

            +
          • + +
          • effect [effect] (shadow direction) +

            Applies the selected outline, shadow, or glow effect to a textblock. Note that this effect only works for the textblock. The available effects are:

            +
              +
            • PLAIN
            • +
            • OUTLINE
            • +
            • SOFT_OUTLINE
            • +
            • SHADOW
            • +
            • SOFT_SHADOW
            • +
            • OUTLINE_SHADOW
            • +
            • OUTLINE_SOFT_SHADOW
            • +
            • FAR_SHADOW
            • +
            • FAR_SOFT_SHADOW
            • +
            • GLOW
            • +
            + +

            The available shadow direction definitions are:

            +
              +
            • BOTTOM_RIGHT (default)
            • +
            • BOTTOM
            • +
            • BOTTOM_LEFT
            • +
            • LEFT
            • +
            • TOP_LEFT
            • +
            • TOP
            • +
            • TOP_RIGHT
            • +
            • RIGHT
            • +
            +
          • + +
          • entry_mode [mode] +

            Sets the edit mode for a textblock part. The available modes are:

            +
              +
            • NONE: Textblock is non-editable
            • +
            • PLAIN: Textblock is non-editable, but selectable
            • +
            • EDITABLE: Textblock is editable
            • +
            • PASSWORD: Textblock is editable if the Edje object has the keyboard focus and the part has the Edje focus (or selectable always regardless of focus). In case of the password mode, the textblock is not selectable and all text characters are replaced with * characters, but they remain editable and pastable.
            • +
            +
          • + +
          • select_mode [mode] +

            Sets the selection mode for a textblock part. The available modes are:

            +
              +
            • DEFAULT: Selection mode is what you would expect on any desktop. Press mouse, drag, and release to end.
            • +
            • EXPLICIT: Mode requires the application controlling the Edje object to explicitly begin and end selection modes, and the selection itself is draggable at both ends
            • +
            +
          • + +
          • cursor_mode [mode] +

            Sets the cursor mode for a textblock part. The available modes are:

            +
              +
            • UNDER: Cursor draws below the character pointed at. This is the default setting.
            • +
            • BEFORE: Cursor is drawn as a vertical line before the current character, just like many other GUI toolkits handle it
            • +
            +
          • + +
          • multiline [1 or 0] +

            Enables multiple lines for editing in an editable a textblock.

            +
          • + +
          • access [1 or 0] +

            Determines whether the part uses the accessibility feature (1). The default value is 0.

            +
          • +
          • draggable block + +
            +draggable 
            +{
            +   confine: "another part";
            +   threshold: "another part";
            +   events:  "another draggable part";
            +   x: 0 0 0;
            +   y: 0 0 0;
            +}
            +
            + +

            The draggable block enables the part to be dragged around the interface. Do not confuse this feature with external drag and drop. By default, Edje (and most applications) attempts to use the smallest possible size for a draggable part. If the min property is not set in the description, the part is (most likely) set to 0px width and 0px height, thus invisible.

            + +
              + +
            • x [enable/disable] [step] [count] +

              Sets up dragging events for the X axis. The first parameter is used to enable (1 or -1) and disable (0) dragging along the axis. When enabled, 1 sets the starting point at 0.0 and -1 at 1.0. The second parameter takes any integer and limits the movement to values divisible by it, causing the part to jump from position to position. If the step is set to 0, it is calculated as the width of the confine part divided by count.

              +
            • + +
            • y [enable/disable] [step] [count] +

              Sets up dragging events for the Y axis. The first parameter is used to enable (1 or -1) and disable (0) dragging along the axis. When enabled, 1 sets the starting point at 0.0 and -1 at 1.0. The second parameter takes any integer and limits the movement to values divisible by it, causing the part to jump from position to position. If the step is set to 0, it is calculated as the height of the confine part divided by count.

              +
            • + +
            • confine [another part's name] +

              Limits the movement of the dragged part to another part's container. Set a min size for the part, or the dragged object does not show up.

              +
            • + +
            • threshold [another part's name] +

              Allows (when set) the movement of the dragged part start only when it gets moved outside the threshold part.

              +
            • + +
            • events [another draggable part's name] +

              Causes the part to forward the drag events to another part, thus ignoring the drag events for itself.

              +
            • + +
            +
          • +
          • box or table block +
              +
            • box.items or table.items block + +
              +box/table 
              +{
              +   items 
              +   {
              +      item 
              +      {
              +         type: GROUP;
              +         source: "some source";
              +         min: -1 -1;
              +         max: 100 100;
              +         padding: 1 1 2 2;
              +      }
              +      item 
              +      {
              +         type: GROUP;
              +         source: "some other source";
              +         name: "some name";
              +         align: 1.0 0.5;
              +      }
              +   }
              +}
              +
              + +

              On a box part, the items block is used to set other groups as elements of the box. These elements can be mixed with external objects set by the application through the edje_object_part_box*() functions.

              +
                +
              • box.items.item or table.items.item block +

                The item block defines an element within the box or table.

                +
                  + +
                • type [item type] +

                  Sets the type of the object this item holds. The supported type is:

                  +
                    +
                  • GROUP (default)
                  • +
                  +
                • + +
                • name [name for the object] +

                  Sets the name of the object using the evas_object_name_set() function.

                  +
                • + +
                • source [another group's name] +

                  Sets the group this object is made of.

                  +
                • + +
                • min [width] [height] +

                  Sets the minimum size hints for this object.

                  + + + + + + + + + +
                  Note
                  The minimum size hint must be -1 to get the expand behavior.
                  +
                • + +
                • spread [width] [height] +

                  Replicates the item in a rectangle of size (width x height) box starting from the defined position of this item. The default value is 1 1;.

                  +
                • + +
                • prefer [width] [height] +

                  Sets the preferred size hints for this object.

                  +
                • + +
                • max [width] [height] +

                  Sets the maximum size hints for this object.

                  +
                • + +
                • padding [left] [right] [top] [bottom] +

                  Sets the padding hints for this object.

                  +
                • + +
                • align [x] [y] +

                  Sets the alignment hints for this object.

                  +
                • + +
                • weight [x] [y] +

                  Sets the weight hints for this object.

                  +
                • + +
                • aspect [w] [h] +

                  Sets the aspect width and height hints for this object.

                  +
                • + +
                • aspect_mode [mode] +

                  Sets the aspect control hints for this object. The available hints are:

                  +
                    +
                  • NONE
                  • +
                  • NEITHER
                  • +
                  • HORIZONTAL
                  • +
                  • VERTICAL
                  • +
                  • BOTH
                  • +
                  +
                • + +
                • options [extra options] +

                  Sets extra options for the object.

                  +
                • + +
                • position [col] [row] +

                  Sets the position this item has in the table. This is required for the table type parts only.

                  +
                • + +
                • span [col] [row] +

                  Sets how many columns and rows this item uses. The default value is 1 1.

                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          • description block + +
            +description 
            +{
            +   inherit: "another_description" INDEX;
            +   state: "description_name" INDEX;
            +   visible: 1;
            +   min: 0 0;
            +   max: -1 -1;
            +   align: 0.5 0.5;
            +   fixed: 0 0;
            +   step: 0 0;
            +   aspect: 1 1;
            +
            +   rel1 
            +   {
            +      ...
            +   }
            +
            +   rel2 
            +   {
            +      ...
            +   }
            +}
            +
            + +

            The description block is used to define the style and layout properties of a part in a given state. Every part can have one or more description blocks.

            + +
              + +
            • inherit [another description's name] [another description's index] +

              Sets the description from which all the properties are inherited. The properties defined in this part override the inherited properties, reducing the amount of necessary code for simple state changes. Note that inheritance in Edje is single level only.

              +
            • + +
            • source [another part's name] +

              Causes the part to use another part's content as the content of this part. This works only with a proxy part.

              +
            • + +
            • state [name for the description] [index] +

              Sets the name used to identify a description inside a given part. Multiple descriptions are used to declare different states of the same part, like clicked or invisible. All state declarations are also coupled with an index number between 0.0 and 1.0. All parts must have at least one description named default 0.0.

              +
            • + +
            • visible [0 or 1] +

              Determines whether a part is visible (1). Non-visible parts do not emit signals. The default value is 1.

              +
            • + +
            • limit [mode] +

              Emits a signal when the part size changes from zero or to zero (limit,width,over, limit,width,zero). By default, no signal is emitted. The valid values are:

              +
                +
              • NONE
              • +
              • WIDTH
              • +
              • HEIGHT
              • +
              • BOTH
              • +
              +
            • + +
            • align [X axis] [Y axis] +

              When the displayed object's size is smaller or bigger than its container, this property moves it relatively along both axes inside its container. 0.0 means left/top edges of the object touching container's respective ones, and 1.0 stands for right/bottom edges of the object (on horizontal/vertical axis, respectively). The default value is 0.5 0.5. For a more detailed explanation, see Align size hint.

              +
            • + +
            • fixed [width, 0 or 1] [height, 0 or 1] +

              Sets the minimum size calculation. See the edje_object_size_min_calc() and edje_object_size_min_restricted_calc() functions of the Edje Object Geometry API (in mobile and wearable applications). The value tells the min size calculation routine where this part does not change size in width or height (1 for it does not, 0 for it does), so the routine does not try to expand or contract the part.

              +
            • + +
            • min [width] [height] or SOURCE +

              Sets the minimum size of the state. When the property is set to SOURCE, it looks at the original image size and enforces its minimal size to match at least the original one. The part must be an image or a group part.

              +
            • + +
            • minmul [width multiplier] [height multiplier] +

              Sets the multiplier forcibly applied to whatever minimum size is only during minimum size calculation.

              +
            • + +
            • max [width] [height] or SOURCE +

              Sets the maximum size of the state. A size of -1.0 means that it is ignored in one direction. When the property is set to SOURCE, Edje enforces the part to be not more than the original image size. The part must be an image part.

              +
            • + +
            • step [width] [height] +

              Restricts resizing of each dimension to values divisible by its value. This causes the part to jump from value to value while resizing. The default value is 0 0, which disables stepping.

              +
            • + +
            • aspect [min] [max] +

              Forces the width to height ratio to be kept between the minimum and maximum set. For example, 1.0 1.0 increases the width a pixel for every pixel added to height. The default value is 0.0 0.0, which disables aspect. For a more detailed explanation, see Minimum size hint. Normally the width and height can be resized to any values independently.

              +
            • + +
            • aspect_preference [DIMENSION] +

              Sets the dimensions to which the aspect property applies. The available options are:

              +
                +
              • BOTH
              • +
              • VERTICAL
              • +
              • HORIZONTAL
              • +
              • SOURCE
              • +
              • NONE
              • +
              +

              For a more detailed explanation, see Minimum size hint.

              +
            • + +
            • color_class [color class name] +

              Sets the part to use the color values of the named color_class. These values can be overridden by the color, color2, and color3 properties.

              +
            • + +
            • color [red] [green] [blue] [alpha] +

              Sets the main color to the specified values (between 0 and 255).

              + + + + + + + + + +
              Note
              The textblock part is not affected by the color description. Set the color in the text style.
              + +
            • + +
            • color2 [red] [green] [blue] [alpha] +

              Sets the text shadow color to the specified values (0 to 255).

              +
            • + +
            • color3 [red] [green] [blue] [alpha] +

              Sets the text outline color to the specified values (0 to 255).

              +
            • + +
            • description.rel1 or description.rel2 block +
              +description 
              +{
              +   rel1 
              +   {
              +      relative: 0.0 0.0;
              +      offset:     0   0;
              +   }
              +   rel2 
              +   {
              +      relative: 1.0 1.0;
              +      offset:    -1  -1;
              +   }
              +}
              +
              + +

              The rel1 and rel2 blocks are used to define the position of each corner of the part's container. rel1 refers to the left-top corner and rel2 to the right-down corner.

              + +
                + +
              • relative [X axis] [Y axis] +

                Moves the corner to a relative position inside the container of the relative to part. Values from 0.0 (0%, beginning) to 1.0 (100%, end) on each axis.

                +
              • + +
              • offset [X axis] [Y axis] +

                Affects the corner position a fixed number of pixels along each axis.

                +
              • + +
              • to [another part's name] +

                Positions the corner relative to another part's container. Setting to "" resets this value for inherited parts.

                +
              • + +
              • to_x [another part's name] +

                Positions the corner relative to the X axis of another part's container. This affects the first parameter of the relative property. Setting to "" resets this value for inherited parts.

                +
              • + +
              • to_y [another part's name] +

                Positions the corner relative to the Y axis of another part's container. This affects the second parameter of the relative property. Setting to "" resets this value for inherited parts.

                +
              • + +
              +
            • +
            • description.image block + +
              +description 
              +{
              +   image 
              +   {
              +      normal: "filename.ext";
              +      tween:  "filename2.ext";
              +      tween:  "filenameN.ext";
              +      border:  left right top bottom;
              +      middle:  0/1/NONE/DEFAULT/SOLID;
              +      fill {}
              +   }
              +}
              +
              +

              The image block defines the settings for an image used in a visual element.

              +
                + +
              • normal [image's filename] +

                Sets the name of the image to be used as previously declared in the images block. In an animation, this is the first and last image displayed. The file name is required in all image parts.

                +
              • + +
              • tween [image's filename] +

                Sets the name of an image to be used in an animation loop. An image block can have none, one, or multiple tween declarations. Images are displayed in the order they are listed, during the transition to the state they are declared in; the normal image is the final state.

                +
              • + +
              • border [left] [right] [top] [bottom] +

                Sets the width (in pixels) of each side of the image displayed as a fixed size border, from the side inwards, preventing the corners from being changed on a resize.

                +
              • + +
              • middle [mode] +

                If a border is set, this value tells Edje whether the rest of the image (not covered by the defined border) is displayed or assumed to be solid (without alpha). The default value is 1/DEFAULT. The available values are:

                +
                  +
                • 0 or NONE
                • +
                • 1 or DEFAULT
                • +
                • SOLID (strip alpha from the image over the middle zone)
                • +
                +
              • + +
              • border_scale_by [value] +

                If border scaling is enabled, normally the output border sizes scale accordingly. For example, if 3 pixels on the left edge are set as a border, then normally at scale 1.0, those 3 columns are always exactly 3 columns of output, or at scale 2.0 they are 6 columns, or 0.33 they merge into a single column. This property multiplies the input scale factor by this multiplier, allowing the creation of supersampled borders to make higher resolution outputs possible by always using the highest resolution artwork and then at runtime scaling it down. The value can be: 0.0 or bigger (0.0 or 1.0 to switch it off)

                +
              • + +
              • border_scale [0/1] +

                Tells Edje whether the border is scaled by the object or global Edje scale factors.

                +
              • + +
              • scale_hint [mode] +

                Sets the Evas image scale hint letting the engine more effectively save cached copies of the scaled image, if it makes sense. The valid values are:

                +
                  +
                • 0 or NONE
                • +
                • DYNAMIC
                • +
                • STATIC
                • +
                +
              • + +
              • description.image.fill block + +
                +image 
                +{
                +   fill 
                +   {
                +      type: SCALE;
                +      smooth: 0-1;
                +      origin {}
                +      size {}
                +   }
                +}
                +
                + +

                The fill block is an optional block that defines the way an image part is going to be displayed inside its container. It can be used for tiling (repeating the image) or displaying only part of an image. For more information, see the evas_object_image_fill_set() function of the Image Object Functions API (in mobile and wearable applications).

                + +
                  + +
                • smooth [0 or 1] +

                  Determines whether the image is smoothed on scaling (1). The default value is 1.

                  +
                • + +
                • spread +
                • + +
                • type [fill type] +

                  Sets the image fill type. The min part property must be set, it is the size of the tiled image. If the max property is set, the tiled area has the size according to the max value. The valid values are:

                  +
                    +
                  • SCALE: Image is scaled according to the value of the relative and offset properties from the origin and size blocks. This is the default value.
                  • +
                  • TILE: Image is tiled according to the value of the relative and offset properties from the origin and size blocks
                  • +
                  +
                • + +
                • image.fill.origin block + +
                  +image 
                  +{
                  +   fill 
                  +   {
                  +      origin 
                  +      {
                  +         relative: 0.0 0.0;
                  +         offset: 0 0;
                  +      }
                  +   }
                  +}
                  +
                  + +

                  The origin block is used to place the starting point inside the displayed element that is used to render the tile. By default, the origin is set at the element's left-top corner.

                  + +
                    + +
                  • relative [X axis] [Y axis] +

                    Sets the starting point relative to the displayed element's content.

                    +
                  • +
                  • offset [X axis] [Y axis] +

                    Affects the starting point a fixed number of pixels along each axis.

                    +
                  • + +
                  +
                • + +
                • image.fill.size block + +
                  +image 
                  +{
                  +   fill 
                  +   {
                  +      size 
                  +      {
                  +         relative: 1.0 1.0;
                  +         offset: -1 -1;
                  +      }
                  +   }
                  +}
                  +
                  + +

                  The size block defines the tile size of the content that is displayed.

                  + +
                    + +
                  • relative [width] [height] +

                    Takes a pair of decimal values that represent the percentage of the original size of the element. For example, 0.5 0.5 represents half the size, while 2.0 2.0 represents double. The default value is 1.0 1.0.

                    +
                  • +
                  • offset [X axis] [Y axis] +

                    Affects the size of the tile a fixed number of pixels along each axis.

                    +
                  • + +
                  +
                • +
                +
              • +
            • + +
            • description.text block + +
              +text 
              +{
              +   text: "some string of text to display";
              +   font: "font_name";
              +   size: SIZE;
              +   text_class: "class_name";
              +   fit: horizontal vertical;
              +   min: horizontal vertical;
              +   max: horizontal vertical;
              +   align: X-axis Y-axis;
              +   source: "part_name";
              +   text_source: "text_part_name";
              +   style: "stylename";
              +}
              +
              + +

              The text block defines a text part element.

              + +
                + +
              • text [a string of text, or nothing] +

                Sets the default content of a text part, normally the application is the one changing its value.

                +
              • + +
              • text_class [text class name] +

                Sets the name used by the application to alter the font family and size at runtime (similar to color_class).

                +
              • + +
              • font [font alias] +

                Sets the font family to one of the aliases set up in the fonts block. This can be overridden by the application settings.

                +
              • + +
              • style [the style name] +

                Causes the part to use the default style and tags defined in the style block with the specified name.

                +
              • + +
              • repch [the replacement character string] +

                In the password mode, this string is used to replace every character to hide the details of the entry. Normally * is used, but you can use any character you like.

                +
              • + +
              • size [font size in points (pt)] +

                Sets the default font size for the text part. This can be overridden by the application settings.

                +
              • + +
              • size_range [font min size in points (pt)] [font max size in points (pt)] +

                Sets the allowed font size for the text part. Setting min and max to 0 means that sizing is not restricted. This is also the default value.

                +
              • + +
              • fit [horizontal] [vertical] +

                When any of the parameters is set to 1, Edje resizes the text for it to fit in its container. Both are disabled by default.

                +
              • + +
              • min [horizontal] [vertical] +

                When any of the parameters is enabled (1), it forces the minimum size of the container to be equal to the minimum size of the text. The default value is 0 0.

                +
              • + +
              • max [horizontal] [vertical] +

                When any of the parameters is enabled (1), it forces the maximum size of the container to be equal to the maximum size of the text. The default value is 0 0.

                +
              • + +
              • align [horizontal] [vertical] +

                Changes the position of the point of balance inside the container. The default value is 0.5 0.5.

                +
              • + +
              • source [another TEXT part's name] +

                Causes the part to use the text properties (like font and size) of another part and update them as they change.

                +
              • + +
              • text_source [another TEXT part's name] +

                Causes the part to display the text content of another part and update them as they change.

                +
              • + +
              • ellipsis [point of balance] +

                Balances the text in a relative point from 0.0 to 1.0. This point is the last section of the string to be cut out in case of a resize to a smaller size than the text itself. The default value is 0.0.

                +
              • + +
              +
            • + +
            • description.box block + +
              +box 
              +{
              +   layout: "vertical";
              +   padding: 0 2;
              +   align: 0.5 0.5;
              +   min: 0 0;
              +}
              +
              + +

              The box block can contain other objects and display them in different layouts, any of the predefined set, or a custom one, set by the application.

              + +
                + +
              • layout [primary layout] (fallback layout) +

                Sets the layout for the box:

                +
                  +
                • horizontal (default)
                • +
                • vertical
                • +
                • horizontal_homogeneous
                • +
                • vertical_homogeneous
                • +
                • horizontal_max (homogeneous to the max sized child)
                • +
                • vertical_max
                • +
                • horizontal_flow
                • +
                • vertical_flow
                • +
                • stack
                • +
                • some_other_custom_layout_set_by_the_application +

                  Set a custom layout as a fallback. For more information, see the edje_box_layout_register() function in the Edje Box Part API (in mobile and wearable applications). If an unregistered layout is used, it defaults to horizontal.

                • + +
                +
              • + +
              • align [horizontal] [vertical] +

                Changes the position of the point of balance inside the container. The default value is 0.5 0.5.

                +
              • + +
              • padding [horizontal] [vertical] +

                Sets the space between cells in pixels. The default value is 0 0.

                +
              • + +
              • min [horizontal] [vertical] +

                When any of the parameters is enabled (1), it forces the minimum size of the box to be equal to the minimum size of the items. The default value is 0 0.

                +
              • + +
              +
            • + +
            • description.table block + +
              +table 
              +{
              +   homogeneous: TABLE;
              +   padding: 0 2;
              +   align: 0.5 0.5;
              +   min: 0 0;
              +}
              +
              + +

              The table block can contain other objects packed in multiple columns and rows, and each item can span across more than one column or row.

              + +
                + +
              • homogeneous [homogeneous mode] +

                Sets the homogeneous mode for the table:

                +
                  +
                • NONE: Default
                • +
                • TABLE: Available space is evenly divided between children (the space overflows onto other children if too little space is available)
                • +
                • ITEM: Size of each item is the largest minimum size of all the items
                • +
                +
              • + +
              • align [horizontal] [vertical] +

                Changes the position of the point of balance inside the container. The default value is 0.5 0.5.

                +
              • + +
              • padding [horizontal] [vertical] +

                Sets the space between cells in pixels. The default value is 0 0.

                +
              • + +
              • min [horizontal] [vertical] +

                When any of the parameters is enabled (1), it forces the minimum size of the table to be equal to the minimum size of the items. The default value is 0 0.

                +
              • + +
              +
            • +
            • description.map block + +
              +map 
              +{
              +   perspective: "name";
              +   light: "name";
              +   on: 1;
              +   smooth: 1;
              +   perspective_on: 1;
              +   backface_cull: 1;
              +   alpha: 1;
              +
              +   rotation 
              +   {
              +      ...
              +   }
              +}
              +
              + +
                + +
              • perspective [another part's name] +

                Sets the part that is used as the perspective point for giving a part a 3D look. The perspective point must have a perspective section that provides zplane and focal properties. The center of this part is used as the focal point, thus size, color, and visibility are not relevant, just the center point, zplane, and focal are used. This also implicitly enables perspective transforms.

                +
              • + +
              • light [another part's name] +

                Sets the part that is used as the light for calculating the brightness (based on how directly the part's surface is facing the light source point). Like the perspective point part, the center point is used and zplane is used for the z position (0 being the zero-plane where all 2D objects normally live) and positive values being further away into the distance. The light part color property is used as the light color (alpha not used for light color). The color2 property is used for the ambient lighting when calculating brightness (alpha also not used).

                +
              • + +
              • on [1 or 0] +

                Enables mapping for the part. The default value is 0.

                +
              • + +
              • smooth [1 or 0] +

                Enables smooth map rendering. This can be linear interpolation, anisotropic filtering, or anything the engine decides is smooth. This is a best-effort hint and it may not produce precisely the same results in all engines and situations. The default value is 1.

                +
              • + +
              • alpha [1 or 0] +

                Enables the alpha channel when map rendering. The default value is 1.

                +
              • + +
              • backface_cull [1 or 0] +

                Enables backface culling (when the rotated part that normally faces the camera is facing away after being rotated). This means that the object is hidden when the backface is culled.

                +
              • + +
              • perspective_on [1 or 0] +

                Enables perspective when rotating even without a perspective point object. This uses a perspective set for the object itself or for the canvas as a whole as the global perspective with the edje_perspective_set() and edje_perspective_global_set() functions of the Edje Perspective API (in mobile and wearable applications).

                +
              • + +
              • color [point] [red] [green] [blue] [alpha] +

                Sets the color of a vertex in the map. The colors are linearly interpolated between vertex points through the map. The default color of a vertex in a map is white solid (255, 255, 255, 255), which means it has no affect on modifying the part pixels. Currently only 4 points are supported:

                +
                  +
                • 0: Left-top point of a part
                • +
                • 1: Right-top point of a part
                • +
                • 2: Left-bottom point of a part
                • +
                • 3: Right-bottom point of a part
                • +
                +
              • +
              • map.rotation block + +
                +rotation 
                +{
                +   center: "name";
                +   x: 45.0;
                +   y: 45.0;
                +   z: 45.0;
                +}
                +
                + +

                The rotation block rotates the part, optionally with the center on another part.

                + +
                  + +
                • center [another part's name] +

                  Sets the part that is used as the center of rotation when rotating the part with this description. The part's center point is used as the rotation center when applying rotation around the X, Y and Z axes. If no center is given, the part's original center itself is used for the rotation center.

                  +
                • + +
                • x [X degrees] +

                  Sets the rotation around the X axis of the part considering the center set. The value is given in degrees.

                  +
                • + +
                • y [Y degrees] +

                  Sets the rotation around the Y axis of the part considering the center set. The value is given in degrees.

                  +
                • + +
                • z [Z degrees] +

                  Sets the rotation around the Z axis of the part considering the center set. The value is given in degrees.

                  +
                • + +
                +
              • +
              • map.perspective block + +
                +perspective 
                +{
                +   zplane: 0;
                +   focal: 1000;
                +}
                +
                + +

                The perspective block adds focal and plane perspective to the part. Active if the perspective_on property is true. This must be provided, if the part is being used by another part as its perspective target.

                + +
                  + +
                • zplane [unscaled Z value] +

                  Sets the Z value that is not scaled. Normally this is 0 as that is the Z distance.

                  +
                • + +
                • focal [distance] +

                  Sets the distance from the focal Z plane (zplane) and the camera, for example, equating to focal length of the camera.

                  +
                • + +
                +
              • + +
              +
            • +
            +
          • +
          + +

          Program Block

          + +
          +program
          +{
          +   // Set the name of the program
          +   name: "programname";
          +   // Set the signals which trigger the program
          +   signal: "signalname";
          +   // Filter incoming signals depending on the sender name
          +   source: "partname";
          +   // Filter incoming signals depending on the part's state
          +   filter: "partname" "statename";
          +   // Delay the program by X seconds plus a random time between 0 and Y
          +   in: 0.3 0.0;
          +   // Set the action to perform
          +   action: STATE_SET "statename" state_value;
          +   // If the action is STATE_SET, define a transition from the current to the target state
          +   transition: LINEAR 0.5;
          +   // If the action is SIGNAL_EMIT, set the name of the part which receives the signal
          +   target: "partname";
          +   // Run another program after the current one is done
          +   after: "programname";
          +   after: "anotherprogram";
          +}
          +
          + +

          The program block defines how your interface reacts to events. Programs can change the part state or trigger other events.

          + +
            + +
          • name [program name] +

            Sets the symbolic name of the program as a unique identifier.

            +
          • + +
          • signal [signal name] +

            Sets the signals that cause the program to run. The signal received must match the specified source to run. There can be several signals, but only one signal keyword per program can be used. Also, there are some predefined signals for touch event handling. The predefined signals are:

            +
              +
            • hold,on: Holding on the mouse event matching the source that starts the program
            • +
            • hold,off: Holding off the mouse event matching the source that starts the program
            • +
            • focus,part,in: Focusing in the matching source that starts the program
            • +
            • focus,part,out: Focusing out of the matching source that starts the program
            • +
            • mouse,in: Moving the mouse into the matching source that starts the program
            • +
            • mouse,out: Moving the mouse out of the matching source that starts the program
            • +
            • mouse,move: Moving the mouse in the matching source that starts the program
            • +
            • mouse,down,*: Pressing the mouse button in the matching source that starts the program
            • +
            • mouse,up,*: Releasing the mouse button in the matching source that starts the program
            • +
            • mouse,clicked,*: Clicking any mouse button in the matching source that starts the program
            • +
            • mouse,wheel,0,*: Moving the mouse wheel in the matching source that starts the program. A positive number moves up and a negative number moves down.
            • +
            • drag,start: Starting a drag of the mouse in the matching source that starts the program. This signal works only in the draggable part.
            • +
            • drag,stop: Stopping a drag of the mouse in the matching source that starts the program. This signal works only in the draggable part.
            • +
            • drag: Dragging the mouse in the matching source that starts the program. This signal works only in the draggable part.
            • +
            +
          • + +
          • source [source name] +

            Sets the source of an accepted signal. There can be several signals, but only one source keyword per program can be used. For example, source: button-* means that signals from any part or program named button-* are accepted.

            +
          • + +
          • filter [part] [state] +

            Filters the signals to be only accepted if the part is in the [state] state. Only 1 filter per program can be used. If the [state] parameter is not given, the source of the event is used instead.

            +
          • + +
          • in [from] [range] +

            Waits [from] seconds before executing the program and add a random number of seconds (from 0 to [range]) to the total waiting time.

            +
          • + +
          • action [type] (param1) (param2) (param3) (param4) +

            Sets the action to be performed by the program. The valid actions (only 1 can be specified) are:

            +
              +
            • STATE_SET: Set the target part state as target state
            • +
            • ACTION_STOP: Stop the ongoing transition
            • +
            • SIGNAL_EMIT: Emit a signal to the application level. The application can register a callback for handling actions based on the EDC state.
            • +
            • DRAG_VAL_SET: Set a value for the draggable part (x, y values)
            • +
            • DRAG_VAL_STEP: Set a step for the draggable part (x, y values)
            • +
            • DRAG_VAL_PAGE: Set a page for the draggable part (x, y values)
            • +
            • FOCUS_SET: Set the focus to the target group
            • +
            • PLAY_SAMPLE "sample name" speed (channel): Play a music sample clip + +

              PLAY_SAMPLE's (optional) channel can be one of:

              +
                +
              • EFFECT/FX
              • +
              • BACKGROUND/BG
              • +
              • MUSIC/MUS
              • +
              • FOREGROUND/FG
              • +
              • INTERFACE/UI
              • +
              • INPUT
              • +
              • ALERT
              • +
              +
            • + +
            • PLAY_TONE "tone name" duration_in_seconds (Range 0.1 to 10.0): Play a predefined tone of a specific duration
            • +
            • PLAY_VIBRATION "sample name" repeat (repeat count)
            • +
          • + + +
          • transition [type] [length] (interp val 1) (interp val 2) (option) +

            Determines how transitions occur using the STATE_SET action. The [type] parameter is the style of the transition and the [length] parameter is a double specifying the number of seconds in which to perform the transition. The valid types are:

            +
              +
            • LIN or LINEAR
            • +
            • SIN or SINUSOIDAL
            • +
            • ACCEL or ACCELERATE
            • +
            • DECEL or DECELERATE
            • +
            • ACCEL_FAC or ACCELERATE_FACTOR
            • +
            • DECEL_FAC or DECELERATE_FACTOR
            • +
            • SIN_FAC or SINUSOIDAL_FACTOR
            • +
            • DIVIS or DIVISOR_INTERP
            • +
            • BOUNCE
            • +
            • SPRING
            • +
            +

            The types have the following requirements:

            +
              + +
            • ACCEL_FAC, DECEL_FAC, and SIN_FAC need the extra optional interp val 1 to determine the factor of curviness. 1.0 is the same as their non-factor counterparts and 0.0 is equal to linear. Numbers higher than 1.0 make the curve angles steeper with a more pronounced curve point.
            • + +
            • DIVIS, BOUNCE, and SPRING also require interp val 2 in addition to interp val 1.
            • + +
            • DIVIS uses [val 1] as the initial gradient start (for example, 0.0 is horizontal, 1.0 is diagonal (linear), and 2.0 is twice the gradient of linear). [val 2] is interpreted as an integer factor defining how much the value swings outside the gradient before going back to the final resting spot at the end. 0.0 for [val 2] is equivalent to a linear interpolation. Note that DIVIS can exceed 1.0.
            • + +
            • BOUNCE uses [val 2] as the number of bounces (so it is rounded down to the nearest integer value), with [val 1] determining how much the bounce decays; 0.0 gives a linear decay per bounce and higher values give much more decay.
            • + +
            • SPRING is similar to bounce; [val 2] specifies the number of spring swings and [val 1] specifies the decay, but it can exceed 1.0 on the outer swings.
            • + +
            • The valid options are: +
                +
              • CURRENT: Causes the object to move from its current position. Can be used as the last parameter of any transition type.
              • +
              +
            • +
            +
          • +
          • target [target] +

            Sets the program or part on which the specified action acts.

            +
          • + +
          • after [after] +

            Determines the program that is run after the current program completes. The source and signal parameters of a program run as an after are ignored. Multiple after statements can be specified per program.

            +
          • + +
          + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edc_positioning_n.htm b/org.tizen.ui.practices/html/native/efl/edc_positioning_n.htm new file mode 100644 index 0000000..6ef79ed --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edc_positioning_n.htm @@ -0,0 +1,487 @@ + + + + + + + + + + + + + Positioning Parts with the EDC File + + + + + +
          + +

          Positioning Parts with the EDC File

          + +

          The size of a part in pixels is set using the min and max properties. The following code example sets the minimum and maximum size of the rectangle part to 200 x 200 px:

          + +
          +part 
          +{ 
          +   name: "rectangle";
          +   type: RECT;
          +   description 
          +   { 
          +      state: "blue" 0.0;
          +      align: 0.0 0.0;
          +      // Set the size to 200x200
          +      min: 200 200;
          +      max: 200 200;
          +      // Blue color
          +      color: 0 0 255 255;
          +   }
          +}
          +
          + +

          The position of the parts is defined in the rel1 and rel2 blocks, which define the upper-left corner and the lower-right corner of the part. The position can be defined in relation to other parts (with the relative property) as an offset (offset property). When using relative positioning, the to, to_x and to_y properties are used to define in relation to which part the positioning is done. If nothing else is specified, the positioning is in relation to the parent's part.

          + +

          To demonstrate relative positioning, the following example creates another rectangle part and positions it under the first part. The upper-left corner of the new part starts at the lower-left corner of the previous one.

          + +
          +part 
          +{ 
          +   name: "rectangle2";
          +   type: RECT;
          +   description 
          +   { 
          +      state: "green" 0.0;
          +      align: 0.0 0.0;
          +      // Set the size to 200 x 200
          +      min: 200 200;
          +      max: 200 200;
          +      // Green color
          +      color: 0 255 0 255;
          +      // Set the position
          +      // rel1 is relative to "rectangle"
          +      rel1 
          +      {
          +         relative: 0.0 1.0;
          +         to: "rectangle";
          +      }
          +      // rel2 is relative to the parent
          +      rel2 
          +      {
          +         relative: 1.0 1.0;
          +      }
          +   }
          +}
          +
          + + + + + + + + + + +
          Note
          The align property defines how the parts align themselves in the main window if their size is smaller than the main window. If nothing is specified, the parts are aligned in the center of the window.
          + +

          Adding an Offset to Relative Positioning

          + +

          The rel1 and rel2 blocks also support offset. The offset is a complement to the relative positioning: the corners are first placed according to their relative parameters, and then adjusted using the offsets.

          + +

          The following figure shows the pixel positions for a 4 x 4 rectangle. The indexes start in the top-left corner at (0, 0), and increase to the right and to the bottom. Since the indexes have started at 0, the 4th pixel has an index of 3. To create a 2 x 2 blue rectangle centered inside the green rectangle, the top-left corner must be (1, 1) and the bottom-right one (2, 2).

          + +

          Figure: Offset indexes

          +

          Offset indexes

          + +

          To determine the relative position of the blue rectangle, Edje needs the following definitions:

          +
            +
          • Part coordinates, depending on the size and position of the green rectangle
          • +
          • Relative component of the positions must be the same: the top-left corner of the green rectangle
          • +
          • Top-left pixel (1, 1) and bottom-right pixel (2, 2)
          • +
          + +

          The following code example shows the definitions:

          + +
          +name: "blue rectangle";
          +
          +rel1.to: "green rectangle";
          +rel1.relative: 0 0;
          +rel1.offset: 1 1;
          +
          +rel2.to: "green rectangle";
          +rel2.relative: 0 0;
          +rel2.offset: 2 2;
          +
          + +

          For most tasks, relative positioning is simpler than using offsets. Offsets are usually left for fine-tuning and creating borders.

          + +

          The following example is similar to the previous one but it uses relative positioning instead of offsets to achieve the same result for the 4 x 4 rectangle (though it can scale to larger sizes as well). The blue rectangle starts at 25% of the green rectangle (both vertically and horizontally) and ends at 75% of it (both vertically and horizontally). Like in the previous example, the blue rectangle is named and Edje is told what the object of reference is:

          + +
          +name: "blue rectangle";
          +rel1.to: "green rectangle";
          +rel2.to: "green rectangle";
          +
          + +

          The following figure shows how to refer to pixels using relative positioning when the offsets are (0, 0).

          + +

          Figure: Relative positioning

          +

          Relative positioning

          + +

          Note that in addressing the pixels, (0, 0) is addressed through relative: 0 0; offset 0 0; and each additional 0.25 in the relative field gives a 1-pixel move. With this, the pixel addressed through relative: 0.75 0.75; offset: 0 0; is at (3, 3) and not (2, 2).

          + +

          This addressing method comes from a design choice in Evas and Edje, favoring simplicity. In the examples shown in this guide, there are 4 pixels, and therefore when the [0; 1) range is divided in 4, the result is [0; 0.25), [0.25; 0.50), [0.50; 0.75), [0.75; 0.100). With Edje, the value used to refer to each segment is the left bound and therefore, 0.75 refers to [0.75; 0.100) (the bottom-right pixel of the green rectangle and not the 3/4th one).

          + +

          To refer to the previous pixel is to set the rel2 bound to relative: 0.75 0.75;, as expressed naturally, and offset: -1 -1;. This can also be understood as extending the rectangle up to 75% of its parent with the upper bound excluded (as shown in the [0.50; 0.75)).

          + +

          Since -1 -1 is the most common offset wanted for rel2, it is the default value as the default behavior is the most practical.

          + +

          Calculating the Edje Object Total Size

          + +

          When the EDC file is composed of several parts, Edje calculates the size of the global Edje object, by taking all the parts and their properties into account. The following properties have a role in this calculation and affect the global size:

          + +
            +
          • min and max: define the minimum and the maximum size of a part.
          • +
          • rel1 and rel2: specify the relative position of a part.
          • +
          • align: relates to the alignment of the part in the parent object.
          • +
          • fixed: defines if the part has a fixed size.
          • +
          + + + + + + + + + + +
          Note
          The fixed property can only be used on the TEXTBLOCK type parts. Setting this property to fixed: 1 1 does not take into account the part for the calculation of the global size.
          + +

          Using Edje Size Hints

          + +

          Any Evas_Object can have hints for the object to know how to properly position and resize. Edje uses these hints when swallowing an Evas_Object to a position and resizing it in the SWALLOW part of the EDC file.

          + +

          The size hints are not a size enforcement, they only tell the parent object the desired size for the child object. The parent tries to get as close as possible to the hint.

          + +

          Hints are set in an Evas_Object using the following evas_object_size_hint_*() functions:

          + +
            +
          • Minimum size hint + +

            Set the hint for the object's minimum size, given in pixels. In the following example, the horizontal and vertical minimum size hint of an Evas_Object is set to 0 pixels:

            + +
            +Evas_Object *object;
            +evas_object_size_hint_min_set(object, 0, 0);
            +
            +
          • + +
          • Maximum size hint + +

            Set the hint for the object's maximum size, given in pixels. In the following example, the horizontal and vertical maximum size hint of an Evas_Object is set to 200 pixels:

            +
            evas_object_size_hint_max_set(object, 200, 200);
            +
          • + +
          • Aspect size hint + +

            Set the hint for the object's aspect ratio. The available aspect size hints are:

            + +
              +
            • EVAS_ASPECT_CONTROL_NONE
            • +
            • EVAS_ASPECT_CONTROL_HORIZONTAL
            • +
            • EVAS_ASPECT_CONTROL_VERTICAL
            • +
            • EVAS_ASPECT_CONTROL_BOTH
            • +
            + +

            The other parameters are the aspect width and height ratio. These integers are used to calculate the proportions of the object. If the aspect ratio terms are null, the object's container ignores the aspect and scale of the object and occupies the whole available area.

            + +

            Figure: Aspect control

            +

            Aspect control

            + +

            Aspect control

            + +

            Aspect control

            + +

            The following example sets the aspect size hint to EVAS_ASPECT_CONTROL_BOTH with a width of 100 and a height of 200. So the aspect ratio must be 1/2.

            + +
            +evas_object_size_hint_aspect_set(object, EVAS_ASPECT_CONTROL_BOTH, 100, 200);
            +
            +
          • + +
          • Align size hint +

            Set the hint for the object's alignment. This hint is used when the object is smaller than its parent. The special EVAS_HINT_FILL parameter uses the maximum size hints with a higher priority, if they are set. Also, any padding hints set on objects are added up to the alignment space on the final scene composition.

            + +

            Figure: Alignment

            +

            Alignment

            + +

            In the following example, the special EVAS_HINT_FILL parameter is used:

            + +
            +evas_object_size_hint_align_set(object, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +
            +
          • + +
          • Weight size hint +

            Set the hint for the object's weight. The weight tells to a container object how the given child is resized. If the EVAS_HINT_EXPAND parameter is used, the child object's dimensions are expanded to fit the container's own.

            + +

            When several child objects have different weights in a container object, the container distributes the space it has to layout them by those factors. Most weighted children get larger in this process than the lighter ones.

            + +

            In the following example, the container is asked to expand the object in both directions:

            + +
            +evas_object_size_hint_weight_set(object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +
            +
          • + +
          • Padding size hint + +

            Set the hint for the object's padding space. Padding is extra space an object takes on each of its delimiting rectangle sides. The padding space is rendered transparent. Four hints can be defined for the left, right, top, and bottom padding.

            + +

            Figure: Padding

            +

            Padding

            + +

            In the following example, the padding hints are set to 5 pixels on each side of the object:

            + +
            +evas_object_size_hint_padding_set(object, 5, 5, 5, 5);
            +
            +
          • +
          + + +

          Creating an Edje Swallow

          + +

          The parent of all layout components is Edje. Edje, as detailed in the EDJE Data Collection Reference, is a library which converts EDC files into Evas objects. One of its main features is the possibility to create SWALLOW objects. When a SWALLOW object is added in Evas, it can contain any other Evas_Object.

          + +

          To create a swallow part:

          +
            +
          1. Create the EDC file. +

            The file describes a group named container, which contains a SWALLOW type part named part.swallow. The part is centered inside the parent (it is the default behavior) but there are 32 pixels free all around this part.

            +
            +collections
            +{
            +   group 
            +   { 
            +      name: "container";
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "part.swallow"
            +            type: SWALLOW;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1.offset: 31 31;
            +               rel2.offset: -32 -32;
            +            }
            +         }
            +      }
            +   }
            +}
            +
            + +

            Use the edje_cc tool to compile the EDC file into a binary .edj file:

            + +
            +edje_cc -o container.edj container.edc
            +
            +
          2. +
          3. Create an Edje object and load the file: + +
            +edje = edje_object_add(evas_object_evas_get(parent));
            +edje_object_file_set(edje, "container.edj", "container");
            +
            + + + + + + + + + + +
            Note
            The edje_object_add() function, as opposed to an elementary object, does not take an Evas_Object as a parent. You must give the function the Evas on which the object is added. As the parent is already added on the Evas by elementary, retrieve a reference to it by using the evas_object_evas_get() function.
            + + +

            Use the edje_object_file_set() function to set the Edje file from which the object is loaded. The object itself is the name of the group as defined in the EDC file. In this case it is container. +

            +
          4. +
          5. Use the edje_object_part_swallow() function to swallow any kind of Evas_Object inside it: + +
            +ic = elm_icon_add(parent);
            +elm_image_file_set(ic, "c1.png", NULL);
            +edje_object_part_swallow(edje, "part.swallow", ic);
            +
            + + + + + + + + + + +
            Note
            The elm_image_file_set() function parameters are linked to Edje. The second parameter in this example is a PNG file, but it can also be an Edje file. In that case, the third parameter must be the Edje group to load, exactly as previously shown with the edje_object_file_set() function.
            +
          6. +
          + +

          Using ELM Layouts

          + +

          A layout is a container component. For the basic use of the elm_layout component with a default style, see the Layout guide. The ELM layout takes a standard Edje design file and wraps it in a UI component. Layouts are the basis of graphical UI components used in Elementary.

          + +

          To create a layout:

          +
            +
          1. Create a new elementary layout using the elm_layout_add() function: + +
            +Evas_Object *layout;
            +layout = elm_layout_add(parent);
            +
            +
          2. + +
          3. For Edje swallows, load an Edje file: +
            1. Create an Edje file that contains a black rectangle and an icon in the center: + +
              +images
              +{
              +   image: "c1.png" COMP;
              +}
              +
              +collections
              +{
              +   group 
              +   { 
              +      name: "my_layout";
              +      parts 
              +      {
              +         part 
              +         {
              +            name: "background";
              +            type: RECT; description 
              +            { 
              +               state: "default" 0.0; color: 0 0 0 255; 
              +            } 
              +         } 
              +         part 
              +         { 
              +            name: "background"; 
              +            type: IMAGE; 
              +            description 
              +            { 
              +               state: "default" 0.0; 
              +               rel1.offset: 31 31; 
              +               rel2.offset: -32 -32; 
              +               default.image: "c1.png"; 
              +            } 
              +         }
              +      } 
              +   } 
              +}
              +
              +
            2. +
            3. Compile the file with the edje_cc -o edje_example.edj edje_example.edc command. +
            4. + +
            5. Load the file with the elm_layout_file_set() function: + +
              +elm_layout_file_set(layout, "edje_example.edj", "my_layout");
              +
              + +

              The layout component can contain as many parts and children as described in its theme file (EDC). Some of these children can have special types:

              + +
                +
              • SWALLOW (content holder): +

                Only one object can be added to a SWALLOW. The elm_layout_content_*() functions are used to manage the objects in a SWALLOW part. After being set to this part, the object's size, position, visibility, clipping, and other description properties are controlled by the description of the given part inside the Edje theme file.

              • +
              • BOX: +

                The BOX layout can be used through the elm_layout_box_*() functions. It is very similar to the elm_box component, but the BOX layout's behavior is completely controlled by the Edje theme.

              • +
              • TABLE: +

                The TABLE layout is like the BOX layout, but it is used through the elm_layout_table_*() functions.

              • +
              +
            6. +
          + +

          ELM can send Edje signals to the EDC part using the elm_layout_signal_emit() function. You can also use the elm_layout_signal_callback_add() function to receive signals.

          + +

          Use the following code to listen to any signals sent by the layout:

          + +
          +elm_layout_signal_callback_add(layout, "*", "*", _signal_cb, NULL);
          +
          +static void 
          +_signal_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
          +{
          +   printf("Info received from layout : %s %s\n", emission, source);
          +}
          +
          + +

          For more information on signals, see Managing Multiple Signal Emitters in Layouts.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_animation_n.htm b/org.tizen.ui.practices/html/native/efl/edje_animation_n.htm new file mode 100644 index 0000000..28c4beb --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_animation_n.htm @@ -0,0 +1,535 @@ + + + + + + + + + + + + + Edje Animations + + + + + +
          + +

          Edje Animations

          + +

          One of the greatest strengths of EFL and Edje is the ability to create animations. This tutorial demonstrates how Elm_Transit can create predefined animations, but you can also use the Edje library to create your own animations.

          + +

          The Edje animations are based on a very simple principle: going from one state to another. If you want to animate something with Edje, you must define two states and move from the first state to the second.

          + +

          Animating a Rectangle

          + +

          This example shows how to animate a rectangle. It is positioned in the top left corner of the window and is moved to the bottom right corner in five seconds. To do that with Edje, define a part called "rectangle" with the type RECT: this part has two descriptions (or states). In the first state, the rectangle is in is the top left corner. In the second state, it is in is the bottom right corner. To create the transition, set this EDC code for Edje to switch the object from its current state to another.

          + +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "rectangle";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               align: 0.0 0.0;
          +               rel1 {relative: 0.0 0.0;}
          +               rel2 {relative: 0.3 0.1;}
          +               color: 0 0 255 255;
          +            }
          +            description 
          +            { 
          +               state: "default" 0.5;
          +               align: 0.0 0.0;
          +               rel1 {relative: 0.7 0.9;}
          +               rel2 {relative: 1.0 1.0;}
          +               color: 0 0 255 255;
          +            }
          +         }
          +      }
          +      programs 
          +      {
          +         program 
          +         { 
          +            name: "animation,state1";
          +            source: "";
          +            signal: "load";
          +            action: STATE_SET "default" 0.5;
          +            target: "rectangle";
          +            transition: LINEAR 5;
          +         }
          +      }
          +   }
          +}
          +
          + +

          The "rectangle" part has two descriptions that share the same name, but have a different "version".

          + +
          +part 
          +{ 
          +   name: "rectangle";
          +   type: RECT;
          +   description 
          +   { 
          +      state: "default" 0.0;
          +   }
          +   description 
          +   { 
          +      state: "default" 0.5;
          +   }
          +}
          +
          + +

          The program defines when and how to move from one state to another. A program is called upon reception of a signal from a source. Here the program is called when the signal load is received from any source.

          + +
          +program 
          +{ 
          +   name: "animation,state1";
          +   source: "";
          +   signal: "load";
          +}
          +
          + +

          An action is performed upon the signal reception. In this example, the state is changed.

          + +
          +action: STATE_SET "default" 0.5;
          +
          + +

          The program has a target, here the "rectangle".

          + +
          +target: "rectangle";
          +
          + +

          The program uses a transition to perform the action.

          + +
          +transition: LINEAR 5;
          +
          + +

          This example produces a blue rectangle that moves from the upper left to the lower right corner with a linear transition in five seconds.

          + +

          Actions

          + +

          The Edje programs are not only for animations. There are different actions, for example STATE_SET and ACTION_STOP. You may also send signals with SIGNAL_EMIT.

          + +

          The STATE_SET action changes the state of the "target".

          + +

          In the following example, the state of the part named "image" changes to "default" "0.0".

          + +
          +program 
          +{
          +   name: "animate";
          +   signal: "animate";
          +   action: STATE_SET "default" 0.0;
          +   transition: LINEAR 3.0;
          +   target: "image";
          +}
          +
          + +

          The ACTION_STOP stops the program specified by "target".

          + +
          +program 
          +{
          +   name: "animate_stop";
          +   signal: "animate_stop";
          +   action: ACTION_STOP;
          +   target: "animate_loop";
          +}
          +
          + +

          The previous example stops the program defined as "target" named animate_loop. This program runs on the animate_stop signal.

          + +

          The SIGNAL_EMIT emits a signal that is used to communicate with the application directly from the theme.

          + +

          The following example emits a signal frame_move "start" when it receives the signal mouse,down,* from the video_over part. In other words, it sends the signal frame_move "start" when the mouse is pressed in the video_over part.

          + +
          +program 
          +{ 
          +   name: "video_move_start";
          +   signal: "mouse,down,*";
          +   source: "video_mover";
          +   action: SIGNAL_EMIT "frame_move" "start";
          +}
          +
          + +

          Transitions

          + +

          The transitions available are:

          +
            +
          • LIN or LINEAR: makes a linear transition and takes the duration in seconds as the parameter
          • +
          • SIN or SINUSOIDAL: makes a sinusoidal transition and takes the duration in seconds as the parameter
          • +
          • ACCEL or ACCELERATE: makes an accelerated transition and takes the duration in seconds as the parameter
          • +
          • DECEL or DECELERATE: makes a decelerated transition and takes the duration in seconds as the parameter
          • +
          • ACCEL_FAC or ACCELERATE_FACTOR: makes an accelerated transition and takes the duration and the factor as the parameters
          • +
          • DECEL_FAC or DECELERATE_FACTOR: makes a decelerated transition and takes the duration and the factor as the parameters
          • +
          • SIN_FAC or SINUSOIDAL_FACTOR: makes a sinusoidal transition and takes the duration and the factor as the parameters
          • +
          • DIVIS or DIVISOR_INTERP: takes 3 parameters: +
              +
            • the duration
            • +
            • the initial gradient start (0.0 is horizontal, 1.0 is diagonal (linear), 2.0 is twice the gradient of linear, and so on)
            • +
            • an integer factor that defines how much the value swings outside the gradient to come back to the final resting spot at the end. 0.0 for the third parameter is equivalent to linear interpolation. Note that DIVIS may exceed 1.0.
            • +
            +
          • +
          • BOUNCE: makes a bounce transition and takes 3 parameters: +
              +
            • the duration
            • +
            • how much the bounce decays, with 0.0 giving linear decay per bounce, and higher values giving more decay
            • +
            • the number of bounces (rounded down to the nearest integer value)
            • +
            +
          • +
          • SPRING: makes a spring transition and takes 3 parameters: +
              +
            • the duration
            • +
            • the decay, with the level exceeding 1.0 on the outer swings
            • +
            • the number of spring swings
            • +
            +
          • +
          + +

          There are graphical representations of these effects in the Ecore_Evas section above.

          + +

          Chaining Edje Programs

          + +

          To define a couple of Edje programs and chain them, we can, for example, create a program to make the rectangle return to its initial state with another transition (such as BOUNCE).

          + +

          Use the statement after in the first program. after takes the name of the transition to run when the program is done.

          + +
          +after: "animation,state0";
          +
          + +

          This is how to add the bounce animation. To return the blue rectangle to its initial position with a BOUNCE transition: it bounces with a factor of 1.8, six times. This program is only to be used at the end of the first one, so it does not have any signal statement.

          + +
          +program 
          +{ 
          +   name: "animation,state0";
          +   source: "";
          +   signal: "";
          +   action: STATE_SET "default" 0.0;
          +   target: "rectangle";
          +   transition: BOUNCE 5 1.8 6;
          +}
          +
          + +

          Playing on Signals

          + +

          The programs start when they receive a signal from a source. Edje handles many kind of signals, including mouse events.

          + + + + + + + + + + +
          Note
          To show the signals, use edje_player -p myfile.edj.
          + +

          For example, in another transition the rectangle is left clicked. The corresponding signal name is mouse,clicked,1.

          + +

          For this transition, define a new state. This state changes the color and the position of the rectangle.

          + +
          +// To be placed in the "part" definition
          +description 
          +{ 
          +   state: "color" 0.0;
          +   rel1 {relative: 0.3 0.3;}
          +   rel2 {relative: 0.7 0.4;}
          +   color: 255 0 0 255;
          +}
          +
          + +

          The program is as follows:

          + +
          +program 
          +{ 
          +   name: "animation,color";
          +   source: "rectangle";
          +   signal: "mouse,clicked,1";
          +   action: STATE_SET "color" 0.0;
          +   target: "rectangle";
          +   transition: SIN 2;
          +}
          +
          + +

          This starts when the rectangle is left clicked.

          + +

          If you want to send a signal from your application when you use signals to start transitions, create a program waiting for your own special signal. For example:

          + +
          +program 
          +{ 
          +   name: "animation,menu_side,hide";
          +   source: "MenuButton";
          +   signal: "hide,sidemenu";
          +   action: STATE_SET "default" 1.0;
          +   target: "menu/side";
          +   transition: LINEAR 0.2;
          +}
          +
          + +

          This program changes the state of the target named animation,menu_side,hide to "default" 1.0. It waits for the hide,sidemenu signal emitted by a source called MenuButton.

          + +
          +edje_object_signal_emit(layout, "hide,sidemenu", "MenuButton");
          +
          + +

          This statement sends a signal named hide,sidemenu with a source named MenuButton to the object called layout.

          + +

          The edje_object_signal_emit function emits a signal on an Evas_Object part of the application.

          + +
          +edje_object_signal_emit(Evas_Object *obj,
          +                        const char *emission,
          +                        const char *source)
          +
          + +
            +
          • The first parameter is the Evas_Object, which emits the signal (layout in the example).
          • +
          • The second parameter is the emission string (the name of the signal hide,sidemenu in the example).
          • +
          • The third parameter is the source of the signal (the name of the source, MenuButton in the example).
          • +
          + +

          If you use the Elementary in the application, you can use elm_object_signal_emit. It functions exactly the same way as edje_object_signal_emit and takes the same parameters.

          + + + + + + + + + + +
          Note
          To find a complete example, use elm_object_signal_emit in Creating Mobile Menus.
          + +

          Rotating with Edje

          + +

          The Edje library allows you to rotate objects, using the map statement. For example, if you want to rotate the blue rectangle on a right click, you must define a new rotate state. To enable the map on you object you must add a map part to your default state.

          + +
          +map 
          +{
          +   on: 1;
          +   smooth: 1;
          +   perspective_on: 1;
          +   rotation.x: 0;
          +   rotation.y: 0;
          +   rotation.z: 0;
          +}
          +
          + +
            +
          • on: 1; enables the map on the object
          • +
          • perspective_on: 1, enables the perspective when rotating, even without a perspective point object
          • +
          • smooth: 1; enables a smooth map rendering
          • +
          • The rotation statements define the default rotation of the object on x, y, and z axes.
          • +
          + +

          To add a new rotate state with a rotation around any axis, do the following.

          + +
          +description 
          +{ 
          +   state: "rotate" 0.0;
          +   inherit: "default" 0.0;
          +   map.rotation.z: 120;
          +}
          +
          + +

          This rotate state inherits all the default state properties, but changes the value of map.rotation.z from 0° to 120°.

          + +

          To set a program to run the rotate state, do the following.

          + +
          +program 
          +{ 
          +   name: "animation,rotate";
          +   source: "rectangle";
          +   signal: "mouse,clicked,3";
          +   action: STATE_SET "rotate" 0.0;
          +   target: "rectangle";
          +   transition: LIN 5;
          +}
          +
          + +

          This program runs on a right click on the rectangle object.

          + +

          The complete code of this example is as follows.

          + +
          +collections 
          +{
          +   group 
          +   { 
          +      name: "main";
          +      parts 
          +      {
          +         part 
          +         { 
          +            name: "rectangle";
          +            type: RECT;
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               align: 0.0 0.0;
          +               rel1 {relative: 0.0 0.0;}
          +               rel2 {relative: 0.3 0.1;}
          +               map 
          +               {
          +                  on: 1;
          +                  smooth: 1;
          +                  perspective_on: 1;
          +                  rotation 
          +                  {
          +                     z: 0;
          +                     x: 0;
          +                     y: 0;
          +                  }
          +               }
          +               color: 0 0 255 255;
          +            }
          +            description 
          +            { 
          +               state: "default" 0.5;
          +               align: 0.0 0.0;
          +               rel1 {relative: 0.7 0.9;}
          +               rel2 {relative: 1.0 1.0;}
          +               color: 0 0 255 255;
          +            }
          +            description 
          +            { 
          +               state: "color" 0.0;
          +               rel1 {relative: 0.3 0.3;}
          +               rel2 {relative: 0.7 0.4;}
          +               color: 255 0 0 255;
          +            }
          +            description 
          +            { 
          +               state: "rotate" 0.0;
          +               inherit: "default" 0.0;
          +               map.rotation.z: 120;
          +            }
          +         }
          +      }
          +      programs 
          +      {
          +         program 
          +         { 
          +            name: "animation,state1";
          +            source: "";
          +            signal: "load";
          +            action: STATE_SET "default" 0.5;
          +            target: "rectangle";
          +            transition: LINEAR 1;
          +            after: "animation,state0";
          +         }
          +         program 
          +         { 
          +            name: "animation,state0";
          +            source: "";
          +            signal: "";
          +            action: STATE_SET "default" 0.0;
          +            target: "rectangle";
          +            transition: BOUNCE 2 1.8 26;
          +         }
          +         program 
          +         { 
          +            name: "animation,color";
          +            source: "rectangle";
          +            signal: "mouse,clicked,1";
          +            action: STATE_SET "color" 0.0;
          +            target: "rectangle";
          +            transition: SIN 2;
          +         }
          +         program 
          +         { 
          +            name: "animation,rotate";
          +            source: "rectangle";
          +            signal: "mouse,clicked,3";
          +            action: STATE_SET "rotate" 0.0;
          +            target: "rectangle";
          +            transition: LIN 5;
          +         }
          +      }
          +   }
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_animation_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/edje_animation_tutorial_n.htm new file mode 100644 index 0000000..76b99cc --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_animation_tutorial_n.htm @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + Creating Edje Animations + + + + + + +
          +

          Creating Edje Animations

          + + +

          One of the greatest strengths of EFL and Edje is the ability to create animations. This tutorial demonstrates how Elm_Transit can create predefined animations, but you can also use the Edje library to create your own animations.

          + +

          Animating on Application Start-up

          + + +

          The goal of this tutorial is to create, in an EDC (Edje Data Collection) file, an animation target and buttons to start animations.

          +

          To create an animation on the application start-up:

          +
            +
          1. +

            Create an application using the Basic EDC UI Application template.

            +

            By default, the Basic EDC UI Application model produces an empty window with a title. In this example, a Tizen logo is added to the window and the behavior of the window title is changed.

            +

            The images used by the Edje file are stored in the edje/images directory of the application. Copy the Tizen logo available in shared/res/<yourapplicationname>.png into the edje/images Edje image directory, and add the image to the Edje images block:

            +
            +images 
            +{
            +   image: "edceffects.png" COMP;
            +   image: "tizen-logo.png" COMP;
            +}
            +
            +
          2. +
          3. +

            Add an Edje part block using the small logo.

            + +

            The logo part has the IMAGE type and 2 states. The state describes the appearance of a part, such as its size, position, and color.

            +

            The default state definition is in the first description block of the part:

            +
              +
            • Maximum and minimum sizes in the min and max properties
            • +
            • Image to use in this part
            • +
            • Default position
            • +
            +

            The second state, down-state, inherits all of the default state properties, and only changes the position to put the image at the bottom of the application window.

            +

            These 2 states are the start and end states of the animation.

            +
            +// Image using the Tizen logo
            +part 
            +{ 
            +   name: "logo";
            +   type: IMAGE;
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      max: 63 63;
            +      min: 63 63;
            +      image { normal: "small-logo.png"; }
            +      rel1.relative: 0.1 0.0;
            +      rel2.relative: 0.0 0.0;
            +   }
            +
            +   description 
            +   { 
            +      state: "down-state" 1.0;
            +      inherit: "default" 0.0;
            +      rel1.relative: 0.1 0.92;
            +      rel2.relative: 0.05 1.0;
            +   }
            +}
            +
            +
          4. +
          5. +

            Add a program block to the Edje programs block to create the animation.

            +

            This program is named animation,state1 and is started when the application receives the load signal immediately on startup. It runs the STATE_SET action and changes the object state from default to down-state. The target of the program is the logo part.

            +

            To switch from one state to another, the program uses a transition property of the BOUNCE type with 3 parameters, the bounce_decay, the number_of_bounces, and the duration which is set to 5 seconds. This produces a falling and bouncing effect.

            +
            +// Icon drop animation
            +program 
            +{ 
            +   name: "animation,state1";
            +   source: "";
            +   signal: "load";
            +   action: STATE_SET "down-state" 1.0;
            +   target: "logo";
            +   transition: BOUNCE 2.5 0.0 5.0;
            +}
            +
            +
          6. +
          7. +

            Add an animation for the window title to make it move from left to right with a bounce effect while growing the font size.

            +

            Create a new part block called "txt_title", with 2 states that change the font size and position of the window title.

            +
            +part 
            +{ 
            +   name: "txt_title";
            +   type: TEXT;
            +   mouse_events: 0;
            +
            +   // default state
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      align: 0.0 0.0;
            +      rel1 { relative: 0.0 0.0; }
            +      rel2 { relative: 0.0 0.0; }
            +      text 
            +      { 
            +         font: "Tizen:style=regular";
            +         size: 24;
            +         min: 1 1;
            +      }
            +      color: 0 0 0 255;
            +   }
            +
            +   // Bigger state
            +   description 
            +   { 
            +      state: "Bigger" 0.0;
            +      align: 0.0 0.0;
            +      rel1 { relative: 0.75 0.0; }
            +      rel2 { relative: 0.0 0.0; }
            +      text 
            +      { 
            +         font: "Tizen:style=regular";
            +         size: 28;
            +         min: 1 1;
            +      }
            +      color: 0 0 0 255;
            +   }
            +}
            +
            +
          8. +
          9. +

            Create a program block to animate the "txt_title" part on start-up, just like the small Tizen logo.

            +
            +// Make the title bigger
            +program 
            +{ 
            +   name: "animation,bigtitle";
            +   source: "";
            +   signal: "load";
            +   action: STATE_SET "Bigger" 1.0;
            +   target: "txt_title";
            +   transition: LINEAR 5.0;
            +}
            +
            +

            This program goes from the start to the end state in 5 seconds with a LINEAR effect. It automatically runs on the application start-up.

            +
          10. +
          + + +

          Animating Objects on Click

          + +

          The animations in the previous use case are automatic and require no user interaction. This use case takes advantage of user actions, by animating a part when another part is clicked, and by making the title restore its default aspect when the small logo is clicked.

          + +

          To animate an object based on a click:

          +
            +
          1. To animate the title: +

            Use the parts and states already defined in step 2 of the previous use case. After the start-up animation, the application goes back to the default state, and there is no need to add any parts or states. You only need to add a program block that makes the transition when the user clicks the logo part.

            + +

            The program starts when the application receives the mouse,clicked,* signal (any mouse button is clicked) from the logo part (source). It performs the STATE_SET action and sets the default state on the target (txt_file part) with a LINEAR transition.

            +
            +// Make the title go back to normal
            +program 
            +{
            +   name: "animation,normaltitle";
            +   source: "logo";
            +   signal: "mouse,clicked,*";
            +   action: STATE_SET "default" 1.0;
            +   target: "txt_title";
            +   transition: LINEAR 0.5;
            +}
            +
            +

            When clicking any mouse button on the small logo, the title goes back to its original state.

            +
          2. +
          3. +

            Create the rotate part.

            +

            It is possible to create a button with Edje from scratch, but to save time, the SWALLOW part is used in this example to store the Elementary UI components.

            +

            This part is called btn/rotate, and it only has a SWALLOW type and a default state with its position being on the bottom left of the screen.

            +
            +// Container for the rotate button
            +part 
            +{
            +   type: SWALLOW;
            +   name: "btn/rotate";
            +   description 
            +   {
            +      state: "default" 0.0;
            +      rel1.relative: 0.10 0.80;
            +      rel2.relative: 0.30 0.90;
            +   }
            +}
            +
            +
          4. +
          5. +

            Create the grow part.

            +

            This second SWALLOW part is very similar to the first one. It is placed relatively to btn/rotate part and it is to remain next to it.

            +
            +// Container for the grow button
            +part 
            +{
            +   type: SWALLOW;
            +   name: "btn/grow";
            +   description 
            +   {
            +      state: "default" 0.0;
            +      rel1.relative: 1.02 0;
            +      rel1.to: "btn/rotate";
            +      rel2.relative: 2.02 1;
            +      rel2.to: "btn/rotate";
            +   }
            +}
            +
            +
          6. +
          7. +

            Create the actual UI components in the .c file. The code is added to the create_base_ui() function.

            +

            In the default Basic EDC UI Application, the Edje layout is loaded by default. Create 2 Elementary buttons and add them to the SWALLOW containers, without having to set up sizes or positions as this is done in the SWALLOW container.

            +

            Note that the part name is very important, because it is used to merge the Elementary UI component and the SWALLOW part.

            +
            +// Create a button in the app window
            +ad->button = elm_button_add(ad->win);
            +elm_object_text_set(ad->button, "Rotate");
            +// Add the button to the edje layout container called "btn/rotate"
            +elm_object_part_content_set(ad->layout, "btn/rotate", ad->button);
            +evas_object_show(ad->button);
            +
            +// Create up button in the app window
            +ad->btn_up = elm_button_add(ad->win);
            +// Add the button to the edje layout container called "btn/grow"
            +elm_object_text_set(ad->btn_up, "Grow");
            +elm_object_part_content_set(ad->layout, "btn/grow", ad->btn_up);
            +evas_object_show(ad->btn_up);
            +
            +
          8. +
          9. +

            Create the animation target in the EDC file.

            +

            The following example shows the part initialization and the default state.

            +
            +// Animation target
            +part 
            +{
            +   name: "atarget";
            +   type: IMAGE;
            +
            +   // Default state
            +   description 
            +   {
            +      state: "default" 0.0;
            +      image { normal: "tizen-logo.png"; }
            +      color: 255 0 0 255; // Red
            +      rel1 { relative: 0.3 0.3; }
            +      rel2 { relative: 0.7 0.4; }
            +   }
            +}
            +
            +

            This part is an image displaying a big Tizen logo, placed on the top of the screen more or less centered.

            +
          10. +
          11. +

            Create a state to change the color and add the map block.

            +

            This part changes the color to green and defines the map. This statement makes rotations possible on an Edje part. Rotations are done around the X, Y, or Z axes. In this example, the map is enabled and a 0° rotation is applied around each axis.

            +
            +// rotate state
            +description 
            +{
            +   state: "rotate" 0.0;
            +   inherit: "default" 0.0;
            +
            +   map 
            +   {
            +      // Enable map on the part
            +      on: 1;
            +      // Enable smooth rendering
            +      smooth: 1;
            +      // Enable perspective
            +      perspective_on: 1;
            +
            +      // Apply rotations on the part
            +      rotation.x: 0;
            +      rotation.y: 0;
            +      rotation.z: 0;
            +   }
            +   color: 0 255 0 255; // Green
            +}
            +
            +
          12. +
          13. +

            Add a state with a rotation around the Z axis of 360°.

            +

            This state inherits from the default state properties and adds a rotation around the Z axis.

            +
            +description 
            +{
            +   state: "rotate" 1.0;
            +   inherit: "rotate" 0.0;
            +   map.rotation.z: 360;
            +}
            +
            +
          14. +
          15. +

            Add a state to the other button for the grow animation. Change the size of the animation target and add an offset.

            +
            +// grow state
            +description 
            +{
            +   state: "grow" 0.0;
            +   color: 0 0 255 255; // Blue
            +   rel1 
            +   {
            +      relative: 0.2 0.2;
            +      offset: 0.3 0.3;
            +   }
            +   rel2 
            +   {
            +      relative: 0.7 0.4;
            +      offset: 0.3 0.3;
            +   }
            +}
            +
            +
          16. +
          17. +

            Create the programs to make all these states animate.

            +

            To make the rotation animation smoother, create and chain several program blocks with different durations.

            +
              + +
            1. Create the main program.

              +

              The main program goes from the default state to the rotate 0.0 state in 0.2 seconds.

              +

              Note that the states are all named the same way (rotate) but not with the same version. The version allows you to have more than one state with the same name, in fact, the actual name of the state is the name plus the version.

              +

              The program starts when the btn/rotate part is clicked with any mouse button.

              +
              +// Change the color of the target to green
              +program 
              +{
              +   name: "rotate,target";
              +   source: "btn/rotate";
              +   signal: "mouse,clicked,*";
              +   action: STATE_SET "rotate" 0.0;
              +   target: "atarget";
              +   transition: SIN 0.2;
              +   after: "rotate,target,2";
              +}
              +
              + +
            2. +
            3. +

              Create the 2nd program.

              +

              When the main program animation ends, it calls the next program called rotate,target,2. This program sets the part state to rotate 1.0 in 0.7 seconds.

              +
              +// Rotate 360°
              +program 
              +{
              +   name: "rotate,target,2";
              +   action: STATE_SET "rotate" 1.0;
              +   target: "atarget";
              +   transition: SIN 0.7;
              +   after: "rotate,end";
              +}
              +
              +
            4. +
            5. +

              Create the 3rd program.

              +

              When the 2nd program animation ends, it calls the next program called rotate,end. It is the last program of the rotation effect, and it sets the state to rotate 0.0 very fast.

              +
              +// Go back to the normal
              +program 
              +{
              +   name: "rotate,end";
              +   action: STATE_SET "rotate" 0.0;
              +   target: "atarget";
              +   transition: LINEAR 0.2;
              +}
              +
              +
            6. +
            7. +

              Create the last program, which is the grow effect that switches from one state to another.

              +

              The program starts when the btn/grow part is clicked, and it goes from the current state to grow 1.0 in one second. In this program, both size and color change during the transition. At the end, it calls the go,default program.

              +
              +// Grow the target and go back to normal state
              +program 
              +{
              +   name: "grow,target";
              +   source: "btn/grow";
              +   signal: "mouse,clicked,*";
              +   action: STATE_SET "grow" 1.0;
              +   after: "go,default";
              +   target: "atarget";
              +   transition: SINUSOIDAL 1.0;
              +}
              +
              +
            8. +
            9. +

              Return to the default state.

              +

              The go,default program sets the state back to default for the animation target.

              +
              +// Go back to normal (default) state
              +program 
              +{
              +   name: "go,default";
              +   action: STATE_SET "default" 1.0;
              +   target: "atarget";
              +   transition: SIN 1.0;
              +}
              +
              +
            10. +
            +
          18. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/edje_color_n.htm b/org.tizen.ui.practices/html/native/efl/edje_color_n.htm new file mode 100644 index 0000000..2010a5e --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_color_n.htm @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + Using Edje Color Classes + + + + + + +
          +

          Using Edje Color Classes

          + +

          This tutorial demonstrates how you can change the color of 2 or more parts using Edje color classes.

          +

          If a part is assigned with a color class, setting color values to this class causes all those parts to have their colors multiplied by the values. Setting the values to a color class affects all parts within that color class at process level, while at object level, it only affects the parts inside a specified object.

          + +

          Create a simple application with a menu and separate screens for each Edje Animation function:

          + +
            +
          1. In the Tizen IDE, go to Tizen Native project > UI application > EDC and create a new project named colorclass.
          2. + +
          3. Open the colorclass.edc file and replace it with the following code: +
            color_classes 
            +{
            +   color_class 
            +   {
            +      name: "A";
            +      color: 255 255 0 255;
            +      color2: 255 0 0 255;
            +      color3: 0 0 255 255;
            +   }
            +   color_class 
            +   {
            +      name: "B";
            +      color: 0 255 0 255;
            +      color2: 0 0 255 255;
            +      color3: 255 0 0 255;
            +   }
            +   color_class 
            +   {
            +      name: "C";
            +      color: 125 0 0 255;
            +      color2: 255 0 0 255;
            +      color3: 0 0 255 255;
            +   }
            +}
            +
            +collections 
            +{
            +   group 
            +   { 
            +      name: "main";
            +      parts 
            +      {
            +         part 
            +         { 
            +            name: "bg";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "textA";
            +            type: TEXT;
            +            effect: OUTLINE_SHADOW;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "A";
            +               rel1.relative: 0.0 0.0;
            +               rel2.relative: 0.2 0.2;
            +               color2: 255 255 255 255;
            +               color3: 255 255 255 255;
            +               text 
            +               {
            +                  text: "A:";
            +                  size: 44;
            +               }
            +            }
            +         }
            +         part 
            +         { 
            +            name: "textB";
            +            type: TEXT;
            +            effect: OUTLINE_SHADOW;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "B";
            +               rel1.relative: 0.0 0.2;
            +               rel2.relative: 0.2 0.4;
            +               color2: 255 255 255 255;
            +               color3: 255 255 255 255;
            +               text 
            +               {
            +                  text: "B:";
            +                  size: 44;
            +               }
            +            }
            +         }
            +         part 
            +         { 
            +            name: "textC";
            +            type: TEXT;
            +            effect: OUTLINE_SHADOW;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "C";
            +               rel1.relative: 0.0 0.4;
            +               rel2.relative: 0.2 0.6;
            +               color2: 255 255 255 255;
            +               color3: 255 255 255 255;
            +               text 
            +               {
            +                  text: "C:";
            +                  size: 44;
            +               }
            +            }
            +         }
            +         part 
            +         { 
            +            name: "rect1";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "A";
            +               rel1.relative: 0.2 0.0;
            +               rel2.relative: 0.4 0.2;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "rect2";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "B";
            +               rel1.relative: 0.4 0.2;
            +               rel2.relative: 0.6 0.4;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "rect3";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "A";
            +               rel1.relative: 0.6 0.0;
            +               rel2.relative: 0.8 0.2;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "rect4";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color_class: "B";
            +               rel1.relative: 0.8 0.2;
            +               rel2.relative: 1.0 0.4;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "rect5";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color: 125 0 0 255;
            +               color_class: "C";
            +               rel1.relative: 0.6 0.4;
            +               rel2.relative: 0.8 0.6;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "rect6";
            +            type: RECT;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               color: 255 255 255 255;
            +               color_class: "C";
            +               rel1.relative: 0.8 0.4;
            +               rel2.relative: 1.0 0.6;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "swallow.btn1";
            +            type: SWALLOW;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               rel1.relative: 0.0 0.8;
            +               rel2.relative: 0.45 1.0;
            +            }
            +         }
            +         part 
            +         { 
            +            name: "swallow.btn2";
            +            type: SWALLOW;
            +            description 
            +            { 
            +               state: "default" 0.0;
            +               rel1.relative: 0.55 0.8;
            +               rel2.relative: 1.0 1.0;
            +            }
            +         }
            +      }
            +   }
            +}
            + +

            Setting the color class of a part causes its colors to be multiplied by color_class color values. To see how the color class affects the shadow and outline colors, set those colors as white in the part:

            + +
            color2: 255 255 255 255;
            +color3: 255 255 255 255;
            + +

            Parts with color_class "C" have different colors because their base colors are different.

            +
          4. + +
          5. Replace the create_base_gui() function with the following code: + +
            static void
            +btn1_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   edje_color_class_set("A", rand()%255, rand()%255, rand()%255, 255,
            +                        rand()%255, rand()%255, rand()%255, 255,
            +                        rand()%255, rand()%255, rand()%255, 255);
            +}
            +static void
            +btn2_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   edje_color_class_set("B", rand()%255, rand()%255, rand()%255, 255,
            +                        rand()%255, rand()%255, rand()%255, 255,
            +                        rand()%255, rand()%255, rand()%255, 255);
            +}
            +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   char edj_path[PATH_MAX] = {0, };
            +
            +   // Window
            +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +   elm_win_conformant_set(ad->win, EINA_TRUE);
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   if (elm_win_wm_rotation_supported_get(ad->win)) 
            +   {
            +      int rots[4] = { 0, 90, 180, 270 };
            +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            +   }
            +
            +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            +
            +   // Conformant
            +   ad->conform = elm_conformant_add(ad->win);
            +   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            +   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(ad->win, ad->conform);
            +   evas_object_show(ad->conform);
            +
            +   // Base layout
            +   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +   ad->layout = elm_layout_add(ad->win);
            +   elm_layout_file_set(ad->layout, edj_path, GRP_MAIN);
            +   evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);
            +   elm_object_content_set(ad->conform, ad->layout);
            +
            +   // Buttons
            +   ad->btn1 = elm_button_add(ad->win);
            +   elm_object_part_content_set(ad->layout, "swallow.btn1", ad->btn1);
            +   evas_object_smart_callback_add(ad->btn1, "clicked", btn1_cb, ad);
            +   elm_object_part_text_set(ad->btn1, NULL, "Change A");
            +   ad->btn2 = elm_button_add(ad->win);
            +   elm_object_part_content_set(ad->layout, "swallow.btn2", ad->btn2);
            +   evas_object_smart_callback_add(ad->btn2, "clicked", btn2_cb, ad);
            +   elm_object_part_text_set(ad->btn2, NULL, "Change B");
            +
            +   // Show the window
            +   evas_object_show(ad->win);
            +}
            + +

            Pressing the Change A button changes all colors of all parts with color_class set as "A" but does not affect other parts. The actual color, color2, and color3 values remain unchanged but they are multiplied by values from the color class.

            +

            You can omit the color class declaration in the .edc file and still use it in parts. There are no visual effects unless you change the color class in the code. For example, you can comment out the color class "B" and see what happens when you press the Change B button.

            +
          6. + +

            Figure: Edje colorclass application

            +

            Edje colorclass application

            + +
          + + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/edje_files_n.htm b/org.tizen.ui.practices/html/native/efl/edje_files_n.htm new file mode 100644 index 0000000..6754ab6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_files_n.htm @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + Handling Edje Files + + + + + + +
          +

          Handling Edje Files

          + +

          This tutorial demonstrates how you can manage EDJ files. An EDJ file is a specific eet file that collects layouts. The Edje layout is called Style and created using the EDC language. The file that contains the layout collection called Theme.

          + +

          Initializing the Application

          + +

          The following example shows a typical Elementary application that creates a window entitled Genlist Basic Tutorial. It is consisted of a conformant widget that contains a naviframe widget. The genlist goes inside the naviframe.

          + +
          static void
          +create_base_gui(appdata_s *ad)
          +{
          +   char edj_path[PATH_MAX] = {0, };
          +
          +   // Window
          +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          +   elm_win_conformant_set(ad->win, EINA_TRUE);
          +   elm_win_autodel_set(ad->win, EINA_TRUE);
          +
          +   if (elm_win_wm_rotation_supported_get(ad->win)) 
          +   {
          +      int rots[4] = {0, 90, 180, 270};
          +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          +   }
          +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, ad);
          +
          +   // Conformant
          +   ad->conform = elm_conformant_add(ad->win);
          +   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
          +   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
          +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   elm_win_resize_object_add(ad->win, ad->conform);
          +   evas_object_show(ad->conform);
          +
          +   // Naviframe
          +   ad->navifr = elm_naviframe_add(ad->win);
          +   elm_object_content_set(ad->conform, ad->navifr);
          +   eext_object_event_callback_add(ad->navifr, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, ad);
          +
          +   // Genlist
          +   ad->itc = elm_genlist_item_class_new();
          +   ad->itc->func.text_get =_genlist_item_text_get;
          +
          +   ad->genlist = elm_genlist_add(ad->win);
          +   evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   elm_naviframe_item_simple_push(ad->navifr, ad->genlist);
          +
          +   // Show window after base GUI is set up
          +   evas_object_show(ad->win);
          +}
          +
          +static bool
          +app_create(void *data)
          +{
          +   // Initialize UI resources and application data
          +   // If this function returns true, the main loop of application starts
          +   // If this function returns false, the application is terminated
          +   appdata_s *ad = data;
          +
          +   create_base_gui(ad);
          +
          +   return true;
          +}
          + +

          Declare the struct appdata:

          + +
          typedef struct appdata
          +{
          +   Evas_Object *win;
          +   Evas_Object *conform;
          +   Evas_Object *navifr;
          +   Evas_Object *genlist;
          +   Eina_List *list;
          +   Elm_Genlist_Item_Class *itc;
          +} 
          +appdata_s;
          + +

          Loading the Collection List from an EDJ File

          + +

          Edje provides the functionality to manipulate the EDJ files. First, get the list of styles from EDJ file:

          + +
          // Get the collection list from the EDJ file
          +app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
          +ad->list = edje_file_collection_list(edj_path);
          + +

          When you do not use the collection list, delete it:

          + +
          static void
          +win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
          +{
          +   appdata_s *ad = data;
          +   // Free the collection list
          +   edje_file_collection_list_free(ad->list);
          +   ui_app_exit();
          +}
          + + + + + + + + + + +
          Note
          The list returned after using the edje_file_collection_list() function must only be deleted using the edje_file_collection_list_free() function.
          + +

          Add the item in the genlist to display the list:

          + +
          EINA_LIST_FOREACH(ad->list, l, str)
          +{
          +   elm_genlist_item_append(ad->genlist, ad->itc, str, NULL, ELM_GENLIST_ITEM_NONE, _genlist_clicked, ad);
          +}
          + + +

          Creating an Edje Object

          + +

          Implement callbacks for the clicked (tapped) event. Check that the required style exists using the edje_file_group_exists() function. The first argument is the path to EDJ file and style name. Create the Edje object and load the given style.

          + +
          static void
          +_genlist_clicked(void *data, Evas_Object *obj, void *event_info)
          +{
          +   appdata_s *ad = data;
          +   Elm_Object_Item *eoi = NULL;
          +   const char *str;
          +   char edj_path[PATH_MAX] = {0, };
          +   Evas_Object *edje_object;
          +
          +   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
          +   eoi = elm_genlist_selected_item_get(obj);
          +
          +   str = elm_object_item_part_text_get(eoi, "elm.text");
          +   // Check whether a group matching glob exists in an edje file
          +   // If there is no matching group
          +   if (!edje_file_group_exists(edj_path, str)) return;
          +
          +   // Load the given style to the object
          +   edje_object = edje_object_add(evas_object_evas_get(ad->win));
          +   edje_object_file_set(edje_object, edj_path, str);
          +   // Check object loading errors
          +   if (edje_object_load_error_get(edje_object) != EDJE_LOAD_ERROR_NONE)
          +   {
          +      evas_object_del(edje_object);
          +
          +      return;
          +   }
          +   evas_object_size_hint_weight_set(edje_object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   elm_naviframe_item_simple_push(ad->navifr, edje_object);
          +}
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/edje_intro_n.htm b/org.tizen.ui.practices/html/native/efl/edje_intro_n.htm new file mode 100644 index 0000000..1582d13 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_intro_n.htm @@ -0,0 +1,305 @@ + + + + + + + + + + + + + Introduction to EDC Programming + + + + + +
          + +

          Introduction to EDC Programming

          + + +

          An EDC (Edje data collection) file is a text file that contains the code describing the position, size, and other parameters of graphical elements that compose the visual aspect of your application. In addition to graphical elements, it can also handle sounds. EDC is a description language where the objects of an interface are described by using a text description.

          + +

          The EDC file has the .edc file extension. The syntax for the EDC files follows a simple structure of blocks that can contain properties and more blocks. For more information on the blocks and their content, see the extensive language references included in the EDC Reference documentation.

          + + +

          Writing a Simple EDC File

          + +

          The following example shows the basic structure of an EDC file:

          + +
          +collections 
          +{
          +   group 
          +   {
          +      name: "my_group";
          +      parts {}
          +      programs {}
          +   }
          +}
          +
          + +

          An EDC file is a collection of groups that contain parts and programs:

          + +
          • A group can define the content of the entire screen of your application, or some smaller section of it. The group is identified with a name.
          • + +
          • The parts within the group correspond to the graphical elements on the screen. Each part can have several states that describe a specific position, size, and visual aspect of the element.
          • +
          • The programs within the group contain the program code related to the graphical elements, such as interaction with the main application through signals. Animations are also defined within a program (for example, changing a part state using an animated transition).
          • +
          + +

          The state of the part is defined in the description field:

          + +
          +part
          +{
          +   description 
          +   { 
          +      state: "default" 0.0;
          +   }
          +   description 
          +   { 
          +      state: "state1" 0.0;
          +   }
          +   description 
          +   { 
          +      state: "state2" 0.0;
          +   }
          +}
          +
          + +

          The following example shows an EDC file that contains only 1 part and 1 program. The part is a rectangle with a blue state and a red state, and the program changes the state from blue to red when the user clicks the rectangle:

          + +
          +collections 
          +{
          +   group 
          +   {
          +      name: "example";
          +      parts 
          +      {
          +         // Create the part
          +         part 
          +         { 
          +            name: "rectangle";
          +            // Set the type to RECT (rectangle)
          +            type: RECT;
          +            // Default state (blue color)
          +            description 
          +            { 
          +               state: "default" 0.0;
          +               align: 0.0 0.0;
          +               // Blue color
          +               color: 0 0 255 255;
          +            }
          +            // Second state (red color)
          +            description 
          +            { 
          +               state: "red" 0.0;
          +               align: 0.0 0.0;
          +               // Red color
          +               color: 255 0 0 255;
          +            }
          +         }
          +      }
          +      programs 
          +      {
          +         // Create a program
          +         program 
          +         { 
          +            name: "change_color";
          +            // The program is triggered on a mouse click
          +            signal: "mouse,clicked,*";
          +            source: "*";
          +            // Set the red state of the "rectangle" part
          +            action: STATE_SET "red" 0.0;
          +            target: "rectangle";
          +         }
          +      }
          +   }
          +}
          +
          + +

          The program is triggered when a signal arrives from a specific source (in the above example, all the sources are taken into account). When launched, the program does the action (changing the part state) on the target (the rectangle).

          + +

          Compiling the EDC File

          + +

          An EDC file needs to be compiled into a .edj file using the Edje library tools. After compiling, the .edj file can be used by a native Tizen application.

          + +

          The following example shows how to compile the helloworld.edc file to create a helloworld.edj file using the edje_cc tool:

          + +
          +$ edje_cc helloworld.edc
          +
          + +

          The EDC file can use external files, such as sounds, images, or fonts. The path to these resources is passed to the edje_cc tool so that they are included in the final .edj file:

          + +
          +$ edje_cc -sd $SOUNDS_DIR -fd $FONTS_DIR -id $IMAGES_DIR
          +
          + +

          The SOUNDS_DIR, FONTS_DIR, and IMAGES_DIR are the paths for the sound, font, and image resources.

          + +

          The Tizen SDK automatically calls the edje_cc tool during the project building, if it finds an EDC source file in the ./res/edje/ directory.

          + + +

          The following Tizen SDK compilation log extract shows that if your EDC file uses images, they must be copied to the ./edje/images directory. Fonts and sounds go to the ./edje/fonts and ./edje/sounds directories. The SDK builds the helloworld.edj file in the ./res/edje/ folder.

          + +
          +Building file: ../res/edje/helloworld.edc
          +Invoking: EDC Resource Compiler
          +edje_cc -sd ../edje/sounds -fd ../edje/fonts -id ../edje/images ../res/edje/helloworld.edc ../res/edje/helloworld.edj
          +
          + +

          Tips for Using EDC Blocks

          + +

          See the following tips for using EDC blocks:

          + +
            +
          • To add an element on the screen: +

            Add a new part inside the parts block.

            +
          • + +
          • To use an image: +

            List the image in the images block, make sure the part has the IMAGE type, and set the normal property inside the description.image of the part.

            +
          • + +
          • To use the same color definitions across multiple elements: +

            Define a color class and set the description.color_class property.

            +
          • + +
          • To position and resize a part with relative and absolute positioning: +

            Fill in the rel1 and rel2 structures inside the description block of the part.

            +
          • + +
          • To hide a part: +

            Set the visible property inside the description block of the part to 0.

            +
          • + +
          • To animate a part: +
              +
            1. Create several description blocks inside the part, and give each of them a different state value. Set 1 description for the initial state and 1 for the end state.
            2. + +
            3. Create a program with an action that is STATE_SET end_state 0.0; and with a target that is the name of the part. You can also set a non-default transition.
            4. + +
            5. When defining the second description, inherit from the first part in order to re-use the values which are already defined.
            6. + +
            7. The after property of the program block is used to trigger another program after the animation is done. It can be used to trigger another animation or to emit a signal to the C part of the program.
            8. + +
            +
          • + +
          • To make a genlist item theme: +

            Create a group with one part for each list item part that can be filed from the C code and set the items properties inside the group:

            + +
            +items: "texts" "text_part_1 text_part_2";
            +items: "icons" "image_part_1 image_part_2";
            +
            +

            On the C side, the text_get() and content_get() callbacks are called respectively with text_part_1 and text_part_2, and image_part_1 and image_part_2.

            +
          • +
          • To use the image masking effect: +

            EDC files support an image masking effect that applies the transparency of a mask image to a content object.

            + +

            Figure: Masking effect

            +

            Masking effect

            + +

            To use the image masking effect, add 2 new part blocks inside the parts block to be used as content and mask. Set the mask using the clip_to property in the content part.

            +
            +part 
            +{
            +   name: "bg";
            +   type: RECT;
            +   description 
            +   {
            +      state: "default" 0.0;
            +   }
            +}
            +part 
            +{
            +   name: "text";
            +   type: TEXTBLOCK;
            +   clip_to: "mask";
            +   description 
            +   {
            +      state: "default" 0.0;
            +      align: 0.5 0.5;
            +      text 
            +      {
            +         style: "text_style";
            +         text: "TEXT<br>WITH<br>MASK";
            +      }
            +   }
            +}
            +part 
            +{
            +   name: "mask";
            +   type: IMAGE;
            +   description 
            +   {
            +      state: "default" 0.0;
            +      image.normal: "mask.png";
            +   }
            +}
            +
            +

            The content part is cropped off in the mask shape, which depends on the alpha value per pixel. The content part type can be almost anything in the EDC files, but the mask part type can only be IMAGE.

            +
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_manage_animation_n.htm b/org.tizen.ui.practices/html/native/efl/edje_manage_animation_n.htm new file mode 100644 index 0000000..9b2a5be --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_manage_animation_n.htm @@ -0,0 +1,728 @@ + + + + + + + + + + + + + Edje Animations + + + + + +
          + +

          Edje Animations

          + +

          This tutorial demonstrates how you can turn Edje animations on and off, pause, stop and resume them, and check the status of Edje parts.

          + + +

          Creating the Application Layout

          + +

          Create a simple application with a menu and separate screens for each Edje Animation function:

          + +
            +
          1. +

            Create a simple main layout with a swallow for demo animation and another for controls:

            + +
            collections 
            +{
            +   group 
            +   {
            +      name: "demo";
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "swallow.demo";
            +            type: SWALLOW;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel2 
            +               {
            +                  relative: 1.0 0.0;
            +                  to_y: "swallow.control";
            +               }
            +            }
            +         }
            +         part 
            +         {
            +            name: "swallow.control";
            +            type: SWALLOW;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 
            +               {
            +                  relative: 0.0 0.8;
            +               }
            +            }
            +         }
            +      }
            +   }
            +}
            +
            +
          2. + +
          3. +

            Create a group for the cycled animation:

            +
            group 
            +{
            +   name: "cycled_animation";
            +   parts 
            +   {
            +      part 
            +      {
            +         name: "bg";
            +         type: RECT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            color: 100 100 100 255;
            +         }
            +         description 
            +         {
            +            state: "clicked" 0.0;
            +            color: 200 100 100 255;
            +         }
            +      }
            +      part 
            +      {
            +         name: "a";
            +         type: RECT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            color: 0 255 0 255;
            +            rel2 
            +            {
            +               relative: 0.3 0.3;
            +            }
            +         }
            +         description 
            +         {
            +            state: "red" 0.0;
            +            color: 255 0 0 255;
            +            rel1 
            +            {
            +               relative: 0.35 0.7;
            +            }
            +            rel2 
            +            {
            +               relative: 0.65 1.0;
            +            }
            +         }
            +         description 
            +         {
            +            state: "blue" 0.0;
            +            color: 0 0 255 255;
            +            rel1 
            +            {
            +               relative: 0.7 0.0;
            +            }
            +            rel2 
            +            {
            +               relative: 1.0 0.3;
            +            }
            +         }
            +      }
            +   }
            +   programs 
            +   {
            +      program 
            +      {
            +         name: "bg_click";
            +         signal: "mouse,clicked,*";
            +         source: "bg";
            +         action: STATE_SET "clicked" 0.0;
            +         target: "bg";
            +      }
            +      program 
            +      {
            +         name: "step1";
            +         signal: "load";
            +         source: "";
            +         action: STATE_SET "red" 0.0;
            +         transition: LINEAR 1.0;
            +         target: "a";
            +         after: "step2";
            +      }
            +      program 
            +      {
            +         name: "step2";
            +         action: STATE_SET "blue" 0.0;
            +         transition: LINEAR 1.0;
            +         target: "a";
            +         after: "step3";
            +      }
            +      program 
            +      {
            +         name: "step3";
            +         action: STATE_SET "default" 0.0;
            +         transition: LINEAR 1.0;
            +         target: "a";
            +         after: "step1";
            +      }
            +   }
            +}
            +
          4. + +
          5. +

            Create another group for animation that can be activated by clicking:

            +
            group 
            +{
            +   name: "clickme";
            +   parts 
            +   {
            +      part 
            +      {
            +         name: "bg";
            +         type: RECT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            color: 100 100 100 255;
            +         }
            +      }
            +      part 
            +      {
            +         name: "text_bg";
            +         type: RECT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            rel1 
            +            {
            +               to: "text";
            +            }
            +            rel2 
            +            {
            +               to: "text";
            +            }
            +         }
            +      }
            +      part 
            +      {
            +         name: "text";
            +         type: TEXT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            color: 0 0 0 255;
            +            text 
            +            {
            +               text: ":-)";
            +               font: "Sans";
            +               size: 42;
            +               min: 1 1;
            +               max: 1 1;
            +            }
            +         }
            +         description 
            +         {
            +            state: "state2" 0.0;
            +            inherit: "default" 0.0;
            +            align: 1.0 1.0;
            +            text.text: ":-D";
            +         }
            +      }
            +      part 
            +      {
            +         name: "text_bg2";
            +         type: RECT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            color: 0 200 0 255;
            +            rel1 
            +            {
            +               to: "text2";
            +            }
            +            rel2 
            +            {
            +               to: "text2";
            +            }
            +         }
            +         description 
            +         {
            +            state: "state2" 0.0;
            +            inherit: "default" 0.0;
            +            color: 200 0 0 255;
            +         }
            +      }
            +      part 
            +      {
            +         name: "text2";
            +         type: TEXT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            align: 0.0 1.0;
            +            visible: 0;
            +            text 
            +            {
            +               text: "Click me";
            +               font: "Sans";
            +               size: 42;
            +               min: 1 1;
            +               max: 1 1;
            +            }
            +         }
            +         description 
            +         {
            +            state: "state2" 0.0;
            +            inherit: "default" 0.0;
            +            visible: 1;
            +         }
            +      }
            +      part 
            +      {
            +         name: "text3";
            +         type: TEXT;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            align: 0.0 1.0;
            +            visible: 1;
            +            text 
            +            {
            +               text: "Click me";
            +               font: "Sans";
            +               size: 42;
            +               min: 1 1;
            +               max: 1 1;
            +            }
            +         }
            +         description 
            +         {
            +            state: "state2" 0.0;
            +            inherit: "default" 0.0;
            +            visible: 0;
            +         }
            +      }
            +   }
            +   programs 
            +   {
            +      program 
            +      {
            +         name: "clicked";
            +         signal: "mouse,clicked,1";
            +         source: "text3";
            +         action: STATE_SET "state2" 0.00;
            +         transition: LINEAR 3.00000;
            +         target: "text";
            +         target: "text2";
            +         target: "text3";
            +         target: "text_bg2";
            +      }
            +      program 
            +      {
            +         name: "return";
            +         signal: "mouse,clicked,1";
            +         source: "text2";
            +         action: STATE_SET "default" 0.00;
            +         transition: LINEAR 1.00000;
            +         target: "text";
            +         target: "text2";
            +         target: "text3";
            +         target: "text_bg2";
            +      }
            +   }
            +}
            +
          6. +
          + +

          Creating the Application Logic

          + +
            +
          1. Create new project named test.
          2. + +
          3. Add 2 new files to the application project:edje_animation.h and edje_animation.c.
          4. +
          5. To access the application data from the newly created files, move the appdata_s structure from the test.c file to the test.h file and remove the static specifier.
          6. + +
          7. Add the following code to the edje_animation.h file: +
            #ifndef __edje_animation_H__
            +#define __edje_animation_H__
            +#include "test.h"
            +
            +typedef struct _edje_animation_item_s 
            +{
            +   const char *name;
            +   Evas_Object* (*func)(appdata_s *ap);
            +} 
            +Edje_Animation_Menu_Item;
            +
            +#endif // __edje_animation_H__
            + +

            This structure will define menu items and their callbacks.

            +
          8. + +
          9. +

            Create a global menu array in the edje_animation.c file and fill it with necessary items:

            +
            Edje_Animation_Menu_Item edje_animation_items[] =
            +{
            +   {"test1", _test1_func },
            +   {"test2", _test2_func },
            +
            +   {NULL, NULL } // Do not delete
            +};
            +
          10. + +
          11. +

            Use the array to fill the main menu:

            +
            extern Edje_Animation_Menu_Item edje_animation_items[];
            +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   // Genlist
            +   ad->itc = elm_genlist_item_class_new();
            +   ad->itc->func.text_get =_genlist_item_text_get;
            +   ad->genlist = elm_genlist_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +
            +   int i;
            +   Elm_Object_Item *eoi = NULL;
            +
            +   for (i = 0; edje_animation_items[i].name; ++i)
            +   {
            +      eoi = elm_genlist_item_append(ad->genlist, ad->itc, edje_animation_items[i].name, NULL,
            +                                    ELM_GENLIST_ITEM_NONE, _genlist_clicked, ad);
            +      elm_object_item_data_set(eoi, (void *)&edje_animation_items[i]);
            +   }
            +}
            +
          12. + +
          13. All examples use the same basic layout: +
            static void
            +app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max)
            +{
            +   char *res_path = app_get_resource_path();
            +   if (res_path) 
            +   {
            +        snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in);
            +        free(res_path);
            +   }
            +}
            +
            +static void
            +_example_layout_create(appdata_s *ad,
            +                       const char *layout_group,
            +                       const char *demo_group,
            +                       Evas_Object **layout_out,
            +                       Evas_Object **animation_out)
            +{
            +   char edj_path[PATH_MAX] = {0, };
            +
            +   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +
            +   *layout_out = elm_layout_add(ad->win);
            +   elm_layout_file_set(*layout_out, edj_path, layout_group);
            +   evas_object_size_hint_weight_set(*layout_out, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +
            +   *animation_out = edje_object_add(evas_object_evas_get(ad->win));
            +   edje_object_file_set(*animation_out, edj_path, demo_group);
            +   evas_object_size_hint_weight_set(*animation_out, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_layout_content_set(*layout_out, SWALLOW_DEMO, *animation_out);
            +   evas_object_show(*animation_out);
            +}
            +
          14. + +
          15. You can try out the following operations to see how the application works: + +
              +
            • Check the time for each frame. + +

              The edje_frametime_get() function allows you to check how much time is elapsed for single frame. This is a value of an internal parameter and not actual frame time. You can change it using the edje_frametime_set() function.

              + + + + + + + + + + +
              Note
              Changing the frame time affects all objects on the same canvas, not only on the given one.
              + +

              Use the edje_frametime_get() function and edje_frametime_set() function in the edje_animation.c file:

              +
              // edje_frametime_set/get
              +static void
              +_frametime_test_spinner_changed_cb(void *data, Evas_Object *obj, void *event_info)
              +{
              +   edje_frametime_set(elm_spinner_value_get(obj));
              +}
              +
              +Evas_Object *
              +frametime_test(appdata_s *ad)
              +{
              +   Evas_Object *layout, *animation, *spinner;
              +   _example_layout_create(ad, GRP_DEMO, GRP_CYCLED_ANIM, &layout, &animation);
              +
              +   spinner = elm_spinner_add(ad->win);
              +   elm_spinner_label_format_set(spinner, "Frame_t: %1.3f");
              +   double framerate = edje_frametime_get();
              +   elm_spinner_min_max_set(spinner, 0.001, 2.0);
              +   elm_spinner_step_set(spinner, 0.005);
              +   elm_spinner_value_set(spinner, framerate);
              +   evas_object_smart_callback_add(spinner, "changed", _frametime_test_spinner_changed_cb, NULL);
              +   elm_layout_content_set(layout, SWALLOW_CONTROL, spinner);
              +   evas_object_show(spinner);
              +
              +   return layout;
              +}
              +
              +Edje_Animation_Menu_Item edje_animation_items[] =
              +{
              +   {"frametime test", frametime_test},
              +
              +   {NULL, NULL}
              +};
              + +

              The spinner displays the current frame time value and enables changing it. Extreme values (> 0.9) are affecting animation.

              + +

              Figure: Displaying the frame time

              +

              Displaying the frame time

              + +
            • + +
            • Pause and resume animation and check its status. + +

              The edje_object_play_set() function allows you to pause or resume animation for a given object. A resumed animation starts from the same point.

              +

              To check whether the animation is paused, use the edje_object_play_get() function.

              + +
              // edje_object_play_set/get
              +static void
              +_play_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              +{
              +   Evas_Object *anim = data;
              +   if (edje_object_play_get(anim))
              +   {
              +      edje_object_play_set(anim, EINA_FALSE);
              +      elm_object_text_set(obj, "Play");
              +   }
              +   else
              +   {
              +      edje_object_play_set(anim, EINA_TRUE);
              +      elm_object_text_set(obj, "Pause");
              +   }
              +}
              +
              +Evas_Object *
              +play_test(appdata_s *ad)
              +{
              +   Evas_Object *layout, *animation, *button;
              +   _example_layout_create(ad, GRP_DEMO, GRP_CYCLED_ANIM, &layout, &animation);
              +   button = elm_button_add(ad->win);
              +   elm_object_text_set(button, "Pause");
              +   evas_object_smart_callback_add(button, "clicked", _play_test_button_cb, animation);
              +   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              +   evas_object_show(button);
              +
              +   return layout;
              +}
              +
              +Edje_Animation_Menu_Item edje_animation_items[] =
              +{
              +   {"frametime test", frametime_test},
              +   {"play test", play_test},
              +   
              +   {NULL, NULL}
              +};
              +
            • + +
            • Stop the animation. + +

              The edje_object_freeze() function allows you to stop animation rendering. This function puts all changes on hold. Successive freezes are nested, requiring an equal number of thaws. Using the edje_object_thaw() function, you can apply all changes immediately.

              + +
              // edje_object_freeze/thaw
              +static void
              +_freeze_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              +{
              +   Evas_Object *anim = data;
              +   static int i = 0;
              +   if(!i)
              +   {
              +      i = edje_object_freeze(anim);
              +      elm_object_text_set(obj, "Thaw");
              +   }
              +   else
              +   {
              +      i = edje_object_thaw(anim);
              +      elm_object_text_set(obj, "Freeze");
              +   }
              +}
              +
              +Evas_Object *
              +freeze_test(appdata_s *ad)
              +{
              +   Evas_Object *layout, *animation, *button;
              +   _example_layout_create(ad, GRP_DEMO, GRP_CYCLED_ANIM, &layout, &animation);
              +
              +   button = elm_button_add(ad->win);
              +   elm_object_text_set(button, "Freeze");
              +   evas_object_smart_callback_add(button, "clicked", _freeze_test_button_cb, animation);
              +   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              +   evas_object_show(button);
              +
              +   return layout;
              +}
              +
              +Edje_Animation_Menu_Item edje_animation_items[] =
              +{
              +   {"frametime test", frametime_test},
              +   {"play test", play_test},
              +   {"freeze/thaw test", freeze_test},
              +
              +   {NULL, NULL}
              +};
              + +

              The edje_freeze() function and edje_thaw() function freeze or thaw all objects in the entire application.

              +
            • + +
            • Enable and disable the animation. + +

              All transitions in edje programs are ignored and parts go directly to their final states.

              + +
              // edje_object_animation_set/get
              +static void
              +_animation_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              +{
              +   Evas_Object *anim = data;
              +   if (edje_object_animation_get(anim))
              +   {
              +      edje_object_animation_set(anim, EINA_FALSE);
              +      elm_object_text_set(obj, "Turn animation on");
              +   }
              +   else
              +   {
              +      edje_object_animation_set(anim, EINA_TRUE);
              +      elm_object_text_set(obj, "Turn animation off");
              +   }
              +}
              +
              +Evas_Object *
              +animation_test(appdata_s *ad)
              +{
              +   Evas_Object *layout, *animation, *button;
              +   _example_layout_create(ad, GRP_DEMO, GRP_CLICKME, &layout, &animation);
              +
              +   button = elm_button_add(ad->win);
              +   elm_object_text_set(button, "Turn animation off");
              +   evas_object_smart_callback_add(button, "clicked", _animation_test_button_cb, animation);
              +   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              +   evas_object_show(button);
              +
              +   return layout;
              +}
              +
              +Edje_Animation_Menu_Item edje_animation_items[] =
              +{
              +   {"frametime test", frametime_test},
              +   {"play test", play_test},
              +   {"freeze/thaw test", freeze_test},
              +   {"animation test", animation_test},
              +
              +   {NULL, NULL}
              +};
              +
            • + +
            • Get the current state of given part. + +

              Parts that are in transition return the transition's starting state.

              + +
              // edje_object_part_state_get
              +static void
              +_state_get_test_button_cb(void *data, Evas_Object *obj, void *event_info)
              +{
              +   Evas_Object *anim = data;
              +   const char *state;
              +   double state_val = 0;
              +   state = edje_object_part_state_get(anim, "text", &state_val);
              +   edje_object_part_text_set(anim, "text", state);
              +}
              +
              +Evas_Object *
              +state_get_test(appdata_s *ad)
              +{
              +   Evas_Object *layout, *animation, *button;
              +   _example_layout_create(ad, GRP_DEMO, GRP_CLICKME, &layout, &animation);
              +
              +   button = elm_button_add(ad->win);
              +   elm_object_text_set(button, "Get state");
              +   evas_object_smart_callback_add(button, "clicked", _state_get_test_button_cb, animation);
              +   elm_layout_content_set(layout, SWALLOW_CONTROL, button);
              +   evas_object_show(button);
              +
              +   return layout;
              +}
              +
              +Edje_Animation_Menu_Item edje_animation_items[] =
              +{
              +   {"frametime test", frametime_test},
              +   {"play test", play_test},
              +   {"freeze/thaw test", freeze_test},
              +   {"animation test", animation_test},
              +   {"part state get test", state_get_test},
              +
              +   {NULL, NULL}
              +};
              +
            • +
            +
          16. +
          + + + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_message_signal_n.htm b/org.tizen.ui.practices/html/native/efl/edje_message_signal_n.htm new file mode 100644 index 0000000..1e9b448 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_message_signal_n.htm @@ -0,0 +1,457 @@ + + + + + + + + + + + + + Managing Signals and Messages + + + + + +
          + +

          Managing Signals and Messages

          + + +

          Edje objects have 2 communication interfaces between the application logic (code) and GUI (theme). You can either emit a signal from the code to the theme, or create handles for the signals emitted from the theme. Signals are identified by strings. With Edje messages, you can communicate values, such as strings, float numbers, and integer numbers. Messages can also be identified by integer numbers.

          + + +

          Signals

          +

          You can emit signals from code to a theme, or create handles for the signals emitted from themes. Signals are identified by strings.

          + +

          Using signals in the EDC file is simple. Create a program and set the signal name to the signal attribute.

          + +
          +group 
          +{ 
          +   name: "main";
          +   parts 
          +   {
          +      part 
          +      { 
          +         name: "rect1";
          +         type: RECT;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            min: 100 100;
          +            max: 100 100;
          +            color: 255 0 0 255;
          +         }
          +         description 
          +         { 
          +            state: "default" 1.0;
          +            min: 100 100;
          +            max: 100 100;
          +            color: 0 0 255 255;
          +         }
          +      }
          +      part 
          +      { 
          +         name: "swallow.check";
          +         type: SWALLOW;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            align: 0.5 0.0;
          +            rel2 
          +            {
          +               relative: 0.0 0.0;
          +               to_x: "swallow.slider_ver";
          +            }
          +         }
          +      }
          +   }
          +   programs 
          +   {
          +      program 
          +      { 
          +         name: "to_default_0";
          +         signal: "to,state,default,0";
          +         action: STATE_SET "default" 0.00;
          +         transition: ACCELERATE 0.5 CURRENT;
          +         target: "rect1";
          +      }
          +      program 
          +      { 
          +         name: "to_default_1";
          +         signal: "to,state,default,1";
          +         action: STATE_SET "default" 1.00;
          +         transition: ACCELERATE 0.5 CURRENT;
          +         target: "rect1";
          +      }
          +   }
          +}
          +
          + +

          Emitting Signals from the C Code

          + +

          Create the Edje Object and widget check. When a changed event is triggered, a signal is emitted from the C code to the EDC file.

          + +
          +static void
          +create_base_gui(appdata_s *ad)
          +{
          +   char edj_path[PATH_MAX] = {0, };
          +   
          +   // Window
          +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          +   elm_win_conformant_set(ad->win, EINA_TRUE);
          +   elm_win_autodel_set(ad->win, EINA_TRUE);
          +
          +   if (elm_win_wm_rotation_supported_get(ad->win)) 
          +   {
          +      int rots[4] = { 0, 90, 180, 270 };
          +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
          +   }
          +
          +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          +
          +   // Conformant
          +   ad->conform = elm_conformant_add(ad->win);
          +   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
          +   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
          +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   elm_win_resize_object_add(ad->win, ad->conform);
          +   evas_object_show(ad->conform);
          +
          +   // Base layout
          +   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
          +   ad->edje_object = edje_object_add(evas_object_evas_get(ad->win));
          +   edje_object_file_set(ad->edje_object, edj_path, GRP_MAIN);
          +   evas_object_size_hint_weight_set(ad->edje_object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   
          +   ad->check = elm_check_add(ad->win);
          +   edje_object_part_swallow(ad->edje_object, "swallow.check", ad->check);
          +   evas_object_smart_callback_add(ad->check, "changed", _check_toggled, ad);
          +
          +   elm_object_content_set(ad->conform, ad->edje_object);
          +   // Show the window
          +   evas_object_show(ad->win);
          +}
          +
          + +

          The following figure displays the result.

          + +

          Figure: Signal implemented on the screen

          +

          Signal implemented on the screen

          + +

          The following example implements the callback for the changed event from the widget check.

          +
          +static void
          +_check_toggled(void *data, Evas_Object *obj, void *event_info)
          +{
          +   appdata_s *ad = data;
          +
          +   if (elm_check_state_get(obj))
          +      edje_object_signal_emit(ad->edje_object, "to,state,default,1", "");
          +   else
          +      edje_object_signal_emit(ad->edje_object, "to,state,default,0", "");
          +}
          +
          + +

          The following figure displays the result.

          + +

          Figure: Widget check status changed

          +

          Widget check status changed

          + + +

          Messages

          + +

          Edje messages are used for communication between code and a given Edje object's theme. With messages, you can communicate values, such as strings, float numbers, and integer numbers. Messages can also be identified by integer numbers.

          + +

          In the following example, the rect1 part is made draggable and 2 sliders added to change the part position.

          + +
          +group 
          +{ 
          +   name: "main";
          +   parts 
          +   {
          +      part 
          +      { 
          +         name: "drag_area";
          +         type: RECT;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            rel1 
          +            {
          +               relative: 0.0 1.0;
          +               to_y: "swallow.check";
          +            }
          +            rel2 
          +            {
          +               relative: 0.0 0.0;
          +               to_x: "swallow.slider_ver";
          +               to_y: "swallow.slider_hor";
          +            }
          +         }
          +      }
          +      part 
          +      { 
          +         name: "rect1";
          +         type: RECT;
          +         dragable 
          +         {
          +            x: 1 1 1;
          +            y: 1 1 1;
          +            confine: "drag_area";
          +         }
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            min: 100 100;
          +            max: 100 100;
          +            color: 255 0 0 255;
          +         }
          +         description { state: "default" 1.0;
          +            min: 100 100;
          +            max: 100 100;
          +            color: 0 0 255 255;
          +         }
          +      }
          +      part 
          +      { 
          +         name: "swallow.check";
          +         type: SWALLOW;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            align: 0.5 0.0;
          +            rel2 
          +            {
          +               relative: 0.0 0.0;
          +               to_x: "swallow.slider_ver";
          +            }
          +         }
          +      }
          +      part 
          +      { 
          +         name: "swallow.slider_ver";
          +         type: SWALLOW;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            align: 1.0 0.5;
          +            rel1 
          +            {
          +               relative: 1.0 1.0;
          +               to_y: "swallow.check";
          +            }
          +            rel2 
          +            {
          +               relative: 1.0 0.0;
          +               to_y: "swallow.slider_hor";
          +            }
          +         }
          +      }
          +      part 
          +      { 
          +         name: "swallow.slider_hor";
          +         type: SWALLOW;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            align: 0.5 1.0;
          +            rel1 
          +            {
          +               relative: 0.0 1.0;
          +            }
          +            rel2 
          +            {
          +               relative: 0.0 1.0;
          +               to_x: "swallow.slider_ver";
          +            }
          +         }
          +      }
          +   }
          +   programs 
          +   {
          +      program 
          +      { 
          +         name: "to_default_0";
          +         signal: "to,state,default,0";
          +         action: STATE_SET "default" 0.00;
          +         transition: ACCELERATE 0.5 CURRENT;
          +         target: "rect1";
          +      }
          +      program 
          +      { 
          +         name: "to_default_1";
          +         signal: "to,state,default,1";
          +         action: STATE_SET "default" 1.00;
          +         transition: ACCELERATE 0.5 CURRENT;
          +         target: "rect1";
          +      }
          +      program 
          +      {
          +         signal: "drag";
          +         source: "rect1";
          +         script 
          +         {
          +               new Float:x, Float:y;
          +               get_drag(PART:"rect1", x, y);
          +               send_message(MSG_FLOAT, 2, x);
          +               send_message(MSG_FLOAT, 3, y);
          +         }
          +      }
          +   }
          +}
          +
          + +

          Add the sliders:

          + +
          +ad->slider_ver = elm_slider_add(ad->win);
          +edje_object_part_swallow(ad->edje_object, "swallow.slider_ver", ad->slider_ver);
          +elm_slider_horizontal_set(ad->slider_ver, EINA_FALSE);
          +evas_object_smart_callback_add(ad->slider_ver, "changed", _slider_changed, ad);
          +
          +ad->slider_hor = elm_slider_add(ad->win);
          +evas_object_smart_callback_add(ad->slider_hor, "changed", _slider_changed, ad);
          +
          + +

          The following figure displays the result.

          +

          Figure: Sliders added

          +

          Sliders added

          + +

          To handle the message in the Style, add the following script to the EDC file:

          + +
          +group 
          +{ 
          +   name: "main";
          +   script 
          +   {      	
          +      public message(Msg_Type:type, id, ...) 
          +      {
          +         if ((type == MSG_FLOAT_SET) && (id == 1)) 
          +         {
          +            new Float:x, Float:y;
          +            
          +            x = getfarg(2);
          +            y = getfarg(3);
          +            set_drag(PART:"rect1", x, y);
          +         }
          +      }
          +   }
          +}
          +
          + +

          This script is called when an incoming message is detected.

          + +

          Sending Messages

          + +

          Add a callback for the changed event to send a message to the Style:

          + +
          +static void
          +_slider_changed(void *data, Evas_Object *obj, void *event_info)
          +{
          +   appdata_s *ad = data;
          +   Edje_Message_Float_Set *msg;
          +   
          +   msg = malloc(sizeof(*msg) + 1 * sizeof(float));
          +   msg->count = 2;
          +   msg->val[0] = elm_slider_value_get(ad->slider_hor);
          +   msg->val[1] = elm_slider_value_get(ad->slider_ver);
          +   
          +   edje_object_message_send(ad->edje_object, EDJE_MESSAGE_FLOAT_SET, 1, msg);
          +   free(msg);
          +}
          +
          + +

          The same message can be sent in the opposite direction. To send messages in EDC script (Embryo – link to Embryo), use the sent_message() function.

          + +
          +program 
          +{
          +   signal: "drag";
          +   source: "rect1";
          +   script 
          +   {
          +      new Float:x, Float:y;
          +      get_drag(PART:"rect1", x, y);
          +      send_message(MSG_FLOAT, 2, x);
          +      send_message(MSG_FLOAT, 3, y);
          +   }
          +}
          +
          + +

          2 messages are sent using the drag signal from the rect1 part.

          + +

          Add a message handler in the C code:

          + +
          +edje_object_message_handler_set(ad->edje_object, _message_handle, ad);
          +
          + +

          Add a callback:

          + +
          +static void
          +_message_handle(void *data, Evas_Object *obj, Edje_Message_Type type,
          +                int id, void *msg)
          +{
          +   Edje_Message_Float *m;
          +   appdata_s *ad = data;
          +   
          +   if (type != EDJE_MESSAGE_FLOAT) return;
          +   m = msg;
          +   if (id == 2) elm_slider_value_set(ad->slider_hor, m->val);
          +   if (id == 3) elm_slider_value_set(ad->slider_ver, m->val);
          +}
          +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_objects_n.htm b/org.tizen.ui.practices/html/native/efl/edje_objects_n.htm new file mode 100644 index 0000000..9ea2292 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_objects_n.htm @@ -0,0 +1,87 @@ + + + + + + + + + + + + + Edje Objects: Managing Layouts and Layout Components + + + + + +
          + +

          Edje Objects: Managing Layouts and Layout Components

          + + +

          You can build and handle layouts using Edje objects. An Edje object is a type of Evas object for displaying units, such as rectangles, lines, polygons, text, and images. Edje objects are only used in Edje and provide functions that deal with Edje layouts and layout components. Namely, there is no Edje object type in the source code for implementing an application. The objects are mainly layouts or themes defined by groups and parts, and declared in EDC files.

          +

          Edje provides functions for the following features:

          + +
            +
          • Handling Edje Files +

            Edje layouts are called themes and created using the EDC language. The EDC language is declarative and must be compiled before being used. The output of this compilation is an EDJ file, which can be loaded by Edje, and the result is an Edje object.

          • + +
          • Scaling Edje Objects +

            Edje enables you to build scalable interfaces. There are 2 types of scaling factors, which are set to neutral (1.0) values by default (no scaling, actual sizes): global and individual. Scaling affects the minimum and maximum values of the part sizes, which are multiplied. Font sizes are scaled, too.

          • + +
          • Using Edje Color Classes +

            To change the color and text of 2 or more parts simultaneously, you can use color classes. If parts are assigned with a color class, setting the color values to this class causes all the parts to have their colors multiplied by the values. Setting the values to a color class at a process level affects all parts with that color class, while at the object level, only the parts inside a specified object are affected.

          • + +
          • Using Edje Text Classes +

            To change the text of 2 or more parts simultaneously, you can use text classes. If parts are assigned with a text class, setting the font attributes to this class updates all these parts with the new font attributes. Setting the values to a text class at a process level affects all parts with that text class, while at the object level, only the parts inside a specified object are affected.

          • + +
          • Using Edje Perspective +

            Perspective is a graphical tool that makes 2D objects appear as 3D. The perspective can be used with all Edje objects.

          • + +
          • Managing Signals and Messages +

            Edje objects have 2 communication interfaces between the logic and GUI. You can either emit a signal from the logic to the GUI, or create handles for the signals emitted from the GUI. Signals are identified by strings. With Edje messages, you can communicate values, such as strings, float numbers, and integer numbers. Messages can also be identified by integer numbers.

          • + +
          • Managing Edje Animations +

            Edje has the ability to animate their objects. You can start, stop, play, pause, freeze, and thaw Edje animations, and check their status.

          • +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_perspective_n.htm b/org.tizen.ui.practices/html/native/efl/edje_perspective_n.htm new file mode 100644 index 0000000..31bb4d3 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_perspective_n.htm @@ -0,0 +1,486 @@ + + + + + + + + + + + + + Using Edje Perspective + + + + + +
          + +

          Using Edje Perspective

          + + +

          This tutorial demonstrates how you can create a 3D projection of a 2D object.

          +

          Edje Perspective is a graphical tool that makes 2D objects appear like they have a 3D appearance.

          +

          Edje Perspective can be used in all Edje objects to create and configure a perspective objects and to set the to an Edje object or a canvas, affecting all the objects within that have no specific perspective already defined.

          + +

          Creating the Basic Application

          +

          The perspective application has buttons to move the Edje object and change its perspective. The Edje object is a 2D object that changes its position so that the perspective point can be applied.

          + + + + + + + + + + +
          Note
          The loaded Edje object must have the perspective option enabled in its EDC source code.
          + +

          Create a simple Edje object that has 4 states: left-top, right-top, left-bottom, and right-bottom. Clicking a button emits signals into the object and makes the object move.

          + +
            +
          1. + +

            The following example implements the Edje object:

            + +
            +group 
            +{
            +   name: "example/group";
            +   min: 480 320;
            +   parts 
            +   {
            +      part 
            +      {
            +         name: "bg";
            +         type: RECT;
            +         mouse_events: 1;           
            +         description 
            +         {
            +            state: "default" 0.0;
            +         }
            +      }       
            +      part 
            +      {
            +         name: "rectangle";
            +         type: RECT;
            +         mouse_events: 0;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            color: 255 0 0 128;
            +            rel1 
            +            {
            +               offset: -5 -5;
            +               to: "title";
            +            }
            +            rel2 
            +            {
            +               offset: 4 4;
            +               to: "title";
            +            }
            +            map 
            +            {
            +               on: 1;
            +               perspective_on: 1;
            +               rotation 
            +               {
            +                  x: 45;
            +                  y: 15;
            +               }
            +            }
            +         }
            +      }
            +      part 
            +      {
            +         name: "title";
            +         type: TEXT;
            +         mouse_events: 0;
            +         description 
            +         {
            +            state: "default" 0.0;
            +            color: 200 200 200 255;
            +            align: 0.0 0.5;
            +            rel1.relative: 0.2 0.2;
            +            rel2.relative: 0.2 0.2;
            +            text 
            +            {
            +               text: "Perspective example";
            +               font: "Sans";
            +               size: 16;
            +               min: 1 1;
            +            }
            +            map 
            +            {
            +               on: 1;
            +               perspective_on: 1;
            +               rotation 
            +               {
            +                  x: 45;
            +                  y: 15;
            +               }
            +            }
            +         }
            +         description 
            +         {
            +            state: "right" 0.0;
            +            inherit: "default" 0.0;
            +            rel1.relative: 0.5 0.2;
            +            rel2.relative: 0.5 0.2;
            +         }
            +         description 
            +         {
            +            state: "bottom" 0.0;
            +            inherit: "default" 0.0;
            +            rel1.relative: 0.2 0.8;
            +            rel2.relative: 0.2 0.8;
            +         }
            +         description 
            +         {
            +            state: "bottomright" 0.0;
            +            inherit: "default" 0.0;
            +            rel1.relative: 0.5 0.8;
            +            rel2.relative: 0.5 0.8;
            +         }
            +      }
            +   }
            +   programs 
            +   {
            +      program 
            +      {
            +         name: "move,right";
            +         signal: "move,1,0";
            +         action: STATE_SET "right" 0.0;
            +         transition: SINUSOIDAL 1.0;
            +         target: "title";
            +         after: "animation,end";
            +      }
            +      program 
            +      {
            +         name: "move,bottom";
            +         signal: "move,0,1";
            +         action: STATE_SET "bottom" 0.0;
            +         transition: SINUSOIDAL 1.0;
            +         target: "title";
            +         after: "animation,end";
            +      }
            +      program 
            +      {
            +         name: "move,bottomright";
            +         signal: "move,1,1";
            +         action: STATE_SET "bottomright" 0.0;
            +         transition: SINUSOIDAL 1.0;
            +         target: "title";
            +         after: "animation,end";
            +      }
            +      program 
            +      {
            +         name: "move,default";
            +         signal: "move,0,0";
            +         action: STATE_SET "default" 0.0;
            +         transition: SINUSOIDAL 1.0;
            +         target: "title";
            +         after: "animation,end";
            +      }
            +      program 
            +      {
            +         name: "animation,end";
            +         action: SIGNAL_EMIT "animation,end" "";
            +      }
            +   }
            +}
            +
            +
          2. + +
          3. +

            Create the application. Create a basic window widget that is going to be loaded and created in the main starting function:

            + +
            +// Window
            +ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +elm_win_conformant_set(ad->win, EINA_TRUE);
            +elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +if (elm_win_wm_rotation_supported_get(ad->win)) 
            +{
            +   int rots[4] = 
            +   {
            +      0, 90, 180, 270 
            +   };
            +   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            +}
            +
            +
          4. + +
          5. +

            Add a conformant and set the main layout of the application.

            +

            The main layout is described in the EDC part and consists of 2 swallows. The first swallow has the Edje object loaded into it. The second contains a box of buttons to manipulate the perspective of the Edje object.

            + +
            +// Conformant
            +ad->conform = elm_conformant_add(ad->win);
            +elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            +elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            +evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_win_resize_object_add(ad->win, ad->conform);
            +evas_object_show(ad->conform);
            +
            +// Base layout
            +app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +ad->layout = elm_layout_add(ad->win);
            +elm_layout_file_set(ad->layout, edj_path, GRP_MAIN);
            +evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);
            +elm_object_content_set(ad->conform, ad->layout);
            +
            +
          6. + +
          7. +

            Create the Edje object on Evas using the evas_object_evas_get() function. This function is very useful because you must operate on the canvas, but have only an object pointer to a window object.

            + +
            +Evas *evas;
            +evas = evas_object_evas_get(ad->win);
            +ad->edje_obj = edje_object_add(evas);
            +
            +
          8. + +
          9. +

            Instantiate a new Edje object by creating a new Edje smart object and returning its Evas_Object handle:

            + +
            +ad->edje_obj = edje_object_add(evas);
            +
            +
          10. + +
          11. +

            An Edje object is useless without a source file set to it, so use the edje_object_file_set() function to set the object into the main layout:

            + +
            +ad->edje_obj = edje_object_add(evas);
            +edje_object_file_set(ad->edje_obj, edj_path, "example/group");
            +evas_object_move(ad->edje_obj, 0, 0);
            +evas_object_show(ad->edje_obj);
            +elm_object_part_content_set(ad->layout, "swallow", ad->edje_obj);
            +
            + +

            Figure: Main layout with the swallow part highlighted

            +

            Main layout with the swallow part highlighted

            +
          12. + +
          13. +

            Create the actual perspective object, define its position, focal distance and Z plane position, and set it as global:

            + +
            +ad->ps = edje_perspective_new(evas);	
            +edje_perspective_set(ad->ps, 160, 320, 0, ad->focal);
            +edje_perspective_global_set(ad->ps, EINA_TRUE);
            +
            + +

            To set the perspective of the Edje object, instead of setting it as global to the entire canvas, you can use the edje_object_perspective_set() function. +

            +
          14. + +
          15. +

            Create a new perspective in the canvas by setting up the transformation for the perspective object:

            + +
            +void 
            +edje_perspective_set(Edje_Perspective * ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc)
            +
            + +

            This sets the parameters of the perspective transformation. X, Y, and Z values are used. The px and py points specify the infinite distance point in the 3D conversion, where all lines converge. The z0 point specifies the Z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates. Any points on the Z value do not have their X and Y values modified in the transformation. The points further away (with a higher Z value) shrink into the distance, and those that are closer expand and become bigger.

            +

            The foc value determines the focal length of the camera. This is the distance between the camera lens plane and the z0 Z value. This allows for some depth control. The foc value must be greater than 0.

            +
          16. + +
          17. +

            The Swallow buttons layout part contains a box of buttons to manipulate the perspective of the loaded Edje object.

            + +

            Figure: Main layout with swallow buttons highlighted

            +

            Main layout with swallow buttons highlighted

            + +

            Add the box and pack the buttons into it. Name the first button Global and register a callback for clicking:

            + +
            +Evas_Object *box, *button;
            +// Adding box
            +box = elm_box_add(ad->layout);
            +evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
            +evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
            +elm_box_horizontal_set(box, EINA_TRUE);
            +evas_object_show(box);
            +elm_object_part_content_set(ad->layout, "swallow.buttons", box);
            +
            +button = elm_button_add(ad->layout);
            +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_object_text_set(button, "move");
            +evas_object_show(button);
            +elm_box_pack_end(box, button);
            +evas_object_smart_callback_add(button, "clicked", _on_btn_clicked, ad);
            +
            +button = elm_button_add(ad->layout);
            +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_object_text_set(button, "more");
            +evas_object_show(button);
            +elm_box_pack_end(box, button);
            +evas_object_smart_callback_add(button, "clicked", _on_btn_more_clicked, ad);
            +
            +button = elm_button_add(ad->layout);
            +evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_object_text_set(button, "less");
            +evas_object_show(button);
            +elm_box_pack_end(box, button);
            +evas_object_smart_callback_add(button, "clicked", _on_btn_less_clicked, ad);
            +
            +ad->edje_obj = edje_object_add(evas);
            +edje_object_file_set(ad->edje_obj, edj_path, "example/group");
            +evas_object_move(ad->edje_obj, 0, 0);
            +evas_object_show(ad->edje_obj);
            +elm_object_part_content_set(ad->layout, "swallow", ad->edje_obj);
            +
            +
          18. + +
          19. +

            Show the main window:

            + +
            +evas_object_show(ad->win);
            +
            + +

            Figure: Main screen

            +

            Figure: Main screen

            + +
          20. +
          + +

          Playing with the Perspective

          + +
            +
          1. +

            The callback for a clicked button is converted to a signal determining where the text and rectangle must be moved:

            + +
            +static void
            +_part_move(appdata_s *ad, int dx, int dy)
            +{
            +   char emission[64];
            +
            +   dlog_print(DLOG_ERROR, "AAAA", "x,y = %d, %d", dx, dy);
            +   snprintf(emission, sizeof(emission), "move,%d,%d", dx, dy);
            +   edje_object_signal_emit(ad->edje_obj, emission, "");
            +}
            +
            +
          2. + +
          3. +

            The callback representing the Edje object move calls the part_move() function that directly sends a signal to the Edje part. The moving action is treated in the program according to the passed signal.

            + +
            +static void
            +_on_btn_clicked(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   static int i = 0;
            +   switch (i) 
            +   {
            +      case 0:
            +         _part_move(ad, 1, 0);
            +         break;
            +      case 1:
            +         _part_move(ad, 1, 1);
            +         break;
            +      case 2:
            +         _part_move(ad, 0, 1);
            +         break;
            +      case 3:
            +         _part_move(ad, 0, 0);
            +         break;
            +   }
            +   i++;
            +   i = i%4;
            +}
            +
            + +

            Figure: Moving process

            +

            ->Figure: Moving process Figure: Moving process

            +
          4. + +
          5. +

            By clicking the More and Less buttons, you can increase or decrease the focal length of the camera:

            + +
            +static void
            +_on_btn_more_clicked(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   ad->focal += 5;
            +   edje_perspective_set(ad->ps, 160, 320, 0, ad->focal);
            +   edje_perspective_global_set(ad->ps, EINA_TRUE);
            +}
            +
            +static void
            +_on_btn_less_clicked(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   ad->focal -= 5;
            +   edje_perspective_set(ad->ps,160, 320, 0, ad->focal);
            +   edje_perspective_global_set(ad->ps, EINA_TRUE);
            +}
            +
            + +

            Figure: Decreasing and increasing the focal length

            + +

            Decreasing and increasing the focal length

            +
          6. +
          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm b/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm new file mode 100644 index 0000000..694956d --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm @@ -0,0 +1,794 @@ + + + + + + + + + + + + + + Scaling Edje Objects + + + + + + +
          +

          Scaling Edje Objects

          + +

          This demonstrates how you can scale Edje objects. Scalability is important when building user interfaces for different environments, such as mobile phones and laptops.

          +

          The natural value of scale factors is 1.0. Scaling affects minimum and maximum part size and font size, and multiplies them.

          + +

          You can disable scaling of certain parts.

          + +

          Initializing the EDC File

          + +

          Set up and prepare the EDC source code for loading the Edje objects in your application:

          + +
            +
          1. +

            To demonstrate Edje scale usability, set up 2 groups. The first group contains only one scalable part.

            + +
            group 
            +{ 
            +   name: "scale_group_1";
            +   parts 
            +   {
            +      part
            +      { 
            +         name: "scalable_rect";
            +         type: RECT;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            min: 16 16;
            +            max: 16 16;
            +            color: 0 0 255 255;
            +         }
            +      }
            +   }
            +}
            + +

            Figure: First scalable group

            +

            First scalable group

            + +

            For this example, the group is used for showing Edje's global scale.

            + +

            The other group is used for showing usability of the edje_object_scale function. The group has 2 non-scalable parts (not_scalable_rect1 and not scalable_rect2 ), which are related to the scalable parts. It can be seen that scalability actually changes the scalable parts and all UI can be changed according to new relatives.

            + +

            Scalability of certain parts is usually preset in the EDC source code with the scale property:

            + +
            +group 
            +{ 
            +   name: "scale_group_2";
            +   parts 
            +   {
            +      part 
            +      { 
            +         name: "not_scalable_rect1";
            +         type: RECT;
            +         scale: 0;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.5;
            +            min: 40 40;
            +            max: 40 40;
            +            color: 255 0 255 255;
            +         }
            +      }
            +      part 
            +      { 
            +         name: "scalable_rect";
            +         type: RECT;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.5;
            +            min: 25 19;
            +            max: 25 19;
            +            color: 0 255 255 255;
            +            rel1 
            +            {
            +               relative: 1.0 0.0;
            +               to_x: "not_scalable_rect1";
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "not_scalable_rect2";
            +         type: RECT;
            +         scale: 0;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.5;
            +            min: 40 40;
            +            max: 40 40;
            +            color: 255 0 255 255;
            +            rel1 
            +            {
            +               relative: 1.0 0.0;
            +               to_x: "scalable_rect";
            +            }
            +         }
            +      }
            +   }
            +}
            +
            + +

            Figure: Second scalable group

            +

            Second scalable group

            +
          2. + +
          3. + +

            The base_scale factor can be used when the whole collection in the EDC file contains it:

            + +
            collections 
            +{
            +   base_scale: 1.2;
            +   group 
            +   { 
            +      name: "scale_group_1";
            +   }
            +   group 
            +   { 
            +      name: "scale_group_2";
            +   }
            +   group 
            +   {
            +      name: "main_layout";
            +   }
            +}
            +
          4. + +
          5. +

            An application must contain controls, such as a spinner, to change the scale and see the result.

            + +

            Add a box with 2 groups loaded as edje objects, and spinners for changing the scale values:

            + +
            +group 
            +{ 
            +   name: "main_application";
            +   parts 
            +   {
            +      part 
            +      { 
            +         name: "edje.swallow.content";
            +         type: SWALLOW;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 1.0;
            +            rel1 
            +            {
            +               relative: 0.0 1.0;
            +               offset: 0 20;
            +               to_y: "title2";
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "title1";
            +         type: TEXT;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 100 32;
            +            color: 0 0 0 255;
            +            text 
            +            {
            +               text: "edje scale:";
            +               font: "Sans";
            +               size: 16;
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "title2";
            +         type: TEXT;
            +         scale: 1;
            +         description
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 150 32;
            +            color: 0 0 0 255;
            +            rel1 
            +            {
            +               relative: 0.0 1.0;
            +               to_y: "scale.swallow";
            +            }
            +            text 
            +            {
            +               text: "edje object scale:";
            +               font: "Sans";
            +               size: 16;
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "scale.swallow";
            +         type: SWALLOW;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 200 48;
            +            rel1 
            +            {
            +               relative: 1.0 0.0;
            +               to_x: "title2";
            +               to_y: "title1";
            +            }
            +            rel2 
            +            {
            +               to_y: "title1";
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "scale.swallow2";
            +         type: SWALLOW;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 200 48;
            +            rel1 
            +            {
            +               relative: 1.0 0.0;
            +               to: "title2";
            +            }
            +            rel2 
            +            {
            +               to_y: "title2";
            +            }
            +         }
            +      }
            +   }
            +}
            +
            + +

            Figure: Main application layout

            +

            Main application layout

            + +

            In the example, there are the following swallows:

            +
              +
            • edje.swallow.content is used for the box containing the Edje objects.
            • +
            • scale.swallow is used for the spinner that changes the scale value a loaded Edje object.
            • +
            • scale.swallow2 is used for the spinner that changes the global scale, so changing this value changes the scale of all Edje objects if they do not have their own scales set using the edje_object_scale_set() function.
            • +
            +
          6. +
          + +

          Initializing the Application

          + +

          All application code lays in the create_base_gui() function that creates and loads all objects and forms, and creates application's main look.

          + +
            +
          1. +

            Create a window and get the path to the EDJ file:

            + +
            +ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);   elm_win_conformant_set(ad->win, EINA_TRUE);
            +elm_win_autodel_set(ad->win, EINA_TRUE);
            +if (elm_win_wm_rotation_supported_get(ad->win))
            +{
            +   int rots[4] = 
            +   {
            +      0, 90, 180, 270
            +   };
            +   elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            +}
            +// Path to edj group with three groups
            +app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +
            +
          2. + +
          3. +

            Set the conformant containing the main layout into the window:

            + +
            +ad->conform = elm_conformant_add(ad->win);
            +elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            +elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            +evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_win_resize_object_add(ad->win, ad->conform);
            +evas_object_show(ad->conform);
            +// Main layout
            +ad->main_layout = elm_layout_add(ad->win);
            +evas_object_size_hint_weight_set(ad->main_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_layout_file_set(ad->main_layout, edj_path, "main_application");
            +elm_object_content_set(ad->conform, ad->main_layout);
            +evas_object_show(ad->main_layout);
            +app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +
            + + + + + + + + + + +
            Note
            If you have layout for your window written in the EDC file, use and load it as Layout with Elementary layout API (using, for example, the elm_layout_add() , elm_object_style_set() , and elm_layout_file_set() functions).
            +
          4. + +
          5. +

            Add the box and set it into the edje.swallow.content main layout swallow:

            + +
            +// Add the box
            +ad->box = elm_box_add(ad->main_layout);
            +evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, 0.0);
            +evas_object_size_hint_align_set(ad->box, EVAS_HINT_FILL, 0.0);
            +elm_box_horizontal_set(ad->box, EINA_TRUE);
            +evas_object_show(ad->box);
            +// Set the box into the main layout
            +elm_object_part_content_set(ad->main_layout, "edje.swallow.content", ad->box);
            +
          6. + +
          7. +

            Load the Edje objects:

            + +
            +// Add group1
            +ad->edje_object_1 = edje_object_add(evas_object_evas_get(ad->win));
            +evas_object_size_hint_weight_set(ad->edje_object_1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +edje_object_file_set(ad->edje_object_1, edj_path, "scale_group_1");
            +// Check object loading errors
            +if (edje_object_load_error_get(ad->edje_object_1) != EDJE_LOAD_ERROR_NONE)
            +{
            +   evas_object_del(ad->edje_object_1);
            +
            +   return;
            +}
            +evas_object_show(ad->edje_object_1);
            +
          8. + +
          9. +

            Pack the Edje objects into the box:

            + +
            +elm_box_pack_end(ad->box, ad->edje_object_1);
            +elm_box_pack_end(ad->box, ad->edje_object_2);
            +
          10. + +
          11. +

            Add 2 spinners that change the scale values:

            + +
            +ad->edje_scale = elm_spinner_add(ad->win);
            +evas_object_size_hint_weight_set(ad->edje_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_align_set(ad->edje_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +elm_spinner_min_max_set(ad->edje_scale, 1, 300);
            +elm_spinner_step_set(ad->edje_scale, 10);
            +evas_object_show(ad->edje_scale);
            +elm_spinner_value_set(ad->edje_scale, 100);
            +elm_object_part_content_set(ad->main_layout, "scale.swallow", ad->edje_scale);
            +
            +ad->edje_object_scale = elm_spinner_add(ad->win);
            +evas_object_size_hint_weight_set(ad->edje_object_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_align_set(ad->edje_object_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +elm_spinner_min_max_set(ad->edje_object_scale, 1, 300);
            +elm_spinner_step_set(ad->edje_object_scale, 10);
            +evas_object_show(ad->edje_object_scale);
            +elm_spinner_value_set(ad->edje_object_scale, 100);
            +elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_scale);
            +
          12. + +
          13. Display the window:

            + +
            +evas_object_show(ad->win);
            + +

            Figure: Scale testing application

            +

            Scale testing application

            +
          14. +
          + + +

          Setting Global Scales

          + +
            +
          1. +

            Add a callback for the second spinner that changes Edje global scale value and, as a result, affects all loaded Edje objects:

            + +
            static void
            +create_base_gui(appdata_s *ad)
            +{
            +   // Add scale spinners
            +   ad->edje_object_scale = elm_spinner_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->edje_object_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(ad->edje_object_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   elm_spinner_min_max_set(ad->edje_object_scale, 1, 300);
            +   elm_spinner_step_set(ad->edje_object_scale, 10);
            +   evas_object_show(ad->edje_object_scale);
            +   elm_spinner_value_set(ad->edje_object_scale, 100);
            +   elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_object_scale);
            +
            +   evas_object_smart_callback_add(ad->edje_object_scale, "changed", _on_global_scale_change, ad);
            +}
            +
          2. + +
          3. + +

            Set the scale using the edje_scale_set() function:

            + +
            static void
            +_on_global_scale_change(void *data, Evas_Object *obj, void *event_info)
            +{
            +   edje_scale_set(elm_spinner_value_get(obj) / 100);
            +}
            + +

            By clicking the spinner buttons, you can change the scale of all loaded Edje objects. The Edje object on the right has its own scale values, so global scale values do not apply to it.

            + +

            Figure: Different global scales

            +

            Different global scales

            +
          4. + +
          + + + + + + + + + +
          Note
          Using the edje_scale_set() function that changes the global scale values can affect your whole application and destroy the UI layout. Be careful with this function.
          + +

          Setting Scales for Edje Objects

          + +

          Add a callback to get the value of the first spinner and apply it to the Edje object on the right:

          + +
          static void
          +_on_scale_change(void *data, Evas_Object *obj, void *event_info)
          +{
          +   appdata_s *ad = data;
          +   edje_object_scale_set(ad->edje_object_2, elm_spinner_value_get(obj) / 100);
          +}
          +
          +static void
          +create_base_gui(appdata_s *ad)
          +{
          +   // Add scale spinners
          +   ad->edje_scale = elm_spinner_add(ad->win);
          +   evas_object_size_hint_weight_set(ad->edje_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   evas_object_size_hint_align_set(ad->edje_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +   elm_spinner_min_max_set(ad->edje_scale, 1, 300);
          +   elm_spinner_step_set(ad->edje_scale, 10);
          +   evas_object_show(ad->edje_scale);
          +   elm_spinner_value_set(ad->edje_scale, 100);
          +   elm_object_part_content_set(ad->main_layout, "scale.swallow", ad->edje_scale);
          +   evas_object_smart_callback_add(ad->edje_scale, "changed", _on_scale_change, ad);
          +}
          + + +

          By clicking on spinner buttons, you can change the scale of the second Edje object in the box.

          + +

          Figure: Edje object scales

          +

          Edje object scales

          + + +

          Personal, Global, and Base Scales

          + +

          Modify the main layout and add a swallow for the buttons. The buttons are used for showing the current scale:

          + +
            +
          1. +

            Modify the main layout EDC code by creating another swallow part, swallow.buttons , and modifying the edje.swallow.content part:

            + +
            +group 
            +{ 
            +   name: "main_application";
            +   parts 
            +   {
            +      part 
            +      { 
            +         name: "edje.swallow.content";
            +         type: SWALLOW;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 1.0;
            +            rel1 
            +            {
            +               relative: 0.0 1.0;
            +               offset: 0 20;
            +               to_y: "title2";
            +            }
            +            rel2 
            +            {
            +               relative: 1.0 0.0;
            +               to_y: "swallow.buttons";
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "title1";
            +         type: TEXT;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 100 32;
            +            color: 0 0 0 255;
            +            text 
            +            {
            +               text: "edje scale:";
            +               font: "Sans";
            +               size: 16;
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "title2";
            +         type: TEXT;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 150 32;
            +            color: 0 0 0 255;
            +            rel1 
            +            {
            +               relative: 0.0 1.0;
            +               to_y: "scale.swallow";
            +            }
            +            text 
            +            {
            +               text: "edje object scale:";
            +               font: "Sans";
            +               size: 16;
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "scale.swallow";
            +         type: SWALLOW;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 200 48;
            +            rel1 
            +            {
            +               relative: 1.0 0.0;
            +               to_x: "title2";
            +               to_y: "title1";
            +            }
            +            rel2 
            +            {
            +               to_y: "title1";
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "scale.swallow2";
            +         type: SWALLOW;
            +         scale: 1;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 0.0;
            +            max: 200 48;
            +            rel1 
            +            {
            +               relative: 1.0 0.0;
            +               to: "title2";
            +            }
            +            rel2 
            +            {
            +               to_y: "title2";
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "swallow.buttons";
            +         type: SWALLOW;
            +         scale: 0;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.0 1.0;
            +            min: 0 60;
            +            max: -1 60;
            +         }
            +      }
            +   }
            +}
            +
            +
          2. + +
          3. +

            Add a box with buttons and set it into the main layout:

            + +
            static void
            +_edje_object_scale_get(void *data, Evas_Object *obj, void *event_info)
            +{
            +   char title[PATH_MAX] = {0, };
            +   appdata_s *ad = data;
            +   snprintf(title, (int)PATH_MAX, "object %.2f", edje_object_scale_get(ad->edje_object_2));
            +   elm_object_text_set(obj, title);
            +}
            +static void
            +_edje_scale_get(void *data, Evas_Object *obj, void *event_info)
            +{
            +   char title[PATH_MAX] = {0, };
            +   snprintf(title, (int)PATH_MAX, "global %.2f", edje_scale_get());
            +   elm_object_text_set(obj, title);
            +}
            +static void
            +_edje_object_base_scale_get(void *data, Evas_Object *obj, void *event_info)
            +{
            +   char title[PATH_MAX] = {0, };
            +   appdata_s *ad = data;
            +   snprintf(title, (int)PATH_MAX, "base %.2f", edje_object_base_scale_get(ad->edje_object_2));
            +   elm_object_text_set(obj, title);
            +}
            +
            +static void
            +create_base_gui(appdata_s *ad) 
            +{
            +   Evas_Object *box, *button;
            +   // Add the box
            +   box = elm_box_add(ad->main_layout);
            +   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
            +   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
            +   elm_box_horizontal_set(box, EINA_TRUE);
            +   evas_object_show(box);
            +   elm_object_part_content_set(ad->main_layout, "swallow.buttons", box);
            +
            +   button = elm_button_add(ad->main_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, "object ");
            +   evas_object_show(button);
            +   evas_object_smart_callback_add(button, "clicked", _edje_object_scale_get, ad);
            +   elm_box_pack_end(box, button);
            +
            +   button = elm_button_add(ad->main_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, "global ");
            +   evas_object_show(button);
            +   evas_object_smart_callback_add(button, "clicked", _edje_scale_get, ad);
            +   elm_box_pack_end(box, button);
            +
            +   button = elm_button_add(ad->main_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, "base ");
            +   evas_object_show(button);
            +   evas_object_smart_callback_add(button, "clicked", _edje_object_base_scale_get, ad);
            +   elm_box_pack_end(box, button);
            +}
            + + +

            Clicking a button gets a specific scale and prints its value on the button. For example, clicking the Global button shows the global scale value.

            + +

            Figure: Scale values

            +

            Scale values

            +
          4. + +
          5. +

            The loaded Edje object does not have its own scale value (0.00), so it uses the global scale value defined in the EFL configuration based on the device. A mobile device that is being used here, has the global scale ~1.8). The base scale is set to 1.2.

            + +
            collections 
            +{
            +   base_scale: 1.2;
            +   group 
            +   { 
            +      name: "scale_group_1";
            +   }
            +   group 
            +   { 
            +      name: "scale_group_2";
            +   }
            +   group 
            +   { 
            +      name: "main_layout";
            +   }
            +}
            + +

            Figure: Scale values after changing the Edje object scale

            +

            Figure: Scale values after changing the Edje object scale

            + +

            After applying the scale of the new object, the global scale does not apply to this Edje object anymore. While all other objects have the scale value 1.8, the new object has the scale value 1.37.

            + + + + + + + + + + +
            Note
            The default base scale value is 1.0. All scale values in Edje objects, either set with the global scale value using the edje_scale_set() function or with a personal scale factor using the edje_object_scale_set() function are divided by base scale.
            + +

            Figure: Base scale

            +

            Base scale

            + +

            Setting a scale value that is same as the base scale makes the layout appear as if it had the scale value 1.0.

            +
          6. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/edje_text_n.htm b/org.tizen.ui.practices/html/native/efl/edje_text_n.htm new file mode 100644 index 0000000..f37599a --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/edje_text_n.htm @@ -0,0 +1,712 @@ + + + + + + + + + + + + + + Using Edje Text Classes + + + + + + +
          +

          Using Edje Text Classes

          + +

          This tutorial demonstrates how you can change the text of 2 or more parts using Edje text classes.

          +

          If a part is assigned with a text class, setting font attributes to this class updates all those parts with the new font attributes. Setting the values to a text class affects all parts in that text class at process level, while at the object level, it only affects the parts inside a specified object.

          + +

          Creating the Basic Application

          + +

          The example application has 2 screen with different UIs. The screens demonstrate different text class APIs. The screen contains a genlist with 2 items set into a naviframe. Clicking an item opens displays a screen. Pressing the hardware Back button displays the main screen with the genlist.

          + +
            +
          1. Create the basic application: + +
            static void
            +win_back_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   elm_naviframe_item_pop(ad->navifr);
            +}
            +
          2. + +
          3. +

            Get the path to the EDC file that contains the main layout and the Edje object to load:

            + +
            static void
            +app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max)
            +{
            +   char *res_path = app_get_resource_path();
            +   if (res_path) 
            +   {
            +      snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in);
            +      free(res_path);
            +   }
            +}
            + +

            Create a window and register an event callback that calls the win_back_cb() function after pressing the Back button on the device:

            + +
            static void
            +create_base_gui(appdata_s *ad)
            +{
            +   Elm_Object_Item *eoi = NULL;
            +
            +   // Window
            +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +   elm_win_conformant_set(ad->win, EINA_TRUE);
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   if (elm_win_wm_rotation_supported_get(ad->win)) 
            +   {
            +      int rots[4] = {0, 90, 180, 270};
            +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            +   }
            +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
            +}
            +
            +
          4. + +
          5. +

            Add a conformant that contains the naviframe and genlist. Add item selection callbacks for the genlist items to show different screens:

            + +
            static char *
            +_genlist_item_text_get(void *data, Evas_Object *obj, const char *part)
            +{
            +   Eina_Stringshare *text_class = (Eina_Stringshare *)data;
            +   if (strcmp(part, "elm.text") == 0)
            +      return strdup(text_class);
            +   else
            +      return NULL;
            +}
            +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   // Conformant
            +   ad->conform = elm_conformant_add(ad->win);
            +   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
            +   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
            +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(ad->win, ad->conform);
            +   evas_object_show(ad->conform);
            +
            +   // Naviframe
            +   ad->navifr = elm_naviframe_add(ad->win);
            +   elm_object_content_set(ad->conform, ad->navifr);
            +   eext_object_event_callback_add(ad->navifr, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, ad);
            +
            +   // Genlist
            +   ad->itc = elm_genlist_item_class_new();
            +   ad->itc->func.text_get =_genlist_item_text_get;
            +
            +   ad->genlist = elm_genlist_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +
            +   eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Text Class List"), NULL,
            +                                 ELM_GENLIST_ITEM_NONE, NULL, ad);
            +   eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Object Text Class API"), NULL,
            +                                 ELM_GENLIST_ITEM_NONE, NULL, ad);
            +   elm_naviframe_item_simple_push(ad->navifr, ad->genlist);
            +
            +   // Show the window
            +   evas_object_show(ad->win);
            +}
            + + +

            The following figure shows the result.

            + +

            Figure: Main screen

            +

            Main screen

          6. +
          + +

          Getting, Deleting, and Displaying Text Classes

          + +

          The first screen of the application shows an example of the edje_text_class_del(), edje_text_class_list(), and edje_text_class_get() functions.

          + +

          The following code implements the layout:

          + +
          +group 
          +{ 
          +   name: "class_list_application";
          +   parts 
          +   {
          +      part 
          +      { 
          +         name: "text_view";
          +         type: TEXT;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            visible: 1;
          +            color: 0 0 0 255;
          +            align: 0.5 0.0;
          +            text 
          +            {
          +               text: "text part number 3";
          +               font: "Sans";
          +               min: 1 1;
          +               max: 1 1;
          +               size: 20;
          +            }
          +         }
          +      }
          +      part 
          +      { 
          +         name: "edje.swallow.list";
          +         type: SWALLOW;
          +         description
          +         { 
          +            state: "default" 0.0;
          +            align: 0.5 0.0;
          +            color: 0 0 0 255;
          +            rel1 
          +            {
          +               relative: 0.0 1.0;
          +               to_y: "text_view";
          +            }
          +         }
          +      }
          +   }
          +}
          +
          + +

          Figure: First screen EDC layout

          +

          First screen EDC layout

          + +

          The first part (text_view) shows the properties of the selected text class. Clicking a text class in the genlist shows its properties, such as font, size, and name in the text part.

          + +
            +
          1. +

            Add the base genlist:

            + +
            +ad->genlist = elm_genlist_add(ad->win);
            +evas_object_size_hint_weight_set(ad->genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Text Class List"), NULL, 
            +                              ELM_GENLIST_ITEM_NONE, _create_class_list_gui, ad);
            +eoi = elm_genlist_item_append(ad->genlist, ad->itc, eina_stringshare_add("Object Text Class API"), 
            +                              NULL, ELM_GENLIST_ITEM_NONE, NULL, ad);
            +elm_naviframe_item_simple_push(ad->navifr, ad->genlist);
            +
            +
          2. + +
          3. +

            Load the layout:

            + +
            static void
            +_create_class_list_gui(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data; // Get application's data
            +   char edj_path[PATH_MAX] = {0, }; // path to edc file
            +   Eina_List *l;  //  Used later
            +   const char *str; // Used later
            +   Elm_Object_Item *eoi = NULL; // Used later
            +   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +
            +   // Main layout
            +   ad->gui1_layout = elm_layout_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->gui1_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_layout_file_set(ad->gui1_layout, edj_path, "class_list_application");
            +}
            +
            +
          4. + +
          5. +

            Get a list of all text classes loaded into the system.In the following example, the Eina_List list is a field in application data.

            + +
            ad->list = edje_text_class_list();
            +
          6. + +
          7. +

            Create the genlist:

            + +
            // Genlist
            +ad->itc_text_classes = elm_genlist_item_class_new();
            +ad->itc_text_classes->func.text_get =_genlist_item_text_get;
            +
            +ad->genlist_text_classes = elm_genlist_add(ad->win);
            +evas_object_size_hint_weight_set(ad->genlist_text_classes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +
            +
          8. + +
          9. +

            Go through the text class list and insert each text class to the genlist. Set the genlist into the main layout of the current screen and show it in the naviframe:

            + +
            +EINA_LIST_FOREACH(ad->list, l, str)
            +{
            +   eoi = elm_genlist_item_append(ad->genlist_text_classes, ad->itc_text_classes, str, NULL, ELM_GENLIST_ITEM_NONE, NULL, ad);
            +   elm_object_item_data_set(eoi, (void *)str);
            +}
            +elm_object_part_content_set(ad->gui1_layout, "edje.swallow.list", ad->genlist_text_classes);
            +evas_object_show(ad->genlist_text_classes);
            +elm_naviframe_item_simple_push(ad->navifr, ad->gui1_layout);
            +
            + + +

            Clicking Text Class List displays the screen with a genlist of text classes.

            + +

            Figure: Text class list

            +

            Text class list

            +
          10. + +
          11. +

            The edje_text_class_del() function deletes a text class (in the following example, T094):

            + +
            +// Main layout
            +ad->gui1_layout = elm_layout_add(ad->win);
            +evas_object_size_hint_weight_set(ad->gui1_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_layout_file_set(ad->gui1_layout, edj_path, "class_list_application");
            +evas_object_show(ad->gui1_layout);
            +
            +// Get the collection list
            +app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +edje_text_class_del("T094");
            +ad->list = edje_text_class_list();
            +
            +// Genlist
            +ad->itc_text_classes = elm_genlist_item_class_new();
            +ad->itc_text_classes->func.text_get =_genlist_item_text_get;
            +
            + +

            Figure: Text class list after deleting a class

            +

            Text class list after deleting a class

            +
          12. + +
          13. +

            Every text class contains specific information, such as the font name, font size, and text class name. To show the properties when the text class name is clicked, create a callback that uses the edje_text_class_get() function:

            + +
            static void
            +_genlist_clicked(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   char text_class[PATH_MAX] = {0, };
            +   Elm_Object_Item *eoi = NULL;
            +   const char *str;
            +   char *font;
            +   Evas_Font_Size size;
            +
            +   eoi = elm_genlist_selected_item_get(obj);
            +   str = elm_object_item_data_get(eoi);
            +   edje_text_class_get(str, &font, &size);
            +   snprintf(text_class, PATH_MAX, "%s font{%s} size{%d}", str, font, size);
            +   elm_object_part_text_set(ad->gui1_layout, "text_view", text_class);
            +}
            +
          14. + +
          15. +

            Register the added callback function in the genlist:

            + +
            +EINA_LIST_FOREACH(ad->list, l, str)
            +{
            +   eoi = elm_genlist_item_append(ad->genlist_text_classes, ad->itc_text_classes, str, NULL, ELM_GENLIST_ITEM_NONE, _genlist_clicked, ad);
            +   elm_object_item_data_set(eoi, (void *)str);
            +}
            +elm_object_part_content_set(ad->gui1_layout, "edje.swallow.list", ad->genlist_text_classes);
            +
            +evas_object_show(ad->genlist_text_classes);
            +elm_naviframe_item_simple_push(ad->navifr, ad->gui1_layout);
            +
            + +

            Figure: Displaying text class properties

            +

            Displaying text class properties

            +
          16. +
          + + +

          Application Layout

          + +

          The second screen contains 2 Edje object with text parts containing the custom_text_class text class. When a text class is modified, all text parts assigned to it are changed as well.

          + +

          The following example shows a simple Edje object layout:

          + +
          +group 
          +{ 
          +   name: "edje_example";
          +   parts 
          +   {
          +      part 
          +      { 
          +         name: "text_example";
          +         type: TEXT;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            visible: 1;
          +            color: 0 0 0 255;
          +            text 
          +            {
          +               text: "text part number 3";
          +               font: "Sans";
          +               size: 10;
          +               text_class: "custom_text_class";
          +            }
          +         }
          +      }
          +   }
          +}
          + +
            +
          1. +

            After loading the Edje objects, add a spinner for changing the font size.

            + +

            Add 2 buttons for changing the text class of a specific object or setting the font size of the custom_text_class text class. The Set1 button sets a new size for the text class of the first Edje object and the Set2 button for the second object, respectively.

            + +

            The Get1 and Get2 buttons get the text class properties and display them on the screen.

            +

            The Global button changes the text class globally, causing all Edje object parts to be changed in case they contain the custom_text_class text class.

            + +
            +group 
            +{ 
            +   name: "class_list_application";
            +   parts 
            +   {
            +      part 
            +      { 
            +         name: "text_view";
            +         type: TEXT;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            visible: 1;
            +            color: 0 0 0 255;
            +            align: 0.5 0.0;
            +            text 
            +            {
            +               text: "text part number 3";
            +               font: "Sans";
            +               min: 1 1;
            +               max: 1 1;
            +               size: 20;
            +            }
            +         }
            +      }
            +      part 
            +      { 
            +         name: "edje.swallow.list";
            +         type: SWALLOW;
            +         description 
            +         { 
            +            state: "default" 0.0;
            +            align: 0.5 0.0;
            +            color: 0 0 0 255;
            +            rel1 
            +            {
            +               relative: 0.0 1.0;
            +               to_y: "text_view";
            +            }
            +      }
            +   }
            +}
            +
            +
          2. + +
          3. +

            Create a view for the new screen:

            + +
            static void
            +_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   char edj_path[PATH_MAX] = {0, };
            +
            +   app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
            +
            +   // Main Layout
            +   ad->gui2_layout = elm_layout_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->gui2_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_layout_file_set(ad->gui2_layout, edj_path, "object_text_class_application");
            +   evas_object_show(ad->gui2_layout);
            +
            +   // Add group1
            +   ad->edje_object_1 = edje_object_add(evas_object_evas_get(ad->win));
            +   evas_object_size_hint_weight_set(ad->edje_object_1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   edje_object_file_set(ad->edje_object_1, edj_path, "edje_example");
            +   // Check the object loading error
            +   if (edje_object_load_error_get(ad->edje_object_1) != EDJE_LOAD_ERROR_NONE)
            +   {
            +      evas_object_del(ad->edje_object_1);
            +
            +      return;
            +   }
            +   evas_object_show(ad->edje_object_1);
            +   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.group1", ad->edje_object_1);
            +
            +   // Addgroup2
            +   ad->edje_object_2 = edje_object_add(evas_object_evas_get(ad->win));
            +   evas_object_size_hint_weight_set(ad->edje_object_2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   edje_object_file_set(ad->edje_object_2, edj_path, "edje_example");
            +   // Check object loading errors
            +   if (edje_object_load_error_get(ad->edje_object_2) != EDJE_LOAD_ERROR_NONE)
            +   {
            +      evas_object_del(ad->edje_object_2);
            +
            +      return;
            +   }
            +   evas_object_show(ad->edje_object_2);
            +   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.group2", ad->edje_object_2);
            +
            +   // Add spinner
            +   ad->spinner = elm_spinner_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->spinner, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(ad->spinner, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   elm_spinner_min_max_set(ad->spinner, 1, 64);
            +   elm_spinner_step_set(ad->spinner, 1);
            +   evas_object_show(ad->spinner);
            +   elm_spinner_value_set(ad->spinner, 10);
            +   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.spinner", ad->spinner);
            +   elm_naviframe_item_simple_push(ad->navifr, ad->gui2_layout);
            +}
            + + +

            Figure: Second application screen

            +

            Second application screen

          4. +
          + +

          Setting the Text Class for All Edje Objects

          + +

          To set the text class globally, use the edje_test_class_set() function:

          + +
            +
          1. +

            Add a box and pack the buttons into it. Add the Global button and register a callback for clicking:

            + +
            static void
            +_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *box, *button;
            +   // Add the box
            +   box = elm_box_add(ad->gui2_layout);
            +   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
            +   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
            +   elm_box_horizontal_set(box, EINA_TRUE);
            +   evas_object_show(box);
            +
            +   button = elm_button_add(ad->gui2_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, "Global");
            +   evas_object_show(button);
            +   evas_object_smart_callback_add(button, "clicked", _edje_text_class_set, ad);
            +   elm_box_pack_end(box, button);
            +
            +   elm_object_part_content_set(ad->gui2_layout, "edje.swallow.buttons", box);
            +
            +   elm_naviframe_item_simple_push(ad->navifr, ad->gui2_layout);
            +}
            +
          2. + +
          3. +

            The callback contains functions for setting the text class globally:

            + +
            static void
            +_edje_text_class_set(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   edje_text_class_set("custom_text_class", "Sans", elm_spinner_value_get(ad->spinner));
            +}
            + +

            Clicking the Global button recalculates all text parts in every Edje object that contains the custom_text_class text class and changes their size.

            + + +

            Figure: Changing the text class globally

            +

            Changing the text class globally

          4. + +
          + +

          Setting the Text Class of a Specific Object

          + +

          To set the text class of a specific Edje object, use the edje_object_test_class_set() function.

          + +
            +
          1. +

            Add 2 more buttons, Set1 and Set2.

            +

            The first button sets the text class of the first Edje object on the left, and the second sets the text class of the other object, respectively.

            + +
            static void
            +_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            +{
            +   button = elm_button_add(ad->gui2_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, Set1);
            +   evas_object_show(button);
            +   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_set_1, ad);
            +   elm_box_pack_end(box, button);
            +
            +   button = elm_button_add(ad->gui2_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, Set2);
            +   evas_object_show(button); 
            +   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_set_2, ad);
            +   elm_box_pack_end(box, button);
            +}
            +
          2. + +
          3. +

            Add callbacks:

            + +
            static void
            +_edje_object_text_class_set_1(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   edje_object_text_class_set(ad->edje_object_1, "custom_text_class", "Sans", elm_spinner_value_get(ad->spinner));
            +}
            +
            +static void
            +_edje_object_text_class_set_2(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   edje_object_text_class_set(ad->edje_object_2, "custom_text_class", "Sans", elm_spinner_value_get(ad->spinner));
            +}
            +
          4. + +
          5. +

            Test the functionality:

            + +
              +
            1. Set the size of the left object to 16. + +

              Font size 16

            2. + +
            3. Set the size of the right object to 44. + +

              Font size 44

            4. + +
            5. Set the size of the right object to 22. + +

              Font size 22

            6. +
            +
          6. +
          + + +

          Getting the Text Class of an Object

          + +

          To get the text class of a specific Edje object, use the edje_object_test_class_get() function.

          + +
            +
          1. +

            Add 2 more buttons, Get1 and Get2. The first gets the text class of the first Edje object on the left and sets into that object result, and the second gets the text class of the other object, respectively.

            + +
            static void
            +_create_text_class_gui(void *data, Evas_Object *obj, void *event_info)
            +{
            +   button = elm_button_add(ad->gui2_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, Get1);
            +   evas_object_show(button); 
            +   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_get_1, ad);
            +   elm_box_pack_end(box, button);
            +
            +   button = elm_button_add(ad->gui2_layout);
            +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_object_text_set(button, Get2);
            +   evas_object_show(button); 
            +   evas_object_smart_callback_add(button, "clicked", _edje_object_text_class_get_2, ad);
            +   elm_box_pack_end(box, button);
            +}
            +
          2. + +
          3. +

            Add callbacks:

            +
            static void
            +_edje_object_text_class_get_1(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   char *font;
            +   Evas_Font_Size size;
            +   char text_class[PATH_MAX] = {0, };
            +
            +   edje_object_text_class_get(ad->edje_object_1, "custom_text_class", &font, &size);
            +   snprintf(text_class, PATH_MAX, "font{%s} size{%d}", font, size);
            +   edje_object_part_text_set(ad->edje_object_1, "text_example", text_class);
            +}
            +
            +static void
            +_edje_object_text_class_get_2(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   char *font;
            +   Evas_Font_Size size;
            +   char text_class[PATH_MAX] = {0, };
            +
            +   edje_object_text_class_get(ad->edje_object_2, "custom_text_class", &font, &size);
            +   snprintf(text_class, PATH_MAX, "font{%s} size{%d}", font, size);
            +   edje_object_part_text_set(ad->edje_object_2, "text_example", text_class);
            +}
            + + +

            The following figure shows the result.

            + +

            Figure: Displaying text class changes

            +

            Displaying text class changes

            + + +

            Changing the custom_text_class for the first object changed its font size to 16 size, while changing the custom_text_class for the second object changes its font size to 22.

          4. +
          + + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/efl_overview_n.htm b/org.tizen.ui.practices/html/native/efl/efl_overview_n.htm new file mode 100644 index 0000000..3e89915 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/efl_overview_n.htm @@ -0,0 +1,135 @@ + + + + + + + + + + + + + EFL Overview: Getting Started with EFL UI Programming + + + + + +
          + +

          EFL Overview: Getting Started with EFL UI Programming

          + +

          EFL stands for Enlightenment Foundation Libraries. Enlightenment is a project consisting of the Enlightenment window manager, EFL libraries, and various utilities and applications. The Enlightenment team needed powerful libraries to handle, among others, rendering, main loops, and events, so EFL was introduced during the development of the Enlightenment window manager to fill these gaps. EFL is now widely used outside of the Enlightenment window manager.

          + +

          EFL Features

          + +

          The general UI design features include:

          +
            +
          • UI component support +

            You can use basic core UI components, such as buttons, genlists, and sliders, and also create a layout for the Tizen native application by using container UI components.

          • +
          • Theme support +

            You can create and change a theme that is a preset package containing graphical details. Tizen supports specifying the UI look and feel through a default theme.

          • +
          • Font settings +

            Tizen supports various methods to change the font of your application to another system default font or your own font.

          • +
          • Scalability +

            Elementary provides a way to scale UI components in order to be comfortably used with a finger and to make the text more readable.

          • +
          • Event handling and main loop +

            The user interface relies on callbacks designed to react to EFL events generated by the system or the user. You can handle various events, from low-level Ecore system events to Evas smart object events that happen on object collections.

            +

            The Ecore library provides a main loop abstraction that gets you data when it is available and sends you events. You can handle the main loop and use threads with the Ecore main loop.

          • +
          • UI animating with animators and effects +

            Tizen supports various methods to create animations and effects in your application.

          • +
          • Data types and tools support +

            Tizen supports a core library for data types and some useful tools.

          • +
          • Hardware input event support +

            Tizen supports the handling of hardware input events.

          • +
          + +

          EFL Characteristics

          + +

          EFL is aimed at not only desktop computers but also touch-screen and embedded devices, making EFL applications portable to many different types of devices. Applications do not need to care about the types of devices and profiles they run on. Instead of changing the code, it is typically enough to simply configure the applications for different devices.

          + +

          The key characteristics of EFL include:

          + +
            +
          • Performance +

            The main reason Tizen adopted EFL as its native toolkit is its speed. EFL is highly optimized by using a scene graph and retained-mode rendering. EFL is fast even in software rendering.

          • +
          • Small memory footprint +

            Despite its fast performance, EFL's memory footprint is smaller than that of other toolkits with similar features. A small memory footprint is useful in the embedded world, since embedded devices do not normally have much memory.

          • +
          • Back-end engine support +

            EFL supports several back-end engines, such as X11 (OpenGL, Xlib, Xcb), Wayland (OpenGL, SHM), Direct Framebuffer, DRM, memory buffers, PS3 native, Windows, and Mac OS. Applications do not need to deal with each back-end engine separately.

          • +
          • GUI and logic separation +

            EFL supports GUI layout and logic separation by having the layout description in a plain text file and the logic code in the C or C++ source files.

          • +
          • Themeable +

            An EFL theme can be changed at runtime without restarting the application. UI components are customizable so that each application can create its own customized theme to overlay above the default theme, adding customized versions of UI components to achieve a specific look and feel.

          • +
          • Scalable +

            EFL supports a scale factor that affects the size of objects in the application at runtime. By configuring the scale factor, applications can scale up and down as needed. The scale factor also supports a default setting that allows applications to scale nicely out-of-the-box.

          • +
          • Animations +

            EFL supports different types of animations. Evas supports Evas maps with low-level APIs for performing 2D, 2.5D, and 3D object transformations. Edje supports pre-defined transitions and wrapping of Evas maps. Elementary supports transit APIs for various types of animations, which can be combined.

          • +
          • Hardware acceleration +

            EFL supports OpenGL® and OpenGL-ES acceleration.

          • +
          + + +

          EFL Libraries

          + +

          The EFL are a set of layered libraries, as shown in the following diagram:

          + +

          Figure: EFL layers

          +

          EFL layers

          + +

          When you create a basic EFL application, you use the following main libraries as a basis:

          + +
            +
          • Elementary is the top-most library with which you create your EFL application. It 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. The full list of UI components that can be used in Tizen can be found in Mobile UI Components and Wearable UI Components.
          • +
          • Edje is the library used by Elementary to provide a powerful theme. You can also use Edje to create your own objects and use them in your application. You may also want to extend the default theme. You will find more information about Edje and the EDC format in Themes and Customizing Components.
          • +
          • Ecore is the library which manages the main loop of your application. The main loop is one of the most important concepts you need to know about to develop an application. The main loop is where events are handled, and where you interact with the user through the callback mechanism. The main loop mechanisms are explained in the Handling the Main Loop guide.
          • +
          • Evas is the canvas engine. Evas is responsible for managing the drawing of your content. All graphical objects that you create are Evas objects. Evas handles the entire state of the window by filling the canvas with objects and manipulating their states. In contrast to other canvas libraries, such as Cairo, OpenGL, and XRender, Evas is not a drawing library but a scene graph library that retains the state of all objects. The Evas concept is explained in Evas Rendering Concept and Method. Evas objects are created and then manipulated until they are no longer needed, at which point they are deleted. This allows the developer to work in the same terms that a designer thinks in: it is a direct mapping, as opposed to having to convert the concepts into drawing commands in the right order, calculate minimum drawing calls needed to get the job done, and so on.
          • +
          • Eina is the basis of all the EFL libraries. 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. Eina concepts are explained in Data Types and Tools.
          • +
          + +

          The EFL include more than just the above libraries, but the above are the most important libraries to get started with. The other libraries, such as Eet, Embryo, and Emotion, will be explored later in the programming guides and the API Reference (in mobile and wearable applications).

          + +

          The Hello World example shows you how to develop your first application with the EFL.

          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/elementary_animation_n.htm b/org.tizen.ui.practices/html/native/efl/elementary_animation_n.htm new file mode 100644 index 0000000..2dc4ea5 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/elementary_animation_n.htm @@ -0,0 +1,872 @@ + + + + + + + + + + + + + Elementary Animations + + + + + +
          + +

          Elementary Animations

          + +

          Elementary transitions (Elm_Transit) allow you to apply various transition effects, such as translation and rotation, to Evas objects. Elementary transitions are mostly based on Ecore animators, but provide some transition methods at a higher level of abstraction. Elementary transitions provide a simpler way of animating objects than Ecore animators or Edje animations.

          + +

          To use Elementary transitions, you must create an Elm_Transit object and define the desired transitions using the methods of this object. After the transitions are registered, they will be automatically managed: their callback functions will be called for the set duration, and they will be deleted upon completion.

          + +

          Use Elementary transitions only when Edje animations are not sufficient. Edje animations are better at handling transitions, have more flexibility, and can be manipulated inside themes. The only drawback is that Edje animations have their own definition language. If you want to code with the C language, use Elementary transitions.

          + +

          Getting Started

          +

          The first thing you need to do when creating an transition with Elm_Transit is to build your transit object using the elm_transit_add() function:

          + +
          Elm_Transit *transit = elm_transit_add();
          + +

          You now have an Elm_Transit instance that will allow you to perform transitions on one or more objects. The transit object holds the information about the target objects and the transition effects that will be used. The transit object also contains information about animation duration, number of repetitions, auto-reverse, and so on. The transit object starts playing as soon as the application enters the main loop.

          + +

          Adding Objects to an Animation

          + +

          You can add your Evas objects to your transition using the elm_transit_object_add() function:

          + +
          elm_transit_object_add(Elm_Transit *transit, Evas_Object *obj)
          + +

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the Evas object to animate.

          + + + + + + + + + + +
          Note

          The Evas object can be a low-level component, such as a rectangle, but also a UI component, such as a button, image, or calendar.

          +

          If you want to animate an Evas object handled by a container, such as a box, you need to either unpack the object before the animation or animate the whole container.

          + +

          If you want to know which objects are currently in your transition, use the elm_transit_objects_get() function. You will get a list of all the objects that are subject to the transition.

          + +

          At any time, you can remove objects from the transition:

          + +
          elm_transit_object_remove(Elm_Transit *transit, Evas_Object *obj)
          + +

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the Evas object to remove from the transition.

          + + + + + + + + + + +
          Note
          After you have added at least one Evas object to your transition, if the list of objects gets emptied somehow, be it because the transition has been terminated or all objects have been deleted, the transition will be automatically deleted. Otherwise, you will have to delete the transition by yourself using the elm_transit_del() function. If you delete the transit while the transition is running, the transition will stop.
          + +

          Adding Images to an Animation

          + +

          If you do not want to manage UI components for animating images, Elm_Transit provides a helper function for directly manipulating images:

          + +
          +elm_transit_effect_image_animation_add(Elm_Transit *transit, Eina_List *images)
          +
          + +

          The first argument is the Elm_Transit instance that handles the transition. The second argument is a list of the image paths.

          + + + + + + + + + + +
          Note
          This list and its contents will be deleted after the effect ends by the elm_transit_effect_image_animation_context_free() function.
          + +

          You can now define your image transitions exactly the same way as with any Evas object.

          + +

          The following example shows how to use Elm_Transit with images:

          + +
          char buf[PATH_MAX];
          +Eina_List *images = NULL;
          +Elm_Transit *transit = elm_transit_add();
          +snprintf(buf, sizeof(buf), "%s/images/btn_default.png", PACKAGE_DATA_DIR);
          +images = eina_list_append(images, eina_stringshare_add(buf));
          +snprintf(buf, sizeof(buf), "%s/images/btn_hover.png", PACKAGE_DATA_DIR);
          +images = eina_list_append(images, eina_stringshare_add(buf));
          +elm_transit_effect_image_animation_add(transit, images);
          + +

          Animation Duration

          + +

          With Elm_Transit, setting the transition duration is mandatory. To set the duration, use the elm_transit_duration_set() function:

          + +
          elm_transit_duration_set(Elm_Transit *transit, double duration)
          + +

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the duration in seconds.

          + + + + + + + + + + +
          Note
          The purpose of Elm_Transit is to abstract the low-level details of object interpolation, so you cannot create an infinite transition by specifying the duration. However, you can make your transition last forever using the repeat function.
          + +

          The following example shows how to make a complete revolution of the target Evas object in 2 seconds:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, my_evas_object);
          +elm_transit_effect_rotation_add(transit, 0.0, 360);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_go(transit);
          +
          + +

          To get the duration of the transition, use the elm_transit_duration_get() function.

          + +

          Animation Acceleration Mode ("Tween Mode")

          + +

          Elm_Transit supports a number of built-in interpolation methods. By default, all interpolations are linear. If you want to change the animation's dynamics, use the elm_transit_tween_mode_set() function:

          + +
          elm_transit_tween_mode_set(Elm_Transit *transit, Elm_Transit_Tween_Mode tween_mode)
          + +

          The first argument is the Elm_Transit instance that handles the transition. The second argument is the tween mode of the transition, which can be one of the following:

          +
            +
          • ELM_TRANSIT_TWEEN_MODE_LINEAR: The default mode.
          • +
          • ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL: The transition starts with acceleration and ends with deceleration.
          • +
          • ELM_TRANSIT_TWEEN_MODE_DECELERATE: The transition decelerates over time.
          • +
          • ELM_TRANSIT_TWEEN_MODE_ACCELERATE: The transition accelerates over time.
          • +
          • ELM_TRANSIT_TWEEN_MODE_BEZIER_CURVE: The transition uses an interpolated cubic-bezier curve adjusted with parameters.
          • +
          + +

          To get the current tween mode, use the elm_transit_tween_mode_get() function.

          + +

          Animation Repeat

          + +

          To set a transition to repeat, use the elm_transit_repeat_times_set() function:

          + +
          elm_transit_repeat_times_set(Elm_Transit *transit, int repeat)
          + +

          The function takes the following arguments:

          +
            +
          • The transition you want to repeat.
          • +
          • The number of times the transition repeats.
          • +
          + + + + + + + + + + +
          Note
          If the repeat argument is set to 0, the transition will not loop at all. If set to 1, the transition will run twice. If set to a negative value, the transition will repeat forever.
          + +

          To get the repeat value, use the elm_transit_repeat_times_get() function. The default value is 0.

          + +

          The following example shows how to make an Evas object spin for 3 complete revolutions in 6 seconds:

          + +
          Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, my_evas_object);
          +elm_transit_effect_rotation_add(transit, 0.0, 360);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_repeat_set(transit, 3.0);
          +elm_transit_go(transit);
          + +

          Animation Auto-reverse

          + +

          Elm_Transit provides a helper function for automatically reversing the transition once it finishes:

          + +
          elm_transit_auto_reverse_set(Elm_Transit *transit, Eina_Bool reverse)
          + +

          The first argument is the transition you want to reverse. The second argument is the reverse state. If the reverse state is set to EINA_TRUE, this function will perform the same transition backwards as soon as the first transition is complete.

          + + + + + + + + + + +
          Note
          +

          Reversing the transition doubles the duration of the transition. Moreover, if the transition is set to repeat, the transition will run back and forth until the repeat count is finished.

          +

          You can calculate the duration as follows if both auto-reverse and repeat are set: 2 * duration * repeat.

          +
          + +

          The following example shows how to make an object perform half a turn and then reverse the animation to its original position in 4 seconds:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, my_evas_object);
          +elm_transit_effect_rotation_add(transit, 0.0, 360);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_auto_reverse_set(transit, EINA_TRUE);
          +elm_transit_go(transit);
          +
          + +

          To determine whether the auto-reverse mode is enabled, use the elm_transit_auto_reverse_get() function.

          + +

          Transitions

          + +

          We distinguish two main transition types:

          +
            +
          • Transitions that are applied to the properties of objects, such as position, size, angle, and color.
          • +
          • Transitions from one object to another, where the first object is hidden to let the second one appear.
          • +
          +

          All transitions are based on the same principle: we set the starting and the ending values for the properties we want to animate, we then set the lifespan of the animation, and finally we inquire the preferred interpolation method (such as linear, acceleration, or bounce).

          + +

          You must declare the transitions after the parent window has been created, since the transition effects make use of the geometric properties of the parent window. If the parent window does not yet exist when calculating the interpolation, the interpolation may end up being based on wrong information.

          + +

          Built-in Transitions

          + +

          Elm_Transit provides several built-in transition definitions that are useful for the most common cases, so you that will not have to code them from scratch.

          + +

          All these built-in effects are implemented as follows:

          + +
          Elm_Transit *transit = elm_transit_add();
          +elm_transit_effect_add(transit,
          +                       elm_transit_effect_translation_op,
          +                       elm_transit_effect_translation_context_new(),
          +                       elm_transit_effect_translation_context_free);
          + +
            +
          • transit: The Elm_Transit object that contains the target Evas objects and all the information needed to setup the transition.
          • +
          • elm_transit_effect_translation_op: The callback function that performs the transition (resizing interpolation in this example).
          • +
          • elm_transit_effect_translation_context_new(): The callback function that returns the context used in the transition for calculations. In this example, the context is the coordinates of the before and after objects.
          • +
          • elm_transit_effect_translation_context_free: The callback function that frees up the memory once the transition is complete.
          • +
          + +

          All the definitions above can be rewritten as follows:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_effect_translation_add(transit, from_x, from_y, to_x, to_y);
          +
          + +

          Translation

          +

          To perform a translation on an Evas object, use the following method:

          + +
          +elm_transit_effect_translation_add(Elm_Transit *transit,
          +                                   Evas_Coord from_dx,
          +                                   Evas_Coord from_dy,
          +                                   Evas_Coord to_dx,
          +                                   Evas_Coord to_dy)
          +
          + +
            +
          • The first argument is the transit object that contains (among other things) all the Evas objects subject to the translation.
          • +
          • from_dx: The starting X coordinate (source).
          • +
          • from_dy: The starting Y coordinate (source).
          • +
          • to_dx: The ending X coordinate (destination).
          • +
          • to_dy: The ending Y coordinate (destination).
          • +
          + +

          The following example shows how to slide an Evas object (a rectangle) on a 45-degree diagonal, from bottom-left to top-right, at a constant speed, and in 1 second:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, rectangle);
          +elm_transit_effect_translation_add(transit, 0, 0, 280, 280);
          +elm_transit_duration_set(transit, 1);
          +elm_transit_go(transit);
          +
          + +

          Color Transition

          + +

          Color transitions allow you to dynamically change the color of Evas objects. The first argument is the transit object, while the other arguments will be used to define the color transition using RGB colors. There is also an alpha channel that controls the opacity of the color (the background of the object, not the object itself).

          + +
          +elm_transit_effect_color_add(Elm_Transit *transit,
          +                             unsigned int from_r,
          +                             unsigned int from_g,
          +                             unsigned int from_b,
          +                             unsigned int from_a,
          +                             unsigned int to_r,
          +                             unsigned int to_g,
          +                             unsigned int to_b,
          +                             unsigned int to_a)
          +
          + +
            +
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • +
          • from_r: The start value for "Red".
          • +
          • from_g: The start value for "Green".
          • +
          • from_b: The start value for "Blue".
          • +
          • from_a: The start value for "Alpha".
          • +
          • to_r: The end value for "Red".
          • +
          • to_g: The end value for "Green".
          • +
          • to_b: The end value for "Blue".
          • +
          • to_a: The end value for "Alpha".
          • +
          + +

          The following example shows how to transit a rectangle from red to blue in 3 seconds:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, rectangle);
          +elm_transit_effect_color_add(transit, // Target object
          +                             255, 0, 0, 255, // From color
          +                             0, 0, 255, 255); // To color
          +elm_transit_duration_set(transit, 3);
          +elm_transit_go(transit);
          +
          + +

          Rotation

          + +
          elm_transit_effect_rotation_add(Elm_Transit *transit, float from_degree, float to_degree)
          + +
            +
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • +
          • from_degree: The start degree of rotation.
          • +
          • to_degree: The end degree of rotation.
          • +
          + +

          This function can be used to perform a rotation on any Evas object. It works the same way as the other transit effects and takes two arguments for the starting and ending angles. Note that if you apply a rotation on multiple objects, they will individually mill around and not act as a group. If you want several objects to revolve around a common point, you must encapsulate the objects into a single parent object and apply the rotation to the parent object. The following example shows how to achieve this:

          + +
          +// Parent container
          +Evas_Object *parent = elm_box_add(my_window);
          +evas_object_show(parent);
          +elm_box_horizontal_set(parent, EINA_TRUE);
          +elm_box_homogeneous_set(parent, EINA_TRUE);
          +
          +// Button 1
          +Evas_Object *btn1 = elm_button_add(parent);
          +elm_object_text_set(btn1, "Btn1");
          +elm_box_pack_start(parent, btn1);
          +evas_object_show(btn1);
          +
          +// Button 2
          +Evas_Object *btn2 = elm_button_add(parent);
          +elm_object_text_set(btn2, "Btn2");
          +elm_box_pack_end(parent, btn2);
          +evas_object_show(btn2);
          +
          +// Make the parent container do a 360 degrees spin
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, parent);
          +elm_transit_effect_rotation_add(transit, 0.0, 360);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_go(transit);
          +
          + +

          Wipe Effect

          + +

          The wipe effect is designed to dynamically hide or show any element on the scene.

          + +
          +elm_transit_effect_wipe_add(Elm_Transit *transit,
          +                            Elm_Transit_Effect_Wipe_Type type,
          +                            Elm_Transit_Effect_Wipe_Dir dir)
          +
          + +

          In addition to the Elm_Transit instance passed as the first argument, the function takes the following arguments:

          + +
            +
          • type: The wipe type Elm_Transit_Effect_Wipe_Type defines whether to show or hide the target elements. The value can be one of the following: +
              +
            • ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE
            • +
            • ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW
            • +
            +
          • +
          • dir: The wipe direction Elm_Transit_Effect_Wipe_Dir defines in which direction the target will progressively appear or disappear. The value can be one of the following: +
              +
            • ELM_TRANSIT_EFFECT_WIPE_DIR_LEFT
            • +
            • ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT
            • +
            • ELM_TRANSIT_EFFECT_WIPE_DIR_UP
            • +
            • ELM_TRANSIT_EFFECT_WIPE_DIR_DOWN
            • +
            +
          • +
          + +

          The following example shows how to make an object disappear progressively from left to right:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, my_evas_object);
          +elm_transit_effect_wipe_add(transit,
          +                            ELM_TRANSIT_EFFECT_TYPE_HIDE,
          +                            ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_go(transit);
          +
          + +

          Zoom Effect

          +

          Elm_Transit provides a zoom function.

          + +
          +elm_transit_effect_zoom_add(Elm_Transit *transit,
          +                            float from_rate,
          +                            float to_rate)
          +
          + +
            +
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • +
          • from_rate: The starting level of the zoom.
          • +
          • to_rate: The ending level of the zoom.
          • +
          + +

          The from_rate argument defines the scale of the target objects at the beginning of the animation. A value of 1 represents the initial scale of the objects.

          + +

          Setting the value of the to_rate argument to 2 will double the size of the target objects (double the width and double the height). When using this effect, the width and height of a target object will remain proportional to one another. If you want to customize the zoom effect, use the elm_transit_effect_resizing_add() function.

          + +

          The following example shows how to implement a zoom-out transition. At the end of the 2-secondstransition, the animated object will be half its original size.

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, my_evas_object);
          +elm_transit_effect_zoom_add(transit, 1, 0.5);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_go(transit);
          +
          + +

          Resizing Effect

          + +

          The resizing effect allows you to design an interpolation of the width and height attributes of one or more target elements.

          + +
          +elm_transit_effect_resizing_add(Elm_Transit *transit,
          +                                Evas_Coord from_w,
          +                                Evas_Coord from_h,
          +                                Evas_Coord to_w,
          +                                Evas_Coord to_h)
          +
          + +
            +
          • transit: The transit object that contains (among other things) all the Evas objects subject to the translation.
          • +
          • from_w: The starting width.
          • +
          • from_h: The starting height.
          • +
          • to_w: The ending width.
          • +
          • to_h: The ending height.
          • +
          + +

          The from_w and from_h arguments define the size at the beginning of the animation. The to_w and to_h arguments define the size at the end.

          + + + + + + + + + + +
          Note
          If you are planning to use this method to hide an Evas object by setting one of the length attributes to zero, consider using the elm_transit_effect_wipe_add() function instead.
          + +

          The following example shows how to make a rectangle exchange its width and height properties in a 2-second transition:

          + +
          +Evas_Coord w, h;
          +evas_object_geometry_get(my_evas_object, NULL, NULL, &w, &h);
          +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, my_evas_object);
          +elm_transit_effect_resize_add(transit, // Transition object
          +                              w, h, // Original sizing
          +                              h, w); // Target sizing
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_go(transit);
          +
          + +

          Flip Effect

          +

          This transition combines the target Evas objects in pairs, so that one object will show up while the other one disappears. This association relates the even objects in the transit list of objects with the odd ones. The even objects are shown at the beginning of the animation, and the odd objects shown when the transition is complete. In other words, the effect applies to each pair of objects in the order in which they are listed in the transit list of objects.

          + +

          The flip effect itself is a pseudo-3D effect where the first object in the pair is the front object and the second one is the back object. When the transition launches, the front object rotates around a preferred axis in order to let the back object take its place.

          + +
          +elm_transit_effect_flip_add(Elm_Transit *transit,
          +                            Elm_Transit_Effect_Flip_Axis axis,
          +                            Eina_Bool cw)
          +
          + +

          The first argument is the transit object. The second argument is the preferred axis of rotation:

          +
            +
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_X
          • +
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_Y
          • +
          + +

          The third argument is the direction of the rotation:

          +
            +
          • EINA_TRUE is clockwise.
          • +
          • EINA_FALSE is counter-clockwise.
          • +
          + +

          The following example shows how to create a coin that flips indefinitely. Note that we use images as Elementary UI components for demonstration purposes. You can use the elm_transit_effect_image_animation_add() function if you do not want to bother creating UI components.

          + +
          +// Coin Heads
          +Evas_Object *coin_heads = elm_image_add(ad->win);
          +if (!elm_image_file_set(coin_heads, IMG_DIR"/coin_heads.png", NULL))
          +   printf("error: could not load image");
          +elm_win_resize_object_add(ad->win, coin_heads);
          +
          +// Coin Tails
          +Evas_Object *coin_tails = elm_image_add(ad->win);
          +if (!elm_image_file_set(coin_tails, IMG_DIR"/coin_tails.png", NULL))
          +   printf("error: could not load image");
          +elm_win_resize_object_add(ad->win, coin_tails);
          +
          +// Transition definition
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, coin_heads);
          +elm_transit_object_add(transit, coin_tails);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_auto_reverse_set(transit, EINA_TRUE);
          +elm_transit_repeat_times_set(transit, -1);
          +elm_transit_effect_flip_add(transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_X, EINA_TRUE);
          +elm_transit_go(transit);
          +
          + +

          Figure: Coin flip

          +

          Coin flip

          + +

          Resizable Flip Effect

          +

          In the flip example above, we used two objects that have the same size. However, you may sometimes want to flip from one object to another object with different size attributes. The most common example would be using buttons with dimensions that depend on their contents (such as labels). If you decide to use the classic elm_transit_effect_flip_add() function, the size of the object will change at the moment one object becomes completely hidden and the other one begins to show up. If you wish to interpolate the size attributes as well, use the elm_transit_effect_resizable_flip_add() function:

          + +
          +elm_transit_effect_resizable_flip_add(Elm_Transit *transit,
          +                                      Elm_Transit_Effect_Flip_Axis axis,
          +                                      Eina_Bool cw)
          +
          + +

          The first argument is the transit object. The second argument is the preferred axis of rotation:

          +
            +
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_X
          • +
          • ELM_TRANSIT_EFFECT_FLIP_AXIS_Y
          • +
          + +

          The third argument is the direction of the rotation:

          +
            +
          • EINA_TRUE is clockwise.
          • +
          • EINA_FALSE is counter-clockwise.
          • +
          + +

          This function works the exact same way as the standard flip effect function.

          + +

          Fade Effect

          + +

          This effect is used to transition from one Evas object to another one using a fading effect: the first object will slowly disappear to let the second object take its place.

          + +
          elm_transit_effect_fade_add(Elm_Transit *transit)
          + +

          This effect is applied to each pair of objects in the order in which they are listed in the transit list of objects. The first object in the pair will be the before object and the second one will be the after object.

          + +

          Building on the coin flip example, the following example shows how to fade out one face of the coin while fading in the other face:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, coin_heads);
          +elm_transit_object_add(transit, coin_tails);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_effect_fade_add(transit);
          +elm_transit_go(transit);
          +
          + +

          If you simply want to hide an object with a fade transition, consider using a transparent after object.

          + +

          Blend Effect

          + +

          Another transition involving at least two Evas objects is the blend effect. This transition makes the before object blurry before the after object appears.

          + +
          elm_transit_effect_blend_add(Elm_Transit *transit)
          + +

          The argument is the transition target of the blend effect.

          + +

          Building on the coin flip example, the following example shows how to blur out one face of the coin while blurring in the other face:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, coin_heads);
          +elm_transit_object_add(transit, coin_tails);
          +elm_transit_duration_set(transit, 2.0);
          +elm_transit_effect_blend_add(transit);
          +elm_transit_go(transit);
          +
          + +

          If you simply want to hide an object with a blur transition, consider using a transparent after object.

          + +

          Combining Transitions

          + +

          To use multiple transitions at the same time on the same objects, simply declare the transitions one after the other.

          + +

          Building on the coin flip example, the following example shows how to roll the coin on the ground using a rotation and a translation effect:

          + +
          +Evas_Object *coin_heads = elm_image_add(ad->win);
          +if (!elm_image_file_set(coin_heads, IMG_DIR"/coin_heads.png", NULL))
          +   printf("error: could not load image");
          +evas_object_resize(coin_heads, 100, 100);
          +evas_object_show(coin_heads);
          +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_object_add(transit, coin_heads);
          +elm_transit_duration_set(transit, 5.0);
          +elm_transit_effect_translation_add(transit, 0, 0, 3.1415 * 2 * 100, 0);
          +elm_transit_effect_rotation_add(transit, 0, 360);
          +elm_transit_go(transit);
          +
          + +

          Animation Chain

          + +

          Now that we have listed all the effects that can be implemented using Elm_Transit, we will see how to chain transitions into sequences. To create complex, chained animations without worrying about synchronization between the transitions, use the elm_transit_chain_transit_add() function. This function takes as arguments two Elm_Transit objects and will automatically take care of the chaining for you: the second transition will start as soon as the first transition is finished.

          + +

          The following example shows how to move a datetime component on a square trajectory:

          + +
          +Evas_Object *dt = elm_datetime_add(ad->win);
          +evas_object_resize(dt, 350, 50);
          +evas_object_show(dt);
          +
          +// The first transition
          +Elm_Transit *t1 = elm_transit_add();
          +elm_transit_object_add(t1, dt);
          +elm_transit_duration_set(t1, 2);
          +elm_transit_effect_translation_add(t1, 0, 0, 100, 0);
          +
          +// The second transition
          +Elm_Transit *t2 = elm_transit_add();
          +elm_transit_object_add(t2, dt);
          +elm_transit_duration_set(t2, 2);
          +elm_transit_effect_translation_add(t2, 100, 0, 100, 100);
          +
          +// The third transition
          +Elm_Transit *t3 = elm_transit_add();
          +elm_transit_object_add(t3, dt);
          +elm_transit_duration_set(t3, 2);
          +elm_transit_effect_translation_add(t3, 100, 100, 0, 100);
          +
          +// The fourth transition
          +Elm_Transit *t4 = elm_transit_add();
          +elm_transit_object_add(t4, dt);
          +elm_transit_duration_set(t4, 2);
          +elm_transit_effect_translation_add(t4, 0, 100, 0, 0);
          +
          +// Chaining the transitions
          +elm_transit_chain_transit_add(t1, t2);
          +elm_transit_chain_transit_add(t2, t3);
          +elm_transit_chain_transit_add(t3, t4);
          +
          +// Starting the transitions
          +elm_transit_go(t1);
          +
          + +

          Note that we cannot use transition chaining to make a loop animation, since the transit object is automatically destroyed as soon as the transition completes. Therefore, you cannot do something like this:

          + +
          elm_transit_chain_transit_add(t4, t1);
          + +

          To create a looped animation chain, you have to use low-level components provided by the Ecore and Evas transition libraries, or you can use the elm_transit_del_cb_set() function to define a callback function for when a transition gets deleted. This way, you could recreate your objects and reiterate the transition chain as soon as the last transition ends.

          + +
          +elm_transit_del_cb_set(Elm_Transit *transit, Elm_Transit_Del_Cb cb, void *data)
          +
          + +

          The first argument is the transition object. The second argument is the callback function to run on transition delete. The third argument is the data to pass to the callback function.

          + +

          You can severe the chain relationship between two transits by using the elm_transit_chain_transit_del() function:

          + +
          elm_transit_chain_transit_del(Elm_Transit *transit, Elm_Transit *chain_transit)
          + +

          The first argument is the first transition in the chain. The second argument is the second transition in the chain.

          + +

          To get the current chain transit list, use the elm_transit_chain_transits_get() function.

          + +

          Animation Timeline

          + +

          After you have defined all the properties that define your transition, start the transition with the elm_transit_go() function:

          + +
          elm_transit_go(Elm_Transit *transit)
          + +

          You can maintain full control over the execution process even after the transition has started. You can pause the transition by setting the paused argument to EINA_TRUE:

          + +
          elm_transit_paused_set(Elm_Transit *transit, Eina_Bool paused)
          + +

          You can resume the transition by using the same method but setting the paused argument to EINA_FALSE. If you want to know whether the transition is currently paused, use the elm_transit_paused_get() function.

          + +

          You can remain informed about the present transition flow and get the current frame by using the elm_transit_progress_value_get() function. This function will return the timeline position of the animation, ranging between 0.0 (start) and 1.0 (end).

          + +

          Custom Transitions

          + +

          Elm_Transit provides a standard function for defining any effect of your choosing that will be applied to some context data:

          + +
          +elm_transit_effect_add(Elm_Transit *transit,
          +                       Elm_Transit_Effect_Transition_Cb transition_cb,
          +                       Elm_Transit_Effect *effect,
          +                       Elm_Transit_Effect_End_Cb end_cb)
          +
          + +

          The first argument is the transition target of the new effect. The second argument is the transition callback function. The third argument is the new effect. The fourth argument is the callback function to call at the end of the effect.

          + +

          As described earlier in this programming guide, this function embraces three callbacks that will allow you to define every aspects of your transition from its creation to its deletion. The following is an example of how to build a custom resizing animation.

          + +

          First, we define a structure capable of holding the context information about resizing an Evas object:

          + +
          +typedef struct
          +{
          +   struct _size
          +   {
          +      Evas_Coord w, h;
          +   }
          +   from, to;
          +}
          +Custom_Effect;
          +
          + +

          We can now implement our custom resizing callback function. This function takes the following arguments:

          + +
            +
          • The context data that holds the custom properties of our transition, which are used as parameters to calculate the interpolation.
          • +
          • The transit object that contains the list of our Evas objects to animate and all the information about duration, auto-reverse, looping, and so on.
          • +
          • The progress (position along the animation timeline) that ranges from 0.0 to 1.0 and allows us to calculate the desired interpolation for each frame.
          • +
          + +
          +static void
          +_custom_op(void *data, Elm_Transit *transit, double progress)
          +{
          +   if (!data) return;
          +   Evas_Coord w, h;
          +   Evas_Object *obj;
          +   const Eina_List *elist;
          +   Custom_Effect *custom_effect = data;
          +   const Eina_List *objs = elm_transit_objects_get(transit);
          +   if (progress < 0.5)
          +   {
          +      h = custom_effect->from.h + (custom_effect->to.h * progress * 2);
          +      w = custom_effect->from.w;
          +   }
          +   else
          +   {
          +      h = custom_effect->from.h + custom_effect->to.h;
          +      w = custom_effect->from.w + (custom_effect->to.w * (progress - 0.5) * 2);
          +   }
          +   EINA_LIST_FOREACH(objs, elist, obj)
          +      evas_object_resize(obj, w, h);
          +}
          +
          + +

          The callback function above resizes our Evas objects in two steps. During the first half of the transition, only the height changes, while the width remains the same. During the second half, it is the other way around until we get to the desired size.

          + +

          You must then define the context used by your animation:

          + +
          +static void*
          +_custom_context_new(Evas_Coord from_w, Evas_Coord from_h, Evas_Coord to_w, Evas_Coord to_h)
          +{
          +   Custom_Effect *custom_effect;
          +
          +   custom_effect = calloc(1, sizeof(Custom_Effect));
          +   if (!custom_effect) return NULL;
          +
          +   custom_effect->from.w = from_w;
          +   custom_effect->from.h = from_h;
          +   custom_effect->to.w = to_w - from_w;
          +   custom_effect->to.h = to_h - from_h;
          +
          +   return custom_effect;
          +}
          +
          + +

          You must define the function that will take care of deleting all the context objects used by your custom transition and free up the allocated memory:

          + +
          +static void
          +_custom_context_free(void *data, Elm_Transit *transit __UNUSED__)
          +{
          +   free(data);
          +}
          +
          + +

          Finally, apply your custom transition to your Elm_Transit object:

          + +
          +Elm_Transit *transit = elm_transit_add();
          +elm_transit_effect_add(transit,
          +                       _custom_op,
          +                       _custom_context_new(),
          +                       _custom_context_free);
          +
          + +

          If you want to delete an effect from your effects list, use the elm_transit_effect_del() function.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/elementary_animation_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/elementary_animation_tutorial_n.htm new file mode 100644 index 0000000..cf6e719 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/elementary_animation_tutorial_n.htm @@ -0,0 +1,662 @@ + + + + + + + + + + + + + + Creating Elementary Animations + + + + + + +
          +

          Creating Elementary Animations

          + + +

          This tutorial demonstrates how you can use Elm Transit to create animated transitions effects, such as rotation, wiping, zooming, resizing, and fading, to an Evas_Object.

          + + +

          Setting Up the Application

          + +

          To set up the application and create a resize effect:

          +
            +
          1. +

            Create a basic application as explained in the Hello World example and Creating Basic Mobile Interactions.

            +
          2. +
          3. +

            Create Evas objects and animate them. In this example, one single object is animated with different type of animations.

            + +

            Create the structure of the application, represented by the appdata struct, that holds the main UI components of the application:

            + +
            +typedef struct 
            +appdata 
            +{
            +   Evas_Object *win; // Main window
            +   Evas_Object *label; // Title label
            +   Evas_Object *button; // Button object, the target of the animations
            +   Evas_Object *buttonbck; // Button representing the back of the target button
            +   Evas_Object *hbox; // Horizontal box to store the vertical boxes
            +   Evas_Object *left_vbox; // Vertical box for the first button column
            +   Evas_Object *center_vbox; // // Vertical box for the second button column
            +   Evas_Object *right_vbox; // // Vertical box for the last button column
            +   float rt_angle, zto, zfrom; // Variables used to store values for animations
            +} appdata_s;
            +
            +
          4. +
          5. +

            Place the UI components on the application canvas:

            + +
            1. +

              The create_base_gui() function takes appdata_s *ad as its only parameter. This function is called by the creation of the app_create callback of the Tizen application (event_callback.create = app_create;) in the main() function of the application.

              +
              +create_base_gui(appdata_s *ad)
              +{
              +
              +
            2. +
            3. +

              Set up the rotation angle, the original zoom value (zfrom), and the destination zoom value (zto):

              +
              +   ad->rt_angle = 360.0;
              +   ad->zfrom = 1.0;
              +   ad->zto = 2.0;
              +
              +
            4. +
            5. +

              Create the main window with a title and add the delete callback:

              +
              +   // Window
              +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
              +   elm_win_autodel_set(ad->win, EINA_TRUE);
              +
              +   if (elm_win_wm_rotation_supported_get(ad->win)) 
              +   {
              +      int rots[4] = {0, 90, 180, 270};
              +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
              +   }
              +
              +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
              +
              +   // Label
              +   ad->label = elm_label_add(ad->win);
              +   elm_object_text_set(ad->label, "Effects Tutorial");
              +   evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +   elm_win_resize_object_add(ad->win, ad->label);
              +   evas_object_show(ad->label);
              +
              +   // Show the window after the base GUI is set up
              +   evas_object_show(ad->win);
              +
              +   ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, ad);
              +
              +
            6. +
            7. +

              Create the animation target button and the back button. Call the button box creation function with the application data as its parameter.

              +
              +   // Create a button in the app window
              +   ad->button = elm_button_add(ad->win);
              +
              +   // Move the button to x = 50 y = 100
              +   evas_object_move(ad->button, 50, 100);
              +
              +   // Resize the button 100 x 50
              +   evas_object_resize(ad->button, 200, 50);
              +
              +   // Show the button
              +   evas_object_show(ad->button);
              +
              +   // Create a back button in the app window
              +   ad->buttonbck = elm_button_add(ad->win);
              +   elm_object_text_set(ad->buttonbck, "Button back");
              +   evas_object_move(ad->buttonbck, 50, 100);
              +   evas_object_resize(ad->buttonbck, 200, 50);
              +
              +   _create_btn_box(ad);
              +
              +} // End of create_base_gui
              +
              +
          6. +
          7. +

            Create the structure of the buttons box with 3 columns (vertical boxes) and one horizontal for the main container:

            +
            +// Create the main container box
            +ad->hbox = elm_box_add(ad->win);
            +elm_box_horizontal_set(ad->hbox, EINA_TRUE);
            +elm_box_homogeneous_set(ad->hbox, EINA_TRUE);
            +evas_object_move(ad->hbox, 10, 500);
            +evas_object_show(ad->hbox);
            +
            +// Create the first column
            +ad->left_vbox = elm_box_add(ad->hbox);
            +elm_box_horizontal_set(ad->left_vbox, EINA_FALSE);
            +elm_box_homogeneous_set(ad->left_vbox, EINA_TRUE);
            +evas_object_show(ad->left_vbox);
            +elm_box_pack_start(ad->hbox, ad->left_vbox);
            +
            +// Create the second column
            +ad->center_vbox = elm_box_add(ad->hbox);
            +elm_box_horizontal_set(ad->center_vbox, EINA_FALSE);
            +elm_box_homogeneous_set(ad->center_vbox, EINA_TRUE);
            +evas_object_show(ad->center_vbox);
            +elm_box_pack_end(ad->hbox, ad->center_vbox);
            +
            +// Create the last column
            +ad->right_vbox = elm_box_add(ad->hbox);
            +elm_box_horizontal_set(ad->right_vbox, EINA_FALSE);
            +elm_box_homogeneous_set(ad->right_vbox, EINA_TRUE);
            +evas_object_show(ad->right_vbox);
            +elm_box_pack_end(ad->hbox, ad->right_vbox);
            +
            +
          8. +
          9. +

            Create the first action button for the resize effect.

            +

            The evas_object_smart_callback_add() function defines the callback function that is to be called when the button is clicked. In this example, set a _btn_resize_cb() function and pass the application data ad to this callback function.

            +
            +// Create the button
            +btn_resize = elm_button_add(ad->win);
            +// Set the button text
            +elm_object_text_set(btn_resize, "Resize");
            +// Set the hint weight policy
            +evas_object_size_hint_weight_set(btn_resize, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +// Show the button
            +evas_object_show(btn_resize);
            +// Set the "clicked" callback
            +evas_object_smart_callback_add(btn_resize, "clicked", _btn_resize_cb, ad);
            +// Add the button to the first column
            +elm_box_pack_end(ad->left_vbox, btn_resize);
            +
            + +

            The callback by itself only sets a new text for the animation target button, and calls the evas_object_smart_callback function, which actually animates the button.

            +

            The evas_object_smart_callback function needs its specific prototype: it returns nothing and receives the data to be passed, the callback object, and the actual event (seldom used) as parameters.

            + +

            In this case, pass the application data to the callback. However, note that the parameter's type is void * and not appdata_s *, so you must initialize a variable of the correct type with the pointer.

            +
            +static void 
            +_btn_resize_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Resize");
            +   _resize_effect(ad->button);
            +}
            +
            +
          10. +
          11. +

            Use the application data in the callback function. At this point, you can create the animation directly in the callback function, but it is more straightforward to encapsulate the animation process into a dedicated function. The _resize_effect() function implements the following animation code:

            +
              +
            1. +

              Create an Elm_Transit * object representing the transition:

              +
              +static void 
              +_resize_effect(Evas_Object *obj)
              +{
              +   // Elementary Transition declaration and creation
              +   Elm_Transit *trans = elm_transit_add();
              +
              +
            2. +
            3. +

              Add the target object to the transition:

              +
              +   // Add the transition target object
              +   elm_transit_object_add(trans, obj);
              +
              +
            4. +
            5. +

              Add a resizing transition to the object with the origin and destination width and height in pixels:

              +
              +   // Set the resize effect
              +   elm_transit_effect_resizing_add(trans, 100, 50, 300, 150);
              +
              +

              100 and 50 are respectively the object's width and height when the effect begins, whereas 300 and 150 are respectively the object's width and height when the effect ends: the object grows from 100 x 50 to 300 x 150.

              +
            6. +
            7. +

              Set the transition duration with the elm_transit_duration_set() function:

              +
              +   // Set the transition duration
              +   elm_transit_duration_set(trans, 3.0);
              +
              +

              The animation lasts 3 seconds. The duration parameter is a double.

              +
            8. +
            9. +

              Start the animation by calling the elm_transit_go() function with the Elm_Transit object:

              +
              +   // Start the transition
              +   elm_transit_go(trans);
              +}
              +
              +

              When the resize button is clicked, the animation target button grows.

              + +

              All the action buttons are created exactly the same way as the resize button, with a callback and an animation function.

              +
            10. +
            +
          12. +
          + +

          Creating a Rotation Effect

          + +

          The rotation effect rotates the animation target button with an angle of 360°. This angle is stored in the application data as ad->rt_angle.

          +

          To create the rotation effect:

          +
            +
          1. +

            Create the button and add it to the center column in the _create_btn_box() function:

            +
            +// Rotation button
            +btn_rotate = elm_button_add(ad->win);
            +elm_object_text_set(btn_rotate, "Rotate");
            +evas_object_size_hint_weight_set(btn_rotate, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_rotate);
            +evas_object_smart_callback_add(btn_rotate, "clicked", _btn_rotate_cb, ad);
            +elm_box_pack_end(ad->center_vbox, btn_rotate);
            +
            +
          2. +
          3. +

            Call the effect function with the target button as the first parameter and the rotation angle as the second parameter:

            +
            +static void 
            +_btn_rotate_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Rotate");
            +   _rotation_effect(ad->button, ad->rt_angle);
            +}
            +
            +
          4. +
          5. +

            Define the animation function. The animation function rotates the animation target by adding a rotation effect with the elm_transit_effect_rotation_add() function. This function takes 3 parameters:

            + +
              +
            • Elm_Transit
            • +
            • Rotation position at which the effect begins (0°)
            • +
            • Rotation position at which the effect ends (360°)
            • +
            +

            The animation lasts 2 seconds.

            + +
            +static void 
            +_rotation_effect(Evas_Object *obj, float angle)
            +{
            +   Elm_Transit *trans = elm_transit_add();
            +   elm_transit_object_add(trans, obj);
            +
            +   // Rotate the object from its original angle to given degrees to the right
            +   elm_transit_effect_rotation_add(trans, 0.0, angle);
            +   elm_transit_duration_set(trans, 2.0);
            +   elm_transit_go(trans);
            +}
            +
            +
          6. +
          + +

          Creating a Zoom Effect

          + +

          The zoom effect zooms on the animation target to make it twice as big. Store the source and destination zoom level in the application data using ad->zfrom and ad->zto.

          + +

          To create a zoom effect:

          +
            +
          1. +

            Create the button and add it to the center column in the _create_btn_box() function:

            + +
            +// Zoom button
            +btn_zoom = elm_button_add(ad->win);
            +elm_object_text_set(btn_zoom, "Zoom");
            +evas_object_size_hint_weight_set(btn_zoom, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_zoom);
            +evas_object_smart_callback_add(btn_zoom, "clicked", _btn_zoom_cb, ad);
            +elm_box_pack_end(ad->right_vbox, btn_zoom);
            +
            +
          2. +
          3. +

            Add a callback function to perform the animation:

            + +
            +static void 
            +_btn_zoom_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Zoom");
            +   _zoom_effect(ad->button, ad->zfrom, ad->zto);
            +}
            +
            +
          4. +
          5. +

            Create the function which runs the animation.

            +

            To create the zoom effect, use the elm_transit_effect_zoom_add() function with the start and destination zoom level stored in the application data (ad->zfrom and ad->zto).

            + +
            +static void 
            +_zoom_effect(Evas_Object *obj, float from, float to)
            +{
            +   Elm_Transit *trans = elm_transit_add();
            +   elm_transit_object_add(trans, obj);
            +
            +   elm_transit_effect_zoom_add(trans, from, to);
            +   elm_transit_duration_set(trans, 2.0);
            +   elm_transit_go(trans);
            +}
            +
            +
          6. +
          + +

          Creating a Flip Effect

          + +

          This effect is applied to a pair of objects, in the order they are added, in the Elm_Transit transition. In this example, add the animation target button and the button called buttonbck, which represents the back of the target button.

          +

          To create a flip effect:

          +
            +
          1. +

            Create the action button for the flip effect:

            + +
            +// Flip button
            +btn_flip = elm_button_add(ad->win);
            +elm_object_text_set(btn_flip, "Flip x");
            +evas_object_size_hint_weight_set(btn_flip, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_flip);
            +evas_object_smart_callback_add(btn_flip, "clicked", _btn_flip_cb, ad);
            +elm_box_pack_end(ad->left_vbox, btn_flip);
            +
            +
          2. +
          3. +

            Create and start the animation with the 2 objects (target button and back button) to animate:

            + +
            +static void 
            +_btn_flip_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Flip");
            +   _flip_effect(ad->button, ad->buttonbck);
            +}
            +
            +
          4. +
          5. +

            Create the function which runs the animation.

            +

            This flip animation is created using the elm_transit_effect_flip_add() function. The second parameter is the axis of the flip: in this example it is the X axis, so the button flips down from top to show the back button. The last parameter is the flip direction: EINA_TRUE means clockwise.

            +
            +static void 
            +_flip_effect(Evas_Object *obj, Evas_Object *obj2)
            +{
            +   Elm_Transit *trans;
            +
            +   trans = elm_transit_add();
            +   elm_transit_object_add(trans, obj);
            +   elm_transit_object_add(trans, obj2);
            +   elm_transit_effect_flip_add(trans, ELM_TRANSIT_EFFECT_FLIP_AXIS_X, EINA_TRUE);
            +
            +   elm_transit_duration_set(trans, 3.0);
            +   elm_transit_go(trans);
            +}
            +
            +
          6. +
          + +

          Creating a Blend Transition

          + +

          The blend effect works the same way as the flip, but without the axis or direction information. Use the back button in this case as well.

          + +

          To create a blend transition:

          +
            +
          1. +

            Create the blend effect button:

            +
            +// Blend button
            +btn_blend = elm_button_add(ad->win);
            +elm_object_text_set(btn_blend, "Blend");
            +evas_object_size_hint_weight_set(btn_blend, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_blend);
            +evas_object_smart_callback_add(btn_blend, "clicked", _btn_blend_cb, ad);
            +elm_box_pack_end(ad->center_vbox, btn_blend);
            +
            +
          2. +
          3. +

            Create the blend transition callback:

            +
            +static void 
            +_btn_blend_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Blend");
            +   _blend_effect(ad->button, ad->buttonbck);
            +}
            +
            +
          4. +
          5. +

            Create and start the blend animation.

            +

            This animation is created by adding 2 objects to Elm_Transit and using the elm_transit_effect_blend_add() function.

            + +
            +static void 
            +_blend_effect(Evas_Object *obj, Evas_Object *obj2)
            +{
            +   Elm_Transit *trans;
            +
            +   trans = elm_transit_add();
            +   elm_transit_object_add(trans, obj);
            +   elm_transit_object_add(trans, obj2);
            +   elm_transit_effect_blend_add(trans);
            +   elm_transit_duration_set(trans, 3.0);
            +   elm_transit_go(trans);
            +}
            +
            +
          6. +
          + + +

          Creating a Fade Effect

          + +

          The fade effect works exactly the same way as the blend effect.

          + +

          To create a fade effect:

          +
            +
          1. +

            Create the fade button:

            +
            +// Fade button
            +btn_fade = elm_button_add(ad->win);
            +elm_object_text_set(btn_fade, "Fade");
            +evas_object_size_hint_weight_set(btn_fade, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_fade);
            +evas_object_smart_callback_add(btn_fade, "clicked", _btn_fade_cb, ad);
            +elm_box_pack_end(ad->right_vbox, btn_fade);
            +
            +
          2. +
          3. +

            Add the button callback:

            +
            +static void 
            +_btn_fade_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Fade");
            +   _fade_effect(ad->button, ad->buttonbck);
            +}
            +
            +
          4. +
          5. +

            Create and start the animation. Call the elm_transit_effect_fade_add() function.

            + +
            +static void 
            +_fade_effect(Evas_Object *obj, Evas_Object *obj2)
            +{
            +   Elm_Transit *trans;
            +
            +   trans = elm_transit_add();
            +   elm_transit_object_add(trans, obj);
            +   elm_transit_object_add(trans, obj2);
            +   elm_transit_effect_fade_add(trans);
            +   elm_transit_duration_set(trans, 3.0);
            +   elm_transit_go(trans);
            +}
            +
            +
          6. +
          + +

          Creating a Flip on the Y Axis

          + +

          This is same as the flip transition, but on the Y axis.

          +

          To create a flip on the Y axis:

          +
            +
          1. +

            Create the flip y button:

            +
            // Flip y button
            +btn_flip_y = elm_button_add(ad->win);
            +elm_object_text_set(btn_flip_y, "Flip y");
            +evas_object_size_hint_weight_set(btn_flip_y, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_flip_y);
            +evas_object_smart_callback_add(btn_flip_y, "clicked", _btn_flip_y_cb, ad);
            +elm_box_pack_end(ad->left_vbox, btn_flip_y);
            +
            +
          2. +
          3. +

            Add the button callback:

            +
            +static void 
            +_btn_flip_y_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Flip 2");
            +   _flip_y_effect(ad->button, ad->buttonbck);
            +}
            +
            +
          4. +
          5. +

            Create and start the animation:

            +
            +static void 
            +_flip_y_effect(Evas_Object *obj, Evas_Object *obj2)
            +{
            +   Elm_Transit *trans;
            +
            +   trans = elm_transit_add();
            +   elm_transit_object_add(trans, obj);
            +   elm_transit_object_add(trans, obj2);
            +   elm_transit_effect_flip_add(trans, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE);
            +   elm_transit_duration_set(trans, 3.0);
            +   elm_transit_go(trans);
            +}
            +
            +
          6. +
          + +

          Creating a Wipe Effect

          + +

          The wipe transition is applied on an Evas object considering the wipe type and the direction.

          +

          To create a wipe effect:

          +
            +
          1. +

            Create the wipe animation button:

            + +
            +// Wipe button
            +btn_wipe = elm_button_add(ad->win);
            +elm_object_text_set(btn_wipe, "Wipe");
            +evas_object_size_hint_weight_set(btn_wipe, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(btn_wipe);
            +evas_object_smart_callback_add(btn_wipe, "clicked", _btn_wipe_cb, ad);
            +elm_box_pack_end(ad->right_vbox, btn_wipe);
            +
            +
          2. +
          3. +

            Add the button callback:

            + +
            +static void 
            +_btn_wipe_cb(void *data, Evas_Object *btn, void *ev)
            +{
            +   appdata_s *ad = data;
            +
            +   // Set the button text
            +   elm_object_text_set(ad->button, "Wipe");
            +   _wipe_effect(ad->button);
            +}
            +
            +
          4. +
          5. +

            Create and start the wipe animation.

            +

            The animation function calls the elm_transit_effect_wipe_add() function with ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE as the second parameter to hide the button and ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT as the last parameter to set the direction (left to right).

            + +
            +static void 
            +_wipe_effect(Evas_Object *obj)
            +{
            +    Elm_Transit *trans;
            +
            +    trans = elm_transit_add();
            +    elm_transit_object_add(trans, obj);
            +    elm_transit_effect_wipe_add(trans, ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
            +    elm_transit_duration_set(trans, 3.0);
            +    elm_transit_go(trans);
            +}
            +
            +
          6. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/elementary_transit_effect_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/elementary_transit_effect_tutorial_n.htm new file mode 100644 index 0000000..41961fe --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/elementary_transit_effect_tutorial_n.htm @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + Creating Elementary Transit Effects + + + + + + +
          +

          Creating Elementary Transit Effects

          + +

          This tutorial demonstrates how you can implement a variety of EFL animation effects using the APIs available in the EFL library.

          + +

          Initializing the Application Layout

          +

          The application uses UI components, such as elm_conformant and elm_naviframe for view management, layout classes, such as elm_list for the composition of the screen, and UI components, such as elm_button and elm_image for the content inside the view.

          +

          The transit is designed to apply various animated transition effects to the Evas_Object. The following transition effects are supported in the Tizen native applications:

          +
            +
          • Blend
          • +
          • Color
          • +
          • Fade
          • +
          • Flip
          • +
          • Rotation
          • +
          • Transition
          • +
          • Wipe
          • +
          • Zoom
          • +
          + +

          To initialize the application layout:

          +
            +
          1. +

            Create the layout with the create_base_gui() function. First, a window is created and the elm_conformant component is added to it to decorate the window with an indicator. The elm_naviframe component is added to act as a view manager for the window and provide the window title functionality.

            +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   // Window
            +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   if (elm_win_wm_rotation_supported_get(ad->win)) 
            +   {
            +      int rots[4] = { 0, 90, 180, 270 };
            +      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
            +   }
            +
            +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            +
            +   // Conformant
            +   ad->conform = elm_conformant_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(ad->win, ad->conform);
            +   evas_object_show(ad->conform);
            +
            +   // Naviframe
            +   ad->nf = create_main_view(ad);
            +   elm_object_content_set(ad->conform, ad->nf);
            +
            +   // Show window after the base GUI is set up
            +   evas_object_show(ad->win);
            +
            +   ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, ad);
            +}
            +
            +
          2. +
          3. +

            Create the main view with the create_main_view() function. The main view consists of a naviframe containing a list. This function returns a list of naviframe object pointers for the content set.

            +
            +static Evas_Object*
            +create_main_view(appdata_s *ad)
            +{
            +   Elm_Object_Item *nf_it;
            +   Evas_Object *navi, *list;
            +
            +   navi = elm_naviframe_add(ad->conform);
            +
            +   list = elm_list_add(navi);
            +   elm_list_mode_set(list, ELM_LIST_COMPRESS);
            +
            +   elm_list_item_append(list, "Blend", NULL, NULL, blend_cb, navi);
            +   elm_list_item_append(list, "Color", NULL, NULL, color_cb, navi
            +   elm_list_item_append(list, "Fade", NULL, NULL, fade_cb, navi);
            +   elm_list_item_append(list, "Flip", NULL, NULL, flip_cb, navi);
            +   elm_list_item_append(list, "Rotation", NULL, NULL, rotation_cb, navi);
            +   elm_list_item_append(list, "ResizableFlip", NULL, NULL, resizable_flip_cb, navi);
            +   elm_list_item_append(list, "Translation", NULL, NULL, translation_cb, navi);
            +   elm_list_item_append(list, "Wipe", NULL, NULL, wipe_cb, navi);
            +   elm_list_item_append(list, "Zoom", NULL, NULL, zoom_cb, navi);
            +   elm_list_item_append(list, "Custom", NULL, NULL, custom_cb, navi);
            +   elm_list_go(list);
            +
            +   nf_it = elm_naviframe_item_push(navi, "Transit", NULL, NULL, list, NULL);
            +
            +   return navi;
            +}
            +
            + +

            This tutorial describes only the rotation and zoom implementations. For more information about other effects, see the transit.c file and the Transit API. The following figure illustrates the rotation and zoom effects.

            + +

            Figure: Rotation and zoom

            +

            Rotation and zoom

            + +
          4. +
          + + +

          Implementing the Rotation Effect

          + +

          When the rotation effect is selected in the list, a related callback function that implements the animation effect is called. The data is sent as an Evas_Object.

          +

          To implement the rotation effect:

          +
            +
          1. Use the elm_transit object with the elm_transit_add() function to add the transit effect: +
            +static void
            +rotation_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *layout = (Evas_Object *) data;
            +   Elm_Transit *transit = elm_transit_add();
            +
            +
          2. +
          3. Set the transit rotation amount and duration: +
            +   // 360 degree rotation effect in the clockwise direction
            +   elm_transit_object_add(transit, layout);
            +   elm_transit_effect_rotation_add(transit, 0, 360);
            +   elm_transit_duration_set(transit, 1);
            +   elm_transit_del_cb_set(transit, transit_del_cb, NULL);
            +
            +
          4. +
          5. To start the transit animation, use the elm_transit_go() function: +
            +   elm_transit_go(transit);
            +}
            +
            +
          6. +
          + +

          Implementing the Zoom Effect

          + +

          When the zoom effect is selected in the list, a related callback function that implements the animation effect is called. The data is sent as an Evas_Object.

          +

          To implement the zoom effect:

          +
            +
          1. After adding the transit object, add an Evas_Object to get the zoom effect: +
            +static void
            +zoom_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *layout = (Evas_Object *) data;
            +
            +
          2. +
          3. Set the zoom from the original size (1.0) to 0.4 times the original size, and set the duration: +
            +   // Zoom out to scale 0.6
            +   Elm_Transit *transit = elm_transit_add();
            +   elm_transit_smooth_set(transit, EINA_FALSE);
            +   elm_transit_object_add(transit, layout);
            +   elm_transit_effect_zoom_add(transit, 1.0, 0.4);
            +   elm_transit_duration_set(transit, 0.5);
            +
            +
          4. +
          5. Similarly, set the zoom size (0.4) back to the original size (1.0), and set the duration: +
            +   // Zoom in to the original size
            +   Elm_Transit *transit2 = elm_transit_add();
            +   elm_transit_smooth_set(transit2, EINA_FALSE);
            +   elm_transit_object_add(transit2, layout);
            +   elm_transit_effect_zoom_add(transit2, 0.4, 1.0);
            +   elm_transit_duration_set(transit2, 0.5);
            +   elm_transit_del_cb_set(transit2, transit_del_cb, NULL);
            +
            +
          6. +
          7. Set both effects to be applied in sequence, and start the animation: +
            +   elm_transit_chain_transit_add(transit, transit2);
            +   elm_transit_go(transit);
            +}
            +
            +
          8. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/evas_advanced_objects_n.htm b/org.tizen.ui.practices/html/native/efl/evas_advanced_objects_n.htm new file mode 100644 index 0000000..5fb12ed --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_advanced_objects_n.htm @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + Advanced Manipulation of Evas Objects + + + + + + +
          +

          Advanced Manipulation of Evas Objects

          + + +

          This tutorial demonstrates how you can use Evas object extra functions.

          + +

          This tutorial shows how to create an application that enables scaling of an Evas text object by clicking buttons. Data setter and getter functions are used to pass the scalable object through the clicked button object to a callback.

          +

          The tutorial also shows how to change the Evas object rendering mode using the extra object manipulation API.

          + +

          Figure: Advanced Evas application

          +

          Advanced Evas application

          + + +

          Creating the Basic Application

          +

          To create the basic application:

          +
            +
          1. +

            To use the required APIs, include the following libraries:

            + +
            #include <app.h>
            +#include <Elementary.h>
            +#include <system_settings.h>
            +#include <efl_extension.h>
            +
          2. + +
          3. +

            Create objects for an Elementary window and buttons for scaling and changing the object render mode. Also create a text object and 2 rectangle objects to connect to the application data structure:

            + +
            typedef struct appdata 
            +{
            +   Evas_Object *win;
            +   Evas_Object *scale_incr_button;
            +   Evas_Object *scale_decr_button;
            +
            +   Evas_Object *render_text;
            +   Evas_Object *blend_mode_button;
            +   Evas_Object *copy_mode_button;
            +   Evas_Object *render_rect1;
            +   Evas_Object *render_rect2;
            +} 
            +appdata_s;
            +
          4. +
          + +

          Creating the Elementary Window

          +

          To create an elementary window:

          +
            +
          1. +

            Use the elm_win_util_standard_add() function and give there the name and title of the application. To set a callback for the Back hardware button, use the eext_object_event_callback_add() function. To display the Evas object, use the evas_object_show() function.

            + +
            static void
            +create_base_gui(appdata_s *ad)
            +{
            +   // Window
            +   ad->win = elm_win_util_standard_add("Extra object function", "Extra object function");
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   // Window callbacks
            +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, back_cb, ad);
            +
            +   // Show the window
            +   evas_object_show(ad->win);
            +}
            +
          2. + +
          3. + +

            Implement callback functions to enable closing the application:

            + +
            static void
            +back_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +
            +   elm_win_lower(ad->win);
            +}
            +
            +static void
            +win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   ui_app_exit();
            +}
            +
          4. +
          + +

          Creating an Application

          +

          Create an Elementary application with a GUI:

          + +
          static bool
          +app_create(void *data)
          +{
          +   appdata_s *ad = data;
          +
          +   // Create the application UI
          +   create_base_gui(ad);
          +
          +   return true;
          +}
          +
          +int
          +main(int argc, char *argv[])
          +{
          +   appdata_s ad = {0,};
          +
          +   ui_app_lifecycle_callback_s event_callback = {0,};
          +
          +   event_callback.create = app_create;
          +
          +   // Run the main loop
          +   return ui_app_main(argc, argv, &event_callback, &ad);
          +}
          + +

          Creating Buttons

          +

          To create buttons:

          +
            +
          1. +

            Create the scale buttons. The move() and resize() functions configure the buttons' custom geometry.

            + +
            // Scale increasing button
            +ad->scale_incr_button = elm_button_add(ad->win);
            +elm_object_text_set(ad->scale_incr_button, "Scale +");
            +evas_object_resize(ad->scale_incr_button, 120, 50);
            +evas_object_move(ad->scale_incr_button, 180, 20);
            +evas_object_show(ad->scale_incr_button);
            +
            +// Scale decreasing button
            +ad->scale_decr_button = elm_button_add(ad->win);
            +elm_object_text_set(ad->scale_decr_button, "Scale -");
            +evas_object_resize(ad->scale_decr_button, 120, 50);
            +evas_object_move(ad->scale_decr_button, 180, 170);
            +evas_object_show(ad->scale_decr_button);
            +
          2. + +
          3. +

            Create the render mode change buttons:

            + +
            // Blend render mode button
            +ad->blend_mode_button = elm_button_add(ad->win);
            +elm_object_text_set(ad->blend_mode_button, "BLEND Mode");
            +evas_object_resize(ad->blend_mode_button, 190, 50);
            +evas_object_move(ad->blend_mode_button, 30, 280);
            +evas_object_show(ad->blend_mode_button);
            +
            +// Copy render mode button
            +ad->copy_mode_button = elm_button_add(ad->win);
            +elm_object_text_set(ad->copy_mode_button, "COPY Mode");
            +evas_object_resize(ad->copy_mode_button, 190, 50);
            +evas_object_move(ad->copy_mode_button, 260, 280);
            +evas_object_show(ad->copy_mode_button);
            +
          4. +
          + +

          Creating Callbacks for the Button Click Signal

          +

          To create the callbacks:

          +
            +
          1. +

            Create callbacks:

            + +
            +evas_object_smart_callback_add(ad->scale_incr_button, "clicked", scale_incr_cb, NULL);
            +evas_object_smart_callback_add(ad->scale_decr_button, "clicked", scale_decr_cb, NULL);
            +evas_object_smart_callback_add(ad->blend_mode_button, "clicked", blend_mode_cb, ad);
            +evas_object_smart_callback_add(ad->copy_mode_button, "clicked", copy_mode_cb, ad);
            +
          2. + +
          3. +

            Implement callback functions to enable changing the scale and render mode:

            + +
            static void
            +scale_incr_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *evas_text = evas_object_data_get(obj, "evas_text");
            +   if (!evas_text)
            +      return;
            +
            +   double current_scale = evas_object_scale_get(evas_text);
            +
            +   if (current_scale >= 5.0)
            +      return;
            +
            +   evas_object_scale_set(evas_text, current_scale + 0.2);
            +}
            +
            +static void
            +scale_decr_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *evas_text = evas_object_data_get(obj, "evas_text");
            +   if (!evas_text)
            +      return;
            +
            +   double current_scale = evas_object_scale_get(evas_text);
            +
            +   if (current_scale <= 0.0)
            +   {
            +      return;
            +   }
            +
            +   evas_object_scale_set(evas_text, current_scale - 0.2);
            +}
            +
            +static void
            +blend_mode_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +
            +   evas_object_text_text_set(ad->render_text, "EVAS_RENDER_BLEND: d = d * (1-sa) + s");
            +   evas_object_render_op_set(ad->render_rect2, EVAS_RENDER_BLEND);
            +}
            +
            +static void
            +copy_mode_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +
            +   evas_object_text_text_set(ad->render_text, "EVAS_RENDER_COPY: d = s");
            +   evas_object_render_op_set(ad->render_rect2, EVAS_RENDER_COPY);
            +}
            +
          4. +
          + +

          Attaching Data to the Object

          +

          To attach data to the object:

          +
            +
          1. +

            Use the evas_object_data_set() function. To create the keyword to get the data, use the evas_object_data_get() function.

            + +

            Create the text object using the evas_object_text_add() function.

            + +
            +evas = evas_object_evas_get(ad->win);
            +
          2. + +
          3. +

            Create the Evas text object to be used as data attached to the button:

            + +
            +evas_text = evas_object_text_add(evas);
            +evas_object_text_text_set(evas_text, "Scalable Text Object");
            +evas_object_text_font_set(evas_text, "Sans", 10);
            +evas_object_color_set(evas_text, 50, 100, 200, 255);
            +evas_object_move(evas_text, 10, 90);
            +evas_object_show(evas_text);
            +
          4. +
          + +

          Attaching Data

          + +

          The data is passed to the function through buttons. Use the evas_object_data_set() function for the button. Give a pointer to the attach data, and the key name to associate it with the data.

          + +
          +evas_object_data_set(ad->scale_incr_button, "evas_text", evas_text);
          +evas_object_data_set(ad->scale_decr_button, "evas_text", evas_text);
          + +

          Getting data

          + +

          To get the file data attached to the object, use the evas_object_data_get() function and give the data key name added when you attached this data:

          + +
          Evas_Object *evas_text = evas_object_data_get(obj, "evas_text");
          + +

          Deleting data

          + +

          To delete the data attached to the object, use the evas_object_data_del() function and give the data key name added when you attached this data:

          + +
          evas_object_data_del(obj, "evas_text");
          + +

          Using Scale Functions

          + +

          To set the scale factor to a single Evas object instead of setting scale to the entire application, use the evas_object_scale_set() function. This is useful when you want scalable UI elements at runtime. However, only text and textblock objects have scaling change handlers. Other objects do not change visually on this call. In this application, the scale is defined in the button click callbacks.

          + +
          double current_scale = evas_object_scale_get(evas_text);
          +
          +if (current_scale >= 5.0)
          +   return;
          +
          +evas_object_scale_set(evas_text, current_scale + 0.2);
          + +

          Get the current scale of the Evas text object and check its maximum size. If the current size is smaller than the maximum size, the scale factor for the object is increased using the evas_object_scale_set function. The text object is updated on display and its size changes.

          + +

          Configuring the Evas Object Render Mode

          + +

          To change the render operation to be used for rendering the Evas object, use the evas_object_render_op_set() function. To get the current render operation, use the evas_object_render_op_get() function.

          + +

          Creating Rectangle Objects

          + +

          Creates Evas rectangle objects to change the Evas rendering mode for them:

          + +
          // Rectangle with yellow background
          +ad->render_rect1 = evas_object_rectangle_add(evas);
          +evas_object_color_set(ad->render_rect1, 240, 220, 50, 191);
          +evas_object_resize(ad->render_rect1, 260, 260);
          +evas_object_move(ad->render_rect1, 60, 400);
          +evas_object_show(ad->render_rect1);
          +
          +// Translucent rectangle with blue foreground
          +ad->render_rect2 = evas_object_rectangle_add(evas);
          +evas_object_color_set(ad->render_rect2, 25, 110, 220, 127);
          +evas_object_resize(ad->render_rect2, 260, 260);
          +evas_object_move(ad->render_rect2, 170, 500);
          +evas_object_show(ad->render_rect2);
          + +

          Changing the Render Operation

          + +

          To change the rendering mode, use the evas_object_render_op_set() function and give the render operation constant, which informs Evas of the function to use when drawing the eEvas object on canvas. By default, all evas objects use the EVAS_RENDER_BLEND mode and all colors are drawn using the "d = d*(1-sa) + s" formula, where "d" is destination color, "sa" is source alpha, and "s" is source color.

          + +

          Change the rendering mode to copy mode (d = s):

          + +
          evas_object_render_op_set(ad->render_rect2, EVAS_RENDER_COPY);
          + + + + + + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/evas_basic_objects_n.htm b/org.tizen.ui.practices/html/native/efl/evas_basic_objects_n.htm new file mode 100644 index 0000000..c6ade95 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_basic_objects_n.htm @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + Basic Manipulation of Evas Objects + + + + + + +
          +

          Basic Manipulation of Evas Objects

          + + +

          Most Evas objects can be manipulated using generic functions.

          + +

          The list of available basic actions does not depend on the object's type. Evas implements functionality that allows performing basic manipulation, such as showing, hiding, setting, and getting geometry, bringing a layer up or down, managing color, clipping, and reference counting.

          + +

          This tutorial introduces the basic manipulations available for Evas_Object object.

          + + +

          Working with Evas

          + +
            +
          1. +

            To start interacting with Evas, first create an Evas instance or get a reference to an already allocated Evas object:

            + +
            ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +Evas *evas = evas_object_evas_get(ad->win);
            +
          2. + +
          3. +

            When an instance of Evas object exists, you can start creating basic Evas objects using obtained reference to Evas as a parent for child objects. The following example creates an Evas_Object with size 480x800, position on window at 0,0 by x and y axis, and set as a background:

            + +
            +ad->bg = evas_object_rectangle_add(evas);
            +evas_object_color_set(ad->bg, 255, 255, 255, 255);
            +evas_object_resize(ad->bg, 480, 800);
            +evas_object_move(ad->bg, 0, 0);
            +evas_object_show(ad->bg);
            +
            + +

            Figure: Empty window

            +

            Empty window

            + +
          4. +
          + + +

          Clipping an Object

          + +

          You can set an Evas object as a clipper for another Evas object. To obtain a clipper object, create an Evas object, set its width and height parameters, and call the evas_object_clip_set() function to set the object as a clipper for other Evas objects:

          + +
          ad->img = evas_object_image_filled_add(evas);
          +_app_get_resource("images/enlightenment.png", image_path, PATH_MAX);
          +evas_object_image_file_set(ad->img, image_path, NULL);
          +if (evas_object_image_load_error_get(ad->img) != EVAS_LOAD_ERROR_NONE)
          +   return;
          +
          +evas_object_geometry_get(ad->spacer, NULL, NULL, &w, &h);
          +evas_object_name_set(ad->img, "background");
          +evas_object_resize(ad->img, WIDTH, HEIGHT);
          +evas_object_move(ad->img, w, h);
          +evas_object_show(ad->img);
          +
          +ad->clipper = evas_object_rectangle_add(evas);
          +evas_object_geometry_get(ad->img, &x, &y, &w, &h);
          +evas_object_move(ad->clipper, WIDTH / 4 + x, HEIGHT / 4 + y);
          +evas_object_resize(ad->clipper, w / 2, h / 2);
          +evas_object_clip_set(ad->img, ad->clipper);
          +evas_object_show(ad->clipper);
          +
          + +

          Figure: Using the clipper

          +

          Using the clipper

          + + +

          You can also unset the clipper object using the evas_object_clip_unset() function. As a result, there are 2 objects, an image and a rectangle. The rectangle is on top of the image object according to the creation order.

          + +
          static void
          +_clipper_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   const char *object_name = evas_object_name_get(ad->img);
          +   if (strcmp(object_name, "background") != 0)
          +      return;
          +
          +   if (evas_object_clip_get(ad->img) == ad->clipper)
          +      evas_object_clip_unset(ad->img);
          +   else
          +      evas_object_clip_set(ad->img, ad->clipper);
          +}
          + +

          Figure: Using the clipper

          +

          Using the clipper

          + +

          Changing Colors and Visibility

          + +

          You can manage the object colors and visibility. To change a color of a valid Evas_Object, use the evas_object_color_set() and pass a color value:

          + +
          static void
          +_color_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   int alpha, r, g, b;
          +
          +   evas_object_color_get(ad->clipper, &r, &g, &b, &alpha);
          +   evas_color_argb_unpremul(alpha, &r, &g, &b);
          +
          +   if (g > 0)
          +      g = b = 0;
          +   else
          +      g = b = 255;
          +
          +   evas_color_argb_premul(alpha, &r, &g, &b);
          +   evas_object_color_set(ad->clipper, r, g, b, alpha);
          +}
          + +

          Figure: Applying color

          +

          Applying color

          + +

          You can also change the opacity of the object:

          + +
          static void
          +_opacity_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   int alpha, r, g, b;
          +
          +   evas_object_color_get(ad->clipper, &r, &g, &b, &alpha);
          +   evas_color_argb_unpremul(alpha, &r, &g, &b);
          +
          +   alpha -= 20;
          +   if (alpha < 0)
          +      alpha = 255;
          +
          +   evas_color_argb_premul(alpha, &r, &g, &b);
          +   evas_object_color_set(ad->clipper, r, g, b, alpha);
          +}
          + +

          Figure: Changing opacity

          +

          Changing opacity

          + +

          You can also hide the object when it is not needed:

          + +
          static void
          +_visibility_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   if (evas_object_visible_get(ad->clipper))
          +      evas_object_hide(ad->clipper);
          +   else
          +      evas_object_show(ad->clipper);
          +}
          + +

          Figure: Changing visibility

          +

           Changing visibility

          + +

          Reference Counting

          + +

          Evas has a simple reference counting mechanism that is useful for scenarios like inside a code block, callbacks exist which would possibly delete an object we are operating on afterwards.

          +

          To increment the reference count of an object, use the evas_object_ref() function. If the reference count is greater than 0, the evas_object_del() function is called until all references are released. References cannot go below 0 and are limited to 2^32 - 1 for each object:

          + +
          ad->spacer = evas_object_rectangle_add(evas);
          +evas_object_color_set(ad->spacer, 0, 255, 100, 255);
          +evas_object_move(ad->spacer, 0, 0);
          +evas_object_resize(ad->spacer, 120, 20);
          +evas_object_show(ad->spacer);
          +evas_object_ref(ad->spacer);
          +
          +static void
          +_unref_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   if (!ad->spacer)
          +      return;
          +
          +   if (evas_object_ref_get(ad->spacer) != 0)
          +   {
          +      evas_object_unref(ad->spacer);
          +      return;
          +   }
          +
          +int x, y, w, h;
          +
          +evas_object_geometry_get(ad->spacer, &x, &y, NULL, NULL);
          +evas_object_move(ad->img, x, y);
          +evas_object_geometry_get(ad->img, &x, &y, &w, &h);
          +evas_object_move(ad->clipper, x + (w / 4), y + (h / 4));
          +evas_object_move(ad->clipper_border, x + (w / 4) - 3, y + (h / 4) - 3);
          +evas_object_del(ad->spacer);
          +ad->spacer = NULL;
          +}
          + + +

          A green rectangle is used as a padding and the clipper object calculates its x, y coordinates based on the rectangle position. The rectangle reference count is increased by calling the evas_object_ref() function and now it is equal to 1. When the _unref_cb callback is triggered, the reference count value is higher than 0 and the evas_object_del(ad->spacer) function has no effect on the object. After the second callback call, the evas_object_ref_get(ad->spacer) function returns 0 and the evas_object_del(ad->spacer) function marks the rectangle object for deletion.

          + +

          Figure: Removing padding

          +

          Removing padding

          + +

          Changing the Object Order on Canvas

          + +

          By default, the placing of objects on canvas is based on their creation order.

          + +
          +ad->order_rect1 = evas_object_rectangle_add(evas);
          +evas_object_name_set(ad->order_rect1, "red");
          +evas_object_color_set(ad->order_rect1, 255, 0, 0, 255);
          +evas_object_move(ad->order_rect1, 120, 310);
          +evas_object_resize(ad->order_rect1, 200, 200);
          +evas_object_show(ad->order_rect1);
          +
          +ad->order_rect2 = evas_object_rectangle_add(evas);
          +evas_object_name_set(ad->order_rect2, "blue");
          +evas_object_color_set(ad->order_rect2, 0, 0, 255, 255);
          +evas_object_move(ad->order_rect2, 180, 350);
          +evas_object_resize(ad->order_rect2, 200, 200);
          +evas_object_show(ad->order_rect2);
          +
          + +

          Figure: Default order of objects on canvas

          +

          Default order of objects on canvas

          + +

          You can change the object triggering the _object_order_cb() callback, which switches the order of the rectangles.

          + +
          static void
          +_object_order_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   Evas_Object *rect = evas_object_below_get(ad->order_rect2);
          +   if (!rect)
          +      return;
          +
          +   const char *name = evas_object_name_get(rect);
          +   if (name)
          +      if (strcmp(name, "red") == 0)
          +      {
          +         evas_object_stack_below(ad->order_rect2, rect);
          +
          +         return;
          +      }
          +
          +   rect = evas_object_below_get(ad->order_rect1);
          +   if (!rect)
          +      return;
          +
          +   name = evas_object_name_get(rect);
          +   if (name)
          +      if (strcmp(name, "blue") == 0)
          +      {
          +         evas_object_stack_below(ad->order_rect1, rect);
          +
          +         return;
          +      }
          +}
          + +

          Figure: Changed order of objects on canvas

          +

          Changed order of objects on canvas

          + +

          Evas allows placing an object to top and bottom layer of the canvas object stack. The of _raise_cb callback puts the canvas background on the top position of the screen. The call of _lower_cb callback puts the background to the bottom.

          + +
          static void
          +_lower_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   evas_object_lower(ad->bg);
          +}
          +
          +static void
          +_raise_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
          +{
          +   App_Data *ad = (App_Data *)data;
          +
          +   evas_object_raise(ad->bg);
          +   ad->isBgOnTop = EINA_TRUE;
          +}
          + +

          Figure: Canvas background by default and on top

          +

          Canvas background by default and on top

          + + + + + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/evas_map_animation_n.htm b/org.tizen.ui.practices/html/native/efl/evas_map_animation_n.htm new file mode 100644 index 0000000..d658dd6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_map_animation_n.htm @@ -0,0 +1,389 @@ + + + + + + + + + + + + + Evas Map Effects + + + + + +
          + +

          Evas Map Effects

          + +

          Evas Map animations allow you to apply transformations to all types of objects by way of UV mapping.

          + +

          In UV mapping, you map points in the source object to 3D space positions in the target object. This allows for rotation, perspective, scale, and other transformation effects, depending on the map. In addition, each map point can carry a multiplier color, which, if properly calculated, can be used to apply 3D shading effects on the target object.

          + +

          Evas provides both raw and easy-to-use functions for UV mapping. The raw functions allow you to create UV maps outside Evas and import them into your application, for example by loading them from an external file. The easy-to-use functions allow you to create UV maps directly in Evas by calculating the map points based on high-level parameters, such as rotation angle and ambient light.

          + +

          Map Points

          + +

          A map consists of a set of points. (Currently, only four points are supported.) Each point contains X and Y canvas coordinates that can be used to alter the geometry of the mapped object, and a Z coordinate that indicates the depth of the point. The Z coordinate does not normally affect the map, but several utility functions use it to calculate the right position of the point given the other parameters.

          + +

          First, create an Evas_Map object using the evas_map_new() function. This function creates the specified number of map points (currently only up to four points). Each point is empty and ready to be modified with Evas_Map functions.

          + +
          Evas_Map *m = evas_map_new(4);
          + +

          If you want to get the size (number of points) of an existing map, use the evas_map_count_get() function.

          + +

          To set the coordinates for each point, use the evas_map_point_coord_set() function:

          + +
          evas_map_point_coord_set(Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z)
          + +

          The following example shows a common way to define a map that matches the geometry of a rectangle (a square in this case):

          + +
          +evas_map_point_coord_set(m, 0, 100, 100, 0);
          +evas_map_point_coord_set(m, 1, 300, 100, 0);
          +evas_map_point_coord_set(m, 2, 300, 300, 0);
          +evas_map_point_coord_set(m, 3, 100, 300, 0);
          +
          + +

          Figure: Map

          +

          Map

          + +

          The following examples all produce the same result as the above example, but with simpler code:

          + +
            +
          • +

            To create a rectangle map using the starting X and Y coordinates combined with width and height, use the evas_map_util_points_populate_from_geometry() function:

            +
            evas_map_util_points_populate_from_geometry(Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord z)
            +

            The following example creates the same map as above:

            +
            evas_map_util_points_populate_from_geometry(m, 100, 100, 200, 200, 0);
            +
          • +
          • +

            To create a map based on the geometry of a given object, use the evas_map_util_points_populate_from_object() or evas_map_util_points_populate_from_object_full() function. The former sets the Z coordinate of all points to 0, whereas the latter allows you to define the same custom Z coordinate for all points:

            +
            evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *obj)
            +
            evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *obj, Evas_Coord z)
            +

            The following example creates the same map as above:

            +
            +Evas_Object *o;
            +evas_object_move(o, 100, 100);
            +evas_object_resize(o, 200, 200);
            +evas_map_util_points_populate_from_object(m, o);
            +// OR
            +evas_map_util_points_populate_from_object_full(m, o, 0);
            +
          • +
          + +

          You can apply several effects to an object by simply setting each point of the map to the appropriate coordinates. The following example shows how to create a simulated perspective:

          + +

          Figure: Simulated perspective

          +

          Simulated perspective

          + +
          +evas_map_point_coord_set(m, 0, 100, 100, 0);
          +evas_map_point_coord_set(m, 1, 250, 120, 0);
          +evas_map_point_coord_set(m, 2, 250, 280, 0);
          +evas_map_point_coord_set(m, 0, 100, 300, 0);
          +
          + +

          In the above example, the Z coordinate is unused: when setting points by hand, the Z coordinate is irrelevant.

          + +

          If you want to get the actual coordinates of a map, use the evas_map_point_coord_get() function:

          + +
          evas_map_point_coord_get(const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z)
          + +

          After you have defined the map points, apply them to your map for transformation:

          + +
          +evas_object_map_set(o, m);
          +evas_object_map_enable_set(o, EINA_TRUE);
          +
          + +

          Finally, after you are done with the map, release the memory allocated to it using the evas_map_free() function:

          + +
          evas_map_free(m);
          + +

          The utility functions described in the next section allow you to perform the above tasks with less coding work.

          + +

          Utility Functions

          + +

          Utility functions take an already configured map and allow you to easily modify it to produce specific effects. For example, to rotate an object around its center, you need the rotation angle and the coordinates of each corner of the object to perform the math required to get the new set of coordinates that needs to be set for the map. Evas provides a utility function that does the math for you:

          + +
          evas_map_util_rotate(Evas_Map *m, double degrees, Evas_Coord cx, Evas_Coord cy)
          + +

          This function rotates the map based on the angle and the center coordinates of the rotation provided as arguments. A positive angle rotates the map clockwise, while a negative angle rotates the map counter-clockwise.

          + +

          The following example shows how to rotate an object around its center point by 45 degrees clockwise. In the following figure, the center of rotation is the red dot.

          + +
          +evas_object_geometry_get(o, &x, &y, &w, &h);
          +m = evas_map_new(4);
          +evas_map_util_points_populate_from_object(m, o);
          +evas_map_util_rotate(m, 45, x + (w / 2), y + (h / 2));
          +evas_object_map_set(o, m);
          +evas_object_map_enable_set(o, EINA_TRUE);
          +evas_map_free(m);
          +
          + +

          Figure: Rotating around the center point

          +

          Rotating around the center point

          + +

          You can rotate the object around any other point simply by setting the last two arguments of the evas_map_util_rotate() function to the appropriate values:

          + +
          evas_map_util_rotate(m, 45, x + w - 20, y + h - 20);
          + +

          Figure: Rotating around other points

          +

          Rotating around other points

          + +

          You can also set the center of the window as the center of the rotation using the appropriate coordinates of the Evas canvas:

          + +
          +evas_output_size_get(evas, &w, &h);
          +m = evas_map_new(4);
          +evas_map_util_points_populate_from_object(m, o);
          +evas_map_util_rotate(m, 45, w, h);
          +evas_object_map_set(o, m);
          +evas_object_map_enable_set(o, EINA_TRUE);
          +evas_map_free(m);
          +
          + +

          Zoom

          + +

          The evas_map_util_zoom() function zooms the points of the map from a center point, defined by cx and cy. The zoomx and zoomy arguments specify how much to zoom in on the X and Y axes. A value of 1.0 means no zoom, 2.0 means double the size, 0.5 means half the size, and so on. All the coordinates are global canvas coordinates.

          + +
          +evas_map_util_zoom(Evas_Map *m, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
          +
          + +

          3D Maps

          + +

          Maps can also be used to achieve a 3D effect. In a 3D effect, the Z coordinate of each point is meaningful: the higher the value, the further back the point is located. Smaller values (usually negative) mean that the point is closer to the user.

          + +

          3D also introduces the concept of the back face of an object. An object is said to be facing the user when all its points are placed in a clockwise formation, as shown in the left map in the following figure. Rotating the map around its Y axis swaps the order of the points into a counter-clockwise formation, making the object face away from the user, as shown in the right map in the following figure. The back face is especially relevant in lighting (see below).

          + +

          Figure: Rotating around the Y axis

          +

          Rotating around the Y axis

          + +

          To determine whether a map is facing the user, use the evas_map_util_clockwise_get() function. This function returns EINA_TRUE if the map is facing the user and EINA_FALSE if the map is facing away from the user. This is normally done after all the other operations are applied to the map.

          + +
          evas_map_util_clockwise_get(Evas_Map *m)
          + +

          3D Rotation and Perspective

          + +

          The evas_map_util_3d_rotate() function transforms a map to apply a 3D rotation to the mapped object. You can apply the rotation around any point in the canvas (including a Z coordinate). You can also apply the rotation around any of the three axes.

          + +
          evas_map_util_3d_rotate(Evas_Map *m, double dx, double dy, double dz, Evas_Coord cx, Evas_Coord cy, Evas_Coord cz)
          + +

          Starting from this simple setup, and setting the maps so that the blue square rotates around the Y axis, we get the following:

          + +

          Figure: 3D rotation

          +

          3D rotation

          + +

          A simple overlay over the image shows the original geometry of each object and the axis around which they are being rotated. The Z axis is not shown, since it is orthogonal to the screen. To show the Z axis, that is, to add 3D perspective to the transformation, use the evas_map_util_3d_perspective() function on the map after its position has been set:

          + +
          evas_map_util_3d_perspective(Evas_Map *m, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc)
          + +

          The result makes the vanishing point the center of each object:

          + +

          Figure: Adding perspective

          +

          Adding perspective

          + +

          Color and Lighting

          + +

          Each point in a map can be set to a color, which will be multiplied with the object’s own color and linearly interpolated between adjacent points. To set the color separately for each point, use the evas_map_point_color_set() function:

          + +
          evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a)
          + +

          To set the same color for every point, use the evas_map_util_points_color_set() function:

          + +
          evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a)
          + +

          When using a 3D effect, colors can be used to improve its look by simulating a light source. The evas_map_util_3d_lighting() function makes this task easier by taking the coordinates of the light source and its color, along with the color of the ambient light. Evas then sets the color of each point based on its distance to the light source, the angle at which the object is facing the light source, and the ambient light. Here, the orientation of each point is important.

          + +
          evas_map_util_3d_lighting(Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab)
          + +

          If the map points are defined counter-clockwise, the object faces away from the user and is therefore obscured, since no light is reflecting back from it.

          + +

          Figure: Obscured object

          +

          Obscured object

          + +

          Mapping

          + +

          Images need special handling when mapped. While Evas can easily handle objects, it is completely oblivious to the contents of images. This means that each point in a map needs to be mapped to a specific pixel in the source image. Failing to do this can result in unexpected behavior.

          + +

          Let's get started with the following three images, each sized at 200 × 200 pixels:

          + +

          Figure: Starting point

          +

          Starting point

          + +

          The following three images illustrate the case where a map is set to an image object without setting the right UV mapping for each map point. The objects themselves are mapped properly to their new geometries, but the images are not displayed correctly within the mapped objects.

          + +

          Figure: Questionable result

          +

          Questionable result

          + +

          To transform an image correctly, Evas needs to know how to handle the image within the map. You can do this using the evas_map_point_image_uv_set() function, which allows you to map a given point in a map to a given pixel in a source image:

          + +
          +evas_map_point_image_uv_set(Evas_Map *m, int idx, double u, double v)
          +
          + +

          To match our example images to the maps above, all we need is the size of each image, which we can get using the evas_object_image_size_get() function.

          + +
          +// Tux 1: Some cropping and stretch up
          +evas_map_point_image_uv_set(m, 0, 0, 20);
          +evas_map_point_image_uv_set(m, 1, 200, 20);
          +evas_map_point_image_uv_set(m, 2, 200, 180);
          +evas_map_point_image_uv_set(m, 3, 0, 180);
          +evas_object_map_set(tux1, m);
          +evas_object_map_enable_set(tux1, EINA_TRUE);
          +
          +// Inverted texture for shadow:
          +evas_map_point_image_uv_set(m, 0, 0, 180);
          +evas_map_point_image_uv_set(m, 1, 200, 180);
          +evas_map_point_image_uv_set(m, 2, 200, 20);
          +evas_map_point_image_uv_set(m, 3, 0, 20);
          +evas_object_map_set(tux1_shadow, m);
          +evas_object_map_enable_set(tux1_shadow, EINA_TRUE);
          +
          +// Tux 2: Make it fit to the map:
          +evas_map_point_image_uv_set(m, 0, 0, 0);
          +evas_map_point_image_uv_set(m, 1, 200, 0);
          +evas_map_point_image_uv_set(m, 2, 200, 200);
          +evas_map_point_image_uv_set(m, 3, 0, 200);
          +evas_object_map_set(tux2, m);
          +evas_object_map_enable_set(tux2, EINA_TRUE);
          +
          +// Tux 3: Zoom and fit relatively to image size
          +evas_object_image_size_get(evas_object_image_source_get(tux3), &w, &h);
          +evas_map_point_image_uv_set(m, 0, 0.1 * w, 0.1 * h);
          +evas_map_point_image_uv_set(m, 1, 0.9 * w, 0.1 * h);
          +evas_map_point_image_uv_set(m, 2, 0.9 * w, 0.9 * h);
          +evas_map_point_image_uv_set(m, 3, 0.1 * w, 0.9 * h);
          +evas_object_map_set(tux3, m);
          +evas_object_map_enable_set(tux3, EINA_TRUE);
          +
          + +

          Figure: Correct result

          +

          Correct result

          + +

          You can also set a map to use only part of an image, or you can even map the points in inverted order. Combined with the evas_object_image_source_set() function, you can achieve more interesting results still.

          + +

          Lighting

          + +

          Evas_Map allows you to define an ambient light and a light source within the scene. Both of these light sources have their own colors.

          + +
          evas_map_util_3d_lighting(Evas_Map *m, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab)
          + +

          The above function is used to apply lighting calculations (from a single light source) to a given map. The red, green, and blue values of each vertex will be modified to reflect the lighting based on the light source coordinates, its color, the ambient color, and the angle at which the map faces the light source. The points of a surface should be defined in a clockwise formation if the surface is facing the user, since faces have a logical side for lighting.

          + +

          To get the reflections (gradient) in the shadow of our previous example, you have to define a source of light close enough to the user and a very bright ambient light, for example:

          + +
          +evas_map_util_3d_lighting(m, // Evas_Map object
          +                          250/2, 150/2, -100, // Spot light coordinates
          +                          255, 255, 255, // Spot light color
          +                          200, 200, 200); // Ambient light color
          +
          + +

          Alpha Channel

          + +

          You can also use an alpha channel on your map by enabling the alpha channel feature:

          + +
          evas_map_alpha_set(Evas_Map *m, Eina_Bool enabled)
          + +

          Next, set the alpha value separately for each map point:

          + +
          evas_map_point_color_set(Evas_Map *m, int idx, int r, int g, int b, int a)
          + +

          Alternatively, you can set the same alpha value to all map points:

          + +
          evas_map_util_points_color_set(Evas_Map *m, int r, int g, int b, int a)
          + +

          The following code sets the shadow transparency for the first image in the above three-image example:

          + +
          +// Set object transparency to 50%:
          +evas_map_util_points_color_set(m, 255, 255, 255, 127);
          +
          +// Tux's head is almost invisible in the shadow:
          +evas_map_point_color_set(m, 3, 255, 255, 255, 15);
          +evas_map_point_color_set(m, 4, 255, 255, 255, 15);
          +
          + +

          Smoothing

          + +

          To enable smoothing when rendering a map, use the evas_map_smooth_set() function:

          + +
          evas_map_smooth_set(Evas_Map *m, Eina_Bool enabled)
          + +

          The first argument is the Evas_Map object to apply smoothing to. The second argument sets whether to enable the smoothing:

          + +
            +
          • EINA_TRUE: Enable smoothing.
          • +
          • EINA_FALSE: Disable smoothing.
          • +
          + +

          If the object is of a type that has its own smoothing settings, the smoothing settings must be disabled for both the object and the map. Map smoothing is enabled by default. To check whether map smoothing is enabled, use the evas_map_smooth_get() function.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/evas_map_effects_n.htm b/org.tizen.ui.practices/html/native/efl/evas_map_effects_n.htm new file mode 100644 index 0000000..79f4d71 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_map_effects_n.htm @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + Creating Evas Map Effects + + + + + + +
          +

          Creating Evas Map Effects

          + + +

          This tutorial demonstrates how you can use Evas map functions to create an application in which you can change the map point coordinates of Evas objects. You can modify the map point U and V texture source point using Evas map mapping APIs. "U" and "V" denote the axes of the 2D texture.

          + +

          Figure: Evas map mapping application

          +

          Evas map mapping application

          + +

          Creating the Basic Application

          +

          To create a basic application:

          +
            +
          1. +

            To use the required APIs, include the following libraries:

            + +
            #include <app.h>
            +#include <Elementary.h>
            +#include <system_settings.h>
            +#include <efl_extension.h>
            +
          2. + +
          3. +

            Create an Evas object for an Elementary window and a button for mapping the map information:

            + +
            typedef struct appdata 
            +{
            +   Evas_Object *win;
            +   Evas_Object *button;
            +Evas_Object *default_btn;
            +} 
            +appdata_s;
            +
          4. +
          5. +

            To create an Elementary window, use the elm_win_util_standard_add() function and give the name and title of the application. To set a callback on hardware Back button, the use eext_object_event_callback_add() function. To display the Evas object, use the evas_object_show() function.

            + +
            static void
            +create_base_gui(appdata_s *ad)
            +{
            +    Evas_Object *evas_text = NULL;
            +    Evas *evas                = NULL;
            +
            +   // Window
            +   ad->win = elm_win_util_standard_add("Extra object function", "Extra object function");
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   // Window callbacks
            +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, back_cb, ad);
            +
            +   evas = evas_object_evas_get(ad->win);
            +
            +   evas_text = evas_object_text_add(evas);
            +   evas_object_text_text_set(evas_text, "Evas Map Mapping");
            +   evas_object_text_font_set(evas_text, "Sans", 18);
            +   evas_object_color_set(evas_text, 50, 100, 200, 255);
            +   evas_object_move(evas_text, 10, 90);
            +   evas_object_show(evas_text);
            +
            +   // Evas map source code
            +
            +   evas_object_show(ad->win);
            +}
            +
          6. + +
          7. +

            Implement callback functions to enable closing the application:

            + +
            static void
            +back_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *ad = data;
            +
            +   elm_win_lower(ad->win);
            +}
            +
            +static void
            +win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   ui_app_exit();
            +}
            +
          8. + +
          9. +

            Create an elementary application with a GUI:

            + +
            static bool
            +app_create(void *data)
            +{
            +   appdata_s *ad = data;
            +
            +   // Create the application UI
            +   create_base_gui(ad);
            +
            +   return true;
            +}
            +
            +int
            +main(int argc, char *argv[])
            +{
            +   appdata_s ad = {0,};
            +
            +   ui_app_lifecycle_callback_s event_callback = {0,};
            +
            +   event_callback.create = app_create;
            +
            +   // Run the main loop
            +   return ui_app_main(argc, argv, &event_callback, &ad);
            +}
            +
          10. + +
          11. +

            Create the button for mapping. Use the move and resize functions to configure the button's custom geometry:

            + +
            // Create a button for mapping
            +ad->button = elm_button_add(ad->win);
            +elm_object_text_set(ad->button, "Evas Map Mapping ");
            +evas_object_move(ad->button, 15, 100);
            +evas_object_resize(ad->button, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(200));
            +evas_object_show(ad->button);
            +
            +// Create a default button
            +ad->default_btn = elm_button_add(ad->win);
            +elm_object_text_set(ad->default_btn, "Default Button ");
            +evas_object_move(ad->default_btn, 15, 300);
            +evas_object_resize(ad->default_btn, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(200));
            +evas_object_show(ad->default_btn);
            +
          12. +
          + +

          Creating Map Data

          + +

          By using the evas_map_new() and evas_map_*() functions, you can create map data to be attached to the button:

          + +
            +
          1. +

            Get the Evas_Map object to create map data using the evas_map_new() function:

            + +
            +Evas_Map *map;
            +map = evas_map_new(4);
            + +

            The map of transformation points is used later with an Evas object.

            +
          2. + +
          3. +

            Set the coordinates for each point using the evas_map_point_coord_set() function. You can apply several effects to the Evas object by setting each point of the map to the right coordinates.

            + +
            // Set map coordinates
            +evas_map_point_coord_set(map, 0, 15, 100, 0);
            +evas_map_point_coord_set(map, 1, 265, 100, 0);
            +evas_map_point_coord_set(map, 2, 265, 300, 0);
            +evas_map_point_coord_set(map, 3, 15, 400, 0);
            +
          4. + +
          5. +

            Set UV data using the evas_map_point_image_uv_set() function, which informs the map of the correct pixels in the image it is mapping:

            + +
            // Set image UV
            +evas_map_point_image_uv_set(map, 0, 0, 0);
            +evas_map_point_image_uv_set(map, 1, 500, 50);
            +evas_map_point_image_uv_set(map, 2, 500, 400);
            +evas_map_point_image_uv_set(map, 3, 0, 200);
            +
          6. +
          + + +

          Applying the Map to the Evas Object

          + +

          To set the map on a given object, use the evas_object_map_set() function for the object. A map contains 4 points, each having canvas x, y coordinates with an optional z point value for perspective correction, if available. Each point also has U an V coordinates.

          + +
          // Apply map to button evas object
          +
          +evas_object_map_set(ad->button, map);
          + +

          Clearing Map Data and Enabling Map Features

          + +

          Free the map data and all memory associated with it when you no longer need it:

          + +
          // Free map resources
          +
          +evas_map_free(map);
          + +

          You can enable or disable the map features for the object. When enabled, the object geometry is saved, and the new geometry changes its position and size to reflect the set map geometry.

          + +
          // Enable map features
          +
          +evas_object_map_enable_set(ad->button, EINA_TRUE);
          + + + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/evas_objects_n.htm b/org.tizen.ui.practices/html/native/efl/evas_objects_n.htm new file mode 100644 index 0000000..8cb88d4 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_objects_n.htm @@ -0,0 +1,824 @@ + + + + + + + + + + + + + Evas Objects + + + + + +
          + +

          Evas Objects

          + +

          An Evas object is the most basic visual entity used in Evas. Everything, be it a single line or a complex list of UI components, is an Evas object.

          + +

          Primitive Renderable Objects

          +

          Primitive objects are the base upon which to build a complex interface: rectangles, lines, polygons, images, textblocks, and texts.

          +

          Rectangle

          +

          There is only one function to deal with rectangle objects. However, the rectangle is manipulated using the generic evas object functions.

          +

          The evas rectangle serves a number of key functions when working on Evas programs.

          +
            +
          • background
          • +
          • debugging
          • +
          • clipper
          • +
          + +

          Background

          +

          A common requirement of Evas programs is to have a solid color background, which can be accomplished with the following code.

          +
          Evas_Object *bg = evas_object_rectangle_add(evas_canvas);
          +
          +// Here we set the rectangles red, green, blue and opacity levels
          +evas_object_color_set(bg, 255, 255, 255, 255); // opaque white background
          +evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas
          +evas_object_show(bg);
          +
          + +

          Debugging

          +

          When debugging visual issues with evas programs, the rectangle is a useful tool. The rectangle's simplicity means that it is easier to pinpoint issues with it than with more complex objects. A common technique to use when writing an evas program and not getting the desired visual result is to replace an object for a solid color rectangle and seeing how it interacts with the other elements. This often allows us to notice clipping, parenting or positioning issues. Once the issues are identified and corrected, the rectangle can be replaced for the original object, and in all likelihood any remaining issues are specific to that object's type.

          + +

          Clipping

          +

          Clipping serves two main functions:

          +
            +
          • limiting visibility
          • +
          • applying a layer of color to an object
          • +
          + + +

          Text

          +

          An Evas text object shows a basic single-line single-style text.

          +
          Evas_Object *text = evas_object_text_add(evas_canvas);
          +evas_object_text_text_set(text, "some text");
          +evas_object_color_set(text, 127, 0, 0, 127);
          +evas_object_show(text);
          +
          + +

          To set the text, use evas_object_text_text_set(text, some_text). You can set the current text with evas_object_text_text_get(text).

          +

          To set the font, use evas_object_text_font_set(text, font, size):

          +
            +
          • text: The text object
          • +
          • font: The font name you want to use
          • +
          • size: The font size you want to use. To query the current font, use evas_object_text_font_set(text, font, size).
          • +
          +

          To set the text style, use evas_object_text_style_set(text, style). The following styles are supported:

          +
            +
          • EVAS_TEXT_STYLE_PLAIN: Plain, standard text
          • +
          • EVAS_TEXT_STYLE_SHADOW: Text with shadow underneath
          • +
          • EVAS_TEXT_STYLE_OUTLINE: Text with an outline
          • +
          • EVAS_TEXT_STYLE_SOFT_OUTLINE: Text with a soft outline
          • +
          • EVAS_TEXT_STYLE_GLOW: Text with a glow effect
          • +
          • EVAS_TEXT_STYLE_OUTLINE_SHADOW: Text with both outline and shadow effects
          • +
          • EVAS_TEXT_STYLE_FAR_SHADOW: Text with (far) shadow underneath
          • +
          • EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW: Text with outline and soft shadow effects combined
          • +
          • EVAS_TEXT_STYLE_SOFT_SHADOW: Text with (soft) shadow underneath
          • +
          • EVAS_TEXT_STYLE_FAR_SOFT_SHADOW: Text with (far soft) shadow underneath
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT: Shadow growing to bottom right
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM: Shadow growing to the bottom
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT: Shadow growing to bottom left
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT: Shadow growing to the left
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT: Shadow growing to top left
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP: Shadow growing to the top
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT: Shadow growing to top right
          • +
          • EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT: Shadow growing to the right. To query the current style, use evas_object_text_style_get(text).
          • +
          +

          If the text does not fit, make an ellipsis on it by using evas_object_text_ellipsis_set(text, ellipsis). The (float) value specifies, which part of the text is shown.

          +
            +
          • 0.0: The beginning is shown and the end trimmed.
          • +
          • 1.0: The beginning is trimmed and the end shown.
          • +
          • Any value in between means that both ends of the text have ellipsis and the set part is shown.
          • +
          • -1.0: Ellipsis is disabled. To query the current ellipsis value, use evas_object_text_ellipsis_get(text).
          • +
          +

          When the text style is set to glow, set the glow color using evas_object_text_glow_color_set(text, r, g, b, a), where r, g, b, and a are respectively the red, green, blue, and alpha values. The effect is placed at a short distance from the text but not touching it. For glows set right at the text, use evas_object_text_glow2_color_set(text, r, g, b, a). To query the current color, use evas_object_text_glow_color_get(text, r, g, b, a), respectively evas_object_text_glow2_color_get(text, r, g, b, a).

          +

          If your text style is set to display a shadow, use evas_object_text_shadow_color_set(text, r, g, b, a), where r, g, b, and a are respectively the red, green, blue, and alpha values. To query the current color, use evas_object_text_shadow_color_get(text, r, g, b, a)

          +

          If your text style is set to display an outline, use evas_object_text_outline_color_set(text, r, g, b, a), where r, g, b, and a are respectively the red, green, blue, and alpha values. To query the current color, use evas_object_text_outline_color_get(text, r, g, b, a)

          + + +

          Primitive Smart Objects

          +

          A smart object is a special Evas object that provides custom functions to handle automatically clipping, hiding, moving, resizing color setting and more on child elements, for the smart object's user. They could be, for example, a group of objects that move together, or implementations of whole complex UI components, providing some intelligence and extension to simple Evas objects.

          + +

          Primitive Container Objects

          +

          A container is a Smart object that holds children Evas objects in a specific fashion.

          +

          Table

          +

          A table is a smart object that packs children using a tabular layout.

          +
          table = evas_object_table_add(evas);
          +evas_object_table_homogeneous_set(table, EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE);
          +evas_object_table_padding_set(table, 0, 0);
          +evas_object_resize(table, WIDTH, HEIGHT);
          +evas_object_show(table);
          +
          +rect = evas_object_rectangle_add(evas);
          +evas_object_color_set(rect, 255, 0, 0, 255);
          +evas_object_size_hint_min_set(rect, 100, 50);
          +evas_object_show(rect);
          +evas_object_table_pack(table, rect, 1, 1, 2, 1);
          +
          +rect = evas_object_rectangle_add(d.evas);
          +evas_object_color_set(rect, 0, 255, 0, 255);
          +evas_object_size_hint_min_set(rect, 50, 100);
          +evas_object_show(rect);
          +evas_object_table_pack(table, rect, 1, 2, 1, 2);
          +
          +rect = evas_object_rectangle_add(d.evas);
          +evas_object_color_set(rect, 0, 0, 255, 255);
          +evas_object_size_hint_min_set(rect, 50, 50);
          +evas_object_show(rect);
          +evas_object_table_pack(table, rect, 2, 2, 1, 1);
          +
          +rect = evas_object_rectangle_add(d.evas);
          +evas_object_color_set(rect, 255, 255, 0, 255);
          +evas_object_size_hint_min_set(rect, 50, 50);
          +evas_object_show(rect);
          +evas_object_table_pack(table, rect, 2, 3, 1, 1);
          +
          + +

          In this example, we add a non-homogeneous table to the canvas with its padding set to 0.

          +

          We then add four different colored rectangles with different properties.

          +
            +
          • the first one, at the first column and first line, spans two columns and one line
          • +
          • the second one, at the first column and second line, spans one columns and two lines
          • +
          • the third one, at the second column and second line, fits in one cell
          • +
          • the fourth one, at the second column and third line, also fits in one cell
          • +
          +

          To create a table, use evas_object_table_add(evas).

          +

          To set the table layout (the cells), use evas_object_table_homogeneous_set(table, homogeneous). The following values can be homogeneous:

          +
            +
          • EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE: This default value has columns and rows calculated based on hints of individual cells. This is flexible, but much heavier on computations.
          • +
          • EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE: The table size is divided equally among children, filling the whole table area. If the children have a minimum size that is larger than this (including padding), then the table overflows and is aligned respecting the alignment hint, possibly overlapping sibling cells.
          • +
          • EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM: The greatest minimum cell size is used: if no element is set to expand, the contents of the table are the minimum size and the bounding box of all the children is aligned relatively to the table object using evas_object_table_align_get(). If the table area is too small to hold this minimum bounding box, then the objects keep their size and the bounding box overflows the box area, still respecting the alignment. To set the current mode, use evas_object_table_homogeneous_get(table).
          • +
          +

          The table's content alignment is set using evas_object_table_align_set(table, horizontal, vertical), where horizontal and vertical are floating values. To see them, use evas_object_table_align_get(table, horizontal, vertical).

          +

          To set the padding, use evas_object_table_padding_set(table, horizontal, vertical). To see the current value, use evas_object_table_padding_get(table, horizontal, vertical).

          +

          _To see the current column and row count, use evas_object_table_col_row_size_get(table, columns, rows).

          + +

          Grid

          +

          A grid is a smart object that packs its children as with a regular grid layout.

          +

          Grids are added to the canvas with evas_object_grid_add(evas).

          +

          To change a grid's virtual resolution, use evas_object_grid_size_set(grid, width, height), to see it, use evas_object_grid_size_get(grid, width, height).

          +

          To add an object, use evas_object_grid_pack(grid, child, x, y, w, h), where

          +
            +
          • x is the virtual X coordinate of the child
          • +
          • y is the virtual y coordinate of the child
          • +
          • w is the virtual width of the child
          • +
          • h is the virtual height of the child
          • +
          +

          Box

          +

          A box is a simple container that sets its children objects linearly.

          +

          To add a box to your canvas, use evas_object_box_add(evas).

          +

          To add a child to the box, use

          +
            +
          • evas_object_box_append(box, child): The child is appended.
          • +
          • evas_object_box_insert_after(box, child, reference): The child is added after reference.
          • +
          • evas_object_box_insert_before(box, child, reference): The child is added before reference.
          • +
          • evas_object_box_insert_at(box, child, pos): The child is added at the specified position.
          • +
          +

          To set the alignment, use evas_object_box_align_set(box, horizontal, vertical).

          +
            +
          • horizontal: 0.0 means aligned to the left, 1.0 means to the right;
          • +
          • vertical: 0.0 means aligned to the top, 1.0 means to the bottom.
          • +
          +

          Evas has predefined box layouts available:

          +
            +
          • evas_object_box_layout_horizontal();
          • +
          • evas_object_box_layout_vertical();
          • +
          • evas_object_box_layout_homogeneous_horizontal();
          • +
          • evas_object_box_layout_homogeneous_vertical();
          • +
          • evas_object_box_layout_homogeneous_max_size_horizontal();
          • +
          • evas_object_box_layout_homogeneous_max_size_vertical();
          • +
          • evas_object_box_layout_flow_horizontal();
          • +
          • evas_object_box_layout_flow_vertical();
          • +
          • evas_object_box_layout_stack().
          • +
          + +

          Image Objects

          + + +

          Using Evas, you can create and manipulate image objects. Evas supports image loaders of various formats as plug-in modules.

          +

          The image formats that Evas supports include bmp, edj, gif, ico, jpeg, pmaps, png, psd, svg, tga, tiff, wbmp, webp, and xpm.

          + +

          Figure: Evas image loader

          +

          Evas image loader

          + +

          Evas Object Image Functions

          + +

          Evas has over 70 image object functions. The following functions are discussed in this document:

          +
          +Evas_Object *evas_object_image_add(Evas *e);
          +void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key);
          +void evas_object_image_fill_set(Evas_Object *obj, int x, int y, int w, int h);
          +void evas_object_image_filled_set(Evas *e, Eina_Bool setting);
          +Evas_Object *evas_object_image_filled_add(Evas *e);
          +void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smoothscale);
          +void evas_object_image_load_size_set(Evas_Object *obj, int w, int h);
          +void evas_object_image_data_set(Evas_Object *obj, void *data);
          +void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing);
          +void evas_object_image_size_set(Evas_Object *obj, int w, int h);
          +void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h);
          +Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags);
          +
          + +

          Creating an Image Object and Setting the Image Data Source

          +

          A common use case of an image object is to set a file as the image data source. The process has 3 steps and each one involves the following API calls:

          +
            +
          • The evas_object_image_add() function creates an image object and returns the pointer. +
            Evas_Object *evas_object_image_add(Evas *e);
            +
          • +
          • The evas_object_image_file_set() function sets a source file on the image object. The object fetches the image pixel data from the source file. +
            void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key);
            +
          • +
          • The evas_object_image_fill_set() sets how to fill the image object's area with the given pixel data. +
            void evas_object_image_fill_set(Evas_Object *obj, int x, int y, int w, int h);
            +
          • +
          + +

          In the following code example, the main() function creates an image object and displays it on a window. The image object size is 300x300 and the source image resolution is 100x127. The image is scaled into 300 by 300 to fill the image object area using the evas_object_image_fill_set() function.

          +
          +#include <Elementary.h>
          +
          +int main(int argc, char **argv)
          +{
          +   elm_init(argc, argv);
          +
          +   // Create a window object
          +   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          +   evas_object_resize(win, 400, 400);
          +   evas_object_show(win);
          +
          +   // Return Evas handle from window
          +   Evas *e = evas_object_evas_get(win);
          +
          +   // Create an image object
          +   Evas_Object *img = evas_object_image_add(e);
          +
          +   // Set a source file to fetch pixel data
          +   evas_object_image_file_set(img, "./logo.png", NULL);
          +
          +   // Set the size and position of the image on the image object area
          +   evas_object_image_fill_set(img, 0, 0, 300, 300);
          +
          +   evas_object_move(img, 50, 50);
          +   evas_object_resize(img, 300, 300);
          +   evas_object_show(img);
          +
          +   elm_run();
          +
          +   elm_shutdown();
          +
          +   return 0;
          +}
          +
          +

          Figure: Image object display

          +

          Image object display

          + +

          Managing Images

          + +

          To manage image objects in Evas:

          + +

          Limiting Visibility

          +

          Evas always supports the image file type it was compiled with. Check your software packager for the information and use the evas_object_image_extension_can_load_get() function.

          + +

          Create the image object. Set a source file on it, so that the object knows where to fetch the image data.

          +

          Define how to fill the image object area with the given pixel data. You can use a sub-region of the original image, or have it tiled repeatedly on the image object.

          + +
          +img = evas_object_image_add(canvas);
          +evas_object_image_file_set(img, "path/to/img", NULL);
          +evas_object_image_fill_set(img, 0, 0, w, h);
          +
          + + +

          If the entire source image is to be displayed on the image object, stretched to the destination size, use the evas_object_image_filled_set() function helper that you can use instead of the evas_object_image_fill_set() function:

          + +
          +evas_object_image_filled_set(img, EINA_TRUE);
          +
          + +

          Scaling Images

          +

          Resizing image objects scales the source images to the image object size, if the source images are set to fill the object area using the evas_object_image_filled_set() function.

          +

          Control the aspect ratio of an image for different sizes with functions to load images scaled up or down in memory.

          + +

          Evas has a scale cache, which caches scaled versions of images used often. You can also have Evas rescale the images smoothly, however, that is computationally expensive.

          + +

          Users can decide how to fill the image object area with the given image pixel data by setting the position, width, and height of the image using the evas_object_image_fill_set() function. Without setting this information, the image is not displayed. If the size of the image is bigger than the image object area, only a sub-region of the original image is displayed. If the image is smaller than the area, images are tiled repeatedly to fill the object area.

          + +

          Figure: Image scaling

          +

          Image scaling

          + + + + + + + + + + + + + + +

          evas_object_image_fill_set(obj, 50, 0, 300, 300)evas_object_image_fill_set(obj, 0, 0, 200, 200)evas_object_image_fill_set(obj, 0, 0, 100, 127)
          + +

          The evas_object_image_filled_set() function scales the image to fit the object area. Resizing the image object automatically triggers an internal call to the evas_object_image_fill_set() function.

          +
          +void evas_object_image_filled_set(Evas *e, Eina_Bool setting);
          + +

          The evas_object_image_filled_add() function creates a new image object that automatically scales its bound image to the object area. This is a helper function around the evas_object_image_add() and evas_object_image_filled_set() functions.

          + +
          Evas_Object *evas_object_image_filled_add(Evas *e);
          + +

          Scaled images' quality can differ according to scaling algorithms. Smooth scaling improves the image quality in the process of size reducing or enlarging. Evas runs its own smooth scaling algorithm by default and provides an API so users can disable the function.

          + +
          +void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smoothscale);
          + +

          The algorithm is implemented using the SIMD (Single Instruction Multiple Data) vectorization in case of software rendering. It is optimized on Intel and ARM CPU through MMX and NEON command respectively.

          + +

          There is a trade-off between image smoothness and rendering performance. The load gets bigger as the image gets bigger. Users can avoid such scaling overload by using the same size of the image object and the source image.

          + +

          In the following code, 2 image objects are created to show the effects of smooth scaling. The one with smooth scaling applied appears softer on the screen.

          + +
          +#include <Elementary.h>
          +
          +int main(int argc, char **argv)
          +{
          +   elm_init(argc, argv);
          +
          +   // Create a window object
          +   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          +   evas_object_resize(win, 400, 200);
          +   evas_object_show(win);
          +
          +   // Return Evas handle from window
          +   Evas *e = evas_object_evas_get(win);
          +
          +   // Create an image object
          +   Evas_Object *img = evas_object_image_filled_add(e);
          +   evas_object_image_file_set(img, "./logo.png", NULL);
          +   evas_object_move(img, 0, 0);
          +   evas_object_resize(img, 200, 200);
          +   evas_object_show(img);
          +
          +   // Create another image object
          +   Evas_Object *img2 = evas_object_image_filled_add(e);
          +   evas_object_image_file_set(img2, "./logo.png", NULL);
          +
          +   // Disable smooth scaling
          +   evas_object_image_smooth_scale_set(img2, EINA_FALSE);
          +   evas_object_move(img2, 200, 0);
          +   evas_object_resize(img2, 200, 200);
          +   evas_object_show(img2);
          +
          +   elm_run();
          +
          +   elm_shutdown();
          +
          +   return 0;
          +}
          +
          + + + + + + + + + + + + +
          Figure: Smooth scaling effects

          Smooth scaling effects

          Smooth scaling effects

          Smooth scaling enabledSmooth scaling disabled
          + + +

          Evas caches scaled image data and reuses them. Users can save the memory by loading the image in the scaled size to the memory at the beginning. This option is available only for jpeg format at the moment.

          +
          +void evas_object_image_load_size_set(Evas_Object *obj, int w, int h);
          + +

          An example code is as follows.

          +
          +#include <Elementary.h>
          + 
          +int main(int argc, char **argv)
          +{
          +   elm_init(argc, argv);
          + 
          +   // Create a window object
          +   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          +   evas_object_resize(win, 400, 200);
          +   evas_object_show(win);
          + 
          +   // Return Evas handle from window
          +   Evas *e = evas_object_evas_get(win);
          + 
          +   // Create an image object
          +   Evas_Object *img = evas_object_image_filled_add(e); 
          + 
          +   // Load the image scaled into the object size 
          +   // before evas_object_image_file_set() is called
          +   evas_object_image_load_size_set(img, 300, 300);
          + 
          +   evas_object_image_file_set(img, "./logo.png", NULL); 
          +   
          +   evas_object_move(img, 50, 50);
          +   evas_object_resize(img, 300, 300);
          +   evas_object_show(img); 
          + 
          +   elm_run();
          + 
          +   elm_shutdown();
          +
          +   return 0;
          +}
          +
          + +

          Setting Raw Data to Image Object

          +

          Users can set raw data to the image object manually using the evas_object_image_data_set() function instead of setting an image file as the data source. The image data should be in raw data form. In case of an 200x200 sized image with alpha channel enabled (32 bits per pixel), the size of the image data is 14000 (=200*200*4) bytes.

          + +
          void evas_object_image_data_set(Evas_Object *obj, void *data);
          + +

          Image objects fetch metadata such as width or height from the header of the image files. Since the raw data does not have the metadata, users must set the size of the image using the evas_object_image_size_set() function.

          + +
          void evas_object_image_size_set(Evas_Object *obj, int w, int h);
          + +

          The evas_object_image_data_get() function returns the data pointer of an image object and requires a parameter to determine whether the data is modified or not. If users pass EINA_TRUE for for_writing, Evas updates the image pixels in the next rendering cycle.

          + +
          void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing);
          + +

          The evas_object_image_data_update_add() helps to mark the updated area for rendering efficiency.

          + +
          void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h);
          + +

          The following example code and figure show how to specify the area to update.

          +
          +evas_object_image_data_update_add(image, 100, 100, 50, 50);
          +evas_object_image_data_update_add(image, 180, 100, 50, 50);
          +evas_object_image_data_update_add(image, 85, 200, 160, 80);
          +
          + +

          Figure: Partial image update

          +

          Partial image update

          + +

          The following code creates an image object and sets a source file on it. Then it implements the blur effect to the pixel data and saves them using the evas_object_image_save() function.

          + +
          Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags);
          + +
          +#include <Elementary.h>
          +
          +void image_blur(Evas_Object *img)
          +{
          +   unsigned char *img_src = evas_object_image_data_get(img, EINA_TRUE);
          +
          +   int w, h;
          +   evas_object_image_size_get(img, &w, &h);
          +   int blur_size = 4;
          +   int x, y, xx, yy;
          +   
          +   for (y = 0; y < h; y++)
          +   {
          +      for (x = 0; x < w; x++)
          +      {
          +         int avg_color[3] = {0, 0, 0};
          +         int blur_pixel_cnt = 0;
          +
          +         for (xx = x; (xx < x + blur_size) && (xx < w); xx++)
          +         {
          +            for (yy = y; (yy < y + blur_size) && (yy < h); yy++)
          +            {
          +               int idx = (yy * w * 4) + (xx * 4);
          +               avg_color[0] += img_src[idx + 0];
          +               avg_color[1] += img_src[idx + 1];
          +               avg_color[2] += img_src[idx + 2];
          +               ++blur_pixel_cnt;
          +            }
          +         }
          +         avg_color[0] /= blur_pixel_cnt;
          +         avg_color[1] /= blur_pixel_cnt;
          +         avg_color[2] /= blur_pixel_cnt;
          +
          +         for (xx = x; (xx < x + blur_size) && (xx < w); xx++)
          +         {
          +            for (yy = y; (yy < y + blur_size) && (yy < h); yy++)
          +            {
          +               int idx = (yy * w * 4) + (xx * 4);
          +               img_src[idx + 0] = avg_color[0];
          +               img_src[idx + 1] = avg_color[1];
          +               img_src[idx + 2] = avg_color[2];
          +            }
          +         }
          +      }
          +   }
          +   evas_object_image_data_update_add(img, 0, 0, w, h);
          +}
          +
          +int main(int argc, char **argv)
          +{
          +   elm_init(argc, argv);
          +
          +   Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
          +   evas_object_resize(win, 200, 200);
          +   evas_object_show(win);
          +
          +   Evas *e = evas_object_evas_get(win);
          +
          +   Evas_Object *img = evas_object_image_filled_add(e);
          +   evas_object_image_file_set(img, "./logo.png", NULL);
          +   evas_object_resize(img, 200, 200);
          +   evas_object_show(img);
          +
          +   image_blur(img);
          +
          +   evas_object_image_save(img, "logo2.png", NULL, "quality=100 compress=8");
          +
          +   elm_run();
          +
          +   elm_shutdown();
          +
          +   return 0;
          +}
          +
          + + + + + + + + + + + + +
          Figure: Blur effect

          Blur effect

          Blur effect

          BeforeAfter
          + +

          Giving Performance Hints

          +

          In image viewer applications, you can display an image in full size. The navigation to the adjacent images on your album must be fluid and fast. Thus, while displaying a given image, the program can load the next and previous image in the background to be able to immediately repaint the screen with a new image.

          + +

          Evas addresses this issue with image preloading:

          + +
          +prev = evas_object_image_filled_add(canvas);
          +evas_object_image_file_set(prev, "/path/to/prev", NULL);
          +evas_object_image_preload(prev, EINA_TRUE);
          +next = evas_object_image_filled_add(canvas);
          +evas_object_image_file_set(next, "/path/to/next", NULL);
          +evas_object_image_preload(next, EINA_TRUE);
          +
          + +

          If you are loading an image which is too big, set its loading size smaller.

          + +

          Load a scaled down version of the image in the memory if that is the size you are displaying (this can speed up the loading considerably):

          +
          evas_object_image_load_scale_down_set(img, zoom);
          +

          If you know you are showing a sub-set of the image pixels, you can avoid loading the complementary data:

          +
          evas_object_image_load_region_set(img, x, y, w, h);
          +
          + +

          Specifying Borders

          +

          With Evas, you can specify image margins to be treated as borders. The margins then maintain their aspects when the image is resized. This makes setting frames around other UI objects easier. The following figure illustrates the border behavior, when the image is resized.

          + +

          Figure: Borders in Evas

          +

          Borders in Evas

          + + +

          Textblock Objects

          + +

          Unlike basic text objects, a textblock handles complex text, managing multiple styles and multiline text based on HTML-like tags. However, these extra features are heavier on memory and processing cost.

          +

          The textblock objects is an object that shows big chunks of text. Textblock supports many features, including text formatting, automatic and manual text alignment, embedding items (icons, for example). Textblock has three important parts: the text paragraphs, the format nodes and the cursors.

          +

          To set markup to format text, use for example <font_size=50>Big!</font_size>. Set more than one style directive in one tag with <font_size=50 color=#F00>Big and Red!</font_size>. Please note that we used </font_size> although the format also included color. This is because the first format determines the matching closing tag's name. You can use anonymous tags, such as <font_size=30>Big</>, which pop any type of format, but it is advisable to use the named alternatives instead.

          +

          Textblock supports the following formats:

          +
            +
          • font: Font description in fontconfig such as format, for example "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
          • +
          • font_weight: Overrides the weight defined in "font". For example, "font_weight=Bold" is the same as "font=:style=Bold". The supported weights are "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
          • +
          • font_style: Overrides the style defined in "font". For example, "font_style=Italic" is the same as "font=:style=Italic". The supported styles are "normal", "oblique", and "italic".
          • +
          • font_width: Overrides the width defined in "font". For example, "font_width=Condensed" is the same as "font=:style=Condensed". The supported widths are "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
          • +
          • lang: Overrides the language defined in "font". For example, "lang=he" is the same as "font=:lang=he".
          • +
          • font_fallbacks: A comma delimited list of fonts to try if finding the main font fails.
          • +
          • font_size: The font size in points.
          • +
          • font_source: The source of the font, for example an eet file.
          • +
          • color: The text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • underline_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • underline2_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • outline_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • shadow_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • glow_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • glow2_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • strikethrough_color: The color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • align: The text alignment in one of the following formats: "auto" (according to text direction), "left", "right", "center" or "middle", which take a value between 0.0 and 1.0 or a value between 0% to 100%.
          • +
          • valign: The vertical text alignment in one of the following formats: "top", "bottom", "middle", "center", "baseline" or "base", which take a value between 0.0 and 1.0 or a value between 0% to 100%.
          • +
          • wrap: The text wrap in one of the following formats: "word", "char", "mixed", or "none".
          • +
          • left_margin: Either "reset" or a pixel value indicating the margin.
          • +
          • right_margin: Either "reset" or a pixel value indicating the margin.
          • +
          • underline: The style of underlining in one of the following formats: "on", "off", "single", or "double".
          • +
          • strikethrough: The style of text that is either "on" or "off".
          • +
          • backing_color: The background color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", or "#RGBA".
          • +
          • backing: The background color enabled or disabled: "on" or "off".
          • +
          • style: The style of the text in one of the following formats: "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow" or "far_soft_shadow". The direction is selected by adding "bottom_right", "bottom", "bottom_left", "left", "top_left", "top", "top_right" or "right". For example, "style=shadow,bottom_right".
          • +
          • tabstops: The pixel value for tab width.
          • +
          • linesize: To force a line size in pixels.
          • +
          • linerelsize: Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
          • +
          • linegap: To force a line gap in pixels.
          • +
          • linerelgap: Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
          • +
          • item: Creates an empty space that is filled by an upper layer. Use "size", "abssize", or "relsize" to define the item"s size, and an optional vsize = full/ascent to define the item's position in the line.
          • +
          • linefill: Either a float value or percentage indicating how much to fill the line.
          • +
          • ellipsis: A value between 0.0 and 1.0 to indicate the type of ellipsis, or -1.0 to indicate that an ellipsis is not wanted.
          • +
          • password: Either "on" or "off", this is used to specifically turn replacing chars with the password mode (that is, replacement char) on and off.
          • +
          + + +

          Clipping Objects

          + +

          Limiting Visibility

          +

          An Evas object can be clipped – in other words, its visible area is restricted with the clipper object.

          + +

          It is often necessary to show only parts of an object, and while it may be possible to create an object that corresponds only to the part that must be shown (which is not always possible), it is usually easier to use a clipper. A clipper is a rectangle that defines what is visible and what is not. The way to do this is to create a solid white rectangle (by default, so you need not use evas_object_color_set()) and give it a position and size of what is wanted visible. The following code exemplifies showing the center half of my_evas_object:

          +
          Evas_Object *clipper = evas_object_rectangle_add(evas_canvas);
          +evas_object_move(clipper, my_evas_object_x / 4, my_evas_object_y / 4);
          +evas_object_resize(clipper, my_evas_object_width / 2, my_evas_object_height / 2);
          +evas_object_clip_set(my_evas_object, clipper);
          +evas_object_show(clipper);
          +
          + +

          Layer of Color

          +

          A solid white clipper does not produce a change in the color of the clipped object, only hides what is outside the clipper's area. Changing the color of an object is accomplished by using a colored clipper. Clippers with color function by multiplying the colors of the clipped object. The following code shows how to remove all the red from an object.

          +
          Evas_Object *clipper = evas_object_rectangle_add(evas);
          +evas_object_move(clipper, my_evas_object_x, my_evas_object_y);
          +evas_object_resize(clipper, my_evas_object_width, my_evas_object_height);
          +evas_object_color_set(clipper, 0, 255, 255, 255);
          +evas_object_clip_set(obj, clipper);
          +evas_object_show(clipper);
          +
          + + +

          Mapping Objects

          + +

          Evas allows different transformations to be applied to all kinds of objects. These are applied by means of UV mapping. With UV mapping, one map points in the source object to a 3D space positioning at target. This allows rotation, perspective, scale, and many other effects depending on the map that is used.

          + +

          Creating a Map

          +

          A map consists of a set of points, but currently only four are supported. Each of these points contains a set of canvas coordinates x and y that are used to alter the geometry of the mapped object, and a z coordinate that indicates the depth of that point. This last coordinate does not normally affect the map, but is used by several of the utility functions to calculate the right position of the point given other parameters.

          +

          The coordinates for each point are set with evas_map_point_coord_set(map, index, x, y, z). In the example below, there is a rectangle whose coordinates are (100, 100) and (300, 300).

          +
          Evas_Object *object = evas_object_rectangle_add(evas);
          +evas_object_move(object, 100, 100);
          +evas_object_resize(object, 200, 200);
          +Evas_Map map = evas_map_new(4);
          +evas_map_point_coord_set(map, 0, 100, 100, 0);
          +evas_map_point_coord_set(map, 1, 300, 100, 0);
          +evas_map_point_coord_set(map, 2, 300, 300, 0);
          +evas_map_point_coord_set(map, 3, 100, 300, 0);
          +
          +

          There are functions to ease the process.

          +

          Use evas_map_util_points_populate_from_geometry(map, x, y, w, h, z), where the map coordinates are set to the given rectangle, and z is the coordinate in the Z axis, which is the same for all points.

          +
          Evas_Object *object = evas_object_rectangle_add(evas);
          +evas_object_move(object, 100, 100);
          +evas_object_resize(object, 200, 200);
          +Evas_Map map = evas_map_new(4);
          +evas_map_util_points_populate_from_geometry(map, 100, 100, 200, 200, 0);
          +
          + +

          You can also use evas_map_util_points_populate_from_object(map, object).

          +
          Evas_Object *object = evas_object_rectangle_add(evas);
          +evas_object_move(object, 100, 100);
          +evas_object_resize(object, 200, 200);
          +Evas_Map map = evas_map_new(4);
          +evas_map_util_points_populate_from_object(map, object);
          +
          + +

          You can also use evas_map_util_points_populate_from_object_full(map, object, z), where z is the coordinate in the Z axis, which is the same for all points.

          +
          Evas_Object *object = evas_object_rectangle_add(evas);
          +evas_object_move(object, 100, 100);
          +evas_object_resize(object, 200, 200);
          +Evas_Map map = evas_map_new(4);
          +evas_map_util_points_populate_from_object_full(map, object, 0);
          +
          + +

          Manual Point Setting

          +

          Several effects are applied to an object by setting each point of the map to the right coordinates. For example, a simulated perspective is achieved as follows.

          +
          evas_map_point_coord_set(map, 0, 300, 100, 0);
          +evas_map_point_coord_set(map, 1, 450, 120, 0);
          +evas_map_point_coord_set(map, 2, 450, 260, 0);
          +evas_map_point_coord_set(map, 3, 300, 300, 0);
          +
          + +

          The Z coordinate is not used when setting points by hand; thus its value is not important.

          + +

          Applying a Map

          +

          Regardless of the specific way you create a map, to apply it to a specific object, use

          +
          evas_object_map_set(object, map);
          +evas_object_map_enable_set(object, EINA_TRUE);
          +
          + +

          Basic Utility Functions

          +

          Evas provides utility functions for common transformations:

          +
            +
          • evas_map_util_rotate(map, angle, cx, cy): This performs a rotation of the angle degrees around the center point with the coordinates (cx, cy).
          • +
          • evas_map_util_zoom(map, zoomx, zoomy, cx, cy): This performs a zoomx and zoomy zoom in the X and Y directions respectively, with the center point with the coordinates (cx, cy).
          • +
          + +

          For example, the following code rotates an object around its center.

          +
          int x, y, w, h;
          +evas_object_geometry_get(object, &x, &y, &w, &h);
          +Evas_Map *map = evas_map_new(4);
          +evas_map_util_points_populate_from_object(map, object);
          +evas_map_util_rotate(map, 45, x + (w / 2), y + (h / 2));
          +evas_object_map_set(object, map);
          +evas_object_map_enable_set(object, EINA_TRUE);
          +evas_map_free(m);
          +
          + +

          The following code rotates an object around the center of the window.

          +
          int w, h;
          +evas_output_size_get(evas, &w, &h);
          +Evas_Map *map = evas_map_new(4);
          +evas_map_util_points_populate_from_object(map, object);
          +evas_map_util_rotate(map, 45, w / 2, h / 2);
          +evas_object_map_set(object, map);
          +evas_object_map_enable_set(object, EINA_TRUE);
          +evas_map_free(m);
          +
          + +

          3D Utility Functions

          +

          Evas provides utility functions for 3D transformations.

          +

          To make a 3D rotation, use evas_map_util_3d_rotate(map, anglex, angley, anglez, cx, cy, cz). With this code, you can set the Z coordinate of the rotation center, and the angles to rotate through around all axes.

          +

          Rotating in the 3D space does not look natural. A more natural look becomes by adding perspective to the transformation, which is done with evas_map_util_3d_perspective(map, px, py, z0, focal) on the map after its position has been set.

          + +
            +
          • px and py specify the "infinite distance" point in the 3D conversion, where all lines converge to.
          • +
          • z0 specifies the Z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates: any points on this Z value do not have their X and Y coordinates modified in the transform, while those further away (Z value higher) shrink into the distance, and those less than this value expand.
          • +
          • focal determines the "focal length" of the camera: this is the distance in reality between the camera lens plane (the rendering results are undefined at or closer than this) and the z0 value; this function allows for some "depth" control.
          • +
          +

          Color and Lighting

          +

          Each point in a map can be set to a color, which is multiplied with the object's own color and linearly interpolated in between adjacent points. To do this, use evas_map_point_color_set(map, index, r, g, b, a) for each point of the map, or evas_map_util_points_color_set(map, r, g, b, a) to set every point into the same color.

          +

          To add lighting for the objects, which is useful with 3D transforms, use evas_map_util_3d_lighting(map, lightx, lighty, lightz, lightr, lightg, lightb, ambientr, ambientg, ambientb):

          +
            +
          • lightx, lighty and lightz are the local light source coordinates;
          • +
          • lightr, lightg and lightb are the local light source colors;
          • +
          • ambientr, ambientg and ambientb are the ambient light colors. Evas sets the color of each point based on the distance to the light source, the angle with which the object is facing the light and the ambient light. The orientation of each point is important. If the map is defined counter-clockwise, the object faces away from the user and becomes obscured, since no light does not reflect from it.
          • +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/evas_optimization_n.htm b/org.tizen.ui.practices/html/native/efl/evas_optimization_n.htm new file mode 100644 index 0000000..61223fd --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_optimization_n.htm @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + Optimizing Evas + + + + + + +
          +

          Optimizing Evas

          + +

          To optimize Evas:

          + + + +

          Using a Rectangle Object instead of a Solid Color Image

          +

          When you need a solid color object, it is more efficient to use a rectangle object than an image.

          + + + + + + + + + + + + + + + + + + +
          Before
          +
          +image = elm_image_add(win);
          +snprintf(buf, sizeof(buf), "%s/images/white_bg.png", elm_app_data_dir_get()); 
          +elm_image_file_set(image, buf, NULL);
          +evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_win_resize_object_add(win, image);
          +evas_object_show(image);
          +
          After
          +
          +rect = evas_object_rectangle_add(evas_object_evas_get(win));
          +evas_object_color_set(rect, 255, 255, 255, 255);
          +evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_win_resize_object_add(win, rect);
          +evas_object_show(rect);
          +
          + + +

          Making an Object Invisible instead of Setting Alpha as 0

          + +

          To make an object invisible, it is more efficient to use the evas_object_hide() function instead of changing its alpha value to 0.

          + + + + + + + + + + + + + + + +
          BeforeAfter
          +
          +static void
          +_invisible_cb(void *data, Evas_Object *obj, void *ev)
          +{
          +   evas_object_color_set(obj, 0, 0, 0, 0);   
          +}
          +
          +
          +static void
          +_invisible_cb(void *data, Evas_Object *obj, void *ev)
          +{
          +   evas_object_hide(obj);   
          +}
          +
          + +

          Using evas_object_image for Maximum Optimization

          + +

          If you need maximum optimization, use the evas_object_image object instead of the elm_image and elm_icon objects.

          + + + + + + + + + + + + + + + + + + +
          Before
          +
          +img = elm_image_add((parent);
          +snprintf(buf, sizeof(buf), "%s/images/white_bg.png", elm_app_data_dir_get()); 
          +elm_image_file_set(img, buf, NULL);
          +evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +evas_object_show(img);
          +
          After
          +
          +img = evas_object_image_add(evas_object_evas_get(parent));
          +snprintf(buf, sizeof(buf), "%s/images/white_bg.png", elm_app_data_dir_get()); 
          +evas_object_image_file_set(img, buf, NULL);
          +evas_object_image_filled_set(img, EINA_TRUE);
          +evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +evas_object_show(img);
          +
          + + +

          Setting the Parent to Avoid the Elementary Tree Reconstruction

          +

          Before creating an object, make sure that the relationship between the parent and child is set correctly to avoid having to reconstruct later.

          + + + + + + + + + + + + + + + +
          BeforeAfter
          +
          +win = elm_win_add();
          +
          +scroller = elm_scroller_add(win);
          +
          +box = elm_box_add(win);
          +
          +button = elm_button_add(win);
          +
          +
          +win = elm_win_add();
          +
          +scroller = elm_scroller_add(win);
          +
          +box = elm_box_add(scroller);
          +
          +button = elm_button_add(box);
          +
          + + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/evas_rendering_n.htm b/org.tizen.ui.practices/html/native/efl/evas_rendering_n.htm new file mode 100644 index 0000000..4f49d4e --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/evas_rendering_n.htm @@ -0,0 +1,288 @@ + + + + + + + + + + + + + Evas Rendering Concept and Method + + + + + +
          + +

          Evas Rendering Concept and Method

          + +

          Evas is a canvas display library. It is markedly different from most display and windowing systems as the canvas is structural and is also a state engine, whereas most display and windowing systems are immediate mode display targets. Evas handles the logic between a structural display via its state engine, and controls the target windowing system in order to produce rendered results of the current canvas' state on the display.

          +

          Immediate mode display systems retain very little or no state. A program executes a series of commands, as in the following pseudo code.

          +
          +draw line from position (0, 0) to position (100, 200);
          +
          +draw rectangle from position (10, 30) to position (50, 500);
          +
          +bitmap_handle = create_bitmap();
          +scale bitmap_handle to size 100 x 100;
          +draw image bitmap_handle at position (10, 30);
          +
          +

          The series of commands is executed by the windowing system and the results are typically displayed on the screen. Once the commands are executed, the display system does not know how to reproduce this image again, and has to be instructed by the application on how to redraw sections of the screen if needed. Each successive command is executed as instructed by the application and either emulated by software or sent to the graphics hardware on the device to be performed.

          +

          The advantage of such a system is that it is simple and gives a program tight control over how something looks and is drawn. Given the increasing complexity of displays and demands by users to have better looking interfaces, more work needs to be done at this level by the internals of UI component sets, custom display components and other programs. This means that more logic and display rendering code needs to be written again each time the application needs to figure out how to minimize redraws so that display is fast and interactive, and keep track of redraw logic.

          +

          For example, if in the scene below, the windowing system requires the application to redraw the area from 0, 0 to 50, 50 (also referred to as the "expose event"). Then the programmer calculates manually the updates and repaints it again.

          +
          +Redraw from position (0, 0) to position (50, 50):
          +
          +// What was in area (0, 0, 50, 50)?
          +
          +// 1. intersection part of line (0, 0) to (100, 200)?
          +   draw line from position (0, 0) to position (25, 50);
          +
          +// 2. intersection part of rectangle (10, 30) to (50, 500)?
          +   draw rectangle from position (10, 30) to position (50, 50)
          +
          +// 3. intersection part of image at (10, 30), size 100 x 100?
          +   bitmap_subimage = subregion from position (0, 0) to position (40, 20)
          +   draw image bitmap_subimage at position (10, 30);
          +
          + +

          If all elements in the above scene are opaque, the system is doing useless paints: part of the line is behind the rectangle, and part of the rectangle is behind the image. These useless paints tend to be very costly.

          +

          Evas is a structural system in which the programmer creates and manages display objects and their properties, and as a result of this higher level state management, the canvas is able to redraw the set of objects when needed to represent the current state of the canvas.

          +

          For example, see the following pseudo code.

          +
          +line_handle = create_line();
          +set line_handle from position (0, 0) to position (100, 200);
          +show line_handle;
          +
          +rectangle_handle = create_rectangle();
          +move rectangle_handle to position (10, 30);
          +resize rectangle_handle to size 40 x 470;
          +show rectangle_handle;
          +
          +bitmap_handle = create_bitmap();
          +scale bitmap_handle to size 100 x 100;
          +move bitmap_handle to position (10, 30);
          +show bitmap_handle;
          +
          +render scene;
          +
          + +

          This looks longer, but when the display needs to be refreshed or updated, the programmer only moves, resizes, shows, hides etc. the objects that need to change. The programmer thinks at the object logic level, and the canvas software does the rest of the work, figuring out what changed in the canvas since it was last drawn, how to most efficiently redraw the canvas and its contents to reflect the current state, and doing the actual drawing of the canvas.

          +

          This allows the programmer think in a more natural way when dealing with a display, and saves time and effort of working out how to load and display images, to render given the current display system etc. Since Evas is portable across different display systems, this gives the programmer the ability to port and display the code on different display systems with little work.

          +

          Evas is a display system somewhere between a UI component set and an immediate mode display system. It retains basic display logic, but does little high-level logic such as scrollbars, sliders, push buttons etc.

          + +

          For more information on the UI rendering modes (immediate and retained), see UI Rendering Mode.

          + + +

          Evas Engines Concept

          +

          Evas delegates most of the actual rendering work to its engines. Engines are the backends that Evas uses to render (primitive) objects on a canvas. The canvas can be the screen, or a buffer in the memory.

          +

          Evas can work with and provides multiple engines, such as (this list is non-exhaustive):

          +
            +
          • buffer: all the rendering takes place in a buffer
          • +
          • fb: the rendering takes place in the system's framebuffer
          • +
          • software_x11: this is the most used, using X11
          • +
          • gl_x11: this also renders to an X11 window, except that it uses OpenGL
          • +
          +

          These implement the rendering of all the basic objects by themselves, because they often can be accelerated by the hardware or backend software libraries to provide fast rendering.

          +

          If a particular engine does not have the provision for a certain primitive object, it reverts back to using a default software version.

          + +

          UI Rendering Mode

          + +

          Evas removes the need to know about the characteristics of your display system or what graphics calls are used to draw them and how. It deals on an object level where all you do is create and manipulate objects in a canvas, set their properties, and the rest is done for you. This rendering method is called the retained mode, whereas the immediate mode is an alternative rendering method.

          + +

          Immediate Mode

          + +

          The immediate mode is the most commonly used in graphics toolkit libraries, such as GTK+, GDI, and GDI+. The application is responsible for repainting the portion of the client area that is invalidated.

          + +

          Figure: Immediate mode

          +

          Immediate mode

          + +

          The application commands any drawing issues as it needs, and the display system draws some GUIs. After the drawing is done, it appears in the destination. This mode allows you to have a exact control over the render cycles. However, if the draw commands are misused, unnecessary drawing can be performed or drawing never happen at all.

          +

          The following example explains the common usage of the immediate mode:

          + +
          +void update()
          +{
          +   Image *img = load_image(NEW_IMG);
          +
          +   // Switch button image to new one
          +   update_button_image(img);
          +
          +   // Issue the invalidate area (button area) to be redrawn on the screen
          +   invalidate_area(button_x, button_y, button_w, button_h);
          +
          +   // Move rectangle from (200, 200) to (300, 300)
          +   int rect_prev_x = rect_x;
          +   int rect_prev_y = rect_y;
          +   rectangle_x = 300;
          +   rectangle_y = 300;
          +   set_rect_position(rect_x, rect_y);
          +   
          +   // Issue the invalidate area (changed area) to be redrawn on the screen
          +   int diff_x = rect_x – rect_prev_x;
          +   int diff_y = rect_y – rect_prev_y;
          +   invalidate_area(rect_prev_x, rect_prev_y, (rect_w + diff_x), (rect_h + diff_y));
          +
          +
          +   // After setting the invalidate area, request rendering to update the screen
          +   render();
          +
          +   // Now you can see how the button image and rectangle position are changed
          +}
          +
          + +

          Retained Mode

          + +

          A graphics system adopting the retained mode is basically responsible for responding to all repaint requests for rendering the application objects. Clients do not directly cause actual rendering, but objects are redrawn when parts of them are updated.

          + +

          Figure: Retained mode

          +

          Retained mode

          + +

          Since Evas works with the retained mode, there is no need to command any drawings. The following example shows how to write a GUI code with Evas for your application:

          + +
          +void create_image()
          +{
          +   // Initialize an image object to be displayed on the screen
          +   Evas_Object *img = evas_object_image_add(e);
          +
          +   // Set image resource
          +   evas_object_image_file_set(img, IMG, NULL);
          +
          +   // Set image position 
          +   evas_object_move(img, 100, 100);
          +
          +   // Set image size
          +   evas_object_resize(img, 200, 200);
          +
          +   // Set image visibility (show or hide)
          +   evas_object_show(img);
          +}
          +
          +void create_rectangle()
          +{
          +   // Initialize an rectangle object to be displayed on the screen
          +   Evas_Object *rect = evas_object_rectangle_add(e);
          +
          +   // Set rectangle color
          +   evas_object_color_set(rect, 255, 0, 0, 255);
          +
          +   // Set rectangle position
          +   evas_object_move(rect, 200, 200);
          +
          +   // Set rectangle size
          +   evas_object_resize(rect, 200, 200);
          +
          +   // Set rectangle visibility (show or hide)
          +   evas_object_show(rect);
          +}
          +
          + +

          A few main loops later you can replace the image with another one and move the rectangle. You only need to set a new image file to the image object and move the rectangle object. Evas computes the invalidate area and redraws the image and rectangle behind the application when it's on rendering time.

          + +
          +void update()
          +{
          +   // Set new image resource
          +   elm_image_file_set(img, NEW_IMG, NULL);
          +
          +   // Set new rectangle position
          +   evas_object_move(rect, 300, 300);
          +}
          +
          + +

          Evas Rendering

          + +

          Tizen Native applications work on the ecore main loop, and the loop goes on a few steps for every frame. Evas redraws some changes in the objects when the main loop goes to the idle enterer step. If there are no changes, Evas rendering is skipped. Otherwise, Evas calculates any changed portions of all display objects and redraws them.

          + +

          Figure: Evas rendering in the main loop

          +

          Evas rendering in the main loop

          + +

          To minimize the rendering, Evas tracks the states of all display objects, such as position, size, visibility, and color. Even if some of these states are changed but the object is hidden by other obscured objects, it is not redrawn. In other words, Evas draws only the necessary changes in the screen.

          + +

          The following figures illustrate how Evas redraws the changed area:

          + +
          • In the first example, there is a blue-color background object (a sky-blue color rectangle) and a partially hidden cloud image object. Above them, there are a red and green rectangle, and the "Hello out there" text is printed on the green rectangle.

            + +

            Figure: Evas redrawing example 1

            +

            Evas redrawing example 1

          • + +
          • In the second example, some of the objects have moved (the cloud image is moved to right and the green rectangle is moved downwards).

            + +

            Figure: Evas redrawing example 2

            +

            Evas redrawing example 2

          • + +
          • As a result, the third example illustrates some regions that require updates.

            + +

            Figure: Evas redrawing example 3

            +

            Evas redrawing example 3

          • + +
          • Evas decides which portions are invalid and to be redrawn. The fourth example shows the cleaned portion of the screen, which is the redrawn area.

            +

            Evas redraws the content only in the redrawn portions.

            +

            Figure: Evas redrawing example 4

            +

            Evas redrawing example 4

          • + +
          • Finally, the fifth example shows how the screen is updated and the result is visible.

            + +

            Figure: Evas redrawing example 5

            +

            Evas redrawing example 5

            + +

            If Evas worked in an immediate mode style, the application would need to calculate the changed areas themselves, adding extra work. With Evas, you can let Evas figure out the updates and you can yourself concentrate on the application and UI core and logic.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/event_handling_n.htm b/org.tizen.ui.practices/html/native/efl/event_handling_n.htm new file mode 100644 index 0000000..4ef258f --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/event_handling_n.htm @@ -0,0 +1,119 @@ + + + + + + + + + + + + + Event Handling: Managing the Event Flow + + + + + +
          + +

          Event Handling: Managing the Event Flow

          + +

          The EFLs rely on events and callbacks. In case of an event, (for example, a key press, mouse click or a battery running low), the mainloop calls the callback functions that are associated to that specific event. After the callbacks have finished, the mainloop takes over and waits for new events, upon which to trigger new callbacks.

          +

          It is important to do light work in the callbacks and to return to the mainloop relatively quickly. If there is heavy work to do, it is best to use an asynchronous mechanism like Ecore_con for network I/O or threads for CPU-intensive tasks. Failure to return quickly to the mainloop blocks the application's UI and it appears frozen.

          + +

          EFL Event Types

          +

          There are several event types in the EFLs, and their use depends on the level of the event. The event types from lower- to higher-level are:

          +
            +
          • Evas smart events are the most often used and take place on collections of evas objects (which are most typically handled). They are called "smart" because they have internal logic and can define their own events while other event types are fixed.
          • +
          • Ecore events are the lowest-level events and come directly from the system. Except for application-wide shortcuts, it is not advisable to use them.
          • +
          • Evas object events concern the objects that are on the canvas.
          • +
          • Evas events are events on the graphical canvas as a whole. They are fairly low-level and mostly useful when drawing directly on the canvas.
          • +
          + +

          Figure: Event types in the EFLs: Inner boxes are more specific than outer ones

          +

          Event types in the EFLs: Inner boxes are more specific than outer ones

          + + + + + + + + + + + + +
          Note
          There are also Edje signals, which come from program sections in themes; they can be used from high-level Elementary APIs or a low-level Edje API.
          + +

          Basic Event Flow

          +

          A realistic scenario involving various types of events is an application showing a button, which triggers the download of a file to be processed. There are progress bars for the operations.

          +

          Create the window, create a box, set it vertical and add a button and two progress bars. At first, only the button is fully visible.

          +

          When the user clicks on the button, an evas smart object event named "clicked" is emitted. The callback then starts the download in Ecore_con, displays the first progress bar and adds a callback to monitor the download progress. When the download progress changes, the callback updates the progress bar.

          +

          After the download is finished, the second progress bar is displayed and the file processing is offloaded to another thread through Ecore_thread. The processing function regularly updates the progress bar (wrapped in ecore_main_loop_thread_safe_call_async() because GUI operations are not thread-safe).

          +

          Events enable operations taking more than a few milliseconds' time to be executed outside of the mainloop, therefore not blocking UI redraws.

          +

          Below is an illustration for the event flow that follows a click on the screen.

          + +

          Figure: Event flow for a user click

          +

          Event flow for a user click

          + + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/event_types_n.htm b/org.tizen.ui.practices/html/native/efl/event_types_n.htm new file mode 100644 index 0000000..a9ca786 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/event_types_n.htm @@ -0,0 +1,461 @@ + + + + + + + + + + + + + Event Types + + + + + +
          + +

          Event Types

          + +

          EFL provides various event types that you can use to monitor and react to user interactions and system events in the UI.

          + +

          Ecore Events

          + +

          Ecore events are used for low-level handling of events, such as key presses, network connections, and communication with sub-processes. In case of shortcuts, the low-level handling of key presses is particularly useful: instead of adding a signal handler to a specific graphical element, you can add one globally to guarantee that no matter which UI component is currently receiving events, the shortcut is caught correctly.

          +

          Ecore events can also be used to implement new graphical back-ends. However, they are low-level and not useful for most applications.

          + +

          In addition to using predefined Ecore events, you can create your own events with the ecore_event_type_new() function. The function generates a new unique identifier, which you can use as the event type parameter when managing your events and event handlers.

          + + +

          Shortcut Events

          + +

          The following Ecore events are available for shortcuts. The event callbacks receive additional data through a void * object, whose type depends on the received event.

          + +
            +
          • ECORE_EVENT_KEY_DOWN and ECORE_EVENT_KEY_UP events: +
            +typedef struct _Ecore_Event_Key Ecore_Event_Key;
            +
            +struct _Ecore_Event_Key 
            +{
            +   const char *keyname;
            +   const char *key;
            +   const char *string;
            +   const char *compose;
            +   Ecore_Window window;
            +   Ecore_Window root_window;
            +   Ecore_Window event_window;
            +
            +   unsigned int timestamp;
            +   unsigned int modifiers;
            +
            +   int same_screen;
            +};
            +
            + +
          • + +
          • ECORE_EVENT_MOUSE_BUTTON_DOWN and ECORE_EVENT_MOUSE_BUTTON_UP events: +
            typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button;
            +struct _Ecore_Event_Mouse_Button 
            +{
            +   Ecore_Window window;
            +   Ecore_Window root_window;
            +   Ecore_Window event_window;
            +
            +   unsigned int timestamp;
            +   unsigned int modifiers;
            +   unsigned int buttons;
            +   unsigned int double_click;
            +   unsigned int triple_click;
            +   int same_screen;
            +
            +   int x;
            +   int y;
            +   struct 
            +   {
            +      int x;
            +      int y;
            +   } root;
            +
            +   struct 
            +   {
            +      // 0 if normal mouse, 1+ for other mouse-devices (such as multi-touch - other fingers)
            +      int device; 
            +      // Radius of press point - radius_x and radius_y if it is an ellipse (radius is the average of the 2)
            +      double radius, radius_x, radius_y; 
            +      // Pressure - 1.0 == normal, > 1.0 == more, 0.0 == none
            +      double pressure; 
            +      // Angle relative to perpendicular (0.0 == perpendicular), in degrees
            +      double angle; 
            +      // Same as x, y, root.x, root.y, but with sub-pixel precision, if available
            +      double x, y; 
            +      struct 
            +      {
            +         double x;
            +         double y;
            +      } root;
            +   } multi;
            +};
            +
            + +
          • +
          • ECORE_EVENT_MOUSE_MOVE and ECORE_EVENT_MOUSE_WHEEL events: +
            +typedef struct _Ecore_Event_Mouse_Wheel Ecore_Event_Mouse_Wheel;
            +struct _Ecore_Event_Mouse_Wheel 
            +{
            +   Ecore_Window window;
            +   Ecore_Window root_window;
            +   Ecore_Window event_window;
            +
            +   unsigned int timestamp;
            +   unsigned int modifiers;
            +
            +   int same_screen;
            +   int direction;
            +   int z;
            +
            +   int x;
            +   int y;
            +   struct 
            +   {
            +      int x;
            +      int y;
            +   } root;
            +};
            +
            +
          • +
          • ECORE_EVENT_MOUSE_IN and ECORE_EVENT_MOUSE_OUT events: +
            +typedef struct _Ecore_Event_Mouse_Move Ecore_Event_Mouse_Move;
            +struct _Ecore_Event_Mouse_Move 
            +{
            +   Ecore_Window window;
            +   Ecore_Window root_window;
            +   Ecore_Window event_window;
            +
            +   unsigned int timestamp;
            +   unsigned int modifiers;
            +
            +   int same_screen;
            +
            +   int x;
            +   int y;
            +   struct 
            +   {
            +      int x;
            +      int y;
            +   } root;
            +
            +   struct 
            +   {
            +      // 0 if normal mouse, 1+ for other mouse-devices (such as multi-touch - other fingers)
            +      int device; 
            +      // Radius of press point - radius_x and radius_y if it is an ellipse (radius is the average of the 2)
            +      double radius, radius_x, radius_y; 
            +      // Pressure - 1.0 == normal, > 1.0 == more, 0.0 == none
            +      double pressure; 
            +      // Angle relative to perpendicular (0.0 == perpendicular), in degrees
            +      double angle; 
            +      // Same as x, y, root.x, root.y, but with sub-pixel precision, if available
            +      double x, y; 
            +      struct 
            +      {
            +         double x, y;
            +      } root;
            +   } multi;
            +};
            +
            + +
          • +
          +

          Managing Ecore Event Handlers

          + +

          To manage Ecore event handlers:

          + +
          1. To add an Ecore event handler, register a callback for a specific event with the ecore_event_handler_add() function. +

            The function takes as parameters the event type (such as ECORE_EVENT_KEY_DOWN for key presses), callback function, and additional data delivered to the callback. The function returns an event handler pointer, which you can use to remove the handler later.

          2. + +
          3. Define the Ecore_Event_Handler_Cb() callback function. +

            The function takes as parameters the additional data defined in the ecore_event_handler_add() function parameters, the event type, and the event object (Ecore_Event_Key, Ecore_Event_Mouse_Button, Ecore_Event_Mouse_Wheel, or Ecore_Event_Mouse_Move). The function returns ECORE_CALLBACK_PASS_ON to allow other callbacks for that event be called, or ECORE_CALLBACK_DONE to not call them.

          4. + +
          5. When no longer needed, remove the event handler with the ecore_event_handler_del() function, using the event handler pointer as a parameter.
          + +

          The following example shows how you can set a global variable to EINA_TRUE when the Ctrl key is pressed:

          +
          +Eina_Bool ctrl_pressed = EINA_FALSE;
          +
          +static Eina_Bool
          +_key_down_cb(void *data __UNUSED__, int type __UNUSED__, void *ev)
          +{
          +   // The callback is used with the ECORE_EVENT_KEY_DOWN signal: the
          +   // parameter "void *ev" is therefore of the actual type Ecore_Event_Key
          +   // The following renders its fields accessible
          +   Ecore_Event_Key *event = ev;
          +
          +   // Test whether the key that is pressed is Ctrl.
          +   if (!strcmp("Control_L", event->key))
          +   {
          +      // If it is, store that piece of information
          +      ctrl_pressed = EINA_TRUE;
          +   }
          +
          +   // Let the event continue to other callbacks which have not been called yet
          +   return ECORE_CALLBACK_PASS_ON;
          +}
          +
          +ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, NULL);
          +
          + +

          Sending Ecore Events to the Main Loop

          + +

          You can send Ecore events to the main loop yourself to handle actions of various origins through the same codepath. This is a thread-safe operation.

          +

          To send an event, use the ecore_event_add() function. The function takes as parameters the event type (such as ECORE_EVENT_KEY_DOWN for key presses), additional data delivered to the callback, the Ecore_End_Cb() function used to free the additional data after it is deliver to the callback function, and the pointer to additional data delivered to the free function. The free function and the pointer to its additional data are optional; use NULL if you do not need them.

          + + +

          Edje Events

          + +

          Edje themes have small program sections, which are triggered upon the reception of a signal that can execute actions, such as changing the state of an Edje part and running another program.

          + +

          Managing a Single Signal Emitter

          +

          The following example shoes a program section. The program is called "change_color", it is triggered on mouse clicks on the current part, and it emits a "got.a.click" signal where the source is set to "color_changer".

          +
          program 
          +{
          +   name: "change_color";
          +   signal: "mouse,clicked,*";
          +   source: "*";
          +   action: SIGNAL_EMIT "got.a.click" "color_changer";
          +}
          +
          + +

          To catch the emitted signal from the C side, use either the edje_object_signal_callback_add() or elm_object_signal_callback_add() function. Their only difference is that the previous one operates on an Edje object and the latter one on an Elementary object. Unless you do not use the Elementary library at all, use the Elementary variant.

          + +

          Both the functions take as parameters the object emitting the signal, the signal name ("*" acts as a wildcard), the signal source, the Edje_Signal_Cb() callback function called when the signal name and source match, and additional data delivered to the callback. For the signal name and source, "*" acts as a wildcard. The additional data is optional; use NULL if you do not need it.

          + +

          The callback function takes as parameters the additional data defined in the edje_object_signal_callback_add() or elm_object_signal_callback_add() function parameters, the object emitting the signal, the signal name, and the signal source.

          + + +

          Managing Multiple Signal Emitters in Layouts

          + +

          Most of the time, Edje and Elementary are used together. In particular, you can define a group in Edje and use it as a layout (containing several parts) in Elementary. The layouts enable you to perform theming and object placement in Edje while benefiting from the higher-level functions of Elementary.

          +

          Since the layout contains multiple parts, you cannot use the elm_object_signal_callback_add() and edje_object_signal_callback_add() functions, as they require a single emitter object. The solution is to use the dedicated elm_layout_signal_callback_add() function.

          + +

          The elm_layout_signal_callback_add() function works similarly as the elm_object_signal_callback_add() and edje_object_signal_callback_add() functions. The only difference is the type of the object in the first parameter. For elm_layout_signal_callback_add(), it is a pointer to an Evas_Object, which is obtained through the elm_layout_add() function. For more information, see Layout.

          + + +

          Evas Events

          + +

          Evas events happen on a canvas as a whole. These events are too low-level for writing applications and are mostly used when writing the graphical toolkit itself.

          + +

          The following Evas event types are available:

          + +
            +
          • EVAS_CALLBACK_RENDER_FLUSH_PRE: Rendering on the canvas is about to be updated.
          • +
          • EVAS_CALLBACK_RENDER_FLUSH_POST: Rendering on the canvas is updated.
          • +
          • EVAS_CALLBACK_CANVAS_FOCUS_IN: Canvas receives focus.
          • +
          • EVAS_CALLBACK_CANVAS_FOCUS_OUT: Canvas loses focus.
          • +
          • EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN: Any object on the canvas receives focus. +

            Instead of this event type, use the EVAS_CALLBACK_FOCUS_IN type with the evas_object_event_callback_add() function.

          • +
          • EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT: Any object on the canvas loses focus. +

            Instead of this event type, use the EVAS_CALLBACK_FOCUS_OUT type with the evas_object_event_callback_add() function.

          • +
          • EVAS_CALLBACK_RENDER_PRE: Rendering on the canvas starts.
          • +
          • EVAS_CALLBACK_RENDER_POST: Rendering on the canvas finishes.
          • +
          + +

          To register the event handler, use the evas_event_callback_add() function. The function takes as parameters the Evas canvas on which the event happens (to obtain the canvas, use the Evas_Object through the evas_object_evas_get() function), the event type, the Evas_Event_Cb callback function, and the pointer to the additional data delivered to the callback. The additional data is optional; use NULL if you do not need it.

          + +

          The callback function takes as parameters the additional data defined in the evas_event_callback_add() function parameters, the canvas where the event happened, and the event info data, which depends on the object type and the event at play.

          + + +

          Evas Object Events

          + +

          Each Evas object on a specific Evas canvas can be manipulated independently. Each object can send events, which you can handle by registering callback functions for them. The events all relate to single objects, not the whole canvas.

          + +

          The following Evas object event types are available:

          +
            +
          • EVAS_CALLBACK_MOUSE_IN: Pointer got over an object (with no other object between the 2). This takes place no matter how the pointer becomes directly above the object. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_In struct.
          • +
          • EVAS_CALLBACK_MOUSE_OUT: Triggered similarly to the EVAS_CALLBACK_MOUSE_IN event, but when the pointer goes outside the object area. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Out struct.
          • +
          • EVAS_CALLBACK_MOUSE_DOWN: Mouse button is pressed while the object is receiving events (either because the pointer is on top of the object or because the object had focus). The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Down struct.
          • +
          • EVAS_CALLBACK_MOUSE_UP: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Up struct.
          • +
          • EVAS_CALLBACK_MOUSE_MOVE: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Move struct.
          • +
          • EVAS_CALLBACK_MOUSE_WHEEL: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_Wheel struct.
          • +
          • EVAS_CALLBACK_MULTI_DOWN: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Multi_Down struct.
          • +
          • EVAS_CALLBACK_MULTI_UP: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Multi_Up struct.
          • +
          • EVAS_CALLBACK_MULTI_MOVE: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Multi_Move struct.
          • +
          • EVAS_CALLBACK_KEY_DOWN: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Key_Down struct.
          • +
          • EVAS_CALLBACK_KEY_UP: Triggered similarly to the EVAS_CALLBACK_MOUSE_DOWN event. The event info parameter in the callback is a pointer to an Evas_Event_Key_Up struct.
          • +
          • EVAS_CALLBACK_FOCUS_IN: Object gained focus. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_In struct.
          • +
          • EVAS_CALLBACK_FOCUS_OUT: Object lost focus. The event info parameter in the callback is a pointer to an Evas_Event_Mouse_In struct.
          • +
          • EVAS_CALLBACK_SHOW: Object is shown by a call to the evas_object_show() function. The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_HIDE: Object is hidden by a call to the evas_object_hide() function. The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_MOVE: Object origin was moved (origin is the top-left corner at the creation time of the object). The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_RESIZE: Object is resized. The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_RESTACK: Object is re-stacked by the evas_object_stack_below() or evas_object_stack_above() function, or other events. The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_DEL: Object is deleted.
          • +
          • EVAS_CALLBACK_FREE: For internal use only. Do not use (the object resources are about to be freed). The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_HOLD: For internal use only. The event info parameter in the callback is a pointer to an Evas_Event_Hold struct.
          • +
          • EVAS_CALLBACK_CHANGED_SIZE_HINTS: Object size hints changed.
          • +
          • EVAS_CALLBACK_IMAGE_PRELOADED: Image preloaded through the evas_object_image_preload() function is loaded. The event info parameter in the callback is NULL.
          • +
          • EVAS_CALLBACK_IMAGE_UNLOADED: Image data is unloaded. The event info parameter in the callback is NULL.
          • +
          + +

          To register the callback, use the evas_event_callback_add() function. The function takes as parameters the object to which the callback is attached, the event type, the Evas_Object_Event_Cb callback function, and the pointer to the additional data delivered to the callback. The additional data is optional; use NULL if you do not need it.

          + +

          The callback function takes as parameters the additional data defined in the evas_event_callback_add() function parameters, the canvas where the event happened, the object to which the event happened, and the event info data, which depends on the object type and the event at play.

          + +

          When no longer needed, remove the callback with the evas_object_event_callback_del() function.

          + + +

          Evas Smart Object Events

          + +

          Evas smart object events are the most widely-used type of events in graphical applications, since they are used for signals, such as "clicked", "clicked,double" (double-click), and "pressed". They are identified by strings, and each smart object is able to define its own events (although the names follow conventions).

          + +

          Managing Evas Smart Object Event Handlers

          + +
          1. To add an Evas Smart Object event handler, register a callback for a specific event to an object with the evas_object_smart_callback_add() function. +

            The function takes as parameters the object to which the callback is added, the event name, the callback function, and additional data delivered to the callback. The additional data is optional; use NULL if you do not need it.

          2. + +
          3. Define the Evas_Smart_Cb() callback function. +

            The function takes as parameters the additional data defined in the evas_object_smart_callback_add() function parameters, the object to which the event happened, and the event info data, which depends on the object type and the event at play.

            +

            If some of the parameters are not used by the callback function, the compiler can raise the "unused parameter" warning. To avoid it, annotate the parameter with the __UNUSED__ macro, which is a compiler-independent way to let the compiler know that the parameter is unused willingly, rather than by a mistake:

            +
            void cb(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
            +
          4. + +
          5. When no longer needed, remove the event handler with the evas_object_smart_callback_del() function. +

            The function removes the first match for the given event and callback, and returns the data pointer that was used in the corresponding call to the evas_object_smart_callback_add() function.

          + +

          The following example shows the _button_clicked() function and sets it as the callback for the clicked event of an Evas_Object button:

          + +
          +static void
          +_button_clicked(void *data, Evas_Object *obj, void *event_info)
          +{
          +   // Insert function body here
          +}
          +
          +static void
          +some_function(void) 
          +{
          +   // Code to build the window object
          +   Evas_Object *button = elm_button_add(window);
          +   evas_object_smart_callback_add(button, "clicked", _button_clicked, NULL);
          +}
          +
          + +

          For a specific object and event, callbacks are called in the order they have been registered. The evas_object_smart_callback_add() function does not execute any special processing, if it is called several times with the same callback function or data. Callbacks are called as many times as they have been added and in the order they have been added.

          + + + +

          Evas Smart Object Event Handling Examples

          + +

          The following example shows a button with a callback for the "clicked" signal:

          + +
          static void
          +_button_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
          +{
          +   fprintf(stdout, "Button clicked.\n");
          +   fflush(stdout);
          +   elm_exit();
          +}
          +
          +static void
          +_add_button(Evas_Object *window) 
          +{
          +   Evas_Object *button;
          +
          +   button = elm_button_add(window);
          +   elm_object_text_set(button, "Click Me To Exit!");
          +   evas_object_smart_callback_add(button, "clicked", _button_clicked, NULL);
          +
          +   evas_object_show(button);
          +}
          +
          + +

          The following example shows a button with a callback for the "clicked" signal. Clicking the button removes the callback:

          + +
          static void
          +_button_clicked(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
          +{
          +   fprintf(stdout, "Button clicked.\n");
          +   fflush(stdout);
          +   evas_object_smart_callback_del(obj, "clicked", _button_clicked);
          +}
          +
          +static void
          +_add_button(Evas_Object *window) 
          +{
          +   Evas_Object *button;
          +
          +   button = elm_button_add(window);
          +   elm_object_text_set(button, "Click Me!");
          +   evas_object_smart_callback_add(button, "clicked", _button_clicked, NULL);
          +
          +   evas_object_show(button);
          +}
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/font_resource_n.htm b/org.tizen.ui.practices/html/native/efl/font_resource_n.htm new file mode 100644 index 0000000..3069993 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/font_resource_n.htm @@ -0,0 +1,94 @@ + + + + + + + + + + + + + Font Resources + + + + + +
          + +

          Font Resources

          + +

          The font metrics of the default font resource can be used as a guideline for designing your own font resources, which can be distributed as a downloadable font package in the Tizen Store.

          +

          The font resource details can also be used to determine the layout of the UI components for a better user experience.

          + +

          The following guidelines show how to design a font resource:

          +
            +
          • The EM size of TTF must be 1000.
          • + +
          • TTF must not contain any hinting information.
          • +
          • When exporting the font to TTF, the TTF files must be smaller than 1 MB.
          • +
          • The font metrics must follow the following values: +
            +OS/2 table:
            +   TypoAscender:775
            +   TypoDescender:-225
            +   TypoLineGap:0
            +   WinAscent:930
            +   WinDescent:270
            +
            +hhea table:
            +   Ascender:930
            +   Descender:-270
            +   LineGap:0
            +
            +head table:
            +   xMin:-515
            +   yMin:-297
            +   xMax:1261
            +   yMax:1022
            +
            +
          • + +
          • The font family name must contain the company name and font family name. This is recommended to avoid multiple font resources having the same family name.
          • +
          • It is recommended that the font package icon stands for the identity of the font resource.
          • +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/font_setting_n.htm b/org.tizen.ui.practices/html/native/efl/font_setting_n.htm new file mode 100644 index 0000000..8e94ab5 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/font_setting_n.htm @@ -0,0 +1,441 @@ + + + + + + + + + + + + + Fonts: Setting Application Text Fonts + + + + + +
          + +

          Fonts: Setting Application Text Fonts

          + + +

          Tizen provides various methods for setting fonts of the application text. Basically, all UI components have a default font, which can be changed according to the system settings.

          + +

          The font handling methods include:

          + +
            +
          • Setting the font for a UI component using the Elementary Fonts API (in mobile and wearable applications)
          • +
          • Setting the font using EDC
          • +
          • Changing the font and text size using the Edje Class: Text API (in mobile and wearable applications) + +

            In the application, you can set a system-wide font and font size to text(textblock) parts with text classes (except tizen). When the system applies a new system-wide font and font size to the application, the font size of text(textblock) parts with the tizen text class are not affected.

            +

            The following words in the text_class definition are reserved for the system:

            + +
              +
            • button
            • +
            • label
            • +
            • entry
            • +
            • title_bar
            • +
            • list_item
            • +
            • grid_item
            • +
            • toolbar_item
            • +
            • menu_item
            • +
            • tizen
            • +
            + + +

            Set a specific ratio to a given font size for each object through the text class. If you give a negative value as font size, it is used as the percentage of the originally given font size. The following example code show set the font size as 150% of the given font size.

            +
            +elm_config_font_overlay_set("my_class", "TizenSans:style=Bold", -150);
            +elm_config_font_overlay_apply();
            +
            +
          • + +
          • Creating your own font resources +

            You can create your own font resources in the SDK to be distributed as a downloadable font package in the Tizen Store.

            +
          • +
          + +

          Applying System Font Settings

          + +

          Tizen provides a special "Tizen" font name. The "Tizen" font name does not match with any specific font; it is just an alias for a system-defined font (system font). When you create a text(textblock) part with the "Tizen" font name in the application's EDC, the system font is loaded into the user application when those objects are created. Additionally, you can apply the system font to a text or textblock part by using the text class, as described above.

          + +

          The following EDC example shows how to apply the system font to a TEXT or TEXTBLOCK part by using the "Tizen" font name and the tizen text class. As font name is "Tizen" and the font size is set to 36, the system font is loaded in size 36. If the system setting changes, this part loads the new system font. However, its font size is not changed, because the text class is tizen.

          + +
          +description 
          +{
          +   text 
          +   {
          +      font: "Tizen:style=Regular";
          +      font_size: 36;
          +      text_class: "tizen";
          +   }
          +}
          + +

          If the part has a predefined text classes other than tizen, its font size is resized as well.

          + +
          +description 
          +{
          +   text 
          +   {
          +      font: "Tizen:style=Regular";
          +      font_size: 36;
          +      text_class: "label";
          +   }
          +}
          + + +

          Supported Font Styles

          +

          The font styles supported by the EFL are listed in the following table.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Supported font styles
          Font featureStyle attribute
          font_stylenormal
          oblique
          italic
          font_widthnormal
          ultracondensed
          extracondensed
          condensed
          semicondensed
          semiexpanded
          expanded
          extraexpanded
          ultraexpanded
          font_weightnormal
          thin
          ultralight
          light
          book
          medium
          semibold
          bold
          ultrabold
          black
          extrablack
          + +

          The style attributes are not case-sensitive (however, the font feature names are).

          +

          If you set the weight or width attribute to style=, it is processed to the right attribute.

          +
          +font=TizenSans:style=Bold // Textblock
          +"TizenSans:style=Bold"; // Text font
          +<font=TizenSans:style=Bold> // Markup tag
          +
          + +

          You can also use each attribute separately:

          + +
          +font=TizenSans font_style=Regular font_weight=Bold // Textblock
          +<font=TizenSans font_style=Regular font_weight=Bold> // Markup tag
          +
          + + +

          Setting the Font for a UI Component

          + +

          You can use the Elementary Fonts API (in mobile and wearable applications) to set the font for an application.

          +

          To set a font for a UI component:

          +
            +
          • Set the font for a common UI component: + + + + + + + + + + +
            Note
            You can set the font for a textblock in the code, but not in EDC (Edje Data Collection). If you add markup tags for the font inside the text, you can change the font of the text. However, you cannot set the font for a text part in this way because the TEXT type does not support markup tags.
            + +
            +char *buf = "<font=Sans:style=Regular font_size=50>Hello</font/>Font";
            +elm_object_part_text_set(layout, "textblock1", buf);
            +
            +
          • +
          • Set the font for an entry component (in mobile and wearable applications) using the elm_entry_text_style_user_push() function. It overrides the default style of the entry component for each attribute. + + + + + + + + + + +
            Note
            The elm_entry_text_style_user_push() function only affects the main text of the UI component. To change the font of the guide text, you have to add markup tags.
            +
            +char *user_style = "DEFAULT='font=Sans:style=Regular font_size=40'";
            +elm_entry_text_style_user_push(entry, user_style);
            +elm_object_part_text_set(entry, "elm.guide",
            +   "<font=Sans:style=Regular font_size=40>Guide Text</font>");
            +
            +
          • +
          + +

          Setting the Font Using EDC

          + +

          To create a layout with text using the EDC, you can set the font for each text part or textblock:

          +
            +
          • Set the font of a text part using the font family name and a specific style of the font family: +
            +part 
            +{ 
            +   name: "text";
            +   type: TEXT;
            +   scale: 1;
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      rel1.relative: 0.0 0.5;
            +      rel2.relative: 0.5 1.0;
            +      color: 0 136 170 255;
            +      color2: 0 136 170 50;
            +      color3: 0 136 170 25;
            +      text 
            +      {
            +         size: 25;
            +         font: "Sans:style=Bold";
            +         text: "Enventor";
            +         align: 0.5 0.5;
            +      }
            +   }
            +}
            +
            +
          • + +
          • Add style information, which can be used for multiple textblock parts: +
            +styles 
            +{
            +   style 
            +   { 
            +      name: "textblock_style1";
            +      base: "font=Sans:style=Regular font_size=30";
            +   }
            +}
            +
            +part 
            +{ 
            +   name: "textblock";
            +   type: TEXTBLOCK;
            +   scale: 1;
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      align: 0.5 0.5;
            +      fixed: 0 0;
            +      min: 0 0;
            +      visible: 1;
            +      text.text: "TEXTBLOCK";
            +      text.style: "textblock_style1";
            +      rel1.relative: 0.16 0.18;
            +      rel2.relative: 0.88 0.38;
            +   }
            +}
            +
            +
          • +
          + +

          Using the Edje Text Class

          + +

          You can use the Edje Class: Text API (in mobile and wearable applications) to change multiple text occurrences as a batch. If you set a new font or font size to a text class, the change is applied to multiple objects.

          + + + + + + + + + + +
          Note
          Note that the text_class cannot be used in a UI component with markup text or the elm_entry_text_style_user_push() function. You must set the text_class in EDC.
          + + +

          To set the text class, you can use reserved words for text class, but you can also make your own text class:

          + +
            +
          • Set a class for a text part: + +
            +part 
            +{ 
            +   name: "text";
            +   type: TEXT;
            +   scale: 1;
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      rel1.relative: 0.0 0.5;
            +      rel2.relative: 0.5 1.0;
            +      color: 0 136 170 255;
            +      color2: 0 136 170 50;
            +      color3: 0 136 170 25;
            +      text 
            +      {
            +         size: 25;
            +         font: "Sans:style=Bold";
            +         text: "Enventor";
            +         align: 0.5 0.5;
            +         text_class: "my_class";
            +      }
            +   }
            +}
            +
            +
          • +
          • Set a class for a textblock: +
            +styles 
            +{
            +   style 
            +   { 
            +      name: "textblock_style1";
            +      base: "font=Sans:style=Regular font_size=30 ... text_class=my_class";
            +   }
            +}
            +
            +part 
            +{ 
            +   name: "textblock";
            +   type: TEXTBLOCK;
            +   scale: 1;
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      align: 0.5 0.5;
            +      fixed: 0 0;
            +      min: 0 0;
            +      visible: 1;
            +      text.text: "TEXTBLOCK";
            +      text.style: "textblock_style1";
            +      rel1.relative: 0.16 0.18;
            +      rel2.relative: 0.88 0.38;
            +   }
            +}
            +
            +
          • +
          • +

            You can handle font and font style per text_class. If you set your own text_class in the EDC, you can change the font and font size:

            + +
            +elm_config_font_overlay_set("my_class", "TizenSans:style=Bold", 30);
            +elm_config_font_overlay_apply();
            +
            +
          • +
          • +

            Set a specific ratio to a given font size for each object through the text class. If you give a negative value as font size, it is used as the percentage of the originally given font size. The following example code show set the font size as 150% of the given font size.

            +
            +elm_config_font_overlay_set("my_class", "TizenSans:style=Bold", -150);
            +elm_config_font_overlay_apply();
            +
            +
          • +
          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/form_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/form_tutorial_n.htm new file mode 100644 index 0000000..5fafeae --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/form_tutorial_n.htm @@ -0,0 +1,342 @@ + + + + + + + + + + + + + + Creating a Form for a Basic Application Layout + + + + + + +
          +

          Creating a Form for a Basic Application Layout

          + + +

          This tutorial explains how to create a basic application that has a single window and multiple views: contact list view and contact details form view (displaying and editing contact information when an item is selected on the contact list).

          + +

          Creating a Single-window Application

          + +

          To create an elementary application with a single window, use the following code:

          +
          static bool
          +app_create(void *data)
          +{
          +   appdata_s *ad = data;
          +   create_gui(ad);
          +   return true;
          +}
          +
          +int
          +main(int argc, char **argv)
          +{
          +   appdata_s ad = { 0 };
          +   ui_app_lifecycle_callback_s event_callback = { 0 };
          +
          +   event_callback.create = app_create;
          +
          +   // Zero out the structure
          +   memset(&ad, 0x0, sizeof(struct appdata));
          +
          +   // Run the mainloop
          +   return ui_app_main(&argc, &argv, &event_callback, &ad);
          +}
          +
          + + + +

          Use a naviframe in this application to switch between different views. The first displayed view is the contact list. When an item is selected in this list, information on the contact is displayed in a contact details form. Both the list and form views are opened in a naviframe, which handles the animations between the views. It also creates a back button in the top bar, and when the button is clicked, launches the back animation, deletes the form view, and shows the contact list again.

          + +

          Figure: Views (list and form)

          +

          Form tutorial: list Form tutorial: form

          + +

          Since the naviframe is the main layout of the window, it takes all the available space. To configure the naviframe size, use the elm_win_resize_object_add() function to add the naviframe object (second parameter) to the main window (first parameter). To ensure that the naviframe covers the entire window area, call the evas_object_resize_hint_weight_set() function on the naviframe object to force the naviframe to fill its parent (the main window). The naviframe object expands in both X and Y directions.

          +

          In the end, show the naviframe object on the screen.

          +
          +// Create the naviframe
          +nav = elm_naviframe_add(win);
          +evas_object_size_hint_weight_set(nav, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_win_resize_object_add(win, nav);
          +evas_object_show(nav);
          +
          + +

          Creating a Contact List

          + +

          To create a contact list:

          +
            +
          1. +

            Handle the contact list with the _create_contact_list() function. This function takes the parent object (naviframe) as the parameter and returns the genlist. To create the genlist, use the following code:

            +
            +static Evas_Object *
            +_create_contact_list(Evas_Object *parent)
            +{
            +   Evas_Object *list;
            +   int i;
            +
            +   // Create a new genlist
            +   list = elm_genlist_add(parent);
            +   evas_object_show(list);
            +
            +   // Create a new item class for the genlist
            +   itc = elm_genlist_item_class_new();
            +   itc->item_style = "default";
            +   // Set the callback used when the genlist text is created
            +   itc->func.text_get = _genlist_text_get;
            +   // Set the callback be used when the content of the item is created
            +   itc->func.content_get = _genlist_content_get;
            +   itc->func.state_get = NULL;
            +   itc->func.del = NULL;
            +}
            +
            + +

            The itc static variable contains the item class. The item class contains all functions that are called back when an item is created. In this case, create the _genlist_text_get() (for labels) and _genlist_content_get() (for icons) callbacks. These functions are called when labels and icons of the genlist item are created.

            + +

            The contact list is contained in an array of Contacts.

            +
            +typedef struct 
            +_Contact Contact;
            +
            +struct 
            +_Contact
            +{
            +   const char *name;
            +   const char *mobile;
            +   const char *address;
            +   const char *email;
            +   const char *icon;
            +};
            +
            +static 
            +Contact contacts[] = 
            +{
            +   {"Alexander Holmes", "+1234567896", "", "alexander_holmes@tizen.org", "c1.png"},
            +   {"Lara Alvaréz", "+9876543216", "", "lara_alvares@tizen.org", "c2.png"},
            +   {"Aksel Møller", "+1679432846", "", "aksel_moller@tizen.org", "c3.png"},
            +   {"Anir Amghar", "+1679432846", "", "anir_amghar@tizen.org", "c4.png"},
            +   {"Noémie Cordier", "+1679432846", "", "noemie_cordier@tizen.org", "c5.png"},
            +   {"Henry Thompson", "+1679432846", "", "henry_thompson@tizen.org", "c6.png"},
            +   {"Mai Phan", "+1679432846", "", "mai_phan@tizen.org", "c7.png"},
            +};
            +
            +
          2. +
          3. +

            Create a genlist item for each item of the array with the following code:

            +
            +// Create a genlist item for each item in the contacts array
            +for (i = 0; i < EINA_C_ARRAY_LENGTH(contacts); i++)
            +{
            +   // Append the item, add a callback when the item is selected, and use the
            +   // current contact item as data pointer for the callbacks
            +   elm_genlist_item_append(list, itc, &contacts[i], NULL,
            +                           ELM_GENLIST_ITEM_NONE, _contact_selected_cb, &contacts[i]);
            +}
            +
            + +

            Attach the _contact_selected_cb() callback function to the genlist item. When an item is selected in the list, the data pointer passed as the parameter calls this function. In this example, it is a pointer on the contact. Pass the contact in the array to all the item class callbacks.

            +
          4. +
          5. +

            Push the list at the top of the naviframe:

            +
            +// Create the list of contacts
            +list = _create_contact_list(win);
            +
            +// Push the list on top of the naviframe
            +elm_naviframe_item_push(nav, NULL, NULL, NULL, list, NULL);
            +
            +
          6. +
          7. +

            Call the item class functions, the _genlist_text_get() function first:

            +
            +static char *
            +_genlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
            +{
            +   Contact *contact = data;
            +
            +   // Return a new allocated string for the contact name
            +   return strdup(contact->name);
            +}
            +
            + +

            These functions show the index of the contact in the array and return a freshly allocated string with the name of the contact.

            +

            When an item in the list is selected, a callback registers on the select signal and calls the corresponding function; in this case, _contact_selected_cb(). The index of the array passed in the data is retrieved and the form on contact information based on this index is created.

            +

            The _genlist_content_get function is called several times depending on the style of the created item. In this case, with the default style for the genlist item, there are 2 different swallow parts. A swallow part is a container in the edje file of the genlist item, which can contain an Evas object. The following figure shows the layout of different parts in the theme.

            + + +

            Figure: Genlist item

            +

            Genlist item

            + + +

            There are 2 elm.swallow parts. When the callback function for the icon creation is called, the part name is passed through the part variable. Compare this variable to elm.swallow.icon for the first object and to elm.swallow.end for the icon at the end.

            +
          8. +
          + +

          Creating the Icon

          +

          Create the icon when the callback is recognized. This example uses an elm_icon object.

          +
          +static Evas_Object *
          +_genlist_content_get(void *data, Evas_Object *obj, const char *part)
          +{
          +   Contact *contact = data;
          +
          +   // Test which part is being created
          +   if (!strcmp(part, "elm.swallow.icon"))
          +   {
          +      char filename[PATH_MAX];
          +      // Create a new icon
          +      Evas_Object *ic = elm_icon_add(obj);
          +      // Set the filename of the file which is to be loaded
          +      snprintf(filename, sizeof(filename), "%s%s", ICON_PATH, contact->icon);
          +      elm_image_file_set(ic, filename, NULL);
          +      // Keep the ratio squared
          +      evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
          +
          +      // Return the icon
          +      return ic;
          +   }
          +
          +   return NULL;
          +}
          +
          + +

          In case the part is elm.swallow.end, the return is NULL and no icon is added.

          +

          A genlist can seem like an unnecessarily complex structure with its separate callbacks for creating items. However, in a list with thousands of elements, it is quite efficient not to create the graphical items for all list elements at once. Instead only the elements currently displayed on the screen are created through the callbacks. And when the list is scrolled, further callbacks create new elements as they are needed.

          + + + + + + + + + + +
          Note
          When the genlist is first created, the Elementary needs to know the height of the list. All elements in the list are not necessarily the same size due to different kind of styles. Thus, the Elementary creates all elements once to know the size, and display the scroll bars correctly. If all your items have the same height, you can save CPU time by using the elm_genlist_homogeneous_set() function to impose the same height to all items. In this case, the Elementary does not create the complete list, as the global size is a multiple of the height of the first item.
          + +

          Creating a Contact Details Form

          +

          The contact details form is created inside the _create_contact_form() function. This function takes a parent Evas_Object and a contact item as parameters, and returns an Evas_Object. The parent is the naviframe object, and the contact item contains the information on the contact.

          +

          To display the various information about the contact, this example uses boxes.

          + +

          Figure: Contact form layout

          +

          Contact form layout

          + +

          To create a contact form:

          +
            +
          1. +

            Create a vertical box:

            +
            +vbox = elm_box_add(parent);
            +elm_box_align_set(vbox, 0, 0);
            +evas_object_show(vbox);
            +
            +

            The elm_box_align_set() function keeps the box element aligned to the top left corner.

            +
          2. +
          3. +

            Create an icon in the genlist item with the _genlist_content_get() function. For a bigger icon, set the minimum size of the icon object to 96 x 96 px.

            +
          4. +
          5. +

            Add the icon object at the end of the vertical box with the elm_box_pack_end() function. As the icon is the first object added, it is displayed at the top of the box.

            +
            +ic = elm_icon_add(vbox);
            +snprintf(filename, sizeof(filename), "%s%s", ICON_PATH, contact->icon);
            +elm_image_file_set(ic, filename, NULL);
            +evas_object_size_hint_min_set(ic, 96, 96);
            +evas_object_show(ic);
            +elm_box_pack_end(vbox, ic);
            +
            +
          6. +
          7. +

            Add the information on the contact: the name, the mobile phone number, the postal address, and the email address. For each information item, create a label and an edit line. The label defines the information type, and the edit box contains the actual information. To set the UI components in a horizontal layout, use a horizontal box.

            +
          8. +
          9. +

            Change the orientation of the box with the elm_box_horizontal_set() function. To add space between the elements of the vertical box, set padding to 32 px. To set the item of the box not to expand vertically, use the evas_object_size_hint_weight_set() function.

            +
            +hbox = elm_box_add(vbox);
            +elm_box_horizontal_set(hbox, EINA_TRUE);
            +elm_box_padding_set(hbox, 32, 32);
            +evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0);
            +evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, 0);
            +evas_object_show(hbox);
            +
            +
          10. +
          11. +

            Create the label object, which is an elm_label. Set its text, and do not align or expand it.

            +
            +label = elm_label_add(hbox);
            +elm_object_text_set(label, form_items[i]);
            +evas_object_size_hint_weight_set(label, 0, 0);
            +evas_object_size_hint_align_set(label, 0, 0);
            +evas_object_show(label);
            +
            +
          12. +
          13. +

            Create the edit line, which is an elm_entry:

            +
            +edit = elm_entry_add(hbox);
            +evas_object_size_hint_weight_set(edit, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_align_set(edit, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(edit);
            +
            +
          14. +
          15. +

            Add the label and the edit inside the horizontal box and add the horizontal box to the vertical box:

            +
            +elm_box_pack_end(hbox, label);
            +elm_box_pack_end(hbox, edit);
            +
            +elm_box_pack_end(vbox, hbox);
            +
            +
          16. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/genlist_tutorial_mn.htm b/org.tizen.ui.practices/html/native/efl/genlist_tutorial_mn.htm new file mode 100644 index 0000000..8139e6b --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/genlist_tutorial_mn.htm @@ -0,0 +1,475 @@ + + + + + + + + + + + + + + Creating Mobile Genlists + + + + + + +
          +

          Creating Mobile Genlists

          + + +

          This tutorial shows how to create genlists, which are list components for large sets of elements. Genlists use callbacks to populate entries. The same UI component handles both flat lists and trees.

          + +

          This feature is supported in mobile applications only.

          + +

          Creating a Genlist

          + + +

          To initialize the application for a genlist and create the genlist component:

          +
            +
          1. +

            Create a window entitled Genlist Basic Tutorial. It consists of a conformant component that contains a naviframe component. The genlist goes inside the naviframe.

            +
            +static bool
            +_app_create(void *data)
            +{
            +   appdata_s *app = data;
            +
            +   app->win = elm_win_util_standard_add("main", "Genlist Basic Tutorial");
            +   elm_win_conformant_set(app->win, EINA_TRUE);
            +   evas_object_show(app->win);
            +   evas_object_resize(app->win, 480, 800);
            +   elm_win_autodel_set(app->win, EINA_TRUE);
            +
            +   app->conformant = elm_conformant_add(app->win);
            +   evas_object_size_hint_weight_set(app->conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(app->win, app->conformant);
            +   evas_object_show(app->conformant);
            +
            +   app->naviframe = elm_naviframe_add(app->win);
            +   evas_object_size_hint_weight_set(app->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(app->win, app->naviframe);
            +   evas_object_show(app->naviframe);
            +   elm_object_content_set(app->conformant, app->naviframe);
            +
            +   _create_list(app);
            +   elm_naviframe_item_push(app->naviframe, NULL, NULL, NULL, app->list, NULL);
            +
            +   return true;
            +}
            +
            +int
            +main(int argc, char **argv)
            +{
            +   // Declare a few structures and zero-initialize (C99 feature)
            +   struct app_data app = {0};
            +   ui_app_lifecycle_callback_s event_callback = {0};
            +
            +   event_callback.create = _app_create;
            +
            +   // Run the mainloop
            +   return ui_app_main(&argc, &argv, &event_callback, &ad);
            +}
            +
            +
          2. +
          3. +

            Declare the app_data struct:

            +
            struct 
            +app_data
            +{
            +   Evas_Object *win;
            +   Evas_Object *naviframe;
            +   Evas_Object *conformant;
            +   Evas_Object *list;
            +   Elm_Genlist_Item_Class *itc;
            +   Elm_Genlist_Item_Class *itc2;
            +};
            +
            +
          4. + + +
          5. +

            To create the genlist, call the elm_genlist_add() function:

            +
            +Evas_Object *list = elm_genlist_add(parent);
            +
          6. +
          +

          Figure: Genlist example

          +

          Genlist example

          + +

          Adding List Entries

          + +

          To add entries to the list:

          +
            +
          1. +

            Build a basic item class:

            +
            Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
            +itc->item_style = "default";
            +itc->func.text_get = NULL;
            +itc->func.content_get = NULL;
            +itc->func.state_get = NULL;
            +itc->func.del = NULL;
            +
            + +

            This example uses the item class to set the item_style to default and all other fields to NULL. Note that this leaves out the text_get and content_get fields, which are used to add text and an icon to the list entry. In general, the item class fields define the APIs that are used to manage the list items.

            +
          2. +
          3. +

            Add a new element to the list by calling the elm_genlist_item_append() function. Its second parameter is the item class structure which describes how to populate entries. Typically this structure is built once and re-used across calls to the elm_genlist_item_append() function.

            +
            +elm_genlist_item_append(list,
            +                        itc,
            +                        NULL, // Item data
            +                        NULL, // Parent item for trees, NULL if none
            +                        ELM_GENLIST_ITEM_NONE, // Item type; this is the common one
            +                        NULL, // Callback on selection of the item
            +                        NULL // Data for that callback function
            +);
            +
            +

            With most parameters as NULL and itc having most of its members NULL too, the elements of the list are blank and do not trigger anything when selected.

            +
          4. +
          5. +

            Use the text_get() callback to add text in the elements in the Elm_Genlist_Item_Class structure.

            +

            The callback must follow a prototype that takes data, an Evas Object, and a part variable as parameters. It returns a C string that is displayed in the part named after the part parameter. The callback is called for each user-settable text part according to the current theme.

            + +

            For more information on parts as used in the EFL files, see Writing a Simple EDC File.

            + + + + + + + + + + + +
            Note
            The value returned by the callback is freed by the EFL. The value must be freshly allocated: do not free it yourself and do not reuse it across list elements.
            + +

            The default theme (style defined for the item class) contains an elm.text part. The following example shows a possible implementation of the text_get() callback displaying text in the elm.text part:

            +
            +static char *
            +_genlist_text_get(void *data, Evas_Object *obj, const char *part)
            +{
            +   // Check this is text for the expected part
            +   if (strcmp(part, "elm.text") == 0) 
            +   {
            +      return strdup("Some text");
            +   }
            +   else 
            +   {
            +      return NULL;
            +   }
            +}
            +
            + + + + + + + + + + +
            Note
            The part names and positions depend on the item_style chosen when adding new items to the genlist. Setting a custom theme makes it possible to completely change genlists by adding and moving parts. For more information, see Introduction to EDC Programming.
            + +

            The data parameter makes it possible to vary the list behavior according to the data given to the EFL in the data parameter of the elm_genlist_item_append() function call. For example, given an integer in that field through casting with (void *)(uintptr_t) i, you can get its value back using (int)(uintptr_t)data:

            +
            +static char *
            +_genlist_text_get(void *data, Evas_Object *obj__UNUSED__, const char *part)
            +{
            +   if (strcmp(part, "elm.text") == 0) 
            +   {
            +      char *buf = malloc(16);
            +      snprintf(buf, 16, "Entry %d.", (int)(uintptr_t)data);
            +
            +      return buf;
            +   }
            +   else 
            +   {
            +      return NULL;
            +   }
            +}
            +
            +
          6. +
          7. +

            Add icons to the list with the content_get() callback. It returns a pointer to an Evas_Object and is called for each part whose content can be set. The callback must follow a prototype that takes data, an Evas Object, and a part variable as parameters. The only difference with the text_get() callback is that the content_get() function returns an Evas_Object* rather than a char *.

            + +

            The following example creates colored rectangles in the parts that are to be set. In the default theme, this displays a red rectangle on the left side of each list item and a green one on the right side.

            +
            +static Evas_Object *
            +_genlist_content_get(void *data, Evas_Object *obj, const char *part)
            +{
            +   int i = (int) (uintptr_t) data;
            +
            +   if (strcmp(part, "elm.swallow.icon") == 0) 
            +   {
            +      Evas_Object *bg = elm_bg_add(obj);
            +      elm_bg_color_set(bg, 255 * cos(i / (double) 10), 0, i % 255);
            +
            +      return bg;
            +   }
            +   else if (strcmp(part, "elm.swallow.end") == 0) 
            +   {
            +      Evas_Object *bg = elm_bg_add(obj);
            +      elm_bg_color_set(bg, 0, 255 * sin(i / (double) 10), i % 255);
            +
            +      return bg;
            +   }
            +   else 
            +   {
            +      return NULL;
            +   }
            +}
            +
            +
          8. +
          9. +

            Implement the genlist item events.

            +

            Genlist items trigger a callback when clicked. The callback is chosen when adding the new item, for example, when calling the elm_genlist_item_append() function:

            +
            +elm_genlist_item_append(list, itc, NULL,  NULL,  ELM_GENLIST_ITEM_NONE,
            +                        _genlist_selected_cb, // Callback on selection of the item
            +                        NULL);
            +
            + +

            The callback must follow a prototype that takes data, an Evas Object, and event information as parameters. The following implementation changes the item's style when the item is selected.

            +
            +static void
            +_genlist_selected_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   struct app_data *app = data;
            +
            +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
            +
            +   elm_genlist_item_item_class_update(it, app->itc2);
            +}
            +
            +
          10. +
          + +

          Managing Item Style and Size

          + + +

          You can manage the item style and size:

          + +
            +
          • Managing the item style: +

            The number of parts that you can fill for an item depends on the item style that you select when creating the item class ( Elm_Genlist_Item_Class struct) for the genlist:

            +
            +app->itc->item_style = "default";
            +
            +

            For all available styles, see Genlist.

            +

            You can customize the styles by modifying the theme in the EDC file. In case the customization is only visual, it is a good practice to keep the same item style names for new themes. This makes it possible to change the theme and keep the code the same while also retaining the same overall item placement.

            +
          • +
          • Setting a homogeneous item size: +

            To set the scroller correctly, the actual height and width of the genlist must be computed at the beginning. Since this means computing the size of each item and adding all item sizes together, it has a cost and slows down the process of adding items to a genlist.

            +

            The elm_genlist_homogeneous_set() function solves the problem by assuming that all items are the same size as the first item of the list. This assumption speeds up large insertions; however, it can lead to serious graphical issues if the items are not actually the same size. Use this function with care.

          • +
          • Changing the item class after the item has been created: +

            Changing the item class of a UI component is an easy way to change its appearance based on user actions (for example, when it is selected). To change the item class, call the elm_genlist_item_item_class_update() function:

            +
            static void
            +_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
            +{
            +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
            +
            +   // Change the appearance and possibly content of the item being expanded
            +   elm_genlist_item_item_class_update(it, app->itc2);
            +
            +   elm_genlist_item_expanded_set(it, EINA_TRUE);
            +}
            +
            +
          • +
          + +

          Using Item Modes

          + +

          The previous genlist examples have all featured bare lists. However, the genlist component is able to display items in a tree or group mode:

          + +
            +
          • Tree mode uses the parenting relationship with other items. +

            The child elements are created on-demand when their parent is expanded, and deleted when it is contracted.

          • +
          • Group mode keeps an element visible as long as one of its children is visible. +

            When scrolling, the parent element remains at the top of the UI component until all its child elements have been scrolled through and another group replaces it. The group mode is very useful for "title" items.

          • +
          +

          A common UI design is to mix the group and tree modes to allows for a tree behavior while keeping the group header item visible.

          + +
            +
          • +

            To use the group mode:

            +
              +
            1. +

              Mark some elements as ELM_GENLIST_ITEM_GROUP and use the returned Elm_Object_Item to establish the parent-children relationship when adding the children items.

              +

              Since there are 2 kind of items, create 2 item classes. Give them different styles and callback functions.

              +
              +app->itc = elm_genlist_item_class_new();
              +app->itc->item_style = "default_style";
              +app->itc->func.text_get = _genlist_text_get_size;
              +app->itc->func.content_get = _genlist_content_get_bg;
              +app->itc->func.state_get = NULL;
              +app->itc->func.del = NULL; 
              +
              +app->itc2 = elm_genlist_item_class_new();
              +app->itc2->item_style = "icon_top_text_bottom";
              +app->itc2->func.text_get = _genlist_text_get_nosize;
              +app->itc2->func.content_get = _genlist_content_get_icon;
              +app->itc2->func.state_get = NULL;
              +app->itc2->func.del = NULL; 
              +
              +
            2. +
            3. +

              Add a group header and follow it with 10 children. This is repeated 1000 times.

              +

              The parent has the ELM_GENLIST_ITEM_GROUP type, while the children have the ELM_GENLIST_ITEM_NONE type.

              +

              Note that the value returned by the elm_genlist_item_append() function for a group header is stored and sent to the elm_genlist_item_append() call that adds the children. This creates the parent-child relationship.

              +
              +for (i = 0; i < 1000; i++) 
              +{
              +   it = elm_genlist_item_append(app->list, app->itc2, (void *)(uintptr_t) (10 * i), NULL,
              +                                ELM_GENLIST_ITEM_GROUP, NULL, NULL);
              +   for (j = 0; j < 10; j++)
              +   {
              +      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (10 * i + j), it,
              +                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
              +   }
              +}
              +
              +
            4. +
            +
          • + +
          • To use the tree mode:

            +
              +
            1. +

              Register the callbacks (expand,request, expanded, contract,request, and contracted) using the evas_object_smart_callback_add() function on the genlist object:

              +
              +evas_object_smart_callback_add(app->list, "expand,request",
              +                               _tree_item_expand_request, NULL);
              +evas_object_smart_callback_add(app->list, "expanded",
              +                               _tree_item_expanded, NULL);
              +
              +evas_object_smart_callback_add(app->list, "contract,request",
              +                               _tree_item_contract_request, NULL);
              +evas_object_smart_callback_add(app->list, "contracted",
              +                               _tree_item_contracted, NULL);
              +
              + +

              The expand,request and contract,request callbacks do only one thing: decide whether the element is expanded or contracted. This is done by using the elm_genlist_item_expanded_set() function; if it changes the expansion status of the item, the next callback is called (either expanded or contracted, depending on whether it was an expand,request or contract,request event). The following examples show a minimal implementation of these callbacks.

              +
              +static void
              +_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
              +
              +   elm_genlist_item_item_class_update(it, app->itc2);
              +
              +   elm_genlist_item_expanded_set(it, EINA_TRUE);
              +}
              +
              + +
              +static void
              +_tree_item_contract_request(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
              +
              +   elm_genlist_item_item_class_update(it, app->itc);
              +
              +   elm_genlist_item_expanded_set(it, EINA_FALSE);
              +}
              +
              + + + + + + + + + +
              Note
              The above examples have an extra line: the call to the elm_genlist_item_item_class_update() function. This function changes the item style after the item creation.
              +
            2. +
            3. +

              Expand the list. Once the genlist item status is set to expanded, the expanded event is triggered and it is the duty of a callback for that event to populate the list with the item's children. This relies on the parent parameter of functions (such as elm_genlist_item_append()), similar to the group mode.

              +

              The following function is a callback implementation for the expanded event. It adds items that are built similarly to previous items, the only change is the parent parameter which is not NULL. Conveniently, the parent Elm_Object_Item pointer that is passed to the elm_genlist_item_append() function is given in the event_info callback and needs to be cast.

              +
              +static void
              +_tree_item_expanded(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
              +   int i_parent = (int)(uintptr_t) data;
              +   int i;
              +
              +   for (i = 0; i < 10; i++) 
              +   {
              +      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (i + i_parent), it_parent,
              +                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
              +   }
              +}
              +
              +
            4. +
            5. +

              Contract the list. The following code has the callback function for the contracted event. It simply calls the elm_genlist_item_subitems_clear() function to clear all children (including their own children if they have any) of the given item. Again, the item that is being contracted is available through the event_info parameter to the callback.

              +
              static void
              +_tree_item_contracted(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
              +
              +   elm_genlist_item_subitems_clear(it_parent);
              +}
              +
              +
            6. +
            +
          • +
          • +

            To mix group and tree modes:

            +
              +
            1. Create an item of the group type, and an item of the tree type whose parent is the group type item.
            2. +
            3. Add the callbacks to populate the children of the tree item in the regular way.
            4. +
            +
          • +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/genlist_tutorial_wn.htm b/org.tizen.ui.practices/html/native/efl/genlist_tutorial_wn.htm new file mode 100644 index 0000000..becad45 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/genlist_tutorial_wn.htm @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + Creating Wearable Genlists + + + + + + +
          +

          Creating Wearable Genlists

          + +

          This tutorial shows how to create genlists, which are list components for large sets of elements. Genlists use callbacks to populate entries. The same UI component handles both flat lists and trees.

          + +

          This feature is supported in wearable applications only.

          + + +

          Creating a Genlist

          + +

          To initialize the application for a genlist and create the genlist component:

          +
            +
          1. +

            Create a window entitled Genlist Basic Tutorial. It consists of a conformant component that contains a naviframe component. The genlist goes inside the naviframe.

            +
            +static bool
            +_app_create(void *data)
            +{
            +   appdata_s *app = data;
            +
            +   app->win = elm_win_util_standard_add("main", "Genlist Basic Tutorial");
            +   elm_win_conformant_set(app->win, EINA_TRUE);
            +   evas_object_show(app->win);
            +   evas_object_resize(app->win, 480, 800);
            +   elm_win_autodel_set(app->win, EINA_TRUE);
            +
            +   app->conformant = elm_conformant_add(app->win);
            +   evas_object_size_hint_weight_set(app->conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(app->win, app->conformant);
            +   evas_object_show(app->conformant);
            +
            +   app->naviframe = elm_naviframe_add(app->win);
            +   evas_object_size_hint_weight_set(app->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(app->win, app->naviframe);
            +   evas_object_show(app->naviframe);
            +   elm_object_content_set(app->conformant, app->naviframe);
            +
            +   _create_list(app);
            +   elm_naviframe_item_push(app->naviframe, NULL, NULL, NULL, app->list, NULL);
            +
            +   return true;
            +}
            +
            +int
            +main(int argc, char **argv)
            +{
            +   // Declare a few structures and zero-initialize (C99 feature)
            +   struct app_data app = {0};
            +   ui_app_lifecycle_callback_s event_callback = {0};
            +
            +   event_callback.create = _app_create;
            +
            +   // Run the mainloop
            +   return ui_app_main(&argc, &argv, &event_callback, &ad);
            +}
            +
            +
          2. +
          3. +

            Declare the app_data struct:

            +
            struct 
            +app_data
            +{
            +   Evas_Object *win;
            +   Evas_Object *naviframe;
            +   Evas_Object *conformant;
            +   Evas_Object *list;
            +   Elm_Genlist_Item_Class *itc;
            +   Elm_Genlist_Item_Class *itc2;
            +};
            +
            +
          4. + + +
          5. +

            To create the genlist, call the elm_genlist_add() function:

            +
            +Evas_Object *list = elm_genlist_add(parent);
            +
          6. +
          +

          Figure: Genlist example

          +

          Genlist example

          + +

          Adding List Entries

          + +

          To add entries to the list:

          +
            +
          1. +

            Build a basic item class:

            +
            Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
            +itc->item_style = "default";
            +itc->func.text_get = NULL;
            +itc->func.content_get = NULL;
            +itc->func.state_get = NULL;
            +itc->func.del = NULL;
            +
            + +

            This example uses the item class to set the item_style to default and all other fields to NULL. Note that this leaves out the text_get and content_get fields, which are used to add text and an icon to the list entry. In general, the item class fields define the APIs that are used to manage the list items.

            +
          2. +
          3. +

            Add a new element to the list by calling the elm_genlist_item_append() function. Its second parameter is the item class structure which describes how to populate entries. Typically this structure is built once and re-used across calls to the elm_genlist_item_append() function.

            +
            +elm_genlist_item_append(list,
            +                        itc,
            +                        NULL, // Item data
            +                        NULL, // Parent item for trees, NULL if none
            +                        ELM_GENLIST_ITEM_NONE, // Item type; this is the common one
            +                        NULL, // Callback on selection of the item
            +                        NULL // Data for that callback function
            +);
            +
            +

            With most parameters as NULL and itc having most of its members NULL too, the elements of the list are blank and do not trigger anything when selected.

            +
          4. +
          5. +

            Use the text_get() callback to add text in the elements in the Elm_Genlist_Item_Class structure.

            +

            The callback must follow a prototype that takes data, an Evas Object, and a part variable as parameters. It returns a C string that is displayed in the part named after the part parameter. The callback is called for each user-settable text part according to the current theme.

            + +

            For more information on parts as used in the EFL files, see Writing a Simple EDC File.

            + + + + + + + + + + + +
            Note
            The value returned by the callback is freed by the EFL. The value must be freshly allocated: do not free it yourself and do not reuse it across list elements.
            + +

            The default theme (style defined for the item class) contains an elm.text part. The following example shows a possible implementation of the text_get() callback displaying text in the elm.text part:

            +
            +static char *
            +_genlist_text_get(void *data, Evas_Object *obj, const char *part)
            +{
            +   // Check this is text for the expected part
            +   if (strcmp(part, "elm.text") == 0) 
            +   {
            +      return strdup("Some text");
            +   }
            +   else 
            +   {
            +      return NULL;
            +   }
            +}
            +
            + + + + + + + + + + +
            Note
            The part names and positions depend on the item_style chosen when adding new items to the genlist. Setting a custom theme makes it possible to completely change genlists by adding and moving parts. For more information, see Introduction to EDC Programming.
            + +

            The data parameter makes it possible to vary the list behavior according to the data given to the EFL in the data parameter of the elm_genlist_item_append() function call. For example, given an integer in that field through casting with (void *)(uintptr_t) i, you can get its value back using (int)(uintptr_t)data:

            +
            +static char *
            +_genlist_text_get(void *data, Evas_Object *obj__UNUSED__, const char *part)
            +{
            +   if (strcmp(part, "elm.text") == 0) 
            +   {
            +      char *buf = malloc(16);
            +      snprintf(buf, 16, "Entry %d.", (int)(uintptr_t)data);
            +
            +      return buf;
            +   }
            +   else 
            +   {
            +      return NULL;
            +   }
            +}
            +
            +
          6. +
          7. +

            Add icons to the list with the content_get() callback. It returns a pointer to an Evas_Object and is called for each part whose content can be set. The callback must follow a prototype that takes data, an Evas Object, and a part variable as parameters. The only difference with the text_get() callback is that the content_get() function returns an Evas_Object* rather than a char *.

            + +

            The following example creates colored rectangles in the parts that are to be set. In the default theme, this displays a red rectangle on the left side of each list item and a green one on the right side.

            +
            +static Evas_Object *
            +_genlist_content_get(void *data, Evas_Object *obj, const char *part)
            +{
            +   int i = (int) (uintptr_t) data;
            +
            +   if (strcmp(part, "elm.swallow.icon") == 0) 
            +   {
            +      Evas_Object *bg = elm_bg_add(obj);
            +      elm_bg_color_set(bg, 255 * cos(i / (double) 10), 0, i % 255);
            +
            +      return bg;
            +   }
            +   else if (strcmp(part, "elm.swallow.end") == 0) 
            +   {
            +      Evas_Object *bg = elm_bg_add(obj);
            +      elm_bg_color_set(bg, 0, 255 * sin(i / (double) 10), i % 255);
            +
            +      return bg;
            +   }
            +   else 
            +   {
            +      return NULL;
            +   }
            +}
            +
            +
          8. + + + + + + + + + + +
            Note
            The swallow parts have no minimum size. This means that if you do not fix the minimum size, the part cannot be seen.
            + +
          9. +

            Implement the genlist item events.

            +

            Genlist items trigger a callback when clicked. The callback is chosen when adding the new item, for example, when calling the elm_genlist_item_append() function:

            +
            +elm_genlist_item_append(list, itc, NULL,  NULL,  ELM_GENLIST_ITEM_NONE,
            +                        _genlist_selected_cb, // Callback on selection of the item
            +                        NULL);
            +
            + +

            The callback must follow a prototype that takes data, an Evas Object, and event information as parameters. The following implementation changes the item's style when the item is selected.

            +
            +static void
            +_genlist_selected_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   appdata_s *app = data;
            +
            +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
            +
            +   elm_genlist_item_item_class_update(it, app->itc2);
            +}
            +
            +
          10. +
          + +

          Managing Item Style and Size

          + + +

          You can manage the item style and size:

          + +
            +
          • Managing the item style: +

            The number of parts that you can fill for an item depends on the item style that you select when creating the item class ( Elm_Genlist_Item_Class struct) for the genlist:

            +
            +app->itc->item_style = "default";
            +
            +

            For all available styles, see Genlist.

            +

            You can customize the styles by modifying the themein the EDC file. In case the customization is only visual, it is a good practice to keep the same item style names for new themes. This makes it possible to change the theme and keep the code the same while also retaining the same overall item placement.

            +
          • +
          • Setting a homogeneous item size: +

            To set the scroller correctly, the actual height and width of the genlist must be computed at the beginning. Since this means computing the size of each item and adding all item sizes together, it has a cost and slows down the process of adding items to a genlist.

            +

            The elm_genlist_homogeneous_set() function solves the problem by assuming that all items are the same size as the first item of the list. This assumption speeds up large insertions; however, it can lead to serious graphical issues if the items are not actually the same size. Use this function with care.

          • +
          • Changing the item class after the item has been created: +

            Changing the item class of a UI component is an easy way to change its appearance based on user actions (for example, when it is selected). To change the item class, call the elm_genlist_item_item_class_update() function:

            +
            static void
            +_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
            +{
            +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
            +
            +   // Change the appearance and possibly content of the item being expanded
            +   elm_genlist_item_item_class_update(it, app->itc2);
            +
            +   elm_genlist_item_expanded_set(it, EINA_TRUE);
            +}
            +
            +
          • +
          + +

          Using Item Modes

          + +

          The previous genlist examples have all featured bare lists. However, the genlist component is able to display items in a tree or group mode:

          + +
            +
          • Tree mode uses the parenting relationship with other items. +

            The child elements are created on-demand when their parent is expanded, and deleted when it is contracted.

          • +
          • Group mode keeps an element visible as long as one of its children is visible. +

            When scrolling, the parent element remains at the top of the UI component until all its child elements have been scrolled through and another group replaces it. The group mode is very useful for "title" items.

          • +
          +

          A common UI design is to mix the group and tree modes to allows for a tree behavior while keeping the group header item visible.

          +
            +
          • +

            To use the group mode:

            +
              +
            1. +

              Mark some elements as ELM_GENLIST_ITEM_GROUP and use the returned Elm_Object_Item to establish the parent-children relationship when adding the children items.

              +

              Since there are 2 kind of items, create 2 item classes. Give them different styles and callback functions.

              +
              +app->itc = elm_genlist_item_class_new();
              +app->itc->item_style = "default";
              +app->itc->func.text_get = _genlist_text_get_size;
              +app->itc->func.content_get = _genlist_content_get_bg;
              +app->itc->func.state_get = NULL;
              +app->itc->func.del = NULL; 
              +
              +app->itc2 = elm_genlist_item_class_new();
              +app->itc2->item_style = "1text.1icon";
              +app->itc2->func.text_get = _genlist_text_get_nosize;
              +app->itc2->func.content_get = _genlist_content_get_icon;
              +app->itc2->func.state_get = NULL;
              +app->itc2->func.del = NULL; 
              +
              +
            2. +
            3. +

              Add a group header and follow it with 10 children. This is repeated 1000 times.

              +

              The parent has the ELM_GENLIST_ITEM_GROUP type, while the children have the ELM_GENLIST_ITEM_NONE type.

              +

              Note that the value returned by the elm_genlist_item_append() function for a group header is stored and sent to the elm_genlist_item_append() call that adds the children. This creates the parent-child relationship.

              +
              +for (i = 0; i < 1000; i++) 
              +{
              +   it = elm_genlist_item_append(app->list, app->itc2, (void *)(uintptr_t) (10 * i), NULL,
              +                                ELM_GENLIST_ITEM_GROUP, NULL, NULL);
              +   for (j = 0; j < 10; j++)
              +   {
              +      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (10 * i + j), it,
              +                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
              +   }
              +}
              +
              +
            4. +
            +
          • + +
          • To use the tree mode:

            +
              +
            1. +

              Register the callbacks (expand,request, expanded, contract,request, and contracted) using the evas_object_smart_callback_add() function on the genlist object:

              +
              +evas_object_smart_callback_add(app->list, "expand,request",
              +                               _tree_item_expand_request, NULL);
              +evas_object_smart_callback_add(app->list, "expanded",
              +                               _tree_item_expanded, NULL);
              +
              +evas_object_smart_callback_add(app->list, "contract,request",
              +                               _tree_item_contract_request, NULL);
              +evas_object_smart_callback_add(app->list, "contracted",
              +                               _tree_item_contracted, NULL);
              +
              + +

              The expand,request and contract,request callbacks do only one thing: decide whether the element is expanded or contracted. This is done by using the elm_genlist_item_expanded_set() function; if it changes the expansion status of the item, the next callback is called (either expanded or contracted, depending on whether it was an expand,request or contract,request event). The following examples show a minimal implementation of these callbacks.

              +
              +static void
              +_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
              +
              +   elm_genlist_item_item_class_update(it, app->itc2);
              +
              +   elm_genlist_item_expanded_set(it, EINA_TRUE);
              +}
              +
              + +
              +static void
              +_tree_item_contract_request(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it = (Elm_Object_Item*) event_info;
              +
              +   elm_genlist_item_item_class_update(it, app->itc);
              +
              +   elm_genlist_item_expanded_set(it, EINA_FALSE);
              +}
              +
              + + + + + + + + + +
              Note
              The above examples have an extra line: the call to the elm_genlist_item_item_class_update() function. This function changes the item style after the item creation.
              +
            2. +
            3. +

              Expand the list. Once the genlist item status is set to expanded, the expanded event is triggered and it is the duty of a callback for that event to populate the list with the item's children. This relies on the parent parameter of functions (such as elm_genlist_item_append()), similar to the group mode.

              +

              The following function is a callback implementation for the expanded event. It adds items that are built similarly to previous items, the only change is the parent parameter which is not NULL. Conveniently, the parent Elm_Object_Item pointer that is passed to the elm_genlist_item_append() function is given in the event_info callback and needs to be cast.

              +
              +static void
              +_tree_item_expanded(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
              +   int i_parent = (int)(uintptr_t) data;
              +   int i;
              +
              +   for (i = 0; i < 10; i++) 
              +   {
              +      elm_genlist_item_append(app->list, app->itc, (void *)(uintptr_t) (i + i_parent), it_parent,
              +                              ELM_GENLIST_ITEM_NONE, NULL, NULL);
              +   }
              +}
              +
              +
            4. +
            5. +

              Contract the list. The following code has the callback function for the contracted event. It simply calls the elm_genlist_item_subitems_clear() function to clear all children (including their own children if they have any) of the given item. Again, the item that is being contracted is available through the event_info parameter to the callback.

              +
              static void
              +_tree_item_contracted(void *data, Evas_Object *o, void *event_info)
              +{
              +   Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
              +
              +   elm_genlist_item_subitems_clear(it_parent);
              +}
              +
              +
            6. +
            +
          • +
          • +

            To mix group and tree modes:

            +
              +
            1. Create an item of the group type, and an item of the tree type whose parent is the group type item.
            2. +
            3. Add the callbacks to populate the children of the tree item in the regular way.
            4. +
            +
          • +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/graphical_objects_n.htm b/org.tizen.ui.practices/html/native/efl/graphical_objects_n.htm new file mode 100644 index 0000000..30474de --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/graphical_objects_n.htm @@ -0,0 +1,78 @@ + + + + + + + + + + + + + Graphical Objects: Managing and Rendering Evas Objects + + + + + +
          + +

          Graphical Objects: Managing and Rendering Evas Objects

          + +

          Evas is a clean display canvas API for several target display systems that can draw anti-aliased text, smooth super and sub-sampled scaled images, alpha-blend objects and much more.

          +

          It abstracts any need to know much about what the characteristics of your display system are, what graphics calls are used to draw them, and how. It deals on an object level where all you do is create and manipulate objects in a canvas and set their properties.

          +

          Evas optimizes the rendering pipeline to minimize effort in redrawing changes made to the canvas and so takes this work out of the programmers hand, saving a lot of time and energy.

          +

          It is designed to work on embedded systems all the way to large and powerful multi-cpu workstations. It can be compiled to only have the features you need for your target platform if you so wish. It has several display back-ends, allowing it display on several display systems, making it portable for cross-device and cross-platform development.

          + +

          Evas is not a UI component set or a UI component toolkit, but it is their base. See Elementary for a toolkit based on Evas, Edje, Ecore and other Enlightenment technologies.

          +

          It is not dependent or aware of main loops, input or output systems. Input must be polled from various sources and fed to Evas. It does not create windows or report windows updates to your system, but draws the pixels and reports to the user the areas that are changed. These operations are ready to be used in Ecore, particularly in Ecore_Evas wrapper/helper set of functions.

          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/guides_efl_n.htm b/org.tizen.ui.practices/html/native/efl/guides_efl_n.htm new file mode 100644 index 0000000..5ec6712 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/guides_efl_n.htm @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + EFL + + + + + + +
          +

          EFL

          + +

          EFL is an open-source UI toolkit that provides a set of libraries that offer useful features to applications. EFL covers a number of areas from UI component sets to data structures. EFL is one of the Tizen native UI modules and is available in various Tizen profiles. In Tizen, EFL is commonly used for UI applications, although you can also use it for non-UI applications.

          + +

          When creating an EFL application, make sure you understand the following main features:

          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/hw_input_n.htm b/org.tizen.ui.practices/html/native/efl/hw_input_n.htm new file mode 100644 index 0000000..89686b1 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/hw_input_n.htm @@ -0,0 +1,64 @@ + + + + + + + + + + + + + Hardware Input Handling: Managing Hardware Events with EFL Extension + + + + + +
          + +

          Hardware Input Handling: Managing Hardware Events with EFL Extension

          + +

          The Tizen platform offers the Menu, Back, and Home keys as physical hardware keys for mobile devices and rotary component parts for wearable devices. You can also utilize the hardware keys in other applications with key grabbing.

          + +

          Basically, EFL does not depend on any specific hardware input methods, such as hardware keys, to generate back and home events, or rotary component parts to generate rotary events. Instead these hardware input events have tightly related to the Tizen UX. As a result, EFL has created the EFL extension library to support common UX behavior between applications and hardware events.

          + +

          When the user presses the Menu or Back key, the key generates a signal with its key property. The Ecore library receives the signal and propagates it to application layers as an event. The EFL extension library consumes the events and handles the views of the application according to key properties. Otherwise, EFL extension manages the rotary events, which are generated from rotary components in wearable devices and delivered to application layers by defining an event callback or a handler function, and registering it.

          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/key_events_mn.htm b/org.tizen.ui.practices/html/native/efl/key_events_mn.htm new file mode 100644 index 0000000..1707301 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/key_events_mn.htm @@ -0,0 +1,178 @@ + + + + + + + + + + + + + Managing Menu and Back Key Events + + + +
          +
          +

          Mobile native

          +
          + +
          +

          Related Info

          + +
          +
          + +
          +

          Managing Menu and Back Key Events

          + +

          The Menu and Back functions are common UX behaviors in applications. Generally, the user taps the Back hardware key to return to the previous screen. The applications usually also provide option menus to manipulate their functions through the tapping of the Menu hardware key.

          + +

          This feature is supported in mobile applications only.

          + +

          Normally, the key events are only delivered to the object in focus. However, with the EFL Extension functions, you can let visible objects without focus get events from the Menu and Back keys.

          + +

          Figure: Menu and Back keys

          +

          Menu and Back keys

          + +

          The EFL Extension maintains its own object stack for determining which object to deliver events to. Only visible objects are added to this stack. The stack is based on the Evas layer. It means that if 2 objects are registered for the same EFL Extension event, the object on the higher Evas layer gets the event.

          + +

          The following figure shows an example of objects and their layers. Objects 1, 2, and 3 are registered with EFL Extension callbacks for the same event, such as a Back key event. When the event occurs, object 3, which is on the highest layer (layer 3), gets the event callback.

          + +

          Figure: Objects with layers

          +

          Objects with layers

          + +

          If objects stay on the same layer, the object which is registered to the callback first gets the event.

          + +

          To register a callback for the Menu or Back key, use the eext_object_event_callback_add() function with the application callback type:

          +
            +
          • EEXT_CALLBACK_BACK: Hardware Back key event
          • +
          • EEXT_CALLBACK_MORE: Hardware Menu key event
          • +
          + +

          To delete a registered event in the EFL Extension, use the eext_object_event_callback_del() function.

          + +

          The EFL Extension also provides other convenient functions to work with the Menu and Back keys for popup, ctxpopup, naviframe, and entry components.

          + +

          Managing Hardware Key Events

          + +

          The application has a window that contains a naviframe and registers the EFL Extension Menu and Back key events for the naviframe.

          +

          When the Menu key is pressed, a popup is created and an EFL Extension Back key event for this popup is registered. If the popup is shown and the Back key is pressed, the popup is removed. Otherwise, if the Back key is pressed and there is no popup, the application is hidden.

          + +

          To manage hardware key events:

          +
            +
          1. +

            To use the functions and data types of the Efl Extension API, include the <efl_extension.h> header file in your application:

            +
            +#include <efl_extension.h>
            +
            +
          2. + +
          3. Create objects using the window and naviframe: +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   Evas_Object *win = NULL;
            +
            +   // Create the window
            +   win = elm_win_util_standard_add(NULL, "extension sample");
            +   evas_object_smart_callback_add(win, "delete,request", _win_del, NULL);
            +
            +   // Create the naviframe
            +   Evas_Object *nf = NULL;
            +   nf = elm_naviframe_add(win);
            +   evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(win, nf);
            +   evas_object_show(nf);
            +
            +   // Content
            +   Evas_Object *label = NULL;
            +   label = elm_label_add(nf);
            +   elm_object_text_set(label, "Press menu key to show popup,<br/>back key to exit.");
            +   elm_naviframe_item_push(nf, "Efl Extension usage", NULL, NULL, label, NULL);
            +
            +   // Show the window
            +   evas_object_show(win);
            +}
            +
            +
          4. + +
          5. Register EFL Extension callbacks for the naviframe: +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   // Register the EFL extension callbacks for Menu and Back key events
            +   eext_object_event_callback_add(nf, EEXT_CALLBACK_MORE, _create_popup, NULL);
            +   eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, _nf_back_cb, win);
            +}
            +
            +
          6. + +
          7. Create a popup and register EFL Extension Back key event callbacks for it: +
            +static void
            +_create_popup(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *parent = obj;
            +
            +   Evas_Object *popup = NULL, *content = NULL;
            +   popup = elm_popup_add(parent);
            +   elm_object_part_text_set(popup, "title,text", "Title");
            +   elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
            +
            +   // Popup content
            +   content = elm_label_add(parent);
            +   elm_object_text_set(content, "Press back key to remove popup.");
            +   elm_object_content_set(popup, content);
            +
            +   // Register the EFL extension callback for the Back key event
            +   eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            +   evas_object_show(popup);
            +}
            +
            + +

            To remove the popup when a Back key event occurs, use the eext_popup_back_cb callback.

            + +

            The callback function for menu key callback:

            +
            +static void
            +_nf_back_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   Evas_Object *win = data;
            +
            +   // Hide the window
            +   elm_win_lower(win);
            +}
            +
            +
          8. +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/key_events_n.htm b/org.tizen.ui.practices/html/native/efl/key_events_n.htm old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/native/efl/key_events_n.htm rename to org.tizen.ui.practices/html/native/efl/key_events_n.htm diff --git a/org.tizen.ui.practices/html/native/efl/key_grab_n.htm b/org.tizen.ui.practices/html/native/efl/key_grab_n.htm new file mode 100644 index 0000000..fcca868 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/key_grab_n.htm @@ -0,0 +1,699 @@ + + + + + + + + + + + + + Grabbing Hardware Key Events + + + + + +
          + +

          Grabbing Hardware Key Events

          + +

          The applications do not normally grab hardware key events, because each key event is delivered to the focused window by default. Some applications, however, have more advanced functionalities and behavior. For example, a memo application can use the volume key to resize the text. However, in most cases, if the volume keys are pressed, a volume control popup opens. To receive special hardware key events in the application, use the eext_win_keygrab_set() and eext_win_keygrab_unset() functions.

          + +

          To grab hardware key events:

          +
            +
          1. To use the functions and data types of the EFL Extension API (in mobile and wearable applications), include the <efl_extension.h> header in your application: +
            +#include <efl_extension.h>
            +
            +
          2. + +
          3. Create the objects using the window. For more information, see UI Containers. +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   Evas_Object *win = NULL;
            +
            +   // Create the window
            +   win = elm_win_util_standard_add(NULL, "extension sample");
            +   evas_object_smart_callback_add(win, "delete,request", _win_del, NULL);
            +
            +   // Show the window
            +   evas_object_show(win);
            +}
            +
            +
          4. + +
          5. Register the key event callbacks for the window. For more information, see Ecore Events. +
            +Eina_Bool ctrl_pressed = EINA_FALSE;
            +
            +static Eina_Bool
            +_key_down_cb(void *data __UNUSED__, int type __UNUSED__, void *ev)
            +{
            +   // The callback is used with the ECORE_EVENT_KEY_DOWN signal: the
            +   // parameter "void *ev" is therefore of the actual Ecore_Event_Key type
            +   // The following renders its fields accessible
            +   Ecore_Event_Key *event = ev;
            +
            +   // Test whether the key that is pressed is Ctrl
            +   if (!strcmp("Control_L", event->key))
            +   {
            +      // If it is, store that piece of information
            +      ctrl_pressed = EINA_TRUE;
            +   }
            +
            +   // Let the event continue to other callbacks which have not been called yet
            +   return ECORE_CALLBACK_PASS_ON;
            +}
            +
            +ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, NULL);
            +
            +
          6. + +
          7. Grab the key events using the eext_win_keygrab_set() function. The parameters are the window object created in step 2 above, and the key string. +
            +eext_win_keygrab_set(win, "XF86AudioRaiseVolume")
            +
            +
          8. + +
          9. When the application no longer needs to grab the key events, use the eext_win_keygrab_unset() function to ungrab them: +
            +eext_win_keygrab_unset(win, "XF86AudioRaiseVolume")
            +
            +
          10. +
          + +

          The following table lists the hardware keys from which you can grab events in different profiles.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Supported hardware keys +
          KeyDescriptionMobileWearableTV
          "XF86AudioRaiseVolume"Key to raise the volumeYesYesYes
          "XF86AudioLowerVolume"Key to lower the volumeYesYesYes
          "XF86PowerOff"Power key to switch the device on and offYesYesYes
          "XF86Menu"Application-specific menu keyYesYesYes
          "XF86Home"Key to go to the home screenYesYesYes
          "XF86Back"Key to go back to the previous status or pageYesYesYes
          "XF86Camera"Half shutter key to do something before taking a picture on the cameraYes--
          "XF86Camera_Full"Key to take a picture on the cameraYesYesYes
          "XF86Search"Key to go to the search applicationYesYesYes
          "XF86AudioPlay"Key to play mediaYesYesYes
          "XF86AudioPause"Key to pause the media being playedYesYesYes
          "XF86AudioStop"Key to stop the media being playedYesYesYes
          "XF86AudioNext"Key to go to the next media itemYesYesYes
          "XF86AudioPrev"Key to go to the previous media itemYesYesYes
          "XF86AudioRewind"Key to rewind the playing position of the mediaYesYesYes
          "XF86AudioForward"Key to forward the playing position of the mediaYesYesYes
          "XF86AudioMedia"Key to go to the media playerYesYesYes
          "XF86AudioPlayPause"Key to toggle between play and pauseYesYesYes
          "XF86AudioMute"Key to mute the mediaYesYesYes
          "XF86AudioRecord"Key to start recording mediaYesYesYes
          "Cancel"Key to cancel the action triggered by the previous keysYesYesYes
          "XF86SoftKBD"Key to show and hide the soft keyboardYesYesYes
          "XF86QuickPanel"Key to toggle the quick panelYes-Yes
          "XF86TaskPane"Key to toggle the task switcherYesYesYes
          "XF86HomePage"Key to go to the homepage of the user-defined Web browserYes-Yes
          "XF86WWW"Key to launch the user-defined Web browserYes-Yes
          "XF86Mail"Key to go to the user-defined email applicationYes-Yes
          "XF86ScreenSaver"Key to activate the screen lock (such as a pattern lock or a PIN lock)YesYesYes
          "XF86MonBrightnessDown"Key to lower the screen brightnessYesYesYes
          "XF86MonBrightnessUp"Key to raise the screen brightnessYesYesYes
          "XF86Voice"Key to activate a voice-related applicationYesYesYes
          "Hangul"Key to toggle the current languageYes-Yes
          "XF86Apps"Key to call the application holder applicationYesYesYes
          "XF86Call"Key to launch the call applicationYesYesYes
          "XF86Game"Key to go to the game applicationYes-Yes
          "XF86VoiceWakeUp_LPSD"Key to wake up from voice input (LPSD)YesYesYes
          "XF86VoiceWakeUp"Key to wake up from voice inputYesYesYes
          "XF86TV"Key to display the TV screen directly--Yes
          "XF86Display"Key to toggle the video source --Yes
          "XF86RCConfig"Key to set the remote control's specific configuration--Yes
          "XF86RCMode"Key to show and hide the virtual remote control on the screen--Yes
          "1"Numeric key 1 on the remote control--Yes
          "2"Numeric key 2 on the remote control--Yes
          "3"Numeric key 3 on the remote control--Yes
          "4"Numeric key 4 on the remote control--Yes
          "5"Numeric key 5 on the remote control--Yes
          "6"Numeric key 6 on the remote control--Yes
          "7"Numeric key 7 on the remote control--Yes
          "8"Numeric key 8 on the remote control--Yes
          "9"Numeric key 9 on the remote control--Yes
          "0"Numeric key 0 on the remote control--Yes
          "-"Minus key on the remote control--Yes
          "XF86LowerChannel"Key to lower the channel number--Yes
          "XF86RaiseChannel"Key to raise the channel number--Yes
          "XF86ChannelList"Key to display the channel list--Yes
          "XF86PreviousChannel"Key to display the previous channel--Yes
          "XF86SysMenu"Key to launch the system menu--Yes
          "XF86SimpleMenu"Key to launch the simple menu--Yes
          "XF86History"Key to launch the history functionality--Yes
          "XF86Favorites"Key to launch the favorite channels functionality--Yes
          "Up"Arrow key UP on the remote control--Yes
          "Down"Arrow key DOWN on the remote control--Yes
          "Left"Arrow key LEFT on the remote control--Yes
          "Right"Arrow key RIGHT on the remote control--Yes
          "Return"OK key on the remote control to confirm or select an item--Yes
          "XF86Close"Exit key on the remote control to terminate the current menu or application--Yes
          "XF86Info"Key to display the basic and auxiliary information on the screen--Yes
          "XF86Red"Key to execute the functionality registered to the RED key--Yes
          "XF86Green"Key to execute the functionality registered to the GREEN key--Yes
          "XF86Yellow"Key to execute the functionality registered to the YELLOW key--Yes
          "XF86Blue"Key to execute the functionality registered to the BLUE key--Yes
          "XF86ProgInfo"Key to display the program information--Yes
          "XF86PictureMode"Key to change the screen mode--Yes
          "XF86PictureSize"Key to change the screen size and aspect ratio--Yes
          "XF86PIP"Key to set the PIP (Picture-In-Picture) mode to display one screen on the other--Yes
          "XF86Guide"Key to display the user guide--Yes
          "XF86AudioMode"Key to set or change the audio mode--Yes
          "XF86Subtitle"Key to display or hide the subtitles--Yes
          "XF863D"Key to set or change the 3D mode--Yes
          + + + + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/layout_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/layout_tutorial_n.htm new file mode 100644 index 0000000..775e358 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/layout_tutorial_n.htm @@ -0,0 +1,782 @@ + + + + + + + + + + + + + + Creating UI Screen Layouts + + + + + + +
          + +

          Creating UI Screen Layouts

          + + +

          This tutorial demonstrates how you can compose a UI screen layout using the layout classes available in the EFL UI component library. It also highlights the capabilities of the EFL layout classes in free style layouting as well as layouting in a particular sequence (such as linear or grid).

          + + +

          Creating the UI Layout

          + +

          The sample application uses UI components, such as elm_naviframe and elm_toolbar for the view management, layout classes, such as elm_table, elm_box, and elm_grid for the composition of the screen, and UI components, such as elm_label and elm_image for the content inside the view.

          + +

          To create the UI layout:

          +
            +
          1. +

            Create the application layout with the create_base_gui() function:

            +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   Elm_Object_Item *nf_it, *tabbar_it;
            +   // Window
            +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
            +
            +
          2. +
          3. +

            Add the elm_conformant component to the application to decorate the window with an indicator:

            +
            +   // Conformant
            +   ad->conform = elm_conformant_add(ad->win);
            +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(ad->win, ad->conform);
            +   evas_object_show(ad->conform);
            +
            +
          4. +
          5. +

            Add the elm_naviframe component to act as a view manager for the window and provide the window title functionality:

            +
            +   // Naviframe
            +   ad->nf = elm_naviframe_add(ad->conform);
            +   elm_object_content_set(ad->conform, ad->nf);
            +   evas_object_show(ad->nf);
            +   nf_it = elm_naviframe_item_push(ad->nf, "UiLayout", NULL, NULL, NULL, "tabbar/icon/notitle");
            +
            +   // Tabbar
            +   ad->tabbar = create_toolbar(ad);
            +   elm_object_item_part_content_set(nf_it, "tabbar", ad->tabbar);
            +
            +   // Set the first view
            +   tabbar_it = elm_toolbar_first_item_get(ad->tabbar);
            +   elm_toolbar_item_selected_set(tabbar_it, EINA_TRUE);
            +
            +   // Show the window after the base GUI is set up
            +   evas_object_show(ad->win);
            +
            +   ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, NULL);
            +}
            +
            +
          6. +
          7. +

            Add the toolbar to the naviframe using the create_toolbar() function:

            +
            +static Evas_Object*
            +create_toolbar(appdata_s *ad)
            +{
            +   Evas_Object *tabbar;
            +
            +   tabbar = elm_toolbar_add(ad->nf);
            +   elm_object_style_set(tabbar, "tabbar");
            +   elm_toolbar_shrink_mode_set(tabbar, ELM_TOOLBAR_SHRINK_EXPAND);
            +   elm_toolbar_transverse_expanded_set(tabbar, EINA_TRUE);
            +
            +   elm_toolbar_item_append(tabbar, NULL, "Box", tabbar_item_cb, ad);
            +   elm_toolbar_item_append(tabbar, NULL, "Grid", tabbar_item_cb, ad);
            +   elm_toolbar_item_append(tabbar, NULL, "Table", tabbar_item_cb, ad);
            +
            +   return tabbar;
            +}
            +
            + +

            The following figure illustrates the UI Layout.

            + +

            Figure: UI Layout screen

            +

            UI Layout screen

            +
          8. +
          + +

          Adding Content to the Screen

          + +

          To add content to the screen:

          +
            +
          1. +

            Compose a box layout using a recursive composition with the create_box_view() function:

            +
            +static Evas_Object*
            +create_box_view(Evas_Object *parent)
            +{
            +   Evas_Object *box, *box1, *box2, *box3;
            +
            +   box = elm_box_add(parent);
            +   elm_box_padding_set(box, 10, 10);
            +   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +
            +   box1 = elm_box_add(box);
            +   elm_box_horizontal_set(box1, EINA_TRUE);
            +   elm_box_padding_set(box1, 8, 8);
            +   evas_object_size_hint_weight_set(box1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(box1, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_show(box1);
            +
            +   box2 = elm_box_add(box);
            +   elm_box_padding_set(box2, 6, 6);
            +   evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_show(box2);
            +
            +   box3 = elm_box_add(box);
            +   elm_box_padding_set(box3, 5, 5);
            +   evas_object_size_hint_weight_set(box3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(box3, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   elm_box_homogeneous_set(box3, EINA_FALSE);
            +   evas_object_show(box3);
            +} 
            +
            +
          2. +
          3. +

            Add content or another box layout to the box.

            +
            +// Add an item to the box
            +Evas_Object *item1 = create_content(box, "Item 1");
            +evas_object_size_hint_min_set(item1, 0, 40);
            +elm_box_pack_end(box, item1);
            +elm_box_pack_end(box, box1);
            +elm_box_pack_end(box, box3);
            +elm_box_pack_end(box, create_content(box, "Item 4"));
            +
            +// Add an item to the box1
            +elm_box_pack_end(box1, create_content(box1, "Item 2.1"));
            +elm_box_pack_end(box1, box2);
            +elm_box_pack_end(box1, create_content(box1, "Item 2.3"));
            +
            +// Add an item to the box2
            +elm_box_pack_end(box2, create_content(box2, "Item 2.2.1"));
            +elm_box_pack_end(box2, create_content(box2, "Item 2.2.2"));
            +
            +// Add an item to the box3
            +elm_box_pack_end(box3, create_content(box3, "Item 3.1"));
            +elm_box_pack_end(box3, create_content(box3, "Item 3.2"));
            +
            +

            The box layout implements the size policy during the size calculation.

            +
          4. +
          5. +

            Compose a table layout with a content and grid view with the create_table_view() function:

            +
            +static Evas_Object*
            +create_table_view(Evas_Object *parent)
            +{
            +   Evas_Object *table, *item;
            +
            +   table = elm_table_add(parent);
            +   elm_table_padding_set(table, 10, 10);
            +   elm_table_homogeneous_set(table, EINA_TRUE);
            +   evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +
            +   item = create_content(table, "Item 1");
            +   elm_table_pack(table, item, 0, 0, 2, 1);
            +
            +   item = create_content(table, "Item 2");
            +   elm_table_pack(table, item, 2, 0, 1, 1);
            +
            +   item = create_content(table, "Item 3");
            +   elm_table_pack(table, item, 0, 1, 3, 1);
            +
            +   // Add a grid view item
            +   item = create_grid_view(table);
            +   evas_object_show(item);
            +   elm_table_pack(table, item, 0, 2, 3, 10);
            +
            +   return table;
            +}
            +
            +

            The table layout can be used for freestyle layouting, and for standard layouts, such as lists and grids. It does not consider the size policy of the child item during size calculation.

            +
          6. +
          7. +

            Compose a grid layout with the create_grid_view() function, and also use the box and table layouts as child items to pack inside a grid.

            + +
            +static Evas_Object*
            +create_grid_view(Evas_Object *parent)
            +{
            +   Evas_Object *grid, *item;
            +
            +   grid = elm_grid_add(parent);
            +   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +
            +   // Red background for the grid
            +   item = create_bg(grid, 255, 0, 0);
            +   elm_grid_pack(grid, item, 0, 0, 100, 100);
            +
            +   // Add the item to the grid
            +   item = create_content(grid, "Item1");
            +   elm_grid_pack(grid, item, 1, 1, 98, 98);
            +
            +   item = create_content(grid, "Item2");
            +   elm_grid_pack(grid, item, 2, 5, 20, 20);
            +
            +   item = create_content(grid, "Item3");
            +   elm_grid_pack(grid, item, 23, 5, 76, 94);
            +
            +   item = create_content(grid, "Item4");
            +   elm_grid_pack(grid, item, 2, 27, 20, 70);
            +
            +   // Black background for the box view item
            +   item = create_bg(grid, 40, 40, 40);
            +   elm_grid_pack(grid, item, 25, 10, 73, 87);
            +
            +   // Add the box view item to the grid
            +   item = create_box_view(grid);
            +   evas_object_show(item);
            +   elm_grid_pack(grid, item, 26, 11, 71, 85);
            +
            +   return grid;
            +}
            +
            +

            The grid layout uses free style layouting, and during size evaluation of the child item, it does not take the size policy of the child item into consideration.

            +
          8. +
          + +

          Using the Base Layout

          + +

          When developing a Tizen native application, it is recommended that you base your application layout on the base layout. The base layout supports the indicator and view management. The following figure shows the wireframe and UI component hierarchy of the base layout:

          + +

          Figure: Base layout wireframe and UI component hierarchy

          +

          Base layout wireframe and UI component hierarchy

          + +

          The UI components have the following roles:

          + +
            +
          • Window (Elm_win): Every UI component from Elementary is rendered in a window.
          • +
          • Conformant (Elm_Conformant): Conformant supports the indicator area and resizing the application due to rotation or the ISF (keypad).
          • +
          • Naviframe (Elm_Naviframe): Naviframe acts as a view manager and optionally provides the application title. The main layout of the application is added to the naviframe's view area.
          • +
          + + +

          Sample Setting Application with the Base Layout

          + +

          The mobile Setting application consists of a list to show as a menu. To organize the application, create the application layout with a screen-size list and place the layout into the naviframe's view area.

          + +

          Figure: Setting UI and layout

          +

          Settings UI and layout

          + +

          Sample Application Store Application with the Base Layout

          + +

          To organize the mobile Application Store application, add a scroller to the base layout, since the total height of the layout is greater than the screen size, and you therefore need to scroll the screen content up and down. If the layout is larger than the screen, the scroller makes the view itself scrollable.

          + +

          You can use a list or grid if the same objects are shown repeatedly. In this sample application, however, the various items are shown in a layout.

          + +

          Figure: Application Store UI and layout

          +

          Application Store UI and layout

          + +

          Sample Calculator Application with a Customized Layout

          + +

          The mobile Calculator is a good example of an exception to the base layout. The application has no view changes and no application title. As these are the 2 reasons why you must use a Naviframe, you do not need to add a naviframe to the Calculator.

          + +

          You can organize the application layout with container components. Container components are used for arranging UI components, both basic UI components and other container components.

          + +

          Figure: Calculator UI and layout

          +

          Calculator UI and layout

          + + +

          Sample Email Application with a Customized Layout

          + +

          The mobile Email application shows information using a list. The main view is the same as in the Setting application, consisting of a screen-size list for displaying emails. However, the Email application has an additional feature called drawer, which is used for displaying the menu with a hierarchy.

          + +

          To develop the application as a Tizen native application, add a layout on the conformant, and add a naviframe to the layout. This layout has a content area for the drawer and naviframe, and its style name is "layout/drawer/panel". To use this layout, use the following code:

          + +
          +layout = elm_layout_add(parent);
          +elm_layout_theme_set(layout, "layout", "drawer", "panel");
          +
          + +

          The style includes parts for locating the drawer and the main view. In the drawer area, you can add a list to indicate the menu. In the main view, you can add a naviframe to organize the view of the layout.

          + +

          Figure: Email UI and layout

          +

          Email UI and layout

          + + +

          Creating a Simple Clock View

          + +

          The following sample creates a basic clock view that shows the time, current city, and date. This sample demonstrates how to use a box (container component) and label to create a basic layout. The application includes the following UI components:

          + +
            +
          • Elm_window: Basic canvas for rendering the screen
          • +
          • Elm_conformant: Support for the indicator area
          • +
          • Elm_naviframe: View manager component
          • +
          • Elm_box: Container component for layouting other UI components
          • +
          • Elm_label: Basic UI component for showing text with a tag
          • +
          + +

          The following figure illustrates the main view of the simple clock application and its wireframe structure.

          + +

          Figure: Simple clock screen

          +

          Simple clock screen

          + +

          To create a simple clock view:

          +
            +
          1. +

            Implement the data structure for the application in the world_clock.c file:

            +
            +typedef struct appdata
            +{
            +   // Save the window
            +   Evas_Object *win;
            +} 
            +appdata_s;
            +
            + +

            The information in appdata is used for the entire system. In this sample application, the information is related to handling the hardware back key.

            +
          2. +
          3. +

            Create the basic UI with the app_create() function:

            +
            +int
            +main(int argc, char *argv[])
            +{
            +   appdata_s *ad = {0,};
            +   app_event_callback_s event_callback = {0,};
            +   int ret = 0;
            +
            +   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;
            +
            +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
            +   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
            +
            +   ret = ui_app_main(argc, argv, &event_callback, &ad);
            +   if (ret != APP_ERROR_NONE) 
            +   {
            +      dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
            +   }
            +
            +   return ret;
            +}
            +
            +static bool
            +app_create(void *data)
            +{
            +   appdata_s *ad = data;
            +   create_base_gui(ad);
            +
            +   return true;
            +}
            +
            +
          4. +
          5. +

            Use the create_base_gui() function to create a basic layout with a window, conformant, and naviframe. This is the basic layout in the Tizen mobile environment.

            +
            +// Window
            +ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +// Conformant
            +conform = elm_conformant_add(ad->win);
            +elm_win_conformant_set(ad->win, EINA_TRUE);
            +evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_win_resize_object_add(ad->win, conform);
            +evas_object_show(conform);
            +
            +// Naviframe
            +nf = elm_naviframe_add(conform);
            +elm_object_content_set(conform, nf);
            +evas_object_show(nf);
            +
            +
          6. +
          7. +

            Create the main layout for the application. In this sample, it contains a box with 3 labels. The labels show the time, city, and date.

            +

            Set the text to the labels. You can set or decorate the text in the labels using the elm_object_text_set() function. You can modify the text size, color and thickness with the <font_size>, <color>, and <b> elements. To add the labels to the box, use the elm_box_pack_end() function.

            +
            +// Add the box
            +box = elm_box_add(nf);
            +// Create a label
            +label1 = elm_label_add(box);
            +// Set text to the label with a tag
            +elm_object_text_set(label1, "<font_size=110><color=#000000>07:26</color></font_size>");
            +// Add the label to the box
            +elm_box_pack_end(box, label1);
            +// Change label visibility
            +evas_object_show(label1);
            +
            +// Repeat with other labels
            +
            +evas_object_show(box);
            +
            +
          8. +
          9. +

            Set the box as a new view. You can also set the title of the application. These operations are handled by the naviframe using the elm_naviframe_item_push() function. The parameters include the title, the name of the UI component added as a new view, and the naviframe style. The basic style is used for a simple view with a normal title.

            +
            +elm_naviframe_item_push(nf, _("World Clock"), NULL, NULL, box, "basic");
            +
            + +

            The following figure illustrates the UI component hierarchy of the application.

            + +

            Figure: Simple clock components

            +

            Simple clock components

            +
          10. +
          11. +

            Set the hardware key handler. The Tizen mobile environment supports multiple hardware keys, but only the back key is handled in this sample.

            +
            +eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
            +
            + +

            After setting the callback function, the win_back_cb callback is invokes when a back key is pressed. The win_back_cb() callback hides the window.

            +
            +static void
            +win_back_cb(void *data , int type , void *event)
            +{
            +   appdata_s *ad = data;
            +   elm_win_lower(ad->win);
            +}
            +
            +
          12. +
          + +

          Creating a Complex Clock View

          + +

          The following sample creates a complex clock view. The sample demonstrates how to organize a basic layout using boxes. The application includes the following UI components:

          + + +
            +
          • Elm_window: Basic canvas for rendering the screen
          • +
          • Elm_conformant: Support for the indicator area
          • +
          • Elm_naviframe: View manager component
          • +
          • Elm_box: Container component for layouting other UI components
          • +
          • Elm_label: Basic UI component for showing text with a tag
          • +
          • Elm_genlist: List component
          • +
          • Elm_button: Simple push button
          • +
          + +

          The following figure illustrates the main view of the complex clock sample application and its wireframe structure.

          + +

          Figure: Complex clock screen

          +

          Complex clock screen

          + +

          To create a complex clock view:

          +
            +
          1. +

            Implement the data structure for the basic UI in the world_clock.c file:

            +
            +typedef struct appdata
            +{
            +   // Save the window
            +   Evas_Object *win;
            +} 
            +appdata_s;
            +
            + +

            The information in appdata is used for the entire system. In this sample application, the information is related to handling the hardware back key.

            +
          2. +
          3. +

            Create the base UI for the application with the app_create() function:

            + +
            int
            +main(int argc, char *argv[])
            +{
            +   appdata_s *ad = {0,};
            +   app_event_callback_s event_callback = {0,};
            +   int ret = 0;
            +
            +   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;
            +
            +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
            +   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
            +   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
            +
            +   ret = ui_app_main(argc, argv, &event_callback, &ad);
            +   if (ret != APP_ERROR_NONE) 
            +   {
            +      dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
            +   }
            +
            +   return ret;
            +}
            +
            +static bool
            +app_create(void *data)
            +{
            +   appdata_s *ad = data;
            +   create_base_gui(ad);
            +
            +   return true;
            +}
            +
            + +

            The base UI of the application contains the clock, list, and main layout with buttons.

            +
          4. +
          5. +

            Create the clock element. The clock element contains 3 labels. The labels are packed as a single box component, which is part of the main layout.

            +
            +static Evas_Object *
            +create_clock(Evas_Object *nf)
            +{
            +   Evas_Object *box, *label1, *label2, *label3;
            +
            +   // Box
            +   box = elm_box_add(nf);
            +
            +   label1 = elm_label_add(box);
            +   elm_object_text_set(label1, "<font_size=110><color=#000000>07:26</color></font_size>");
            +   elm_box_pack_end(box, label1);
            +   evas_object_show(label1);
            +
            +   evas_object_show(box);
            +
            +   return box;
            +}
            +
            +
          6. +
          7. +

            Create the list element. This element contains a list of cities. The UI component used is genlist, which is a complex list able to show information with various styles.

            +
            +static Evas_Object *
            +create_list(Evas_Object *nf)
            +{
            +   Evas_Object* list;
            +   Elm_Genlist_Item_Class *itc = NULL;
            +   int i, num_of_item;
            +   Elm_Object_Item *it;
            +
            +   list = elm_genlist_add(nf);
            +}
            +
            +
          8. +
          9. +

            Add a new item class using the Elm_Genlist_Item_Class class. After adding a new class, set a callback function to detect when the item is rendered.

            +
            +itc = elm_genlist_item_class_new();
            +itc->item_style = "2line.top.4";
            +itc->func.text_get = gl_text_get_cb;
            +itc->func.content_get = NULL;
            +itc->func.del = NULL;
            +
            +

            In this application, all the list items are similar and use the same gl_text_get_cb() callback function for setting text, so only 1 item class is created:

            +
            static char*
            +gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
            +{
            +   item_data_s *id = data;
            +   char buf[1024];
            +
            +   if (id->index == 0) 
            +   {
            +      if (!strcmp(part, "elm.text.main.left.top")) 
            +      {
            +         snprintf(buf, 1023, "%s", "07:26");
            +
            +         return strdup(buf);
            +      }
            +      else if (!strcmp(part, "elm.text.sub.right.top")) 
            +      {
            +         snprintf(buf, 1023, "%s", "Cardiff");
            +
            +         return strdup(buf);
            +      }
            +      else if (!strcmp(part, "elm.text.sub.left.bottom")) 
            +      {
            +         snprintf(buf, 1023, "%s", "Wen, Jan 1");
            +
            +         return strdup(buf);
            +      }
            +      else if (!strcmp(part, "elm.text.sub.right.bottom")) 
            +      {
            +         snprintf(buf, 1023, "%s", "wales");
            +
            +         return strdup(buf);
            +      }
            +   }
            +
            +   return NULL;
            +}
            +
            +
          10. +
          11. +

            Append items to the list using the elm_genlist_item_append() function. In this application, 3 items are added:

            +
            +num_of_item = 3;
            +
            +for (i = 0; i < num_of_item; i++) 
            +{
            +   item_data_s *id = calloc(sizeof(item_data_s), 1);
            +   id->index = i;
            +   it = elm_genlist_item_append(list,
            +                                itc,
            +                                id,
            +                                NULL,
            +                                ELM_GENLIST_ITEM_NONE,
            +                                NULL,
            +                                id);
            +   id->item = it;
            +}
            +
            +
          12. +
          13. +

            Create the main layout. In the main layout, the other layout elements are merged together and a button is added.

            +
            +static void
            +create_base_gui(appdata_s *ad)
            +{
            +   Evas_Object *conform, *nf, *box, *clock, *layout, *rect, *button;
            +   // Window
            +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
            +   elm_win_autodel_set(ad->win, EINA_TRUE);
            +
            +   // Conformant
            +   conform = elm_conformant_add(ad->win);
            +   elm_win_conformant_set(ad->win, EINA_TRUE);
            +   evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_win_resize_object_add(ad->win, conform);
            +   evas_object_show(conform);
            +
            +   // Naviframe
            +   nf = elm_naviframe_add(conform);
            +   elm_object_content_set(conform, nf);
            +   evas_object_show(nf);
            +
            +
          14. +
          15. +

            Add a box component. The box component is used to organize the main layout. The box is expanded as much as possible to fill the entire view.

            +
            +   // Box
            +   box = elm_box_add(nf);
            +   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +
            + +

            The box contains the following elements:

            + +
              + +
            • The clock element contains 3 labels. The parameter for the evas_object_size_hint_weight_set() function is 0.1 meaning that the height of the clock box occupies 30% of the available area.

              +
              +   clock = create_clock(nf);
              +   evas_object_size_hint_weight_set(clock, EVAS_HINT_EXPAND, 0.3);
              +   evas_object_size_hint_align_set(clock, EVAS_HINT_FILL, EVAS_HINT_FILL);
              +   elm_box_pack_end(box, clock);
              +
              +
            • + +
            • The list element is packed into the box. As the genlist elements do not have a determined size, their size depends on the layout parameter.

              +
              +   layout = elm_layout_add(box);
              +   elm_layout_theme_set(layout, "layout", "application", "default");
              +   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +   evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
              +   rect = create_list(nf);
              +   elm_layout_content_set(layout, "elm.swallow.content", rect);
              +   evas_object_show(rect);
              +   evas_object_show(layout);
              +   elm_box_pack_end(box, layout);
              +
              +
            • + +
            • The button element has a callback function to detect when the button is clicked.

              +
              +   button = elm_button_add(box);
              +   evas_object_smart_callback_add(button, "clicked", btn_clicked_cb, NULL);
              +   evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0.1);
              +   evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
              +   elm_object_text_set(button, "Terminate");
              +   evas_object_show(button);
              +   elm_box_pack_end(box, button);
              +}
              +
              +
            • +
            + +

            The following figure illustrates the UI component hierarchy of the application.

            + +

            Figure: Complex clock components

            +

            Complex clock components

            +
          16. +
          17. +

            Set the hardware key handler:

            +
            +eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
            +
            + +

            After setting the callback function, the win_back_cb() callback is invokes when a back key is pressed. The win_back_cb() callback hides the window.

            +
            +static void
            +win_back_cb(void *data , int type , void *event)
            +{
            +   appdata_s *ad = data;
            +   elm_win_lower(ad->win);
            +}
            +
            +
          18. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/main_loop_n.htm b/org.tizen.ui.practices/html/native/efl/main_loop_n.htm new file mode 100644 index 0000000..07ce510 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/main_loop_n.htm @@ -0,0 +1,409 @@ + + + + + + + + + + + + + Handling the Main Loop + + + + + +
          + +

          Handling the Main Loop

          + +

          The EFL is event-driven. This means that the application polls for data, and listens for events to interact with it.

          + +

          The Ecore library provides the main loop abstraction. It gets data when data is available and sends the events so that costly polling threads are not needed. Ecore manages polling, timers, events, and file descriptors. When there is no ongoing event, the main loop automatically enters an idle mode, minimizing the power consumption. The loop wakes up when needed.

          + +

          Starting the Main Loop

          + +

          To start the Ecore main loop and move your application into the running state, call the ui_app_main() function. The Ecore main loop handles all general events, such as touch, mouse, key, and network events.

          + +
          +int
          +main(int argc, char *argv[])
          +{
          +   ret = ui_app_main(argc, argv, &event_callback, &ad);
          +
          +   return ret;
          +}
          +
          + +

          When your application is running:

          +
          1. Create a window and organize the UI components inside the window.
          2. +
          3. Create the application logic code to be called when callbacks or timed events occurs (for example, animators for animations and timers for timeouts).
          + + +

          Timers

          + +

          Ecore provides timers, which schedule events that are executed later at a specific time. The event can occur once or several times at specific intervals.

          + +

          A timer callback prototype looks like the my_timed_cb() callback function. This function receives data from the application, and returns a Boolean value to specify whether it is called again or completed. The following macros are also provided:

          + +
            +
          • ECORE_CALLBACK_RENEW: the function is called again after the timeout.
          • +
          • ECORE_CALLBACK_CANCEL: the function is not called again, Ecore destroys automatically everything associated with the timer.
          • +
          + +

          To create and destroy a timer:

          + +
            +
          • To create a timer, use the ecore_timer_add() function. The interval, specified in seconds, indicates when the given function is called, and receives the specified data as a parameter. It returns an Ecore_Timer object. +

            In the following example, the my_timed_cb() function is run after 2 seconds and it receives my_data. It is renewed while its count variable value is under 5, and stops after that.

            +
            +Eina_Bool my_timed_cb(void *data)
            +{
            +   static int count = 0;
            +   count++;
            +
            +   if (count < 5) 
            +      return ECORE_CALLBACK_RENEW;
            +
            +   return ECORE_CALLBACK_CANCEL;
            +}
            +ecore_timer_add(2.0, my_timed_cb, my_data);
            +
            +
          • + +
          • To delete the timer, use the ecore_timer_del() function. The timer to delete must still be running, that is, it has not returned a false value. If the timer is not running, the function cannot be called.
          • +
          + +

          To manage a timer:

          +
            +
          • To change the timer's interval, use the ecore_timer_interval_set() function. The interval is specified in seconds. If set during a timer call, this affects the next interval. Use the ecore_timer_interval_get() function to get the timer's current interval.
          • + +
          • To get the timer's pending time, use the ecore_timer_pending_get() function.
          • + +
          • To delay the timer's next occurrence, use the ecore_timer_delay() function. The function adds the specified time to the current interval. It does not change the future occurrences' interval. You can also reset the current interval to its full value by using the ecore_timer_reset() function.
          • + +
          • To pause the currently running timer, use the ecore_timer_freeze() function. The remaining time is saved and used again when the timer is resumed with the ecore_timer_thaw() function.
          • + +
          • To query the current value of the defined timer infrastructure precision, use the ecore_timer_precision_get() function. A higher delay means that more timers can be run together. It diminishes the need to use system wake-ups and thus lowers the power consumption. +

            To set the precision, use the ecore_timer_precision_set() function. This sets the precision for all timers. For example, there are 2 timers, one that expires in 2.0 seconds and another that expires in 2.1 seconds. If the precision is set to 0.1 seconds, Ecore requests the next expiration to happen in 2.1 seconds and runs both callbacks at once, instead of one at 2.0 seconds and the other one 0.1 seconds later. However, if there is no timer expiring in 2.1 seconds, the timeout is at the minimum interval, 2 seconds.

          • +
          + +

          Animators

          + +

          Animators are a specific type of timer, specially designed for on-screen animation purposes:

          + +
            +
          • The time interval is usually known when they are created.
          • +
          • They are called at each screen refresh and their interval can vary. The interval can depend on the system load, the target power consumption, and other factors. The exact interval is not relevant.
          • +
          + +

          To implement animators, Ecore provides the Ecore animator subsystem.

          + +

          Forever-running Animator

          + +

          To create an animation that runs for an indefinite time:

          + +
          +Eina_Bool my_anim_cb(void *data)
          +{
          +   static int count = 0;
          +   count++;
          +   if (count < 5) 
          +      return ECORE_CALLBACK_RENEW;
          +
          +   return ECORE_CALLBACK_CANCEL;
          +}
          +ecore_animator_add(my_anim_cb, my_data);
          +
          + +

          This example looks the same as the one using an Ecore timer. The ecore_animator_add() function takes the callback function and data to pass to it, and returns an Ecore_Animator object. The function is called at a system-defined interval until it returns ECORE_CALLBACK_CANCEL instead of ECORE_CALLBACK_RENEW.

          + +

          Specific-duration Animator

          + +

          An animator callback for an animator running a specific time has a different prototype than the forever running animator.

          + +

          This callback function receives both data and a position which represents the current time among the full timeline, 0 meaning the beginning of the animation, and 1 meaning the end of the animation, returning ECORE_CALLBACK_CANCEL to abort, or ECORE_CALLBACK_RENEW to continue.

          + +

          To create and destroy the animator:

          +
            +
          • To create the animator, use the ecore_animator_timeline_add() function. The first parameter specifies the animator duration, the second parameter is the callback function, and the third parameter is the data to pass to the callback. The data parameter is optional. +
            +Eina_Bool my_anim_cb(void *data, double position)
            +{
            +   if (position < .5) 
            +      return ECORE_CALLBACK_RENEW;
            +
            +   return ECORE_CALLBACK_CANCEL;
            +}
            +ecore_animator_timeline_add(5., my_anim_cb, my_data);
            +
            + +

            In this example, the animator is specified to run for five seconds. The function returns ECORE_CALLBACK_CANCEL as soon as the position among the timeline passes half of the duration, 2.5 seconds.

            + +

            Ecore can generate a virtual position from the original one using ecore_animator_pos_map(position, map, v1, v2). Several maps are available:

            + +
              +
            • ECORE_POS_MAP_LINEAR: linear from 0.0 to 1.0.
            • +
            • ECORE_POS_MAP_ACCELERATE: start slow, then speed up.
            • +
            • ECORE_POS_MAP_DECELERATE: start fast, then slow down.
            • +
            • ECORE_POS_MAP_SINUSOIDAL: start slow, speed up, then slow down at the end.
            • +
            • ECORE_POS_MAP_ACCELERATE_FACTOR: start slow, then speed up, v1 being a power factor: 0.0 is linear, 1.0 is standard acceleration, 2.0 is a much more pronounced acceleration (squared), and 3.0 is cubed.
            • +
            • ECORE_POS_MAP_DECELERATE_FACTOR: start fast, then slow down, v1 being a power factor: 0.0 is linear, 1.0 is standard deceleration, 2.0 is a much more pronounced deceleration (squared), and 3.0 is cubed.
            • +
            • ECORE_POS_MAP_SINUSOIDAL_FACTOR: start slow, speed up, then slow down at the end, v1 being a power factor: 0.0 is linear, 1.0 is a standard sinusoidal, 2.0 is a much more pronounced sinusoidal (squared), and 3.0 is cubed.
            • +
            • ECORE_POS_MAP_DIVISOR_INTERP: start at gradient * v1, interpolated with the power of v2 curve.
            • +
            • ECORE_POS_MAP_BOUNCE: start at 0.0, then drop like a ball bouncing to the ground at 1.0, and bounce v2 times, with a decay factor of v1.
            • +
            • ECORE_POS_MAP_SPRING: start at 0.0, then wobble like a spring to the rest position 1.0, and wobble v2 times, with a decay factor of v1.
            • +
            + +

            Figure: Position maps

            +

            Position maps

            +
          • + +
          • To destroy the animator, use the ecore_animator_del() function. The animator to destroy must be running, that is, it has not returned a false value. If the animator is not running, the function cannot be called.
          • +
          + +

          To manage the animator:

          +
            +
          • To pause the currently running animator, use the ecore_animator_freeze() function. Note that time continues ticking even if the animator is frozen, and that resuming the animation using the ecore_animator_thaw() function does not actually resume, if the full runtime has been passed in the meanwhile.
          • + +
          • To query Ecore for the interval between 2 animator calls, use the ecore_animator_frametime_get() function.
          • + +
          • To change the interval, use the ecore_animator_frametime_set(interval) function. Note that too small a value causes performance and power consumption issues, and too high a value makes the animation jerky.
          • +
          + +

          File Descriptors

          + +

          Ecore provides an infrastructure to monitor file descriptors, so that files do not have to be blocked or polled to read or write on them. Instead, monitor sockets, pipes, or other streams are used to get a file descriptor.

          + +

          To manage the file descriptors:

          +
            +
          • To set a callback, use the _my_cb_func() function. Its first parameter is the data passed to it (optional), and the second one is the Ecore file descriptor handler. Its return value is, as in most Ecore callbacks, ECORE_CALLBACK_RENEW or ECORE_CALLBACK_CANCEL. It tells Ecore whether it wants to be called again or whether its treatment is finished.
          • + +
          • To listen to events, use the ecore_main_fd_handler_add() function.
          • + +
          • To wait for incoming data (that is, to read data) on the my_fd file descriptor, passing my_data: + +
            +Eina_Bool my_fd_cb(void *data, Ecore_Fd_Handler *handler)
            +{
            +   int fd;
            +   fd = ecore_main_fd_handler_fd_get(handler);
            +   count = read(fd, buf, sizeof(buf)); // This is guaranteed not to block
            +
            +   return ECORE_CALLBACK_RENEW;
            +}
            +ecore_main_fd_handler_add(my_fd, ECORE_FD_READ, my_fd_cb, my_data, NULL, NULL);
            +
            +
          • + +
          • To delete a file descriptor handler, use the ecore_main_fd_handler_del() function. This does not close the file descriptor. Always delete the handlers before closing the actual file descriptors.
          • + +
          • To get the handler's file descriptor, use the ecore_main_fd_handler_fd_get() function.
          • + +
          • To select whether a flag is active on a handler, use the ecore_main_fd_handler_active_get() function. For example, the handler is set to monitor both ECORE_FD_READ and ECORE_FD_ERROR. The following example finds out whether the function was called because of an error: + +
            +Eina_Bool my_fd_cb(void *data, Ecore_Fd_Handler *handler)
            +{
            +   int fd;
            +   fd = ecore_main_fd_handler_fd_get(handler);
            +   if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR) == EINA_TRUE) 
            +   {
            +      // We have an error!
            +
            +      return ECORE_CALLBACK_CANCEL;
            +   }
            +   count = read(fd, buf, sizeof(buf)); // This is guaranteed not to block
            +
            +   return ECORE_CALLBACK_RENEW;
            +}
            +ecore_main_fd_handler_add(my_fd, ECORE_FD_READ | ECORE_FD_ERROR, my_fd_cb, my_data, NULL, NULL);
            +
            +
          • + +
          • To change the flags the handler is monitoring, use the ecore_main_fd_handler_active_set() function.
          • +
          + +

          Threads

          + +

          EFL is not entirely thread-safe. This means that if a task is running in another thread and, for example, an Evas object shows the status progress of this task, the object cannot be updated from within the thread. Updating can only be done from the main thread that runs the main loop.

          + +

          Ecore provides a facility to perform tasks on separate worker threads. It is not a simple wrapper around standard threads provided by the operating system. With Ecore threads, it is easier to dispatch a worker function to perform some heavy tasks and get the result once it completes. It does not block the application UI. It is also easy to cancel and reschedule threads. Several threads can be launched simultaneously, since Ecore schedules them according to the number of processors the system has and the maximum amount of concurrent threads set for the application.

          + +

          Ecore has 2 kinds of threads:

          +
            +
          • Short jobs do not give any kind of information on their status to the parent. They are best used for short computing-intensive snippets of code.
          • +
          • Feedback jobs give information on their status to the parent. They are best used for longer snippets requiring a feedback loop, such as an ongoing file download.
          • +
          + +

          Ecore creates a pool of worker threads. The exact count is computed from the number of CPUs or cores, or it can be specified by the application itself.

          + +

          When a worker thread is idle, it picks a job to execute from the waiting list until there is none left. In the following example, there are 2 threads defined by my_short_job() and my_feedback_job(). Both threads take 2 parameters: some data passed to them, and the actual thread running. Call a callback when the jobs end, whether they are cancelled (my_job_cancel()) or end normally (my_job_end()).

          + +
          +struct feedback_msg
          +{
          +   int pos;
          +};
          +
          +void my_short_job(void *data, Ecore_Thread *thread)
          +{
          +   usleep(200000);
          +}
          +
          +void my_feedback_job(void *data, Ecore_Thread *thread)
          +{
          +   int i;
          +   for (i = 0; i < 100; i++) 
          +   {
          +      usleep(50000); // You can have some real computation done
          +      struct feedback_msg *message = malloc(sizeof(struct feedback_msg));
          +      if (message) 
          +      {
          +         message->pos = i;
          +         ecore_thread_feedback(thread, message);
          +      }
          +      if (ecore_thread_check(thread))
          +         return;
          +   }
          +}
          +
          +void my_feedback_job_notify(void *data, Ecore_Thread *thread, void *msg)
          +{
          +   struct feedback_msg *message = msg;
          +   free(message);
          +}
          +
          +void my_job_end(void *data, Ecore_Thread *thread)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Thread has normally ended.\n");
          +}
          +
          +void my_job_cancel(void *data, Ecore_Thread *thread)
          +{
          +   dlog_print(DLOG_INFO, LOG_TAG, "Thread has been cancelled.\n");
          +}
          +
          +ecore_thread_run(my_short_job, my_job_end, my_job_cancel, my_data);
          +ecore_thread_feedback_run(my_feedback_job, my_feedback_job_notify, my_job_end, 
          +                          my_job_cancel, my_data, EINA_FALSE);
          +
          + +

          To manage threads:

          + +
            +
          • To cancel a thread, use the ecore_thread_cancel() function. However, note that this is done cooperatively: the thread continues to run until it exists. Call the ecore_thread_check() function regularly to check whether the thread has been marked for cancellation and exit if true.
          • + +
          • To run threads that are not accounted for in the worker thread pool, use the ecore_thread_feedback_run() function with the last parameter set to EINA_TRUE. + +

            The feedback message a thread sends as notification can be any kind of data. In the above example, it is a simple integer, but it can be as complex as needed.

            +
          • + +
          • To execute a thread later, use the ecore_thread_reschedule() function. This function is added to the end of the pending tasks.
          • + +
          • To get the maximum number of concurrent threads, use the ecore_thread_max_get() function. If needed, set it by using the ecore_thread_max_set() function, or reset the default value using the ecore_thread_max_reset() function.
          • + +
          • To query the number of active threads, use the ecore_thread_active_get() function. To query the number of available worker threads, use the ecore_thread_available_get() function, which is basically the same as the ecore_thread_max_get() - ecore_thread_active_get().
          • +
          + +

          Idlers

          + +

          When the rendering is done and all work is finished, the main loop enters its idle state until the next loop. You can get the functions of your application called back before the main loop enters or exits the idle state, or when it is in the idle state. They are respectively called Ecore_Idle_Enterer, Ecore_Idle_Exiter, and Ecore_Idler.

          + +

          Figure: Idle loop

          +

          Idle loop

          + +

          The idle enterers, exiters, and idlers all have the same prototype, my_idler(), which receives data and returns ECORE_CALLBACK_RENEW or ECORE_CALLBACK_CANCEL to tell Ecore whether it wants to be called again or is finished.

          + +

          To manage the idlers:

          +
            +
          • To add an idler, use the ecore_idler_add() function.
          • +
          • To delete an idler, use the ecore_idler_del() function.
          • + +
          • To add and delete idle exiters, use the ecore_idle_exiter_add() and ecore_idle_exiter_del() functions.
          • + +
          • To add and delete idle enterers, use the ecore_idle_enterer_add() and ecore_idle_enterer_del() functions. The ecore_idle_enterer_before_add() function is also available, if you want your function to be added at the top of the list so that it is called before the others.
          • +
          + +
          +Eina_Bool my_idle_enterer_cb(void *data)
          +{
          +   return ECORE_CALLBACK_RENEW;
          +}
          +
          +Eina_Bool my_idle_exiter_cb(void *data)
          +{
          +   return ECORE_CALLBACK_CANCEL;
          +}
          +
          +Eina_Bool my_idler(void *data)
          +{
          +   return ECORE_CALLBACK_RENEW;
          +}
          +
          +ecore_idle_enterer_add(my_idle_enterer_cb, my_data);
          +ecore_idle_exiter_add(my_idle_exiter_cb, my_data);
          +ecore_idler_add(my_idler_cb, my_data);
          +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/menu_tutorial_mn.htm b/org.tizen.ui.practices/html/native/efl/menu_tutorial_mn.htm new file mode 100644 index 0000000..7287e25 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/menu_tutorial_mn.htm @@ -0,0 +1,612 @@ + + + + + + + + + + + + + + Creating Mobile Menus + + + + + + +
          +

          Creating Mobile Menus

          + + +

          This tutorial shows how to add menus to the application. The example code creates an application with 3 views, which can be accessed from a menu bar at the top of the application window. The application also has a hidden menu that appears only when the menu button is pressed.

          + +

          This feature is supported in mobile applications only.

          + + +

          Defining the Menu Application Structure

          + +

          To define the application structure:

          +
            +
          1. +

            Define the main structure of the application:

            +
            +typedef struct 
            +appdata
            +{
            +   Evas_Object* win; // Main window
            +   Evas_Object* layout; // Edje layout
            +   Evas_Object* conform; // Conform
            +   Evas_Object *nf; // Naviframe to handle the views
            +   appmenu_s *menu; // Main menu
            +   appmenu_s *sidemenu; // Side menu
            +   mainview_s *main_view; // Main view (dayselector)
            +   calview_s *cal_view; // Calendar view
            +   dateview_s *date_view; // Date and time view
            +   settview_s *settings_view; // Settings view
            +   Eina_Bool sdmenu_up; // Boolean variable to keep the side menu status
            +} appdata_s;
            +
            +

            This structure contains some specific variables for the views and the menus.

            +
          2. +
          3. +

            Define the main view by using the mainview structure. It is composed of a box (the main container), a dayselector, an img image, and an lb_main label.

            +
            +typedef struct 
            +mainview
            +{
            +   Evas_Object *box; // Main container of the view
            +   Evas_Object *colorselector; // Color selector
            +   Evas_Object *img; // Image 
            +   Evas_Object *lb_day; // Label
            +} mainview_s;
            +
            +
          4. +
          5. +

            Define the date view. The date view is very similar to the main view. It contains a box, a datetime component and an lb_date label.

            +
            +typedef struct 
            +dateview
            +{
            +   Evas_Object *box; // Main container of the view 
            +   Evas_Object *datetime; // Datetime component 
            +   Evas_Object *lb_date; // Label 
            +} dateview_s;
            +
            +
          6. +
          7. +

            Define the calendar view. It contains a box, a calendar and an lb_cal label.

            +
            +typedef struct 
            +calview
            +{
            +   Evas_Object *box; // Main container of the view 
            +   Evas_Object *calendar; // Calendar component  
            +   Evas_Object *lb_cal; // Label component
            +} calview_s;
            +
            +
          8. +
          9. +

            Define the toolbar and submenu items. The main menu is fixed and visible, and the side menu is hidden on application start. These menus are represented by the appmenu structure.

            +
            +typedef struct 
            +appmenu
            +{
            +   Evas_Object *tb; // Toolbar
            +   Elm_Object_Item *submenu; // Submenu item
            +} appmenu_s;
            +
            +
          10. +
          + +

          Defining the Menus in the Application Theme

          + +

          This tutorial uses the Basic EDC UI Application template, which defines the application theme in an EDC file.

          +

          The following figure shows the application theme structure.

          + +

          Figure: Theme structure

          +

          Theme structure

          +

          The window, conformant, and layout are set by the Basic EDC UI Application template. You only need to set up the containers for the UI components and views.

          + +

          To define the application theme for the menus and views:

          +
            +
          1. +

            To define the main menu at the top of the screen, create the menu/main SWALLOW part in the .edc file.

            +

            This part has 2 descriptions, one for the real menu position at the top named up, and another that is placed out of the screen as the default position.

            +
            +part
            +{
            +   name: "menu/main";
            +   type: SWALLOW;            
            +   description 
            +   {
            +      state: "default" 0.0;
            +      rel1.relative: 0.0 1.0;
            +      rel2.relative: 1.0 1.0;
            +   }
            +   description 
            +   {
            +      state: "up" 0.0;
            +      rel1.relative: 0.0 0.01;
            +      rel2.relative: 1.0 0.18;
            +      
            +   }
            +} // End menu/main
            +
            +
          2. +
          3. +

            Create the animation,menu_main program to change the main menu state at the application start. The state is changed from default to up, and linearly moves the menu from its out-of-the-screen position to the top of the screen.

            +
            +program
            +{ 
            +   name: "animation,menu_main";
            +   source: "";
            +   signal: "load";
            +   action: STATE_SET "up" 1.0;
            +   target: "menu/main";
            +   transition: LINEAR 0.5;
            +} // END animation,menu_main
            +
            +
          4. +
          5. +

            Create another SWALLOW part as a container for the views. This part also has 2 descriptions for animation purposes.

            +
            +part 
            +{
            +   name: "view/main";
            +   type: SWALLOW;            
            +   description 
            +   {
            +      state: "default" 0.0;
            +      rel1.relative: 0.0 1.0;
            +      rel2.relative: 1.0 1.0;
            +   }
            +   description 
            +   {
            +      state: "up" 0.0;
            +      rel1.relative: 0.0 1.1;
            +      rel1.to: "menu/main";
            +      rel2.relative: 1.0 1.0;
            +      color: 0 255 0 255; 
            +   }
            +} // END view/main 
            +
            +
          6. +
          7. +

            Create the animation,view_main program to move the view along the main menu:

            +
            +program 
            +{ 
            +   name: "animation,view_main";
            +   source: "";
            +   signal: "load";
            +   action: STATE_SET "up" 1.0;
            +   target: "view/main";
            +   transition: LINEAR 0.2;
            +} // END animation,view_main
            +
            +
          8. +
          9. +

            Create the menu/side side menu container. In the default state, the side menu is hidden, and in the up state, it is shown on the left of the screen.

            +
            +part 
            +{ 
            +   name: "menu/side";
            +   type: SWALLOW;
            +   description 
            +   { 
            +      state: "default" 0.0;
            +      rel1.relative: -0.3 0.0;
            +      rel2.relative: -0.3 1.0;
            +      color: 255 0 0 255; 
            +   }
            +   description 
            +   {
            +      state: "up" 0.0;
            +      rel1.relative: 0.0 0.01;
            +      rel2.relative: 0.3 1.0;
            +     color: 255 0 0 255;
            +   }
            +} // END menu/side
            +
            +
          10. +
          11. +

            You can show the side menu by clicking the menu button.

            +

            Create the animation,menu_side program to run the related animation. This program runs when it receives a show,sidemenu event from the MenuButton source, and changes the side menu state to up, making the menu visible.

            +
            +program 
            +{ 
            +   name: "animation,menu_side";
            +   source: "MenuButton";
            +   signal: "show,sidemenu";
            +   action: STATE_SET "up" 1.0;
            +   target: "menu/side";
            +   transition: LINEAR 0.2;
            +} // END animation,menu_side
            +
            +
          12. +
          13. +

            You can hide the side menu with another menu button click.

            +

            Create the animation,menu_side,hide program that starts when it receives a hide,sidemenu signal from the MenuButton source. It changes the side menu state back to default, hiding the menu.

            +
            +program 
            +{ 
            +   name: "animation,menu_side,hide";
            +   source: "MenuButton";
            +   signal: "hide,sidemenu";
            +   action: STATE_SET "default" 1.0;
            +   target: "menu/side";
            +   transition: LINEAR 0.2;
            +} // END animation,menu_side,hide
            +
            +
          14. +
          + +

          Creating the Menu Bar and Views

          + +

          The naviframe handles views, which in this example are implemented as box containers. For more information, see the UI Container guide.

          +

          The following figure shows the structure of the view/main container.

          + +

          Figure: Main view

          +

          Main view

          + + +

          To create the menu bar and views for the UI:

          +
            +
          1. +

            Create the naviframe with the create_base_gui() function and allocate the memory to handle the views of the application:

            +
            +// Memory allocation
            +ad->main_view = calloc(1, sizeof(mainview_s)); // Allocate memory for the main view 
            +ad->cal_view = calloc(1, sizeof(calview_s)); // Allocate memory for the calendar view 
            +ad->date_view = calloc(1, sizeof(dateview_s)); // Allocate memory for the date view 
            +ad->settings_view = calloc(1, sizeof(settview_s)); // Allocate memory for the settings view
            +// END of memory allocation
            +
            +
          2. +
          3. +

            Use the app_terminate() function to free the memory for the views and menus:

            +
            +app_terminate(void *data)
            +{
            +   // Release all resources
            +   appdata_s *ad = data;
            +
            +   free(ad->menu);
            +   free(ad->sidemenu);
            +   free(ad->main_view);
            +   free(ad->cal_view);
            +   free(ad->settings_view);
            +} // END of app_terminate
            +
            +
          4. +
          5. +

            Create the main menu after most of the containers are created:

            +
              +
            1. +

              Create a new _build_main_menu() function that takes appdata_s as a parameter. This function is called by the create_base_gui() function.

              +
              +static void 
              +_build_main_menu(appdata_s *ad)
              +{
              +   // Memory allocation for the main menu function
              +   appmenu_s *menu = calloc(1, sizeof(appmenu_s));
              +   // Put the main menu in the application data
              +   ad->menu = menu;
              +
              +
            2. + +
            3. +

              Create a toolbar with the elm_toolbar_add() function. This toolbar is a child of the main window. Set ad->win as its parameter.

              +
              +   // Create the main menu toolbar
              +   menu->tb = elm_toolbar_add(ad->win);
              +
              +
            4. +
            5. +

              Set up the behavior of the toolbar.

              +

              The display mode is set by using the elm_toolbar_shrink_mode_set() function. The toolbar does not scroll under the #ELM_TOOLBAR_SHRINK_NONE mode, but it enforces a minimum size, so that all the items fit inside it. It does not scroll or show the items that do not fit under the #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it scrolls under the #ELM_TOOLBAR_SHRINK_SCROLL mode, and it creates a button to aggregate items which did not fit with the #ELM_TOOLBAR_SHRINK_MENU mode.

              +
              +   // Set the "Menu" Toolbar properties
              +   elm_toolbar_shrink_mode_set(menu->tb, ELM_TOOLBAR_SHRINK_NONE);
              +
              +

              In this example, there is only a limited number of menu elements and the ELM_TOOLBAR_SHRINK_NONE mode is used.

            6. +
            7. +

              Expand the transverse length of the item according to the transverse length of the toolbar, giving EINA_TRUE as second parameter of the elm_toolbar_transverse_expanded_set() function.

              +
              +   elm_toolbar_transverse_expanded_set(menu->tb, EINA_TRUE);
              +
              +
            8. +
            9. +

              Make the menu items have the same size by setting EINA_TRUE to the elm_toolbar_homogeneous_set() function. This activates the homogeneous mode of the toolbar.

              +
              +   elm_toolbar_homogeneous_set(menu->tb, EINA_FALSE);
              +
              +
            10. +
            11. +

              Add menu items to the toolbar using the elm_toolbar_item_append() functions. It takes 5 parameters:

              +
                +
              • Target toolbar
              • +
              • Icon path for the menu item
              • +
              • Item label (also used in the callback function)
              • +
              • Function to call when the item is clicked
              • +
              • Data to associate with the item for related callbacks.
              • +
              +
              +   // Add menu items to the main menu toolbar
              +   elm_toolbar_item_append(menu->tb, ICON_DIR"/home.png", "Home", _menu_item_selected_cb, ad);
              +   elm_toolbar_item_append(menu->tb, ICON_DIR"/calendar.png", "Calendar", _menu_item_selected_cb, ad);
              +   elm_toolbar_item_append(menu->tb, ICON_DIR"/clock.png", "Date", _menu_item_selected_cb, ad);
              +   elm_toolbar_item_append(menu->tb, ICON_DIR"/settings.png", "Settings", _menu_item_selected_cb, ad);
              +
              +

              For the icons, add some images in the res/images application resource directory, and define a macro to contain this path in the application .h file. In this example, it is inc/menututorial.h.

              +

              Use the PACKAGE macro to setup this ICON_DIR macro. This way you can add items to the toolbar using icon images placed in the resource directory of the application.

              + +
              +#define ICON_DIR "/opt/usr/apps/"PACKAGE"/res/images"
              +
              +
            12. +
            13. Show the toolbar and add the UI component to the main menu container: +
              +   // Show the UI component
              +   evas_object_show(menu->tb);
              +
              +   // Add the UI component to the "menu/main" SWALLOW container
              +   elm_object_part_content_set(ad->layout, "menu/main", menu->tb);
              +
              +   // Set the default view 
              +   elm_toolbar_item_selected_set(elm_toolbar_first_item_get(menu->tb), EINA_TRUE);
              +}
              +
              +
            +
          6. +
          7. +

            Enable switching between views based on the menu item selection.

            + +

            When a menu item is selected, the _menu_item_selected_cb() callback is triggered. In this example, this same callback is used for all menu items. However, you can also create a separate callback for each item.

            + +

            The callback must follow the Evas_Smart_Cb prototype that takes the application data, Evas Object, and event info as parameters.

            + +

            In this example, the callback creates the requested view by recovering the calling object text to call the correct view creation function. The available views are Calendar, Date, Settings, and Home (main view). The view names are stored as the menu item labels, to be able to compare the returned string with the view names. When the name matches, the view is built by calling the correct function. Store the view in the application data and set up a new content to the naviframe before exiting.

            + +

            The naviframe component destroys its content on each call of the elm_object_content_set() function. That is why the content must be built again on each item click.

            +
            +it = ev;
            +
            +// Get the menu item text
            +str = elm_object_item_text_get(it);
            +
            +// Compare with the possible view names
            +if (!strcmp(str, "Calendar")) 
            +{
            +   // Build the "Calendar View"
            +   _build_calendar_view(ad);
            +   // Set the view from the application data
            +   view = ad->cal_view->box;
            +}
            +else if (!strcmp(str, "Date")) 
            +{
            +   // Build the "Date View"
            +   _build_date_view(ad);
            +   // Set the view from the application data
            +   view = ad->date_view->box;
            +}
            +else if (!strcmp(str, "Home")) 
            +{
            +   // Build the "Home or main View"
            +   _build_main_view(ad);
            +   // Set the view from the application data
            +   view = ad->main_view->box;
            +}
            +else if (!strcmp(str, "Settings")) 
            +{
            +   // Build the "Settings" view
            +   _build_settings_view(ad);
            +   // Set the view from the application data
            +   view = ad->settings_view->box;
            +}
            +else if (!strcmp(str, "Clock")) 
            +{
            +   // Build the "Date View" 
            +   _build_date_view(ad);
            +   // Set the view from the application data
            +   view = ad->date_view->box;
            +}
            +
            +// Show the view in the naviframe 
            +elm_object_content_set(ad->nf, view);
            +
            +
          8. +
          9. +

            Define the functions which create the views. Each function creates a view and stores it in the application data.

            +
            +static void 
            +_build_main_view(appdata_s *ad)
            +{
            +   mainview_s *view = ad->main_view;
            +   char buf[PATH_MAX];
            +
            +   // Main box
            +   view->box = elm_box_add(ad->nf);
            +   elm_box_horizontal_set(view->box, EINA_FALSE);
            +   elm_box_homogeneous_set(view->box, EINA_TRUE);
            +
            +   view->colorselector = elm_colorselector_add(view->box);
            +   elm_colorselector_mode_set(view->colorselector, ELM_COLORSELECTOR_PALETTE);
            +   elm_box_pack_start(view->box, view->colorselector);
            +   evas_object_show(view->colorselector);
            +
            +   view->img = elm_image_add(view->box);
            +   evas_object_size_hint_weight_set(view->img, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_align_set(view->img, 0.5, 0.5);
            +   evas_object_size_hint_min_set(view->img, 256, 256);
            +   ;snprintf(buf, sizeof(buf), "%s/%s", ICON_DIR, "tizen-logo.png");
            +   if (!elm_image_file_set(view->img, buf, NULL))
            +      elm_object_text_set(view->lb_day, "Problem loading image");
            +   elm_box_pack_start(view->box, view->img);
            +   evas_object_show(view->img);
            +
            +   view->lb_day = elm_label_add(view->box);
            +   elm_object_text_set(view->lb_day, "Main view");
            +   evas_object_size_hint_weight_set(view->lb_day, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_box_pack_end(view->box, view->lb_day);
            +   evas_object_show(view->lb_day);
            +}
            +
            +static void
            +_build_calendar_view(appdata_s *ad)
            +{
            +   calview_s *view = ad->cal_view;
            +
            +   // Main box image = elm_image_add(win);
            +
            +   view->box = elm_box_add(ad->nf);
            +   elm_box_horizontal_set(view->box, EINA_FALSE);
            +   elm_box_homogeneous_set(view->box, EINA_TRUE);
            +
            +   view->calendar = elm_image_add(ad->nf);
            +   evas_object_size_hint_weight_set(view->calendar, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_size_hint_align_set(view->calendar, 0.5, 0.5);
            +   evas_object_size_hint_min_set(view->calendar, 256, 256);
            +   elm_image_file_set(view->calendar, ICON_DIR"/calendar.png", NULL);
            +   elm_box_pack_start(view->box, view->calendar);
            +   evas_object_show(view->calendar);
            +
            +   view->lb_cal = elm_label_add(view->box);
            +   elm_object_text_set(view->lb_cal, "The calendar view");
            +   evas_object_size_hint_weight_set(view->lb_cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   elm_box_pack_end(view->box, view->lb_cal);
            +   evas_object_show(view->lb_cal);
            +} // End of_build_calendar_view
            +
            + +
          10. +
          + +

          Creating a Hidden Menu

          + +

          To create a hidden menu:

          +
            +
          1. +

            Define the _build_side_menu() function to create the side menu toolbar and add some items to it. This function takes the application data as parameter and stores the built menu in the sidemenu attribute of the structure.

            +
            +static void 
            +_build_side_menu(appdata_s *ad)
            +{
            +   appmenu_s *sidemenu = calloc(1, sizeof(appmenu_s));
            +   ad->sidemenu = sidemenu;
            +
            +   sidemenu->tb = elm_toolbar_add(ad->win);
            +
            +   elm_toolbar_shrink_mode_set(sidemenu->tb, ELM_TOOLBAR_SHRINK_EXPAND);
            +   elm_toolbar_transverse_expanded_set(sidemenu->tb, EINA_TRUE);
            +
            +   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/home.png", "Home", _menu_item_selected_cb, ad);
            +   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/account.png", "Account", NULL, NULL);
            +   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/contacts.png", "Friends", NULL, NULL);
            +   elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/clock.png", "Clock", _menu_item_selected_cb, ad);
            +   elm_toolbar_homogeneous_set(sidemenu->tb, EINA_FALSE);
            +   evas_object_show(sidemenu->tb);
            +   elm_object_part_content_set(ad->layout, "menu/side", sidemenu->tb);
            +   elm_toolbar_horizontal_set(sidemenu->tb, EINA_FALSE);
            +   elm_toolbar_item_selected_set(elm_toolbar_first_item_get(sidemenu->tb), EINA_TRUE);
            +}
            +
            +

            The side menu is created, but hidden by default. To make it appear, the menu (Home) button must be clicked.

            +
          2. +
          3. +

            Create the hidden menu functionality.

            +

            By default, the Basic EDC UI Application template creates a keydown_cb() function to handle the key down events. In the create_base_gui() function, an ecore_event_handler_add() function is called with the ECORE_EVENT_KEY_DOWN macro and with the keydown_cb() function as a callback. In this callback, the KEY_END event puts the window in the lower state.

            +
            +keydown_cb(void *data , int type , void *event)
            +{
            +   appdata_s *ad = data;
            +   Ecore_Event_Key *ev = event;
            +   if (!strcmp(ev->keyname, KEY_END)) 
            +   {
            +      // Let window go to hidden state
            +      elm_win_lower(ad->win);
            +   }
            +
            +   return ECORE_CALLBACK_DONE;
            +}
            +
            +
          4. +
          5. +

            Add the menu button key press handling to the keydown_cb() callback. The key name of the menu button is XF86Send. The menu is shown on the first press and hidden on the second press. Use Eina_Bool sdmenu_up on the application data to store the menu status during the application execution. If ad->sdmenu_up is EINA_TRUE, the menu is visible.

            + +

            The animation,menu_side program is defined in the .edc theme file. This program is run when the show,sidemenu signal is received from the MenuButton source. In addition, the program that hides the side menu is defined and is called animation,menu_side,hide, starting on the hide,sidemenu signal.

            + +

            Test the side menu status by sending the signals using the elm_object_signal_emit() function.

            +
            +if (!strcmp(ev->keyname, "XF86Send")) 
            +{
            +   if (ad->sdmenu_up == EINA_TRUE) 
            +   {
            +      // If the menu is visible send a "hide,sidemenu" signal
            +      elm_object_signal_emit(ad->layout, "hide,sidemenu", "MenuButton");
            +      // Store the new menu status (hidden)
            +      ad->sdmenu_up = EINA_FALSE;
            +   }
            +}
            +
            +

            Now the menu appears and disappears when the menu button is pressed.

            +
          6. +
          7. +

            When the user clicks the first side menu button (Home), the menu disappears:

            +
            +// Hide the side menu if it's visible
            +if (ad->sdmenu_up == EINA_TRUE) 
            +{
            +   elm_object_signal_emit(ad->layout, "hide,sidemenu", "MenuButton");
            +      ad->sdmenu_up = EINA_FALSE;
            +}
            +
            +
          8. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/multiple_screens_n.htm b/org.tizen.ui.practices/html/native/efl/multiple_screens_n.htm new file mode 100644 index 0000000..04b31e6 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/multiple_screens_n.htm @@ -0,0 +1,259 @@ + + + + + + + + + + + + + Multiple Screen Support + + + + + +
          + +

          Multiple Screen Support

          + +

          Tizen is available in various devices which support different screen sizes and resolutions. When developing Tizen applications, you must take this into account if you want your application to function well in various device models.

          +

          Before implementing multiple screen support, make sure you are familiar with the key concepts of multiple screen support.

          + +

          Key Concepts

          +

          Before building a native application for multiple resolutions using Tizen native UI framework, make sure you are familiar with the following concepts:

          + + +

          Multi-scale in Tizen Native UI Framework

          +

          Tizen native UI framework supports multiple scaling. If the application is implemented considering scalability, it is enough to change the elm_scale value in different device environments without modifying the application code.

          + +

          Scale 1.0 in Tizen native UI framework means that the application is displayed in a set size and is not scaled. Scale 1.0 is used in a display environment, such as a desktop. In the desktop environment, the monitor has a resolution between 1280 x 800 and 1920 x 1080, with a size between 20 and 27 inch, and the dpi between 80 and 100.

          + +

          If an application is scaled up or down after implementing it in a desktop environment, it can be used in another device without modifying the code. Each device has a proper scale value for adjusting the application size. Edje, which handles layout and themes in Tizen native UI framework, gets the size of an object by multiplying the size specified by an application using the scale value.

          + +

          The following figure illustrates a 50 px wide object in a 1280 px wide monitor. If the same object is displayed with not scaling in mobile environment, it looks very small. To show the object in mobile environment in the similar size as in the monitor, define the scale is 2.0, so that the object size is 100 px instead of 50 px.

          + +

          Figure: Scaling from desktop to mobile

          +

          Scaling from desktop to mobile

          + +

          Base Scale

          +

          The object scaling must be defined in the config.xml file of this application to show the application in a proper size in other devices. However, the scaling must be based on scale 1.0 or, if the application is based on another scale, this scale must be defined in the config.xml file. This predefined scale is called the "base scale".

          + +

          The size of a scalable object is multiplied with the device scale value, as illustrated in the following figure. If the scalable object (on the left) with the size 10 is created in a device with scale 1.0, the size of the object is 20 in a device with scale 2.0, and 40 in a device with scale 4.0.

          + +

          Figure: Base scale

          +

          Base scale

          + +

          The middle object has a base scale 2.0. The following example shows its scaling in a device with scale 4.0:

          + + + + + + + +
          Scale = Device scale (information in the target) / Base scale (information in the application) +

          For example: 2.0 = 4.0 / 2.0

          +
          + + +

          Applying the Base Scale

          +

          To create an application that supports multiple screen sizes, you must learn how to set the base scale in:

          + + +

          Calculating the Base Scale

          + +

          To get the base scale value of your own display, you must know the DPI of the display. Based on the display DPI, you can calculate the base scale, since it is basically proportional to the display DPI with the following formula:

          + +
          +base_scale = (DPI / 90) * profile_factor
          + +

          The profile factor is the value for fitting the object size as a profile. The distance between the user eye and the display differs for each profile. This means that the object size must be different if the device display is changed.

          + +

          The following table lists the profile factors for various profiles.

          + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Profile factors
          ProfileProfile factor
          Wearable0.4
          Mobile - small screen (until 4.4 inch)0.7
          Mobile - normal screen (4.5 inch and upwards)0.8
          Desktop1.0
          + +

          For example, if your display has 233 dpi and the platform uses the mobile profile (small screen), the base scale is calculated like this:

          +
          +1.8 = (233 / 90) * 0.7
          + +

          The base scale of the device is 1.8. If the application is made in the environment using 233 dpi and mobile profile, its base scale must be set to 1.8. For a desktop, the DPI is 90, and its base scale is 1.0.

          + + +

          Setting the Base Scale in EDC

          +

          The application must specify the scale its base scale. The edje objects are scaled properly if the base scale is set in the collection of the edc file, as in the following example:

          + + + + + + + + +
          Note
          The base scale for WVGA is 1.8, and for HD application, 2.4.
          +
          collections 
          +{
          +   base_scale: 1.8; // This value is for WVGA application
          +   parts 
          +   {
          +      part 
          +      {
          +         name: "box"; 
          +         type: RECT;
          +         min: 100 100;
          +         scale: 1;
          +      }
          +   }
          +}
          +
          +

          Setting the Base Scale in C

          +

          The size of the object must be specified in EDC. However, sometimes it is better for an application to the object size in a C file. If the size is defined with no scaling in the C file, the application is displayed in the same size even if the scale changes. To avoid this, use the ELM_SCALE_SIZE macro, as in the following example:

          + +
          #define ELM_SCALE_SIZE(x) x / elm_app_base_scale_get() * elm_config_scale_get()
          + +

          in the definition, the size (x) is changed to a size based on 1.0 (x/elm_app_base_scale_get()) and it is multiplied with the scale of the current target (elm_config_scale_get()).

          + +

          Set the base scale using the elm_app_base_scale_set() function:

          + +
          int app_create(void *data)
          +{
          +   elm_app_base_scale_set(1.8); // This value is for WVGA application
          +}
          +
          +

          After setting the base scale, use the ELM_SCALE_SIZE macro to set the size of an object in the application:

          + +
          evas_object_size_hint_min_set(object, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(100));
          +evas_object_resize(object, ELM_SCALE_SIZE(50), ELM_SCALE_SIZE(50));
          +
          + +

          You can use ELM_SCALE_SIZE macro in any API related with setting objects sizes in Tizen native applications.

          + +

          Scaling without the Base Scale

          + +

          In Tizen, each device has a scale value in proportion to the display. If scaling is enabled, the objects are drawn on the display by multiplying with the user-defined object size and the device scale. If the base scale is set, the objects are drawn by dividing the user-defined object size with the base scale and multiplying it by the device scale.

          + +

          If you use the scale feature without setting the base scale, the result is the same as if you set the base scale to 1.0. Then you do not need to care about the base scale variables, because the pixels roll like a virtual pixel. For example, if you set 1 pixel in 129 dpi without setting the base scale value, the 1 pixel before scaling is equivalent to 1 real physical pixel after scaling. In case of 233 dpi, it is the same with 1.8 pixels after scaling.

          + +

          Always consider the pixel before scaling when defining the application UI, in order to ensure a proper UI display on the screen with a diversity of densities.

          + +
          int app_create(void *data)
          +[ Conversion Formula ]
          +Real physical pixel = (a pixel before scaling) x (dpi / 90) x 0.7
          +
          +

          Where 90 is the default DPI on a desktop and 0.7 is the mobile profile factor.

          + +

          The following table shows some examples.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Pixel conversions
          BaseLow-density device (such as WVGA, 4 inch)High-density device (such as HD, 5 inch)
          DPI129233294
          A pixel before scaling100100100
          Real physical pixel100180260
          Actual base scale1.01.82.6
          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/multipoint_touch_n.htm b/org.tizen.ui.practices/html/native/efl/multipoint_touch_n.htm new file mode 100644 index 0000000..9289034 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/multipoint_touch_n.htm @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + Tracking Multi-point Touch Events + + + + + + +
          +

          Tracking Multi-point Touch Events

          + + +

          This tutorial demonstrates how you can use the Evas_Object to paint on a canvas and track touch events.

          + +

          Initializing Multi-point Touch

          + +

          This sample is a fully functional application able to track multiple simultaneous clicks. For every click, a black rectangle spot is drawn on the screen. This way it is easy to test the multi-point touch operation with the application.

          + +

          Initialization is implemented in the multitouch.c file.

          +

          The appdata structure includes Evas_Object pointers, a list, and a Boolean flag.

          +
          +typedef struct appdata 
          +{
          +   Evas_Object *win;
          +   Evas_Object *conform;
          +   Evas_Object *nf;
          +   Evas_Object *button;
          +   Evas_Object *box;
          +   Evas_Object *rect;
          +   Evas_Object *label;
          +
          +   // List of mouse spots
          +   Eina_List *spots;
          +
          +   // Flag for checking the mouse down event
          +   Eina_Bool down; 
          +} 
          +appdata_s;
          +
          + +

          The main() function initializes event callbacks and calls the ui_app_main() function to start the EFL application.

          +
          +int
          +main(int argc, char *argv[])
          +{
          +   appdata_s *ad = {0,};
          +   int ret = 0;
          +
          +   ui_app_lifecycle_callback_s event_callback = {0,};
          +   app_event_handler_h handlers[5] = {NULL,};
          +
          +   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;
          +
          +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
          +   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
          +
          +   ret = ui_app_main(argc, argv, &event_callback, &ad);
          +
          +   return ret;
          +}
          +
          + + +

          The following figure illustrates the Multi-point Touch.

          + +

          Figure: Multi-point Touch screens

          +

          Multi-point Touch screens

          + +

          Handling the Canvas

          + +

          The create_base_gui() function creates base GUI elements including Naviframe and the Naviframe button. Naviframe includes each view screen as an item, which in turn includes the title and a button which clears spots when clicked.

          + +
          static void
          +create_base_gui(appdata_s *ad)
          +{
          +   Elm_Object_Item *nf_it;
          +
          +   // Naviframe
          +   ad->nf = elm_naviframe_add(ad->conform);
          +   elm_object_content_set(ad->conform, ad->nf);
          +   evas_object_show(ad->nf);
          +
          +   // Button
          +   ad->button = elm_button_add(ad->nf);
          +   elm_object_text_set(ad->button, "Clear");
          +   evas_object_smart_callback_add(ad->button, "clicked", button_clicked_cb, ad);
          +
          +   // Create main view
          +   ad->box = create_main_view(ad);
          +   nf_it = elm_naviframe_item_push(ad->nf, "Multi-point Touch",
          +                                   NULL, NULL, ad->box, NULL);
          +   elm_object_item_part_content_set(nf_it, "title_right_btn", ad->button);
          +} 
          +
          + +

          The create_main_view() function creates the main view including the label and an event rectangle.

          +

          The label displays information on mouse event status and coordinates (x, y positions). The event rectangle is received completely through mouse (touch) events. To show 2 elements in a Naviframe content area, a container combining those elements is necessary. A box container functions in that role. The label and rectangle pack end the box and the box is embedded into the Naviframe content area.

          + +
          static Evas_Object *
          +create_main_view(appdata_s *ad)
          +{
          +   Evas_Object *box;
          +
          +   // Box
          +   box = elm_box_add(ad->nf);
          +   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   evas_object_show(box);
          +
          +   // Label
          +   ad->label = elm_label_add(box);
          +   elm_object_text_set(ad->label, "None");
          +   evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, 0);
          +   evas_object_size_hint_align_set(ad->label, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +   evas_object_repeat_events_set(ad->label, EINA_TRUE);
          +   elm_box_pack_end(box, ad->label);
          +   evas_object_show(ad->label);
          +
          +   // Event Rect
          +   ad->rect = evas_object_rectangle_add(evas_object_evas_get(box));
          +   evas_object_size_hint_weight_set(ad->rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   evas_object_size_hint_align_set(ad->rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +   evas_object_color_set(ad->rect, 204, 204, 204, 255);
          +   evas_object_repeat_events_set(ad->rect, EINA_TRUE);
          +   elm_box_pack_end(box, ad->rect);
          +   evas_object_show(ad->rect);
          +}
          +
          + +

          The create_spot() function creates a rectangle, resizes the rectangle according to received size input, and moves the rectangle according to received coordinates (x, y positions) input.

          + +
          Evas_Object *
          +create_spot(Evas_Object *parent, Evas_Coord x, Evas_Coord y, int size)
          +{
          +   Evas_Object *spot;
          +   spot = evas_object_rectangle_add(evas_object_evas_get(parent));
          +   evas_object_resize(spot, size, size);
          +   // Adjust x, y positions to be center of object
          +   evas_object_move(spot, x - (size/2), y - (size/2));
          +   evas_object_show(spot);
          +
          +   return spot;
          +}
          +
          + +

          The rectangle object is stored in Eina_List (ad->spots) for managing other functions. The button_clicked_cb() function removes all evas_objects into the ad->spots list, meaning all spot rectangles are cleared.

          + +
          static void
          +button_clicked_cb(void *data, Evas *evas, Evas_Object *object, void *event_info)
          +{
          +   appdata_s *ad = data;
          +   Evas_Object *spot;
          +
          +   EINA_LIST_FREE(ad->spots, spot)
          +   {
          +      evas_object_del(spot);
          +      spot = NULL;
          +   }
          +   elm_object_text_set(ad->label, "Clear");
          +}
          +
          + +

          Managing Touch Events

          + +

          On the bottom of the create_main_view() function, event callbacks are added to the event rectangle. An event callback is added using the evas_object_event_callback_add() function.

          + +

          The following touch event types are supported:

          +
            +
          • EVAS_CALLBACK_MOUSE_DOWN: This event is called when the given object receives the mouse down event.
          • +
          • EVAS_CALLBACK_MOUSE_UP: This event is called when the given object receives the mouse up event.
          • +
          • EVAS_CALLBACK_MOUSE_MOVE: This event is called when the given object receives the mouse move event.
          • +
          • EVAS_CALLBACK_MULTI_DOWN: This event is called when the given object has already received the mouse down event and receives the multi-mouse down event.
          • +
          • EVAS_CALLBACK_MULTI_UP: This event is called when the given object receives the multi-mouse up event.
          • +
          • EVAS_CALLBACK_MULTI_MOVE: This event is called when the given object receives the multi-mouse move event.
          • +
          +

          If the given object receives a mouse event, a callback function is called, and event information, such as coordinates (x, y positions) is passed. The mousemove_cb() function sets the mouse status, positions text in the label, and draws a spot rectangle. To distinguish down and up positions, set different colors for the down and up rectangles.

          + +
          +static void
          +mousemove_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
          +{
          +   appdata_s *ad = data;
          +   Evas_Object *spot;
          +   char buf[1024];
          +   Evas_Event_Mouse_Move *ev = event_info;
          +   Evas_Coord x = ev->cur.canvas.x;
          +   Evas_Coord y = ev->cur.canvas.y;
          +   int size = (int) 5 * elm_config_scale_get();
          +
          +   if (!ad->down)
          +      return;
          +
          +   snprintf(buf, sizeof(buf), "Mouse Move, %d, %d", x, y);
          +   elm_object_text_set(ad->label, buf);
          +
          +   // Draw spot on event position
          +   spot = create_spot(ad->rect, x, y, size);
          +   evas_object_color_set(spot, 0, 0, 0, 255);
          +   ad->spots= eina_list_append(ad->spots, spot);
          +}
          +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/naviframe_tutorial_n.htm b/org.tizen.ui.practices/html/native/efl/naviframe_tutorial_n.htm new file mode 100644 index 0000000..f3de69b --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/naviframe_tutorial_n.htm @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + Creating a Naviframe for Navigation + + + + + + +
          +

          Creating a Naviframe for Navigation

          + +

          Naviframes are containers useful for implementing interfaces where several screens have a previous/next relationship.

          + +

          This tutorial shows a UI with 3 naviframes. Each naviframe is made of 20 screens, each made up of a label with the text label<n>, a title with the same text, and the Previous and Next buttons, which are used to navigate between the screens.

          +

          The naviframe is "one-way". This means that elements are added, and when the Previous button is clicked, they are removed, and there is no Next button by default. To add the Next button, define a structure that holds the naviframe object along with a stack of the elements that the user has popped by using the Previous button.

          +

          You can also create the elements on the fly each time the Next button is pressed. Both approaches are valid.

          + +

          To create a naviframe:

          +
            +
          1. Create a naviframe_zipper structure:

            +
            +// NOTE: A zipper is a data structure for an ordered set of elements and a
            +// cursor in this set, meaning there are elements before the cursor (which are
            +// stored inside the naviframe) and after (which are stored in the "popped" list
            +struct 
            +naviframe_zipper 
            +{
            +   Evas_Object *naviframe;
            +   Eina_List *popped;
            +};
            +
            +
          2. +
          3. Create a function that factors the creation of several naviframes and initializes the naviframe_zipper structure:

            +
            +static struct naviframe_zipper *
            +_naviframe_add(Evas_Object *parent)
            +{
            +   struct naviframe_zipper *z = malloc(sizeof(struct naviframe_zipper));
            +   z->naviframe = elm_naviframe_add(parent);
            +   z->popped = NULL;
            +
            +   evas_object_size_hint_weight_set(z->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(z->naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_show(z->naviframe);
            +   // By default, objects are destroyed when they are popped from the naviframe
            +   // To save and reuse them, enable "preserve_on_pop"
            +   elm_naviframe_content_preserve_on_pop_set(z->naviframe, EINA_TRUE);
            +
            +   return z;
            +}
            +
            +
          4. +
          5. +

            Create the buttons that are at the top of the naviframe and allow the user to go back and forth between the screens. The naviframe component builds a Previous button by default, but you can create your own buttons as well. The naviframe has a specific slot for the Next button.

            +
            +// Save the element that is popped from the naviframe
            +static void
            +_naviframe_prev(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
            +{
            +   struct naviframe_zipper *z = data;
            +   z->popped = eina_list_prepend(z->popped, elm_naviframe_item_pop(z->naviframe));
            +}
            +
            +// Set the first element after the current one available and push it to the naviframe
            +static void
            +_naviframe_next(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
            +{
            +   struct naviframe_zipper *z = data;
            +   Evas_Object *label, *prev, *next;
            +   const char *text;
            +   Elm_Object_Item *it;
            +
            +   label = eina_list_data_get(z->popped);
            +   z->popped = eina_list_remove_list(z->popped, z->popped);
            +   if (label != NULL) 
            +   {
            +      // UI component is saved inside the naviframe but nothing more 
            +      // You need to create new buttons and set the title text again 
            +      // (copy the one from the label that is saved)
            +      text = elm_object_text_get(label);
            +      // _button function creates a button which is
            +      // either Previous (-1) or Next (1)
            +      prev = _button(z, -1);
            +      next = _button(z, 1);
            +      it = elm_naviframe_item_push(z->naviframe, text, prev, next, label, NULL);
            +   }
            +}
            +
            +
          6. +
          7. +

            Populate the naviframe when the naviframe and the pages that go inside it are built.

            +

            Remember that 3 naviframes are created, each populated in a different way. The common bits have been factored out as a function and the specific parts are executed through a callback. The generic function is shown in the following example.

            +
            +// Generic naviframe-populate function:
            +// Its third (and last) parameter is a callback for customization. It pushes
            +// the new items to a specific position and returns a "context" value that is
            +// used between its calls and enables behaviors such as "push after the
            +// previously pushed item" 
            +static struct naviframe_zipper*
            +_naviframe_populate_gen(Evas_Object *parent, const char *id,
            +                        void * (*populate_cb) (Evas_Object *nav, const char *title, Evas_Object
            +                        *prev, Evas_Object *next, Evas_Object *label, Elm_Object_Item *context))
            +{
            +   struct naviframe_zipper *z;
            +   Evas_Object *label, *prev, *next;
            +   Elm_Object_Item *context = NULL;
            +   char buf[256];
            +   int i;
            +
            +   z = _naviframe_add(parent);
            +
            +   for (i = 0; i < 20; i++) 
            +   {
            +      label = elm_label_add(z->naviframe);
            +      snprintf(buf, sizeof(buf), "%s [%d]", id, i);
            +      elm_object_text_set(label, buf);
            +      evas_object_show(label);
            +      evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +      evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +      // _button function creates a button which is
            +      // either Previous (-1) or Next (1)
            +      prev = _button(z, -1);
            +      next = _button(z, 1);
            +      // Use the populate_cb callback to provide the customization of the way the
            +      // elements are added inside the naviframe
            +      context = populate_cb(z->naviframe, buf, prev, next, label, context);
            +   }
            +
            +   return z;
            +}
            +
            +

            The prototype of the callbacks is fairly large, but that is because of the syntax for callbacks in C.

            +
            +// Push items one after the other
            +static Elm_Object_Item *
            +_populate_cb__push(Evas_Object *nav, const char *title,
            +                   Evas_Object *prev, Evas_Object *next, Evas_Object *label,
            +                   Elm_Object_Item *context)
            +{
            +   return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
            +}
            +
            +// Push items one after the other but use insert_after
            +static Elm_Object_Item *
            +_populate_cb__push_then_insert_after(Evas_Object *nav, const char *title,
            +                                     Evas_Object *prev, Evas_Object *next, Evas_Object *label,
            +                                     Elm_Object_Item *context)
            +{
            +   if (context == NULL) 
            +   {
            +      return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
            +   }
            +   else 
            +   {
            +      return elm_naviframe_item_insert_after(nav, context, title, prev, next, label, NULL);
            +   }
            +}
            +
            +// Push one item and repeatedly insert new items before the last inserted item
            +static Elm_Object_Item *
            +_populate_cb__push_then_insert_before(Evas_Object *nav, const char *title,
            +                                      Evas_Object *prev, Evas_Object *next, Evas_Object *label,
            +                                      Elm_Object_Item *context)
            +{
            +   if (context == NULL) 
            +   {
            +      return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
            +   }
            +   else 
            +   {
            +      return elm_naviframe_item_insert_before(nav, context, title, prev, next, label, NULL);
            +   }
            +}
            +
            +
          8. +
          9. +

            Create a window with a vertical box, which holds the 3 naviframes from the Appcore's app_create callback.

            + +
            +static bool
            +_app_create(void *data)
            +{
            +   Evas_Object *w, *box;
            +   struct naviframe_zipper *z;
            +
            +   w = elm_win_util_standard_add("Naviframe Test", "Naviframe Test");
            +
            +   box = elm_box_add(w);
            +   elm_box_horizontal_set(box, EINA_FALSE);
            +   elm_box_homogeneous_set(box, EINA_TRUE);
            +   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +   evas_object_show(box);
            +   elm_win_resize_object_add(w, box);
            +
            +   z = _naviframe_populate_gen(w, "Before", _populate_cb__push_then_insert_before);
            +   elm_box_pack_end(box, z->naviframe);
            +
            +   z = _naviframe_populate_gen(w, "After", _populate_cb__push_then_insert_after);
            +   elm_box_pack_end(box, z->naviframe);
            +
            +   z = _naviframe_populate_gen(w, "Push", _populate_cb__push);
            +   elm_box_pack_end(box, z->naviframe);
            +
            +   evas_object_show(w);
            +}
            +
            +
          10. +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/notification_window_n.htm b/org.tizen.ui.practices/html/native/efl/notification_window_n.htm new file mode 100644 index 0000000..6c0fbff --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/notification_window_n.htm @@ -0,0 +1,426 @@ + + + + + + + + + + + + + Notification Windows: Supporting Notification Levels, Screenshots, and Input Generators + + + + + +
          + +

          Notification Windows: Supporting Notification Levels, Screenshots, and Input Generators

          + +

          The EFL UTIL utility package supports the following EFL functionalities:

          + + + + +

          Notification Window and Level

          + +

          The EFL UTIL API allows you to set and get the notification level of the notification window (which is of the EFL window type):

          + +
          • efl_util_set_notification_window_level()
          • +
          • efl_util_get_notification_window_level()
          + +

          To understand notification levels, you must first learn about the Tizen window layer hierarchy. Window layers are logical containers used to control the window stack order. Each window belongs to 1 layer and can change the stack order in the layer. Windows in same layer are always placed on or under a window in another layer. In addition to the default "normal layer", there exists a "notification layer", which is always placed above the normal layer.

          + + +

          Figure: Window layers

          +

          Window layers

          + + +

          Each window is set to a specific layer according to its type or properties. Most application windows belong to the normal layer. However, in case of an important alarm or other information crucial to the user, you can set the window to belong to the notification layer. This ensures that the user notices the information immediately, because the window belonging to the notification layer is always shown above the windows in the normal layer.

          + +

          Using the Notification Windows

          + +

          A window that belongs to the notification layer is called a "notification window". To make a notification window:

          + +
          1. Set the window type to NOTIFICATION, by calling the elm_win_add() function with the third parameter set to ELM_WIN_NOTIFICATION.
          2. +
          3. Set the notification level by calling the efl_util_set_notification_window_level() function. +

            The notification level defines the priority of the window, and the notification layer contains 3 levels (EFL_UTIL_NOTIFICATION_LEVEL_1, EFL_UTIL_NOTIFICATION_LEVEL_2, and EFL_UTIL_NOTIFICATION_LEVEL_3).

            +

            The default notification window level is EFL_UTIL_NOTIFICATION_LEVEL_1. Most of notification windows can be set to this level. The EFL_UTIL_NOTIFICATION_LEVEL_2 is a higher level than EFL_UTIL_NOTIFICATION_LEVEL_1, which means that the window set to EFL_UTIL_NOTIFICATION_LEVEL_2 is always on the EFL_UTIL_NOTIFICATION_LEVEL_1 level window. The EFL_UTIL_NOTIFICATION_LEVEL_3 is the highest level in notification windows. Very few applications can use this level.

            + +

            If there are notification windows that have the same level, the most recently created notification window is placed on top of the other window.

            + +
          + +

          Figure: Notification levels

          +

          Notification levels

          + +

          In general, notification levels in Tizen are used as follows:

          +
            +
          • NOTIFICATION_LEVEL_1 is the basic level which is used as a normal notification popup.
          • +
          • NOTIFICATION_LEVEL_2 is used for the lock screen window.
          • +
          • NOTIFICATION_LEVEL_3, the highest layer, is used in case the user needs to be notified in any circumstances. For example, the incoming call popup can use this level.
          • +
          + +

          The following code snippets shown how to make a notification window with a higher level.

          + +
          +#include <Elementary.h>
          +#include <efl_util.h>
          +#include <dlog.h>
          +
          +static Evas_Object *create_win(const char *name)
          +{
          +   Evas_Object *eo;
          +   efl_util_error_e error;
          +   // Create the NOTIFICATION window object
          +   eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
          +
          +   if (!eo) return NULL;
          +
          +   // Set the NOTIFICATION level
          +   error = efl_util_set_notification_window_level(eo, EFL_UTIL_NOTIFICATION_LEVEL_1);
          +
          +   elm_win_title_set(eo, name);
          +   elm_win_autodel_set(eo, EINA_TRUE); 
          +   evas_object_smart_callback_add(eo, "delete,request", _quit_cb, NULL); 
          +	
          +   return eo;
          +}
          + +

          Use the efl_util_get_notification_window_level() function to get the currently set notification level of a window. If the window is not of the notification type, the function returns the -EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE error.

          +
          +#include <Elementary.h>
          +#include <efl_util.h>
          +#include <dlog.h>
          +
          +void get_notification_level (Evas_Object *eo)
          +{
          +   efl_util_error_e error;
          +   efl_util_notification_level_e  notification_level;
          +
          +   if (!eo) return;
          +
          +   // Get the window notification level
          +   error = efl_util_get_notification_window_level (eo, &notification_level);
          +
          +   // Check the return value
          +   if (error== EFL_UTIL_ERROR_NONE)
          +   {
          +      switch (notification_level)
          +      {
          +         case EFL_UTIL_NOTIFICATION_LEVEL_1:
          +            // Do something for level 1
          +            break;
          +
          +         case EFL_UTIL_NOTIFICATION_LEVEL_2:
          +            // Do something for level 2
          +            break;
          +      }
          +   }
          +   else
          +   {
          +      // Error handling
          +   }
          +}
          + +

          Screenshot

          + +

          The EFL UTIL SCREENSHOT API (in mobile and wearable applications) allows you to get the screen image to the user.

          + +

          First you must make the efl_util_screenshot_h structure and initialize the structure members with the efl_util_screenshot_initialize() function. To take the actual screenshot, create screen capture data and return it to the tbm_surface handler with the efl_util_screenshot_take_tbm_surface() function.

          +

          When no longer needed, remember to free the efl_util_screenshot_h structure with the efl_util_screenshot_deinitialize() function.

          + + +

          Input Generator

          + +

          The EFL UTIL INPUT API (in mobile and wearable applications) allows you to generate input events (such as key and touch events).

          + +

          First you must create the efl_util_inputgen_h structure and initialize the structure members with the efl_util_input_initialize_generator() function. To generate actual key or touch events, use the efl_util_input_generate_key() or efl_util_input_generate_touch() function.

          +

          When no longer needed, remember to free the efl_util_inputgen_h structure with the efl_util_input_deinitialize_generator() function.

          + + + + +

          Initializing EFL Utility

          + +

          To use the EFL UTIL API, the following header file has to be included:

          +
          #include <efl_util.h>
          + +

          Creating a Notification Window and Setting a Notification Window Level

          + +

          To create a notification window and set the window level, use the efl_util_set_notification_window_level() function. If the window type is not notification type, the function returns an error.

          +
          #include <Elementary.h>
          +#include <dlog.h>
          +
          +void create_win() 
          +{
          +   Evas_Object *eo;
          +   efl_util_error_e error;
          +   char *name = "Notification window";
          +   
          +   // Create notification window
          +   eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
          +   if (!eo) return;
          +   
          +   // Set notification level
          +   error = efl_util_set_notification_window_level
          +           (eo, EFL_UTIL_NOTIFICATION_LEVEL_1);
          +   if (error != EFL_UTIL_ERROR_NONE)
          +   {
          +      // Do error handling
          +   }
          +}
          +
          + +

          Getting the Notification Window Level

          + +

          To get the notification window level, use the efl_util_get_notification_window_level() function:

          + +
          void create_win() 
          +{
          +   Evas_Object *eo;
          +   efl_util_error_e error;
          +   efl_util_notification_level_e notification_level;
          +   char *name = "Notification window";
          +   
          +   // Create notification window
          +   eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
          +   if (!eo) return;
          +   
          +   // Get notification level
          +   error = efl_util_get_notification_window_level
          +           (eo, &notification_level);
          +   if (error == EFL_UTIL_ERROR_NONE) 
          +   {
          +      switch (notification_level) 
          +      {
          +         case EFL_UTIL_NOTIFICATION_LEVEL_1:
          +            // Do something for notification level 1
          +            break;
          +         case EFL_UTIL_NOTIFICATION_LEVEL_2:
          +            // Do something for notification level 2
          +            break;
          +      }
          +   }
          +}
          + +

          Getting a Screenshot

          + +

          To get a screenshot:

          + +
          1. Initialize with the efl_util_screenshot_initialize() function: +
            +#include <tbm_surface.h>
            +#include <X11/Xlib.h>
            +
            +void capture()
            +{
            +   efl_util_screenshot_h screenshot = NULL;
            +   tbm_surface_h tbm_surface = NULL;
            +   tbm_surface_info_s tsuri;
            +
            +   screenshot = efl_util_screenshot_initialize(width, height);
            +
          2. + +
          3. After getting the efl_util_screenshot_h structure, execute the efl_util_screenshot_take_tbm_surface() function to get the tbm_surface handler which has the screenshot data. +
            +   if (screenshot) 
            +   {
            +      tbm_surface = efl_util_screenshot_take_tbm_surface(screenshot);
            +      if (tbm_surface) 
            +      {
            +         // Treat tbm_surface handler (screenshot data)
            +      }
            +
          4. + +
          5. Free the resources with the efl_util_screenshot_deinitialize() function: +
            +      efl_util_screenshot_deinitialize(screenshot);
            +   }
            +}
          + +

          Generating a Key Input Event

          + +

          To generate key input events:

          + +
          1. Execute the efl_util_input_initialize_generator() function: +
            +void key_event_generator()
            +{
            +   int ret = EFL_UTIL_ERROR_NONE;
            +   efl_util_inputgen_h inputgen = NULL;
            +
            +   inputgen = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD);
            +   if (!inputgen)
            +   {
            +      // Failed to initialize the input generator system
            +
            +      return;
            +   }
            +
            +
          2. + +
          3. After setting input device type, execute the efl_util_input_generate_key() function to generate key input events: +
            +   ret = efl_util_input_generate_key(inputgen, "XF86Menu", 1);
            +   if (ret != EFL_UTIL_ERROR_NONE) 
            +   {
            +      // Failed to generate a "XF86Menu" key press event
            +      ret = efl_util_input_deinitialize_generator(inputgen);
            +      if (ret != EFL_UTIL_ERROR_NONE)
            +      {
            +         // Failed to deinitialize the input generator system
            +      }
            +      return;
            +   }
            +
            +   ret = efl_util_input_generate_key(inputgen, "XF86Menu", 0);
            +   if (ret != EFL_UTIL_ERROR_NONE) 
            +   {
            +      // Failed to generate a "XF86Menu" key release event
            +      ret = efl_util_input_deinitialize_generator(inputgen);
            +      if (ret != EFL_UTIL_ERROR_NONE)
            +      {
            +         // Failed to deinitialize the input generator system
            +      }
            +      return;
            +   }
            +
          4. + +
          5. Free the resources with the efl_util_input_deinitialize_generator() function: +
            +   ret = efl_util_input_deinitialize_generator(inputgen);
            +   if (ret != EFL_UTIL_ERROR_NONE)
            +   {
            +      // Failed to deinitialize the input generator system
            +   }
            +}
            +
          + + + +

          Generating a Touch Input Event

          + +

          To generate touch input events:

          + +
          1. Execute the efl_util_input_initialize_generator() function: +
            +void touch_event_generator()
            +{
            +   int ret = EFL_UTIL_ERROR_NONE;
            +   efl_util_inputgen_h inputgen = NULL;
            +
            +   inputgen = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN);
            +   if (!inputgen)
            +   {
            +      // Failed to initialize the input generator system
            +
            +      return;
            +   }
            +
          2. +
          3. After setting input device type, execute the efl_util_input_generate_touch() function to generate touch input events: +
            +   ret = efl_util_input_generate_touch(inputgen, 0, EFL_UTIL_INPUT_TOUCH_BEGIN, 100, 100);
            +   if (ret != EFL_UTIL_ERROR_NONE) 
            +   {
            +      // Failed to generate a first finger touch press event on (100, 100)
            +      ret = efl_util_input_deinitialize_generator(inputgen);
            +      if (ret != EFL_UTIL_ERROR_NONE)
            +      {
            +         // Failed to deinitialize the input generator system
            +      }
            +      return;
            +   }
            +   ret = efl_util_input_generate_touch(inputgen, 0, EFL_UTIL_INPUT_TOUCH_UPDATE, 110, 110);
            +   if (ret != EFL_UTIL_ERROR_NONE) 
            +   {
            +      // Failed to generate a first finger touch move event to (110, 110)
            +      ret = efl_util_input_deinitialize_generator(inputgen);
            +      if (ret != EFL_UTIL_ERROR_NONE)
            +      {
            +         // Failed to deinitialize the input generator system
            +      }
            +
            +      return;
            +   }
            +   ret = efl_util_input_generate_touch(inputgen, 0, EFL_UTIL_INPUT_TOUCH_END, 110, 110);
            +   if (ret != EFL_UTIL_ERROR_NONE) 
            +   {
            +      // Failed to generate a first finger touch release event to (110, 110)
            +      ret = efl_util_input_deinitialize_generator(inputgen);
            +      if (ret != EFL_UTIL_ERROR_NONE)
            +      {
            +         // Failed to deinitialize the input generator system
            +      }
            +
            +      return;
            +   }
            +
          4. +
          5. Free the resources with the efl_util_input_deinitialize_generator() function: +
            +   ret = efl_util_input_deinitialize_generator(inputgen);
            +   if (ret != EFL_UTIL_ERROR_NONE)
            +   {
            +      // Failed to deinitialize the input generator system
            +   }
            +}
            +
          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/panes_tutorial_mn.htm b/org.tizen.ui.practices/html/native/efl/panes_tutorial_mn.htm new file mode 100644 index 0000000..362b985 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/panes_tutorial_mn.htm @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + Creating Panes + + + + + + +
          +

          Creating Panes

          + + +

          This tutorial explains how to use panes in the application.

          + +

          This feature is supported in mobile applications only.

          + +

          Initializing the Panes Application

          + +

          Create a window entitled Panes tutorial, composed of a conformant component that contains a naviframe component.

          +
          +#include <Elementary.h>
          +#include <app.h>
          +
          +struct _appdata 
          +{
          +   const char *name;
          +   Evas_Object *win;
          +};
          +
          +static void app_terminate(void *user_data)
          +{
          +   struct _appdata *ad;
          +
          +   if (!user_data)
          +      return;
          +
          +   ad = user_data;
          +
          +   if (ad->win)
          +      evas_object_del(ad->win);
          +}
          +
          +static bool app_create(void *user_data)
          +{
          +   struct _appdata *ad;
          +   Evas_Object *win, *conformant, *naviframe, *panes, *panes_h, *nav_it, *bt;
          +
          +   if (!user_data)
          +      return false;
          +
          +   ad = user_data;
          +
          +   // Create window 
          +   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
          +   win = elm_win_util_standard_add("panes", "Panes tutorial");
          +   elm_win_autodel_set(win, EINA_TRUE);
          +
          +   if (!win)
          +      return false;
          +
          +   ad->win = win;
          +
          +   // Add elm_conformant 
          +   conformant = elm_conformant_add(win);
          +   elm_win_resize_object_add(win, conformant);
          +   evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   evas_object_show(conformant);
          +
          +   // Add naviframe to conformant 
          +   naviframe = elm_naviframe_add(conformant);
          +   elm_object_content_set(conformant, naviframe);
          +   evas_object_show(naviframe);
          +
          +   evas_object_resize(win, 320, 400);
          +   evas_object_show(win);
          +
          +   return true;
          +}
          +
          +int main(int argc, char **argv)
          +{
          +   appdata_s *ad = {0,};
          +   int ret = 0;
          +
          +   ui_app_lifecycle_callback_s event_callback = {0,};
          +   app_event_handler_h handlers[5] = {NULL,};
          +
          +   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;
          +
          +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
          +   ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
          +   ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
          +
          +   ret = ui_app_main(argc, argv, &event_callback, &ad);
          +
          +   return ret;
          +}
          +
          + + +

          Creating a Panes Component

          + +

          To add a new panes object to the application, do it within the _create() function.

          + +

          When you create a panes component, the elm_panes component adds a draggable bar between 2 contents. When dragged, this bar resizes the contents' size. To create a new panes component into an Elementary object, use the elm_panes_add() function.

          +

          In the following example, the panes component is created and added in the naviframe:

          +
          +// Add an elm_panes 
          +panes = elm_panes_add(naviframe);
          +evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +elm_win_resize_object_add(win, panes);
          +evas_object_show(panes);
          +
          +nav_it = elm_naviframe_item_push(naviframe, "Panes view", NULL, NULL, panes, NULL);
          +
          + + +

          Configuring the Panes

          + +

          To configure the panes component:

          +
            +
          • +

            Modify the panes component orientation with the elm_panes_horizontal_set() function.

            +

            By default, the orientation of the panes component is vertical.

            +
            +// Add a horizontal elm_panes 
            +panes_h = elm_panes_add(naviframe);
            +elm_panes_horizontal_set(panes_h, EINA_TRUE);
            +
            +

            The above code creates a panes object and sets the horizontal orientation. To add content in a panes, use the elm_object_part_content_set() function. In the following example, a horizontal panes component (panes_h) is added to the "left" part of the panes component (panes) created in the previous use case.

            +
            +elm_object_part_content_set(panes, "left", panes_h);
            +
            +
          • +
          • +

            Set a button object to the "right" side of the vertical panes component:

            +
            +// Create a button object 
            +bt = elm_button_add(naviframe);
            +elm_object_text_set(bt, "Right");
            +evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(bt);
            +
            +// Set the button object to the "right" part of the vertical panes 
            +elm_object_part_content_set(panes, "right", bt);
            +
            +
          • +
          • +

            Set the content of the horizontal panes component with 2 button objects (up and down).

            +

            When populating a vertically displayed panes component, the left content is placed at the top, and the right content is placed at the bottom.

            +
            +// Create an "Up" button 
            +bt = elm_button_add(naviframe);
            +elm_object_text_set(bt, "Up");
            +evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(bt);
            +elm_object_part_content_set(panes_h, "left", bt);
            +
            +// Create a "Down" button 
            +bt = elm_button_add(naviframe);
            +elm_object_text_set(bt, "Down");
            +evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
            +evas_object_show(bt);
            +elm_object_part_content_set(panes_h, "right", bt);
            +
            +
          • +
          • +

            Resize the panes component.

            +

            To change the size of the panes component, drag the elm_panes with the mouse. The proportion can also be set with the elm_panes_content_left_size_set() and elm_panes_content_right_size_set() functions. The following example shows how to set the left size of both panes to 80%.

            +
            +// Set the proportion of the panes to 80% 
            +elm_panes_content_left_size_set(panes, 0.8);
            +elm_panes_content_left_size_set(panes_h, 0.8);
            +
            +
          • +
          • +

            Set a fixed size for the panes component's size and proportions with the elm_panes_fixed_set() function.

            +
            +// Fix the panes proportion 
            +elm_panes_fixed_set(panes_h, EINA_TRUE);
            +
            +
          • +
          + +

          Figure: Panes tutorial

          +

          Panes tutorial

          + +

          Handling Signals

          + +

          The panes component emits 4 different signals, depending on the user interaction with the draggable bar:

          +
            +
          • clicked - Pane is clicked. +

            The following example, a callback function is registered to the vertical panes component, and it prints Clicked to standard output:

            +
            +// clicked callback 
            +static void
            +_clicked_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   dlog_print(DLOG_INFO, PANES_TAG, "Clicked\n");
            +}
            +
            +evas_object_smart_callback_add(panes, "clicked", _clicked_cb, panes);
            +
            +
          • + +
          • press - Pane is pressed. +

            The following example, a callback function is registered to the vertical panes component, and it prints Pressed to standard output:

            +
            +// press callback 
            +static void
            +_press_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   dlog_print(DLOG_INFO, PANES_TAG, "Pressed\n");
            +}
            +
            +evas_object_smart_callback_add(panes, "press", _press_cb, panes);
            +
            +
          • + +
          • unpressed - Pane is released after being pressed. +

            The following example, a callback function is registered to the vertical panes component, and it prints the proportion size of the left content of the panes component to standard output using the elm_panes_content_left_size_get() function:

            +
            +// unpress callback 
            +static void
            +_unpress_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   dlog_print(DLOG_INFO, PANES_TAG, "Unpressed, size : %f\n",
            +              elm_panes_content_left_size_get(obj));
            +}
            +
            +evas_object_smart_callback_add(panes, "unpress", _unpress_cb, panes);
            +
            +
          • + +
          • clicked,double - Pane is double-clicked. +

            The following example, a callback function is registered to the vertical panes component. It hides the left part of the panes component and sets the left proportion to 0.0. To restore the left part proportion with a double-click on the hidden part of the panes component, use the elm_panes_content_left_size_get() and elm_panes_content_left_size_set() functions, and a variable to store the value of the current proportion.

            + +
            +// clicked,double callback 
            +static void
            +_clicked_double_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   static double size = 0.0;
            +   double tmp_size = 0.0;
            +   tmp_size = elm_panes_content_left_size_get(obj);
            +   if (tmp_size > 0)
            +   {
            +      elm_panes_content_left_size_set(obj, 0.0);
            +      dlog_print(DLOG_INFO, PANES_TAG, "Double clicked, hidden.\n");
            +   }
            +   else
            +   {
            +      elm_panes_content_left_size_set(obj, size);
            +      dlog_print(DLOG_INFO, PANES_TAG,
            +                 "Double clicked, restoring size.\n");
            +   }
            +   size = tmp_size;
            +}
            +
            +evas_object_smart_callback_add(panes, "clicked,double", _clicked_double_cb, panes);
            +
            +
          • +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/popup_tutorial_wn.htm b/org.tizen.ui.practices/html/native/efl/popup_tutorial_wn.htm new file mode 100644 index 0000000..89d6648 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/popup_tutorial_wn.htm @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + Creating Wearable Popups + + + + + + +
          +

          Creating Wearable Popups

          + + +

          This tutorial teaches the basics of popup component interactions.

          + +

          This feature is supported in wearable applications only.

          + +

          Initializing the Popup Application

          + +

          Create an application with a window entitled Popup Basic Tutorial. The window consists of a conformant component, and you can add the popup inside the conformant with the create_popup() function.

          + +
          +static void
          +create_base_gui(appdata_s *ad)
          +{
          +   // Window
          +   ad->win = elm_win_util_standard_add("main", "Popup Basic Tutorial");
          +   elm_win_autodel_set(ad->win, EINA_TRUE);
          +
          +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          +   eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
          +
          +   // Conformant
          +   ad->conform = elm_conformant_add(ad->win);
          +   elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
          +   elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
          +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   elm_win_resize_object_add(ad->win, ad->conform);
          +   evas_object_show(ad->conform);
          +
          +   create_popup(ad->conform);
          +
          +   // Show the window after the base GUI is set up
          +   evas_object_show(ad->win);
          +}
          +
          +static bool
          +app_create(void *data)
          +{
          +   appdata_s *ad = data;
          +   create_base_gui(ad);
          +
          +   return true;
          +}
          +
          +int
          +main(int argc, char **argv)
          +{
          +   struct app_data ad = {0,};
          +   ui_app_lifecycle_callback_s event_callback = {0,};
          +
          +   event_callback.create = app_create;
          +
          +   return ui_app_main(&argc, &argv, &event_callback, &ad);
          +}
          + +

          Using Popup Styles

          + +

          To create popups using various styles:

          + +
          • Create a basic text-only popup: + +
            +Evas_Object *popup;
            +struct appdata *ad;
            +ad = (struct appdata *) data;
            +
            +popup = elm_popup_add(ad->win_main);
            +evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            +eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            +elm_object_text_set(popup, "This has only texts");
            +evas_object_show(popup);
            +
          • + +
          • Create a popup with a title and text. The title,text attribute is the title area text part that defines the title label. +
            +Evas_Object *popup;
            +struct appdata *ad;
            +ad = (struct appdata *) data;
            +
            +popup = elm_popup_add(ad->win_main);
            +evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            +elm_object_part_text_set(popup, "title,text", "Title");
            +elm_object_text_set(popup,"This Popup has title area and text");
            +eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            +evas_object_show(popup);
            +
          • + +
          • Create a popup with a title, text, and 2 buttons: +
            +Evas_Object *popup;
            +Evas_Object *btn;
            +struct appdata *ad = (struct appdata *) data;
            +
            +popup = elm_popup_add(ad->win_main);
            +evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            +elm_object_part_text_set(popup, "title,text", "Title");
            +eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            +elm_object_text_set(popup, "This is title text 2button popup");
            +
            +btn = elm_button_add(popup);
            +elm_object_style_set(btn, "popup");
            +evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_object_text_set(btn, "Cancel");
            +elm_object_part_content_set(popup, "button1", btn);
            +evas_object_smart_callback_add(btn, "clicked", _response_cb, popup);
            +
            +btn = elm_button_add(popup);
            +elm_object_style_set(btn, "popup");
            +evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_object_text_set(btn, "OK");
            +elm_object_part_content_set(popup, "button2", btn);
            +evas_object_smart_callback_add(btn, "clicked", _response_cb, popup);
            +
            +evas_object_show(popup);
            +
          • + +
          • Create a toast popup: +
            +Evas_Object *popup;
            +struct appdata *ad = (struct appdata *) data;
            +
            +popup = elm_popup_add(ad->win_main);
            +elm_object_style_set(popup, "toast");
            +elm_popup_orient_set(popup, ELM_POPUP_ORIENT_BOTTOM);
            +evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            +elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
            +eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
            +elm_object_part_text_set(popup,"elm.text", "Saving Contacts to sim");
            +
            +evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL);
            +elm_popup_timeout_set(popup, 2.0);
            +evas_object_smart_callback_add(popup, "timeout", _timeout_cb, NULL);
            +
            +evas_object_show(popup);
            +
          • +
          + +

          Managing Popup Events

          +

          The Elementary popups respond to user interactions with several events.

          +

          To manage popup events:

          + +
            +
          • Handle timeout events: +

            The timeout event is triggered whenever a popup is closed as a result of a timeout:

            +
            +static void 
            +_timeout_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   evas_object_del(obj);
            +}
            +elm_popup_timeout_set(popup, 3.0);
            +evas_object_smart_callback_add(popup, "timeout", _timeout_cb, NULL);
            +
          • + +
          • Handle block clicked events: +

            The block,clicked event is triggered whenever the user taps on a blocked event area:

            +
            +static void 
            +_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
            +{
            +   evas_object_del(obj);
            +}
            +evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL);
            +
          • + +
          + + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/resource_fallback_n.htm b/org.tizen.ui.practices/html/native/efl/resource_fallback_n.htm new file mode 100644 index 0000000..efe9679 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/resource_fallback_n.htm @@ -0,0 +1,164 @@ + + + + + + + + + + + + + Resource Fallback Support + + + + + +
          + +

          Resource Fallback Support

          + +

          Tizen native applications can run on different types of devices, such as wearable, phone, tablets, and TVs. Tizen also supports various resolutions (WVGA ~ XQXGA) and resources. Regardless of these advantages, remember that you must always polish your work to create an optimal application for each device.

          + +

          For more information, see Resource Explorer.

          + +

          Providing an Alternative Image Set through Edje

          +

          The image set elements are used to display a specific image on the screen based on the container size. The image sets can have the following properties:

          +
          • name: image-name +

            Specifies the name of the image file.

          • +
          • size: minw minh maxw maxh +

            Specifies the minimum and maximum size that causes a specified image to be selected and shown. The image set is used to control the resource quality when the image part is scaled to multiple devices. According to the size of the part's container, an appropriate image is loaded.

          + + + + + + + +
          +
          +collections 
          +{
          +   group 
          +   {
          +      name: "property_test";
          +
          +      images 
          +      {
          +         set 
          +         {
          +            name: "alternative_animal";
          +            image 
          +            {
          +               image: "pig.png" COMP;
          +               size: 640 800 1200 1500;
          +            }
          +            image 
          +            {
          +               image: "monkey.png" COMP;
          +               size: 400 500 639 799;
          +            }
          +            image 
          +            {
          +               image: "cat.png" COMP;
          +               size: 240 300 399 499;
          +            }
          +            image 
          +            {
          +               image: "mouse.png" COMP;
          +               size: 80 100 239 299;
          +            }
          +            image 
          +            {
          +               image: "snail.png" COMP;
          +               size: 0 0 79 99;
          +            }
          +         }
          +      }
          +
          +      parts 
          +      {
          +         part 
          +         {
          +            name: "image1";
          +            description 
          +            {
          +               state: "default" 0.0;
          +               rel1 {relative: 0.0 0.0;}
          +               rel2 {relative: 1.0 0.45;}
          +               image.normal: "alternative_animal";
          +               aspect: 4/5 4/5;
          +               aspect_preference: BOTH;
          +            }
          +         }
          +         part 
          +         {
          +            name: "image2";
          +            description 
          +            {
          +               state: "default" 0.0;
          +               rel1 {relative: 0.0 0.5;}
          +               rel2 {relative: 1.0 0.75;}
          +               image.normal: "alternative_animal";
          +               aspect: 4/5 4/5;
          +               aspect_preference: BOTH;
          +            }
          +         }
          +         part 
          +         {
          +            name: "image3";
          +            description 
          +            {
          +               state: "default" 0.0;
          +               rel1 {relative: 0.0 0.8;}
          +               rel2 {relative: 1.0 1.0;}
          +               image.normal: "alternative_animal";
          +               aspect: 4/5 4/5;
          +               aspect_preference: BOTH;
          +            }
          +         }
          +      }
          +   }
          +}	 
          +
          +

          Image set

          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.guides/html/native/efl/rotary_events_n.htm b/org.tizen.ui.practices/html/native/efl/rotary_events_n.htm old mode 100755 new mode 100644 similarity index 100% rename from org.tizen.ui.guides/html/native/efl/rotary_events_n.htm rename to org.tizen.ui.practices/html/native/efl/rotary_events_n.htm diff --git a/org.tizen.ui.practices/html/native/efl/rotary_events_wn.htm b/org.tizen.ui.practices/html/native/efl/rotary_events_wn.htm new file mode 100644 index 0000000..3608a56 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/rotary_events_wn.htm @@ -0,0 +1,276 @@ + + + + + + + + + + + + + Managing Rotary Events + + + + + +
          +

          Managing Rotary Events

          + + +

          You can use various functions to work with the rotary events. The functions manage the rotary events, which are fired from the rotary device and delivered to a suitable target. To receive rotary events, you must define an event callback or a handler function, and register it using the EFL Extension functions. There are 2 ways to receive the rotary events: the rotary event handler and the rotary object event callback.

          + +

          This feature is supported in wearable applications only.

          + +

          Rotary Event Handler

          + +

          The rotary event handler is suitable when you want to handle rotary events without taking care about an Evas Object or when the application is not implemented using an Evas Object. The handler works like the Ecore event in EFL:

          + +
          • The application registers a rotary event handler with the eext_rotary_event_handler_add() function.

            + +

            The rotary event handlers are treated "first come first served". It means that the first registered handler is called first when rotary events happens. If the handler returns EINA_TRUE, the next handler is called. Otherwise, EFL Extension stops delivering the rotary events.

            +
          • +
          • To remove a rotary event handler, use the eext_rotary_event_handler_del() function.

          + + + +

          Rotary Object Event Callback

          + +

          The rotary object event callback is suitable when you want EFL Extension to handle the event delivery between objects. It means that EFL Extension manages a callback and an object list and decides which object's callback must be called when rotary events happen:

          + +
          • The application registers a callback using the eext_rotary_object_event_callback_add() function.

            + +

            EFL Extension treats callbacks based on the callback priority. If the application registers callbacks for a same object, the callback with the lowest priority number is called first. If this callback returns EINA_TRUE, the higher priority number is called. The above function registers the rotary event callback with a default priority number (value is 0). To register the rotary event callback with another priority number, use the eext_rotary_object_event_callback_priority_add() function.

          • +
          • To remove a registered callback from an object, use the eext_rotary_object_event_callback_del() function:

          + +

          The rotary events are only delivered to 1 object named the activated object. If there is no activated object, the rotary event is not delivered to any object. If the activated object has registered callbacks and the callbacks return EINA_TRUE, the rotary events are delivered to the upper parents of the activated object until there is 1 callback that consumes the rotary event or it reaches the top parent object.

          +

          To set the object as the activated object, use the eext_rotary_object_event_activated_set() function.

          + +

          Providing the activated parameter with the EINA_TRUE value sets the object as the activated object. Providing the EINA_FALSE value deactivates the object. Since there is only 1 object which is the activated object, if an object is set as the activated object, the previously activated object is deactivated and becomes a normal object. An activated signal named rotary,activated is sent when an object is set as the activated object, and the rotary,deactivated signal is sent when an object is deactivated.

          + +

          You can register callbacks for activated or deactivated signals with the evas_object_smart_callback_add() function.

          + +

          For more information, see the Evas smart callback function.

          + +

          Managing Rotary Events

          + +

          To manage rotary events:

          +
            +
          1. Create the rotary event handler: +
              +
            1. Create the window: +
              +static void
              +create_base_gui(appdata_s *ad)
              +{
              +Evas_Object *win = NULL;
              +
              +   // Window
              +   win = elm_win_util_standard_add(NULL, "extension circle sample");
              +   elm_win_autodel_set(win, EINA_TRUE);
              +   evas_object_smart_callback_add(win, "delete,request", win_delete_request_cb, NULL);
              +
              +   // Show the window after base gui is set up
              +   evas_object_show(win);
              +}
              +
              +
            2. + +
            3. Register the rotary event handler: +
              +static void
              +create_base_gui(appdata_s *ad)
              +{
              +   // Register the rotary event handler
              +   eext_rotary_event_handler_add(_rotary_handler_cb, NULL);
              +}
              +
            4. +
            5. Define the callback function: +
              +Eina_Bool _rotary_handler_cb(void *data, Eext_Rotary_Event_Info *ev)
              +{
              +   if (ev->direction == EEXT_ROTARY_DIRECTION_CLOCKWISE)
              +   {
              +      dlog_print(DLOG_DEBUG, LOG_TAG, "ROTARY HANDLER: Rotary device rotated in clockwise direction");
              +   }
              +   else
              +   {
              +      dlog_print(DLOG_DEBUG, LOG_TAG, "Rotary device rotated in counter clockwise direction");
              +   }
              +
              +   return EINA_FALSE;
              +}
              +
              +
            6. + +
            7. Remove the rotary event handler and release all resources when you do not need it anymore. +
              +static void
              +app_terminate(void *data)
              +{
              +   // Release all resources
              +   eext_rotary_event_handler_del(_rotary_handler_cb);
              +}
              +
              +
            8. +
            +
          2. +
          3. Create a rotary event callback for a normal Evas object. +

            When a rotary event occurs, the slider value is adjusted accordingly.

            +
              +
            1. Create the objects. +

              The window and the slider are created using the Elementary APIs.

              +
              +static void
              +create_base_gui(appdata_s *ad)
              +{
              +   Evas_Object *win = NULL, *slider = NULL;
              +
              +   // Window 
              +   win = elm_win_util_standard_add(NULL, "extension sample");
              +   elm_win_autodel_set(win, EINA_TRUE);
              +   evas_object_smart_callback_add(win, "delete,request", win_delete_request_cb, NULL);
              +
              +   // Slider
              +   slider = elm_slider_add(win);
              +   evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +   elm_slider_min_max_set(slider, 0, 50);
              +   elm_slider_step_set(slider, 1.0);
              +   evas_object_show(slider);
              +   elm_win_resize_object_add(win, slider);
              +
              +   // Show the window after the base GUI is set up 
              +   evas_object_show(win);
              +}
              +
              +
            2. +
            3. Register the rotary event callback. +

              To receive the rotary event, register the rotary event callback and set the activated object as the slider object.

              +
              +static void
              +create_base_gui(appdata_s *ad)
              +{
              +   // Register rotary event callback 
              +   ext_rotary_object_event_callback_add(slider, _rotary_event_cb, NULL);
              +   eext_rotary_object_event_activated_set(slider, EINA_TRUE);
              +}
              +
              +

              Define the rotary callback function:

              +
              +Eina_Bool _rotary_event_cb(void *data, Evas_Object *obj, Eext_Rotary_Event_Info *ev)
              +{
              +   Evas_Object *slider = obj;
              +   int val = elm_slider_value_get(slider);
              +   if (ev->direction == EEXT_ROTARY_DIRECTION_CLOCKWISE)
              +   {
              +      elm_slider_value_set(slider, val + 1);
              +   }
              +   else
              +   {
              +      elm_slider_value_set(slider, val - 1);
              +   }
              +
              +   return EINA_FALSE;
              +}
              +
              +
            4. +
            +
          4. +
          5. Create a rotary event callback for an EFL Extension object. +

            When a rotary event occurs, the slider value is adjusted accordingly.

            +
              +
            1. Create the objects: +
              +static void
              +create_base_gui(appdata_s *ad)
              +{
              +   Evas_Object *win = NULL, *conform = NULL;
              +   Eext_Circle_Surface *sur = NULL;
              +
              +   // Window 
              +   win = elm_win_util_standard_add(NULL, "extension circle sample");
              +   elm_win_autodel_set(win, EINA_TRUE);
              +   evas_object_smart_callback_add(win, "delete,request", win_delete_request_cb, NULL);
              +
              +   // Conformant
              +   conform = elm_conformant_add(win);
              +   elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW);
              +   elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_OPAQUE);
              +   evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
              +   elm_win_resize_object_add(win, conform);
              +   evas_object_show(conform);
              +
              +   // Surface 
              +   sur = eext_circle_surface_conformant_add(conform);
              +
              +   // Slider
              +   slider = eext_circle_object_slider_add(conform, sur);
              +   eext_circle_object_value_min_max_set(slider, 0.0, 30.0);
              +   eext_circle_object_value_set(slider, 0.0);
              +
              +   // Show the window after the base GUI is set up
              +   evas_object_show(win);
              +}
              +
              +
            2. +
            3. Set the activated object. +

              Since the EFL Extension API is used to create the slider object, the created slider object already registers the rotary event callbacks internally. To receive a rotary event, you only need to set the activated object as the desired object (slider).

              +
              +static void
              +create_base_gui(appdata_s *ad)
              +{
              +   // Activate circle slider's rotary object event
              +   // Its value increases/decreases its value by 1.0 to clockwise or 
              +   // counter-clockwise rotary event
              +   eext_rotary_object_event_activated_set(slider, EINA_TRUE);
              +   eext_circle_object_slider_step_set(slider, 1.0);
              +}
              +
              +
            4. +
            +
          6. +
          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/scalability_n.htm b/org.tizen.ui.practices/html/native/efl/scalability_n.htm new file mode 100644 index 0000000..d2d918b --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/scalability_n.htm @@ -0,0 +1,762 @@ + + + + + + + + + + + + + Scalability Support + + + + + +
          + +

          Scalability Support

          +

          To ensure that your application works well in diverse devices, you must consider scalability when designing the application layout:

          + + +

          Key Concepts

          + +

          When designing the application layout to be scalable, you must pay attention to the following key concepts:

          + +
          • Understand the character of the relative position and the fixed position + +

            In the relative position, the size is determined in proportion to the size of the referred object. For example, if an orange rectangle occupies 30% of the green rectangle, and the green rectangle is expanded, the orange rectangle is expanded accordingly. However, if the scaling value is changed and the green rectangle is not scaled, the orange rectangle remains unchanged too.

            + +

            Figure: Relative position

            +

            Relative position

            + +

            In the fixed position, the size is determined by a value set for the object. For example, the orange rectangle set to the size of 10. If the green rectangle is expanded, the orange rectangle does not change. However, if the scaling value is, for example, doubled, the size of the orange rectangle grows to 20.

            + +

            Figure: Fixed position

            +

            Fixed position

          • + +
          • Use the relative position +

            If you set the object size as a percentage, the ratio remains fixed regardless of the changes in the screen size or resolution. If you want the object size changed in proportion of the window size, use the relative position.

            + +

            Figure: Scaling relative position

            +

            Scaling relative position

          • + +
          • Multiply the scaling value, if you use the fixed size +

            If you use the EDC file to set up the layout, you can set the scale in the part element:

            +
            +parts 
            +{
            +   part 
            +   { 
            +      name: "box"; 
            +      type: RECT;
            +      scale: 1;
            +   }
            +}
            +
            + +

            If you set the fixed size in C code, you can use the ELM_SCALE_SIZE macro:

            +
            evas_object_size_hint_min_set(object, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(100));
            + +

            For more information see Applying the Base Scale.

          • + +
          • Do not fill the width or height out with a fixed size only +

            If you fill the entire height out with a fixed size only and it is scaled, the end result can be larger than the screen size.

            + +

            Figure: Height filled with a fixed size

            +

            Height filled with a fixed size

            + +

            If you set a partial width or height with a fixed size and leave the remaining area flexible, the layout does not expand outside the screen.

            + +

            Figure: Height with a flexible area

            +

            Height with a flexible area

          + + + +

          Scalability Using Elementary UI Components

          + +

          The Tizen platform provides a UI component toolkit library, called Elementary, that includes an extensive set of UI components. You can use elementary UI components to compose your application user interface (UI). While creating the UI, you can set specific properties for the UI components to control the scalable behavior of the UI. Before you try to create a scalable UI using elementary UI components, make sure you understand the following core concepts on how scalability works with elementary UI components.

          + + + + + + + + + + +
          Note
          The Elementary library provides 3 groups of APIs: +
          • Infrastructure: to control the behavior of elementary.
          • +
          • Container: UI components that can contain other UI components.
          • +
          • UI components: elementary UI components, such as buttons, lists, and check and radio boxes.
          + +

          Using Containers for Effective Layouts

          + +

          The Elementary library provides several containers to display UI components in an effective layout. The containers have no visual identity of their own.

          + +
          • Box + +

            The box container makes a layout where child UI components are stacked in either horizontal or vertical direction. The box size is the sum of its child UI components' size:

            +
            • A vertical box calculates its height as the sum of its children's height and its width as the width of the widest child.
            • +
            • A horizontal box calculates its width as the sum of its children's width and its height as the height of the tallest child.
            + +

            Figure: Box layout

            +

            Box layout

            + +

            The box-based linear layout is the best solution to ensure a minimum size for the child UI components in any device or any orientation.

          • + +
          • Grid + +

            The grid container makes a layout where child UI components set their position and size relative to the container position and size. You can define the virtual width and height of the grid (by default: 100 x 100). You then packs the child UI components into the grid while setting their position and size based on the virtual size of the grid.

            + +

            Figure: Grid layout

            +

            Grid layout

            + +

            The grid-based relative layout can always fill the full screen in any device or any orientation. However, the size of the child UI components is changed based on the screen size.

          + + +

          Using Weight and Align Properties

          + +

          To make a layout scalable with UI components, the UI components must be packed into a container using only the weight and align properties based on their minimum size. Do not resize the UI components directly using pixels.

          + +

          The weight and align properties are associated with every elementary UI component, and they serve as hints for the container they are in. They tell the container how the UI component wants to occupy the space and pack itself with other UI components in the container.

          + +

          Weight

          + +

          You can set the weight property with the evas_object_size_hint_weight_set(x_weight, y_weight) function:

          + +
          • Containers use the weights of the child UI components by normalizing them across all child UI components along both X and Y directions.
          • +
          • The parameter values can be 0 or positive values (default: 0.0). +

            0.0 means that the container allocates a minimum size of the UI component area.

            +

            1.0 (EVAS_HINT_EXPAND) means that the container allocates all of the remaining area to the UI component.

          • +
          • If the container has several UI components, it allocates the UI component area relative to the weights of other UI components.
          + +

          Figure: Weight hint

          +

          Weight hint

          + +

          Figure: Weight hint across multiple child UI components

          +

          Weight hint across multiple child UI components

          + +

          Align

          + +

          You can set the align property with the evas_object_size_hint_align_set(x_align, y_align) function:

          + +
          • UI components use the alignment for their position or size along both X and Y directions.
          • +
          • The parameter values can be from 0.0 to 1.0 or -1.0 (default: 0.5).
          • +
          • The values define positions as follows: left is (x=0.0), right is (x=1.0), top is (y=0.0), and bottom is (y=1.0). The center is (x=0.5, y=0.5). +

            -1.0 (EVAS_HINT_FILL) means that the UI component fills all of the allocated area.

          + +

          Figure: Alignment hint

          +

          Alignment hint

          + +

          Scalability Using Edje

          + +

          The Tizen platform provides a complex graphical design and layout library called Edje, which provides an abstraction layer between the application code and the interface. You can use Edje in your Tizen applications to create visual elements and control the layout, look, and feel.

          +

          Internally, Edje holds a geometry state machine and a state graph that defines, for example, what is visible, where, at what size, and with what colors. These details are described to Edje using an Edje .edj file. The file can be produced by using Edje_cc to take a text file (a .edc file) and "compile" an output .edj file that contains the state graph information, images, and any other needed data.

          + +

          While creating Edje, you set specific element properties to control the scalable behavior of the UI. Before creating a scalable UI using Edje, you must be familiar with the following scalability properties and part types.

          + +

          Part

          +

          Parts are used to represent the most basic layout elements, such as a line in a border or a text on an image.

          +

          The parts can have the following property:

          +
          • scale: 0-1 +

            Specifies whether the part scales its size with the scaling factor (Tizen has a scaling factor to resize the application layout and object). This property is used to scale properties, such as font size or min/max size of the part.

            +

            The default value is 0 (off) and the default scaling factor is 1.0. To make a part scalable, set the property to 1 (on).

            +
          + +

          Description

          +

          Every part can have one or more description blocks to define the layout properties of the part.

          +

          The descriptions can have the following properties:

          + +
          • min/max: width height +

            Specifies the minimum or maximum size of the part in pixels. It has no effect on the container size.

            +

            When the scale property of the part is set to 1 (on), the size is multiplied by the scaling factor.

          • + +
          • fixed: 0-1 0-1 +

            When the min or max property is set, this property sets a boolean value for each dimension (horizontal and vertical, respectively) that tells the application whether it must be scaled when resized.

            +

            The default value is 0 0. To fix a part size to its min or max, set the value to 1.

          • + +
          • align: X-axis Y-axis +

            When the displayed object size is smaller than its container, this property moves it along both axes using the relative position.

            +

            To move the property, use x = 0.0 to move to left, x = 1.0 to move to right, y = 0.0 to move to the top, and y = 1.0 to move to the bottom. The x = 0.5, y = 0.5 value sets the object at the center of its container.

            +

            The default value is 0.5 0.5.

          • + +
          • rel1/rel2 +

            Specifies the position of the left-top and bottom-right corners of the part's container.

            +
            • relative: X-axis Y-axis +

              Specifies the relative position of the part's container.

              +

              The default value is 0.0 0.0 for rel1.relative and 1.0 1.0 for rel2.relative.

            • +
            • to/to_x/to_y +

              Specified that a corner must be positioned relatively to another part's container.

              +

              By default, the corners of a part are placed to the whole interface.

            + + + + + + + + +
            Table: Edje part property example
            +
            +collections 
            +{
            +   group 
            +   {
            +      name: "property_test";
            +                                                                 
            +      images 
            +      {
            +         image: "panorama.png" COMP;
            +      }  
            +                                                                 
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "rect1";
            +            type: RECT;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.3 0.4;}
            +               rel2 {relative: 0.7 0.6;}
            +               color: 0 127 255 255;
            +            }
            +         }
            +         part 
            +         {
            +            name: "rect2";
            +            type: RECT;
            +            // Affected by scaling factor
            +            scale: 1; 
            +            description 
            +            {
            +               state: "default" 0.0;
            +               fixed: 0 1;
            +               // Height: 100 pixels (when the scaling factor is 1.0)
            +               min: 0 100;
            +               rel1 {relative: 0.0 1.0;}
            +               rel2 {relative: 1.0 1.0;}
            +               // Bottom-aligned
            +               align: 0.5 1.0;
            +               color: 255 127 0 255;
            +            }
            +         }
            +         part 
            +         {
            +            name: "image";
            +            // Affected by scaling factor
            +            scale: 1;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               fixed: 1 1;
            +               // Image size: 720 x 180 pixels (when the scaling factor is 1.0)
            +               min: 720 180;
            +               // Y-axis is positioned relative to "rect2" part
            +               rel1 {relative: 0.5 0.0; to_y: "rect2";}
            +               rel2 {relative: 0.5 0.0; to_y: "rect2";}
            +               // Bottom-aligned
            +               align: 0.5 1.0;
            +               image.normal: "panorama.png";
            +            }
            +         }
            +      }
            +   }
            +}
            +

            Part example

            +
          • + +
          • aspect: min max +

            Specifies the width to height ratio to keep when the part is resized. When both values are the same, the ratio is fixed. When they differ, the part is forced to keep the ratio between the min and max properties when resized.

            +

            The default value is 0.0 0.0.

          • + +
          • aspect_preference: dimension +

            Specifies the scope of the aspect property to a given dimension.

            +

            The possible values are BOTH, VERTICAL, HORIZONTAL, and NONE. The default is NONE.

            + + + + + + + + +
            Table: Edje part property aspect example
            +
            +collections 
            +{
            +   group 
            +   {
            +      name: "property_test";
            +
            +      images 
            +      {
            +         image: "island.png" COMP;
            +      }
            +   
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "image";
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.0;}
            +               rel2 {relative: 1.0 1.0;}
            +               image.normal: "island.png";
            +               aspect: 8/5 8/5;
            +               // Keep the aspect ratio based on the part width
            +               aspect_preference: HORIZONTAL;
            +            }
            +         }
            +      }
            +   }
            +}
            +

            Part aspect example

            +
          + +

          Text

          +

          The text elements are used to display text on the screen.

          +

          The texts can have the following properties:

          + +
          • size: font-size +

            Specifies the font size for the text. When the scale property of the part is set to 1 (on), the size is multiplied by the scaling factor.

          • + +
          • min: horizontal vertical +

            Specifies a pair of boolean values that define whether the container can be reduced further than the text size. The property is used to prevent the container from chopping the text.

            +

            When min is set horizontally or vertically, the minimum height or width of the part is decided by the text size.

            +

            The default value is 0 0.

          • + +
          • max: horizontal vertical +

            Specifies a pair of boolean values that define whether the container can be expanded further than the text size.

            +

            When max is set horizontally or vertically, the maximum height or width of the part is decided by the text size.

            +

            The default value is 0 0.

            + + + + + + + + +
            Table: Edje text property example
            +
            +collections 
            +{
            +   group 
            +   {
            +      name: "property_test";
            +
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "text";
            +            type: TEXT;
            +            scale: 1;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.0;}
            +               rel2 {relative: 1.0 0.0;}
            +               align: 0.5 0.0;
            +               color: 108 108 108 255;
            +               text 
            +               {
            +                  font: "TIZEN";
            +                  // Affected by scaling factor
            +                  size: 80;
            +                  // Minimum height of the part container is decided by the text size
            +                  min: 0 1;
            +                  text: "Test properties!!";
            +               }
            +            }
            +         }
            +      }
            +   }
            +}
            +

            Text example

            + +
          • +
          • fit: horizontal vertical +

            Specifies a pair of values that define whether the text is scaled to fill its container horizontally and/or vertically.

            +

            The default value is 0 0.

            + + + + + + + + +
            Table: Edje text property fit example
            +
            +collections 
            +{
            +   group 
            +   {
            +      name: "property_test";
            +
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "text";
            +            type: TEXT;
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.0;}
            +               rel2 {relative: 1.0 0.1;}
            +               color: 108 108 108 255;
            +               text 
            +               {
            +                  font: "TIZEN";
            +                  // Resize text to fill the container height
            +                  fit: 0 1;
            +                  text: "Test properties!!";
            +               }
            +            }
            +         }
            +      }
            +   }
            +}
            +

            Text fit example

          + + +

          Image

          +

          The image elements are used to display images on the screen.

          +

          The images can have the following properties:

          + +
          • border: left right top bottom +

            Specifies the border size of the image in pixels. This property sets the area of each side of the image to be displayed as a fixed size border, preventing the corners from being changed on a resize.

          • + +
          • border_scale +

            Specifies whether the border scales its size according to the scaling factor.

            +

            The default value is 0 (off). To make the border scalable, the value must be set to 1 (on).

            + + + + + + + + +
            Table: Edje image property example
            +
            +collections 
            +{
            +   group 
            +   {
            +      name: "property_test";
            +
            +      images 
            +      {
            +         image: "00_button_01_normal.png" COMP;
            +      }
            +
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "image";
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.6;}
            +               rel2 {relative: 1.0 0.7;}
            +               image.normal: "00_button_01_normal.png";
            +            }
            +         }
            +         part 
            +         {
            +            name: "ninepatch_image";
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.8;}
            +               rel2 {relative: 1.0 0.9;}
            +               image 
            +               {
            +                  normal: "00_button_01_normal.png";
            +                  border: 4 4 0 0;
            +                  // Affected by scaling factor
            +                  border_scale: 1;
            +               }
            +            }
            +         }
            +      }
            +   }
            +}
            +

            Image example

            + +
          +

          Image Set

          +

          The image set elements are used to display a specific image on the screen based on the container size.

          +

          The image sets can have the following properties:

          + +
          • name: image-name +

            Specifies the name of the image file.

          • + +
          • size: minw minh maxw maxh +

            Specifies the minimum and maximum size that causes a specified image to be selected and shown.

            +

            The image set is used to control resource quality when the image part is scaled to multiple devices. According to the size of the part's container, an appropriate image is loaded.

            + + + + + + + + +
            Table: Edje image set property example
            +
            +collections 
            +{
            +   group 
            +   {
            +      name: "property_test";
            +
            +      images 
            +      {
            +         set 
            +         {
            +            name: "alternative_animal";
            +            image 
            +            {
            +               image: "pig.png" COMP;
            +               size: 640 800 1200 1500;
            +            }
            +            image 
            +            {
            +               image: "monkey.png" COMP;
            +               size: 400 500 639 799;
            +            }
            +            image 
            +            {
            +               image: "cat.png" COMP;
            +               size: 240 300 399 499;
            +            }
            +            image 
            +            {
            +               image: "mouse.png" COMP;
            +               size: 80 100 239 299;
            +            }
            +            image 
            +            {
            +               image: "snail.png" COMP;
            +               size: 0 0 79 99;
            +            }
            +         }
            +      }
            +
            +      parts 
            +      {
            +         part 
            +         {
            +            name: "image1";
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.0;}
            +               rel2 {relative: 1.0 0.45;}
            +               image.normal: "alternative_animal";
            +               aspect: 4/5 4/5;
            +               aspect_preference: BOTH;
            +            }
            +         }
            +         part 
            +         {
            +            name: "image2";
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.5;}
            +               rel2 {relative: 1.0 0.75;}
            +               image.normal: "alternative_animal";
            +               aspect: 4/5 4/5;
            +               aspect_preference: BOTH;
            +            }
            +         }
            +         part 
            +         {
            +            name: "image3";
            +            description 
            +            {
            +               state: "default" 0.0;
            +               rel1 {relative: 0.0 0.8;}
            +               rel2 {relative: 1.0 1.0;}
            +               image.normal: "alternative_animal";
            +               aspect: 4/5 4/5;
            +               aspect_preference: BOTH;
            +            }
            +         }
            +      }
            +   }
            +}
            +

            Image set example

            +
          + +

          Part Types

          +

          You can use fixed and flexible parts:

          + +
          • Fixed parts + +
            • Fixed parts have a minimum size (at least width or height).
            • +
            • When the part scale property is set to 1 (on), the scaling factor has an effect on the minimum size.
            • +
            • Fixed parts are used when the parts must keep a fixed size in any device or any orientation.
          • +
          • Flexible parts +
            • Flexible parts resize according to the container size and other fixed parts' size.
            • +
            • Flexible parts are used when the parts can be resized in any device or any orientation.
          + +

          Figure: Fixed and flexible parts

          +

          Fixed and flexible parts

          + + +

          Aspect Ratio

          + +

          In Tizen, the application generally fills out the screen. However, sometimes you want the application to be shown in a specific aspect ratio, regardless of the screen size.

          +

          As images are scaled in different devices, they are resized based on the container size. The images have specific properties that define the area to be shown when resized.

          + +

          For example, the following table illustrates what happens to the parts marked with yellow rectangles in the following figures, when scaling properties are applied.

          + +

          Figure: Original image [1920x1280 (8:5)]

          +

          Original image [1920x1280 (8:5)]

          + + + + + + + + + + + +
          Note
          To set the required aspect ratio, use the evas_object_size_hint_aspect_set() function or the aspect_preference attribute in the EDC.
          + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Image resizing effects with a specific aspect ratio
          AspectContainer area
          720x384 (15:8)720x640 (9:8)
          HORIZONTAL +

          Resizing based on the container width while keeping the image aspect ratio.

          +

          Extra height goes outside the image area and is clipped.

          Scaling effect

          Scaling effect

          VERTICAL +

          Resizing based on the container height while keeping the image aspect ratio.

          +

          Extra width goes outside the image area and is clipped.

          Scaling effect

          Scaling effect

          BOTH +

          Resizing based on the container area while keeping the image aspect ratio.

          +

          No extra width or height goes outside the image area, so the entire image is always shown.

          Scaling effect

          Scaling effect

          NONE +

          Resizing to fill the available area while keeping the image aspect ratio.

          +

          Extra width or height goes outside the image area and is clipped.

          Scaling effect

          Scaling effect

          + +

          Setting the Image Aspect Ratio

          +

          In case of an image object, you can set its aspect ratio with additional APIs:

          + +
          • elm_image_fill_outside_set() +

            If the function is set to TRUE, the image resizes to fill the entire area while keeping its aspect ratio. It lets the extra width or height go outside of the area (same result as with the aspect NONE in the above table).

          • + +
          • elm_image_aspect_fixed_set() + +

            If the function is set to FALSE, the image resizes to fill the entire area without keeping its original aspect ratio. The image can be distorted to fit the area.

            + + + + + + + + + + + + + + +
            Table: Image resizing without keeping the aspect ratio
            Container area
            720x384 (15:8)720x640 (9:8)

            Scaling effect

            Scaling effect

            +
          + + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/theme_n.htm b/org.tizen.ui.practices/html/native/efl/theme_n.htm new file mode 100644 index 0000000..8683d01 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/theme_n.htm @@ -0,0 +1,72 @@ + + + + + + + + + + + + + Themes: Specifying the UI Look and Feel + + + + + +
          + +

          Themes: Specifying the UI Look and Feel

          + + +

          Tizen provides powerful theme features you can use to easily change your applications' UI look and feel. A theme is a collection of visual identities, which provide the graphical appearance of applications. A theme comprises a layout, shapes, fonts, and colors for the UI components.

          + +

          The Tizen platform provides a default theme for UI components implemented based on the Tizen UX design concept (AIR – light and simple). To change the current look and feel, you can replace the default theme with a customized theme package.

          + +

          The Edje library used by Elementary provides themes. You can also use Edje to create your own objects to modify the application appearance with a unique GUI. The UI components are customizable so that each application can have its own customized theme to overlay the default theme.

          + +

          Edje supports separation between layout and logic. While it is possible to implement both GUI and logic in the C code, a loose coupling of GUI and logic is more convenient when you want to revise, add, or delete application UI components. In EFL, the GUI is handled by Edje, while application logic is handled in the C code.

          + +

          Edje was designed as a theme layer for moving the look, feel, and animation of objects into separate data files loaded at runtime. Using a plain text EDC file you can create your application's layout without writing a single line of code. EFL can even change the theme of application at runtime without restarting the application.

          + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/threads_n.htm b/org.tizen.ui.practices/html/native/efl/threads_n.htm new file mode 100644 index 0000000..2ff6f1b --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/threads_n.htm @@ -0,0 +1,507 @@ + + + + + + + + + + + + + Using Threads + + + + + +
          + +

          Using Threads

          + +

          Threads are concurrent execution environments that are lighter than full-blown processes because they share some operating system resources. Threads make it possible to do several things at the same time while using less resources and offering simpler synchronization and data exchange compared to processes.

          + +

          If you move a blocking operation to a separate thread, it cannot block the event loop and keeps the user interface reactive. Blocking the event loop and using long-running callbacks means the application cannot update its graphical user interface.

          + +

          While threads can be useful, they are not always the best choice:

          + +
          • The first rule to using threads is to avoid them as much as possible, as there are often better tools and approaches. For example, to do network transfers, use Ecore_Con that integrates with the event loop to use a function based on callbacks. Being able to use such a function means that specific support work has been done in libraries. In some cases, using a function and libraries is impossible, and in those situations threads are required.
          • +
          • Use threads in CPU-intensive tasks and disk IOs. For example, a thread is the appropriate way to apply filters to an image or to a video without blocking the interface.
          • +
          • Use threads to take advantage of multiple available CPU cores, if the workload can be split into several units of work and spread across the cores. A typical example for an image processing application on a quad-core CPU is to process 4 images at once, each on 1 thread. For such tasks, the thread pool helps with the creation and scheduling of the threads, handling all the grunt work.
          + +

          Thread Safety

          + +

          If several strings have to work on the same resources, conflicts can happen as the threads are run in parallel. For example, if thread A modifies several values while thread B is reading them, it is likely that some of the values read by B are outdated. Similar issues can happen if both threads are modifying data concurrently.

          + +

          These kinds of conflicts are called race-conditions: depending on which thread is faster, the output changes and can be incorrect. Avoiding such issues is called thread safety. Thread safety involves critical sections, which are blocks of code that operate on shared resources and must not be accessed concurrently by another thread.

          + +

          The usual solution for ensuring exclusive access to shared resources is mutual exclusion: only 1 thread can operate on the data at any given time. Mutual exclusion is often implemented through locks. Before attempting to operate on a shared resource, the thread waits until it can lock something called a mutex (stands for mutual exclusion), then operates on the resource, and unlocks the mutex. Operating systems guarantee that only 1 thread can lock a mutex at a given time: this ensures that only 1 thread operates on the shared resource at one time.

          + +

          For more information on thread safety, see Low-level Functions.

          + +

          Thread Pools

          + +

          Threads are operating system resources: while much lighter than processes, they still have a cost. Moreover, spawning a thousand threads means that each of them only gets 1/1000th of the total CPU time: each thread is progressed slowly and, in the worst case, the system wastes all of its time switching between threads without doing any actual work.

          + +

          Thread pools solve this problem. In thread pools, up to a maximum number of threads are created on-demand and used to execute tasks. When the tasks are finished, they are kept alive but sleeping. This avoids the cost of creating and destroying them.

          + +

          In EFL, the thread pool is controlled by a thread_max parameter, which defines the maximum number of threads running at the same time. Another control feature is the func_end() callback that runs from the main loop thread after a task has completed and is typically used to extract the data from the finished task and make it available to the main loop.

          + +

          To manage the maximum number of threads:

          + +
            +
          • To retrieve the current value, use the ecore_thread_max_get() function. +
          • + +
          • To set the value, use the ecore_thread_max_set() function. The value has a maximum of 16 times the CPU count. +
          • + +
          • To reset the maximum number of threads, use the ecore_thread_max_reset() function. + +
          • + +
          • To get the number of available threads in the pool, use the ecore_thread_available_get() function. The function returns the current maximum number of threads minus the number of running threads. The number can be a negative value, if the maximum number of threads has been lowered. +
          • +
          + +

          The following figures illustrate the thread pool. The first figure shows the occupancy of a hypothetical thread pool. There are several tasks, of which 4 are running. The thread_max parameter of the pool is 4, and the other tasks are waiting. There is no thread with its func_end() callback currently called.

          + +

          Figure: Thread pool, step 1

          +

          Thread pool, step 1

          + +

          When a task, applying the sepia filter on image1, finishes, the corresponding func_end() function is invoked from the main loop.

          + +

          Figure: Thread pool, step 2

          +

          Thread pool, step 2

          + +

          With the task done, one of the threads from the pool becomes available, and another thread, adding the reverberation effect on audio3, can run in it.

          + +

          Figure: Thread pool, step 3

          +

          Thread pool, step 3

          + +

          As long as there are tasks to be done, the thread pool continues the same way, running tasks in its threads whenever a thread is available.

          + + +

          Thread Management with Ecore

          + +

          Ecore offers a simplified API for managing threads in EFL applications. The Ecore API applies to a typical scenario where the main thread creates another thread, which in turn sends data back to the main thread or calls GUI-related functions. GUI-related functions are not thread-safe.

          + +

          Creating Threads with Ecore

          + +

          The threads created with Ecore are by default integrated with the thread pool and offer simple callback-based ways to interact with the main loop. New threads are created as needed until the maximum capacity of the thread pool is reached.

          + +
          • To return values to the main thread: +

            Use the ecore_thread_feedback_run() function to send intermediate feedback from the thread to the main loop.

          • + +
          • To return only the final value to the main thread: +

            To create and run a thread, use the ecore_thread_run() function. It runs a function inside a thread from the thread pool and takes care of all the low-level work. It returns the corresponding thread handler or NULL on failure.

            + +

            The most common way to return data from one thread to the main thread is to put a pointer to it in the data. When the thread is aborted or finishes, either func_cancel() or func_end() is called from the main loop. The functions are running in the simpler context of a single thread running at once and therefore avoid race-conditions.

            + +

            The data pointer approach can only be used when the data is shared between the one thread and the main thread only. However, this does not prevent you from using the func_end() callback to merge the results into a single data structure. For example, you can add all the values computed by the threads to an Eina_List, as all the operations on the list happen from a single thread and therefore one after the other and not concurrently.

          + + +

          Running Callbacks from the Main Loop

          + +

          If you are performing operations in another thread and want to update a progress bar, the update operation must be done from the main thread. The simplest way is to use the ecore_main_loop_thread_safe_call_async() function, which takes a function and some data as parameters and instructs the main loop to execute the given function with the given data.

          + +

          Depending on the kind of thread the function is called from, the process differs:

          +
            +
          • If the function is called from a thread that is not the main one, the function sends a message to the main loop and returns quickly. The message is processed in order, similarly to others.
          • + +
          • If the function is called from the main thread, the function is called immediately as if it were a direct call.
          • +
          + +

          If you want to wait until the callback is called and returns, use the ecore_main_loop_thread_safe_call_sync() function, which is similar but synchronous. Since it is synchronous, it can also return the value returned by the callback.

          + +

          Low-level Functions

          + +

          Eina offers low-level functions that are portable across the operating system, such as locks, conditions, semaphores, barriers, and spinlocks. The functions follow closely the logic of pthreads.

          + +

          While these functions are useful, they are building blocks and not usually useful in EFL applications considering the higher-level functions that are available in Ecore.

          + +

          For an introduction to threads and pthreads in particular, see:

          + + + +

          If you are already familiar with threads, see the standard pthreads documentation and the Eina reference documentation, or the following function lists. Remember that the Eina functions map very closely to the pthreads functions.

          + + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Locks (mutual exclusions)
          pthreads functionEina equivalent
          pthread_mutex_new()eina_lock_new()
          pthread_mutex_destroy()eina_lock_free()
          pthread_mutex_lock()eina_lock_take()
          pthread_mutex_trylock()eina_lock_take_try()
          pthread_mutex_unlock()eina_lock_release()
          none (prints debug information on the lock)eina_lock_debug()
          + + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Conditions (notifications when condition objects change)
          pthreads functionEina equivalent
          pthread_cond_init()eina_condition_new()
          pthread_cond_destroy eina_condition_free()
          pthread_cond_wait()eina_condition_wait()
          pthread_cond_timedwait()eina_condition_timedwait()
          pthread_cond_broadcast()eina_condition_broadcast()
          pthread_cond_signal()eina_condition_signal()
          + + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
          RWLocks (Read-write locks, for multiple-readers/single-writer scenarios)
          pthreads functionEina equivalent
          pthread_rwlock_init() +eina_rwlock_new()
          pthread_rwlock_destroy()eina_rwlock_free()
          pthread_rwlock_rwlock_rdlock() +eina_rwlock_take_read()
          pthread_rwlock_rwlock_wrlock() +eina_rwlock_take_write()
          pthread_rwlock_unlock() +eina_rwlock_release()
          + + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
          TLS (Thread-Local Storage)
          pthreads functionEina equivalent
          pthread_key_create()eina_tls_new()
          pthread_key_delete()eina_tls_free()
          pthread_getspecific()eina_tls_get()
          pthread_setspecificeina_tls_set()
          + + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
          Semaphores (access restrictions for a set of resources)
          pthreads functionEina equivalent
          sem_init()eina_semaphore_new()
          sem_destroy()eina_semaphore_free()
          sem_wait()eina_semaphore_lock()
          sem_post()eina_semaphore_release()
          + + + ++++ + + + + + + + + + + + + + + + + + + +
          Barriers
          pthreads functionEina equivalent
          pthread_barrier_init()eina_barrier_new()
          pthread_barrier_destroy()eina_barrier_free()
          pthread_barrier_wait()eina_barrier_wait()
          + +

          Thread Use Examples

          + +

          The following examples display a window with a label. An auxiliary thread semi-regularly changes the text of the label. If you want to display a regular animation, use the Ecore animators described in the Main Loop guide.

          + +

          To use the ecore_thread_feedback() function:

          + +
            + +
          1. Implement the GUI function that sets the text of a label and can be called from the main thread. + +
            +static void
            +_set_label_text(void *data, Ecore_Thread *thread __UNUSED__, void *msgdata)
            +{
            +   char buf[64];
            +   appdata_s *ad = data;
            +   snprintf(buf, sizeof(buf), "Tick %d", (int)(uintptr_t)msgdata);
            +   elm_object_text_set(ad->label, buf);
            +}
            +
            +
          2. +
          3. Send the feedback from the other thread using the ecore_thread_feedback() function. The following function does nothing besides sending the feedback and sleeping. + +
            +static void
            +_long_function(void *data __UNUSED__, Ecore_Thread *thread)
            +{
            +   int iteration;
            +   // Change the text roughly every 1 second. This is only an example; if you
            +   // want regular animations, use Ecore animators!
            +   for (iteration = 0; ; iteration++) 
            +   {
            +      // Since you are running from another thread, you need to take special
            +      // care and instead send data to the main thread and have it run the
            +      // feedback function given when creating the thread
            +      ecore_thread_feedback(thread, (void*)(uintptr_t)iteration);
            +      // Sleep for roughly one second
            +      sleep(1);
            +   }
            +}
            +
            +
          4. + +
          5. Create an end function that is called when the thread exits. In this example, the end function is called only right before the application exits. However, if the blocking function is more complex, it can trigger the end function. + +
            +static void
            +_end_func(void *data, Ecore_Thread *thread __UNUSED__)
            +{
            +   appdata_s *ad = data;
            +   elm_object_text_set(ad->label, "Ticks over");
            +}
            +
            +
          6. + +
          7. Call the ecore_thread_feedback_run() function to start the thread: + +
            +ecore_thread_feedback_run(_long_function, _set_label_text, _end_func, NULL, ad, EINA_FALSE);
            +
            +
          8. +
          + +

          To use the ecore_main_loop_thread_safe_call_sync() function:

          + +
            +
          1. Implement the GUI function that sets the text of a label and can be called from the main thread. The function receives data as a structure and alternatively displays "Tick d" or "Tock d". + +
            +struct thd 
            +{
            +   appdata_s *ad;
            +   Eina_Bool tick_not_tock;
            +   int iteration;
            +};
            +static void *
            +_set_label_text_tick_tock(void *data)
            +{
            +   char buf[64];
            +   struct thd *thd = data;
            +   snprintf(buf, sizeof(buf), "%s %d", (thd->tick_not_tock ? "Tick" : "Tock"), thd->iteration);
            +   elm_object_text_set(thd->ad->label, buf);
            +
            +   return NULL;
            +}
            +
            +
          2. + +
          3. Use the ecore_main_loop_thread_safe_call_sync() function call the GUI function. Differentiate between the ticks and the tocks: + +
            +static void
            +_long_function_tick_tock(void *data, Ecore_Thread *thread __UNUSED__)
            +{
            +   struct thd *thd = malloc(sizeof(struct thd));
            +   thd->ad = data;
            +   for (thd->iteration = 0; ; (thd->iteration)++) 
            +   {
            +      thd->tick_not_tock = EINA_TRUE;
            +      ecore_main_loop_thread_safe_call_sync(_set_label_text_tick_tock, thd);
            +      sleep(1);
            +      thd->tick_not_tock = EINA_FALSE;
            +      ecore_main_loop_thread_safe_call_sync(_set_label_text_tick_tock, thd);
            +      sleep(1);
            +   }
            +   free(thd);
            +}
            +
            +
          4. + +
          5. Start the thread through the ecore_thread_run() function: + +
            +ecore_thread_run(_long_function_tick_tock, _end_func, NULL, ad);
            +
            +
          6. +
          + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/tools_n.htm b/org.tizen.ui.practices/html/native/efl/tools_n.htm new file mode 100644 index 0000000..5234fea --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/tools_n.htm @@ -0,0 +1,243 @@ + + + + + + + + + + + + + Tools + + + +
          +
          +

          Mobile native Wearable native

          +
          + + +
          + +
          + +

          Tools

          +

          Eina provides a number of tools, such as string manipulation, that make your life easier when coding applications:

          + +
            +
          • Convert fast: conversion from, for example, strings to integers and double
          • +
          • Counter: measures the number of calls and their time
          • +
          • Error: error identifiers
          • +
          • File: file list and path split
          • +
          • Lazy allocator: lazy allocator
          • +
          • Log: full-featured logging system
          • +
          • Magic: provides runtime type checking
          • +
          • Memory Pool: abstraction for various memory allocators
          • +
          • Module lists: loads and shares modules using the Eina_Module standard
          • +
          • Rectangle: rectangle structure and standard manipulation methods
          • +
          • Safety Checks: extra checks that report unexpected conditions and can be disabled during compilation
          • +
          • String: set of functions that manage C strings
          • +
          + +

          String

          + +

          When creating applications, you always need to manipulate strings. Eina provides a very useful API for manipulating C strings:

          + +
          • + +

            The most common string manipulation is the "split". If you have a string, such as "Rasterman:Bluebugs:Tasn:Illogict:billiob:Puppet_Master", and you want to print it in an easily readable format, you can use the eina_str_split() function to split the string using a delimiter. The first parameter is the string to split, the second determines where to split the string, and the final parameter is the maximum number of strings to split the string into. If you set a number less than 1, it splits the string as many times as possible.

            +

            The function returns a newly-allocated NULL-terminated array of strings, or NULL, if it fails to allocate the array. Always remember to free the memory allocated by the eina_str_split() function.

            + +
            +char *nicks = "Rasterman:Bluebugs:Tasn:Illogict:billiob:Puppet_Master";
            +char **result_arr;
            +int i;
            +
            +// Splitting the string with ':' delimiter
            +result_arr = eina_str_split(names, ":", 0);
            +// Printing the result
            +for (i = 0; result_arr[i]; i++)
            +   printf("Nick : %s\n", result_arr[i]);
            +// Remember to free memory
            +free(arr[0]);
            +free(arr);
            +
          • + + +
          • To change the string to lowercase or uppercase, use the eina_str_tolower() and eina_str_toupper() functions. They change the case for all characters of the given string. These functions modify the original strings.

            + +
            +char *str;
            +// Initialize the string
            +str = malloc(sizeof(char) * 4);
            +strcpy(str, "bsd");
            +// Change the string to uppercase
            +eina_str_toupper((char **)&str);
            +printf("%s\n", str);
            +// Change the string to lowercase
            +eina_str_tolower(&str);
            +printf("%s\n", str);
            +// Free the allocated memory
            +free(str);
            +
          • +
          • If you need to "join" 2 strings of known length, use the eina_str_join() function. The fist parameter is the buffer to store the result, the second is the size of the buffer, the third is the separator between the 2 strings, and the 2 final parameters are the stings to be joined.

            + +
            +char *part1 = "Tizen powered by";
            +char *part2 = "Enlightenment Foundation Libraries";
            +char *res;
            +size_t size;
            +// Calculate the string size + 1 for the delimiter
            +size = strlen(part1) + strlen(part2) + 1
            +// Allocate memory for the result
            +res = malloc(sizeof(char) * size);
            +// Join the strings
            +eina_str_join(res, size, ' ', part1, part2);
            +printf("%s\n", res);
            +// Free the allocated memory
            +free(res):
            +
          • +
          • To check whether a string starts or ends with another string, use the eina_str_has_prefix() or eina_str_has_suffix() function. You can also check whether a string has a particular extension with the eina_str_has_extension() function.

            + +

            These functions return EINA_TRUE if the given string contains the specified prefix, suffix, or extension, and EINA_FALSE if it does not.

            + +
            +char *names = "Carsten;Cedric;Tom;Chidambar;Boris;Philippe"
            +if (eina_str_has_prefix(names, "Carsten"))
            +   printf("String starts with 'Carsten'")
            +if (eina_str_has_suffix(names, "Philippe"))
            +   printf("String ends with 'Philippe'")
            +if (eina_str_has_extension(names, "philippe"))
            +   printf("String has extension 'philippe'")
            +else
            +   printf("String does not have extension "philippe)
            +
          + +

          Memory Pool

          + +

          The Eina_Mempool tool provides memory pool functionality. With a memory pool, you can preallocate fixed-size memory spaces for easy memory management.

          + +

          The following mempools are available:

          +
            +
          • buddy
          • +
          • chained_pool
          • +
          • ememoa_fixed and ememoa_unknown
          • +
          • fixed_bitmap
          • +
          • pass_through
          • +
          • one_big
          • +
          + +

          Safety Checks

          + +

          Eina safety checks are a set of macros that can be used to check for parameters or values that must never occur. The concept is similar to the assert() function, but safety checks log the parameter or value and return instead of aborting your program.

          + +

          The following safety checks are available:

          +
            +
          • EINA_SAFETY_ON_NULL_RETURN(exp)
          • +
          • EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val)
          • +
          • EINA_SAFETY_ON_NULL_GOTO(exp, label)
          • +
          • EINA_SAFETY_ON_TRUE_RETURN(exp)
          • +
          • EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val)
          • +
          • EINA_SAFETY_ON_TRUE_GOTO(exp, label)
          • +
          • EINA_SAFETY_ON_FALSE_RETURN(exp)
          • +
          • EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val)
          • +
          • EINA_SAFETY_ON_FALSE_GOTO(exp, label)
          • +
          • EINA_ARG_NONNULL(...)
          • +
          + +

          To return if a variable is NULL, use the EINA_SAFETY_ON_NULL_RETURN() function. This macro calls return if the given parameter is NULL.

          + +
          +Eina_Bool myfunction(char *param) 
          +{
          +   // If my param is NULL, EINA_SAFETY_ON_NULL_RETURN calls "return"
          +   EINA_SAFETY_ON_NULL_RETURN(param);
          +
          +   printf("My pram is : %s\n", param);
          +
          +   return EINA_TRUE;
          +} 
          +
          + +

          To return a specific value, use the EINA_SAFETY_ON_NULL_RETURN_VAL() function instead of the EINA_SAFETY_ON_NULL_RETURN() function. This macro returns the given value.

          + +
          +Eina_Bool void myfunction(char *param)
          +{
          +   // If the parameter is NULL, return EINA_FALSE;
          +   EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
          +   printf("My pram is : %s\n", param);
          +
          +   return EINA_TRUE;
          +}
          +
          + +

          To call another function if a parameter is NULL, use the EINA_SAFETY_ON_NULL_GOTO() function. This macro works similarly to the EINA_SAFETY_ON_NULL_RETURN() function except that it calls goto with the given function instead of return.

          + +
          +static void isnullcb()
          +{
          +   printf("The parameter is NULL\n");
          +}
          +Eina_Bool void myfunction(char *param)
          +{
          +   // If the parameter is NULL we return EINA_FALSE;
          +   EINA_SAFETY_ON_NULL_GOTO(param, isnullcb);
          +   printf("My pram is : %s\n", param);
          +
          +   return EINA_TRUE;
          +}
          +
          + +

          Eina also provides macros that check whether a given value is TRUE or FALSE. For example, to call return if a given value is TRUE, use the EINA_SAFETY_ON_TRUE_RETURN() function. To call "goto" in a given function if a given value is TRUE, use the EINA_SAFETY_ON_NULL_GOTO() function.

          + + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/touch_gesture_n.htm b/org.tizen.ui.practices/html/native/efl/touch_gesture_n.htm new file mode 100644 index 0000000..624be6c --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/touch_gesture_n.htm @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + Handling Component Touch Gestures + + + + + + +
          +

          Handling Component Touch Gestures

          + + +

          This tutorial demonstrates how you can implement different types of gestures provided by the EFL library and instructions on how to use them.

          + +

          Initializing Touch Gestures

          + +

          The EFL library provides a wide range of touch gestures, such as tap, double tap, triple tap, long tap, momentum, line, zoom and rotate, which can be used by the application to build a dynamic user interface interaction which is simple to use as well as intuitive.

          +

          The create_base_gui function creates the application layout. It starts by creating a window, then adds the elm_conformant component to it to decorate the window with an indicator. It then adds the elm_naviframe component which acts as a view manager for the window and provides the window title functionality. After this it creates a gesture view by using the create_main_view() function and adds it to naviframe.

          +
          +static void
          +create_base_gui(appdata_s *ad)
          +{
          +   Elm_Object_Item *nf_it, *tabbar_it;
          +   // Window
          +   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
          +   elm_win_autodel_set(ad->win, EINA_TRUE);
          +   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
          +   // Conformant
          +   ad->conform = elm_conformant_add(ad->win);
          +   elm_win_conformant_set(ad->win, EINA_TRUE);
          +   evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
          +   elm_win_resize_object_add(ad->win, ad->conform);
          +   evas_object_show(ad->conform);
          +   // Naviframe
          +   ad->nf = elm_naviframe_add(ad->layout);
          +   // Calendar View
          +   create_main_view(ad);
          +   elm_naviframe_item_push(ad->nf, "Calendar", NULL, NULL, ad->calendar, NULL);
          +   elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf);
          +   // Show window after the base GUI is set up
          +   evas_object_show(ad->win);
          +}
          +
          + +

          The create_main_view function creates the application layout by arranging the labels and rectangles by using recursive composition of the box layout:

          +
          +static void
          +create_main_view(appdata_s *ad)
          +{
          +   // Box
          +   ad->box = elm_box_add(ad->nf);
          +   evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, VAS_HINT_EXPAND);
          +   elm_box_padding_set(ad->box, 0, 5 * elm_config_scale_get());
          +   evas_object_show(ad->box);
          +   // Event Rect
          +   ad->rect = evas_object_rectangle_add(evas_object_evas_get(ad->box));
          +   evas_object_size_hint_weight_set(ad->rect, EVAS_HINT_EXPAND, VAS_HINT_EXPAND);
          +   evas_object_size_hint_align_set(ad->rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
          +   evas_object_color_set(ad->rect, 204, 204, 204, 255);
          +   evas_object_repeat_events_set(ad->rect, EINA_TRUE);
          +
          +   ad->gl = create_gesture_layer(ad);
          +
          +   elm_box_pack_end(ad->box, ad->rect);
          +   evas_object_show(ad->rect);
          +}
          +
          + +

          A gesture layer is added to the rectangle object. This layer is able to receive the gesture event:

          +
          +static Evas_Object *
          +create_gesture_layer(appdata_s *ad)
          +{
          +   Evas_Object *g = elm_gesture_layer_add(ad->win);
          +   elm_gesture_layer_attach(g, ad->rect);
          +}
          +
          + +

          The following figure illustrates the Gesture Detector.

          + +

          Figure: Gesture Detector screen

          +

          Gesture Detector screen

          + +

          Implementing Touch Gestures

          + +

          The elm_gesture_layer_attach() is the function to which a gesture layer for a particular object is attached.

          +

          A gesture can have 4 different states:

          +
            +
          • ELM_GESTURE_STATE_START
          • +
          • ELM_GESTURE_STATE_MOVE
          • +
          • ELM_GESTURE_STATE_ABORT
          • +
          • ELM_GESTURE_STATE_END
          +

          Every gesture starts with the ELM_GESTURE_STATE_START state and finishes with either the ELM_GESTURE_STATE_END or ELM_GESTURE_STATE_ABORT state depending on whether the gesture is completed or aborted on that object.

          +

          If an application only needs to track a finished gesture, it can listen for the finished state only. For a more complete control of the gesture, an application can listen for all state changes for that particular gesture.

          +

          The elm_gesture_layer_cb_set() function is used for registering state change callback for a particular gesture.

          +

          For more information about the gestures, see the gesture documentation.

          + +

          To detect touch gestures:

          +
            +
          • The following example adds callbacks for listening to the tap gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS,
            +   ELM_GESTURE_STATE_START, n_finger_tap_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS,
            +   ELM_GESTURE_STATE_END, n_finger_tap_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS,
            +   ELM_GESTURE_STATE_ABORT, n_finger_tap_abort, ad);
            +
          • +
          • The following example adds callbacks for listening to the double tap gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            +   ELM_GESTURE_STATE_START, dbl_click_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            +   ELM_GESTURE_STATE_MOVE, dbl_click_move, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            +   ELM_GESTURE_STATE_END, dbl_click_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_DOUBLE_TAPS,
            +   ELM_GESTURE_STATE_ABORT, dbl_click_abort, ad);
            +
          • + +
          • The following example adds callbacks for listening to the triple tap gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            +   ELM_GESTURE_STATE_START, triple_click_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            +   ELM_GESTURE_STATE_MOVE, triple_click_move, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            +   ELM_GESTURE_STATE_END, triple_click_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TRIPLE_TAPS,
            +   ELM_GESTURE_STATE_ABORT, triple_click_abort, ad);
            +
          • +
          • The following example adds callbacks for listening to the long tap gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_START, momentum_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_END, momentum_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_ABORT, momentum_abort, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_MOVE, momentum_move, ad);
            +
          • + +
          • The following example adds callbacks for listening to the momentum gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_START, momentum_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_END, momentum_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_ABORT, momentum_abort, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM,
            +   ELM_GESTURE_STATE_MOVE, momentum_move, ad);
            +
          • + +
          • The following example adds callbacks for listening to the line gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            +   ELM_GESTURE_STATE_START, line_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            +   ELM_GESTURE_STATE_MOVE, line_move, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            +   ELM_GESTURE_STATE_END, line_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_LINES,
            +   ELM_GESTURE_STATE_ABORT, line_abort, ad);
            +
          • + +
          • The following examples add callbacks for listening to the flick gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_FLICKS,
            +   ELM_GESTURE_STATE_START, flick_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_FLICKS,
            +   ELM_GESTURE_STATE_END, flick_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_N_FLICKS,
            +   ELM_GESTURE_STATE_ABORT, flick_abort, ad);
            +
          • + +
          • The following examples add callbacks for listening to the zoom gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            +   ELM_GESTURE_STATE_START, zoom_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            +   ELM_GESTURE_STATE_END, zoom_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            +   ELM_GESTURE_STATE_ABORT, zoom_abort, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ZOOM,
            +   ELM_GESTURE_STATE_MOVE, zoom_move, ad);
            +
          • + +
          • The following example adds callbacks for listening to the rotate gesture:

            +
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            +   ELM_GESTURE_STATE_START, rotate_start, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            +   ELM_GESTURE_STATE_END, rotate_end, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            +   ELM_GESTURE_STATE_ABORT, rotate_abort, ad);
            +elm_gesture_layer_cb_set(g, ELM_GESTURE_ROTATE,
            +   ELM_GESTURE_STATE_MOVE, rotate_move, ad);
            +
          • + +
          • The following example adds a callback for getting the tap gesture finishing notification:

            +
            +static Evas_Event_Flags
            +n_finger_tap_end(void *data, void *event_info)
            +{
            +   appdata_s *ad = data;
            +   Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info;
            +   return EVAS_EVENT_FLAG_ON_HOLD;
            +}
            +
          • +
          + + + + +
          + +Go to top + + + + + + + diff --git a/org.tizen.ui.practices/html/native/efl/ui_components_mn.htm b/org.tizen.ui.practices/html/native/efl/ui_components_mn.htm new file mode 100644 index 0000000..032b728 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ui_components_mn.htm @@ -0,0 +1,1088 @@ + + + + + + + + + + + + + Mobile UI Components + + + +
          +
          +

          Mobile native

          +
          + + +
          + +
          + +

          Mobile UI Components

          + +

          The EFL Elementary is a set of fast, finger-friendly, scalable, and themeable UI component libraries. The number of supported UI components is around 80, including both containers and non-containers. Originally, the Elementary was developed as part of the Window Manager development on Desktop devices. For the mobile profile, Tizen reused the proper UI components and created new ones, and then enhanced and adjusted all of them for Tizen native applications.

          + +

          This feature is supported in mobile applications only.

          + +

          The UI components are mobile-friendly: for example, the Naviframe component supports view-managing for multiple views, the Entry component supports many modes (such as Password, Single/Multi-line, Edit/No-Edit), the Index component supports fast access to another group of UI items, and the Toolbar component shows a menu when an item is selected.

          +

          The mobile UI components were designed to allow the user to interact with touch screen-equipped mobile devices. Therefore, when developing mobile applications, you can easily use them through the mobile-related infrastructure in company with view managing and when reacting to touch events and the user finger size.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Available UI components +
          CategoryComponent nameDescription
          Navigation elementsToolbarThe toolbar component is a scrollable list of items. It can also show a menu when an item is selected. Only one item can be selected at a time.
          IndexThe index component provides an index for fast access to another group of UI items.
          SegmentcontrolThe segmentcontrol component is a horizontal control made of multiple segment items, each segment item functioning similarly as a discrete 2-state button.
          Presentation viewsWinThe win component is the root window component that will be often used in an application. It allows you to create some content in it, and it is handled by the window manager.
          BackgroundThe background component can be used to set a solid background decoration to a window or a container object. It works like an image, but has some background specific properties, such as setting it to tiled, centered, scaled, or stretched.
          GenlistThe genlist component displays a scrollable list of items. It can hold a lot of items while still being fast and memory-efficient (only the visible items are allocated memory).
          GengridThe gengrid component displays objects on a grid layout and renders only the visible objects.
          PanelThe panel component is an animated object that can contain child objects. It can be expanded or contracted by clicking on the button on its edge.
          ListThe list component is a very simple list for managing a small number of items. If you need to manage a lot of items, use the genlist component instead.
          LabelThe label component displays text with simple HTML-like markup.
          ImageThe image component can load and display an image from a file or from memory.
          IconThe icon component inherits from the image component. It is used to display images in an icon context.
          ProgressbarThe progressbar component can be used to display the progress status of a given job.
          PhotocamThe photocam component is designed to display high-resolution photos taken with a digital camera. It allows you to zoom photos, load photos fast, and fit photos. It is optimized for JPEG images and has a low memory footprint.
          User inputButtonThe button component is a simple push button. It is composed of a label icon and an icon object, and has an auto-repeat feature.
          CheckThe check component toggles the value of a Boolean between true and false.
          RadioThe radio component can display 1 or more options, but the user can only select one of them. The UI component is composed of an indicator (selected/unselected), an optional icon, and an optional label. Even though it is usually grouped with 2 or more other radio components, it can also be used alone.
          EntryThe entry component is a box to which the user can enter text.
          SliderThe slider component is a draggable bar that is used to select a value from a range of values.
          DatetimeThe datetime component can display and input date and time values.
          ColorselectorThe colorselector component provides a color selection solution to the user. It has different modes available, each of them showing a different configuration of the color selection.
          SpinnerThe spinner component enables the user to increase or decrease a numeric value by using arrow buttons.
          Assist viewsPopupThe popup component shows a pop-up area that can contain a title area, a content area, and an action area.
          CtxpopupThe ctxpopup component is a contextual popup that can show a list of items.
          NotifyThe notify component displays a container in a specific region of the parent object. It can receive some content, and it can be automatically hidden after a certain amount of time.
          TooltipThe tooltip component is a smart object used to show tips or information about a parent object when the mouse hovers over the parent object.
          TransitionTransitThe transit component can apply several transition effects to an Evas object, such as translations and rotations.
          FlipThe flip component can hold two Evas objects and let the user flip between these objects using a variety of predefined animations.
          Hardware accelerationGLViewThe GLView component can render OpenGL in an Elementary object, hiding EvasGL complexity.
          MiscellaneousMapThe map component can display a geographic map. The default map data is provided by the OpenStreetMap project (http://www.openstreetmap.org/).
          PlugThe plug component allows you to show an Evas object created by another process. It can be used anywhere like any other Elementary UI component.
          + + +

          Mobile UI Component Styles

          + +

          EFL can separate the GUI and logic of each UI component, resulting in each component having a different style of look. To change the styles of UI components, use the elm_object_style_get() and elm_object_style_set() functions to get and apply the style for a specific UI component.

          + +

          The following tables list the styles for each winset, including the names of the styles, and the name of the part where to set text or some other Evas_Object in the UI component. For more detailed information, see the Themes.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Button styles
          StyleSampleText partSwallow partNotes
          elm/button/base/default elm.textelm.swallow.content
          elm/button/base/anchorelm.textelm.swallow.content
          elm/button/base/bottomelm.textelm.swallow.contentThis style is used widely at the bottom of the screen.
          elm/button/base/circleelm.textelm.swallow.content
          elm/button/base/dropdownelm.text
          elm/button/base/hoversel_horizontal/defaultelm.textelm.swallow.content
          elm/button/base/hoversel_horizontal_entry/defaultelm.textelm.swallow.content
          elm/button/base/hoversel_vertical/defaultelm.textelm.swallow.content
          elm/button/base/hoversel_vertical_entry/defaultelm.textelm.swallow.content
          elm/button/base/icon_reorder
          elm/button/base/naviframe/drawers
          elm/button/base/naviframe/title_cancel
          elm/button/base/naviframe/title_done
          elm/button/base/option
          + + + +++ + + + + + + + + + + + + + + + + + +
          Table: Check styles
          StyleSample
          elm/check/base/default
          elm/check/base/favorite
          elm/check/base/on&off
          + + + + + + + + + + + + + + + +
          Table: Colorselector styles
          StyleSampleNotes
          elm/colorselector/item/color/colorplaneUse the following command: elm_colorselector_mode_set(colorselector, ELM_COLORSELECTOR_PALETTE);
          + + + + + + + + + + + + + + + + + +
          Table: Progressbar styles
          StyleSample
          default
          wheel
          + + + +++ + + + + + + + + + +
          Table: Radio styles
          StyleSample
          default
          + + + + + + + + + + + + + + + + + +
          Table: List styles
          StyleSampleText partSwallow part
          defaultelm.textelm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          + + + + + + + + + + + + + + + + + +
          Table: Multi Button Entry styles
          StyleSampleText partNotes
          elm/multibuttonentry/base/defaultelm.text, guideThe guide text part is used when there is no item in the Multi Button Entry. It is removed automatically when an item is appended in the Multi Button Entry.
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Toolbar styles
          StyleSampleText partSwallow partNotes
          elm/toolbar/base/default
          elm/toolbar/base/navigationbar
          elm/toolbar/base/tabbar_with_title
          elm/toolbar/item/defaultelm.textelm.swallow.iconThis style is for the toolbar's item. Check the elm_toolbar_item_append() function to set the text and the icon.
          elm/toolbar/item/navigationbarelm.textThis style is for the toolbar's item. Check the elm_toolbar_item_append() function to set the text and the icon.
          + + + +++ + + + + + + + + + +
          Table: Flipselector styles
          StyleSample
          default
          + +

          The style of the genlist's item is not set by external APIs. Check the guide of Genlist to check how to use the item class to set the item's style.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Genlist styles
          StyleSampleText partSwallow partNotes
          defaultelm.textelm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          default_styleelm.textelm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          double_labelelm.text: for the main text. +

          elm.text.sub: for the sub text.

          elm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          end_iconelm.textelm.swallow.icon
          fullelm.swallow.contentThe swallow part is the full size of the item. There is no padding in the item.
          group_indexelm.textelm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          one_iconelm.textelm.swallow.icon
          messageelm.text: for the text on the top. +

          elm.title.1: for the text in the middle.

          +

          elm.title.2: for the text on the bottom.

          + +

          The style of the gengrid's item is not set by external APIs. For more information on using the item class to set the item's style, see the guide of gengrid.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Gengrid styles
          StyleSampleText partSwallow partNotes
          defaultelm.swallow.icon
          album-previewelm.textelm.swallow.icon
          blockThis style is used to show an empty area.
          group_indexelm.textelm.swallow.icon
          default_gridelm.swallow.icon
          default_gridtext2elm.textelm.swallow.icon
          default_gridtextelm.textelm.swallow.icon
          default_styleelm.textelm.swallow.icon
          + + + + + + + + + + + + + +
          Table: Segmentation Control styles
          StyleSample
          default
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Index styles
          StyleSampleNotes
          defaultThis style is for supporting the vertical style.
          defaultThis style is for supporting the horizontal style. To set a horizontal index, use the elm_index_horizontal_set.
          pagecontrolThis style is used for the "page control" layout. For more information, refer to the Core Control sample application.
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Contextual Popup (Ctxpopup) styles
          StyleSampleNotes
          default
          dropdown/listThe size of the item and the ctxpopup follow the size of the screen.
          dropdown/labelThe size of the item and the ctxpopup follow the maximum length of the item.
          + + + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Icon styles
          StyleSample
          apps
          arrow_down
          arrow_left
          arrow_right
          arrow_up
          chat
          clock
          close
          delete
          edit
          file
          home
          media_player/forward
          media_player/info
          media_player/next
          media_player/pause
          media_player/play
          media_player/prev
          media_player/rewind
          media_player/stop
          menu/apps
          menu/arrow_down
          menu/arrow_left
          menu/arrow_right
          menu/arrow_up
          menu/chat
          menu/clock
          menu/close
          menu/delete
          menu/edit
          menu/file
          menu/folder
          menu/home
          menu/refresh
          no_photo
          photo/no_photo
          refresh
          toolbar/apps
          toolbar/arrow_down
          toolbar/arrow_left
          toolbar/arrow_right
          toolbar/arrow_up
          toolbar/chat
          toolbar/clock
          toolbar/close
          toolbar/delete
          toolbar/edit
          toolbar/file
          toolbar/folder
          toolbar/home
          toolbar/more_menu
          toolbar/refresh
          + + + + + + + + + + + + + + + + + + + +
          Table: Entry styles
          StyleSampleText partSwallow partNotes
          defaultelm.guide: for the guide text. +

          elm.text: for the main text.

          The guide text is automatically erased when the main text is entered.
          + + + +++ + + + + + + + + + + + + + + + + + +
          Table: Datetime styles
          StyleSample
          date_layout
          time_layout
          time_layout_24hr
          + + + + + + + + + + + + + + + + + +
          Table: Panel (drawer) styles
          StyleSampleSwallow partNotes
          defaultelm.swallow.contentFor more information on the drawer, see the [UI Sample] Core Control guide.
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Slider styles
          StyleSampleSwallow part
          horizontal/defaultelm.swallow.icon
          horizontal/center_pointelm.swallow.icon
          vertical/center_point
          vertical/default
          + + + +++ + + + + + + + + + + + + + +
          Table: Popup styles
          StyleSample
          default
          toast
          + + + +++ + + + + + + + + + + + + + +
          Table: Spinner styles
          StyleSample
          horizontal
          vertical
          + + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/ui_components_n.htm b/org.tizen.ui.practices/html/native/efl/ui_components_n.htm new file mode 100644 index 0000000..0079e6f --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ui_components_n.htm @@ -0,0 +1,693 @@ + + + + + + + + + + + + + UI Components: Handling Elementary UI Component Libraries + + + + + +
          + +

          UI Components: Handling Elementary UI Component Libraries

          + +

          Before writing an application, you should already have an answer to the following question: What is an application? An application is a process launched by the user. Every application has at least one window for presenting its content. Users can interact with the content through events. Different sources of events can modify the life cycle of the application. The application may receive data from a network connection, and it may also receive touch and key events. From the computer's point of view, an application is a collection of code that reacts to events and displays content on the screen. Elementary bridges this divide between the user and the code.

          + +

          Elementary provides a variety of pre-built UI components, such as layout objects and components, that allow you to build rich graphical user interfaces for your applications. Every Elementary application has at least one window for presenting its content. The window provides the area in which to display the content and where the Evas canvas is placed.

          + +

          There are three main groups of objects provided by Elementary:

          + +
            +
          • UI components: These are the components with which you build your application UI.
          • +
          • Containers: These are the containers that hold the components.
          • +
          • Infrastructure: These are the modules that deal with Elementary as a whole.
          • +
          + +

          Using UI Components

          + +

          The Elementary library is a simple toolkit. It provides several UI components than can be used to compose the user interface of your application. UI components allow you to build your application without having to reinvent basic objects, such as buttons, lists, or text entries. UI components will often generate signals that can be caught in the application when the user interacts with the UI components. This guide teaches you the basics of Elementary, describes selected concepts of the Elementary configuration framework, and describes the most common UI components.

          + +

          Figure: Elementary

          +

          Elementary

          + + +

          Getting Started with the Elementary Library

          + + +

          Elementary UI components are built in a hierarchical fashion. The idea is to factorize as much code as possible between UI components that behave in a similar manner to facilitate the creation of new UI components. The Elementary UI components inherit a lot of their code from the container UI components and the layout component (a container component that takes a standard Edje design file and wraps it very thinly). You can use the container and layout functions on the Elementary UI components, as well as the Elementary object functions, such as elm_object_part_content_set(), elm_object_part_content_get(), and elm_object_part_content_unset().

          + +

          To use the Elementary library:

          + +
          1. Initialize the Elementary library with the elm_init() function.
          2. +
          3. Start the Elementary main loop with the elm_run() function. +

            The function does not return, instead, it constantly loops and runs the event and the processing tasks.

          4. +
          5. Add Elementary UI components in the main loop. +

            Generally, an Elementary UI component can be added with the elm_<UI component name>_add() function, which returns an Evas object (Evas_Object*). The Evas object is passed to the functions that are used to configure the UI component.

          6. +
          7. Stop the main loop and return to the main() function with the elm_exit() function.
          8. +
          9. When your application terminates, shut down the Elementary library with the elm_shutdown() function. +

            The function frees the Elementary objects that were allocated in the main loop, so you do not need to separately deallocate them.

          + + +

          The following code snippet shows the main() function of a minimal Elementary application:

          + +
          +#include <Elementary.h>
          +int main(int argc, char **argv)
          +{
          +   elm_init(argc, argv);
          +   elm_run();
          +   elm_shutdown();
          +
          +   return 0;
          +}
          + + +

          Elementary Objects

          + +

          All objects created using Elementary are of the Evas_Object* type. This means that both Evas and Elementary functions can be used on an Elementary object. However, use Elementary functions on Elementary objects only when you do not know which API to use.

          + +

          Since an Elementary object can take up a lot of memory, the Elm_Object_Item type has been created for situations where you need to use a lot of items, such as in a genlist or gengrid component, and to save memory. Using the Elm_Object_Item type, an Elementary UI component can, in theory, contain a lot of items while maintaining a small memory footprint. In practice, the Elm_Object_Item instance is bigger than expected, but can still help in saving memory.

          + +

          For more information, see Evas Objects.

          + +

          Elementary Callbacks

          + +

          Several callbacks can be registered to handle Elementary object events:

          + +
            +
          • Evas event callback +

            Use the evas_object_event_callback_add() function to add a callback for input events (key up, key down, mouse wheel) on an Evas object. In case of an Elementary object, the callback is registered on the underlying Evas object without considering the Elementary object infrastructure (no event propagation).

            +
          • + +
          • Evas smart callback +

            Use the evas_object_smart_callback_add() function to add a callback for a smart event emitted by an Elementary object. Smart callbacks can only be registered on smart objects, and the "smart event" to register must be implemented by the corresponding smart object. Otherwise, the callback does nothing. The callback does not apply to input events (keyboard or mouse).

            +
          • + +
          • Edje signal callback +

            Use the edje_object_signal_callback_add() function to add a callback for a signal coming from an Edje object (a theme object).

            +
          • + +
          • Elementary signal callback +

            Use the elm_object_signal_callback_add() function to add a callback for a signal coming from an Elementary UI component's theme. The callback does not apply to input events (keyboard or mouse).

            +
          • + +
          • Elementary event callback +

            Use the elm_object_event_callback_add() function to add a callback for an input event (keyboard or mouse) coming from an Elementary object. In contrast to the Evas event callback, the Elementary event callback takes the hierarchy of the object into account: the event can be propagated to the parents of the object, and the parents can process the event.

            +
          • +
          + +

          For more information about events related to Elementary objects, see Event Handling. For more information about Evas objects and smart objects, see Evas Rendering Concept and Method.

          + +

          Managing Elementary Profiles

          + +

          An Elementary profile is a set of preconfigured options that affects the entire look and feel of an application. The options linked to a specific profile form an Elementary configuration, which can be used to store the desired set of options for use in multiple sessions. Once loaded, the Elementary profile configures all the options and sets the look and feel of your Elementary application.

          + +

          To manage Elementary profiles:

          +
            +
          • List the existing profiles: +
            +Eina_List *list = elm_config_profile_list_get();
            +
            +
          • +
          • Set a particular profile: +
            +elm_config_profile_set("myprofile");
            +
            +
          • +
          • Get the current profile: +
            +char *profile = elm_config_profile_get();
            +
            +
          • +
          • To save the current option values as an Elementary configuration for later use, use the Elementary Configuration Save function. +
          • +
          • To reload the Elementary configuration saved for the current profile: +
            +elm_config_reload();
            +
            +
          • +
          + +

          Configuring Elementary Options

          + +

          You can set the following options in the Elementary configuration. In addition, you can customize themes and manage focus.

          +
            + +
          • To scale UI components: +

            You can configure UI component scaling in terms of both interactive and readable areas.

            +
              +
            • Set the global scaling factor (for example, setting it to 2.0 doubles the size of all scalable UI components): +
              +elm_config_scale_set(2.0);
              +
              +
            • + +
            • Set the finger size: +
              +elm_config_finger_size_set(1.5);
              +
              +
            • +
            +
          • + +
          • To manage caches: +
              +
            • Enable the globally configured cache flush, and set the flush interval (in this example, to 60 seconds): +
              +elm_config_cache_flush_enabled_set(EINA_TRUE);
              +elm_config_cache_flush_interval_set(60);
              +
              +
            • + +
            • Configure the font and image cache sizes (to 500 and 5 000 000 bytes, respectively): +
              +elm_config_cache_font_cache_size_set(500);
              +elm_config_cache_image_cache_size_set(5000000);
              +
              +
            • + +
            • Set the Edje collection and Edje file cache sizes: +
              +elm_config_cache_edje_file_cache_size_set(500);
              +elm_config_cache_edje_collection_cache_size_set(500);
              +
              +
            • +
            +
          • + + +
          • To configure the gesture layer: +

            You can set the duration of the long tap and double tap events on the gesture layer objects. The following example sets the duration to 500 ms.

            + +
            +elm_config_glayer_long_tap_start_timeout_set(0.5);
            +elm_config_glayer_double_tap_timeout_set(0.5);
            +
            +
          • +
          • To manage scrolling: +
              +
            • Make the scroller bounce when it reaches its viewport's edge during scrolling by using the elm_config_scroll_bounce_enabled_set() function: +
              +elm_config_scroll_bounce_enabled_set(EINA_TRUE);
              +
              +
            • + +
            • Control the inertia of the bounce animation by using the elm_config_scroll_bounce_friction_set() function: +
              +elm_config_scroll_bounce_friction_set(0.5);
              +
              +

              You can also set the friction for a page scroll, include animations, and zoom animations.

              +
            • + +
            • Set the scroller to be draggable by using the elm_config_scroll_thumbscroll_enabled_set() function. You can configure several drag options, such as friction, sensitivity, acceleration, and momentum. + +

              The following example sets the scroller to be draggable, defines that the number of pixels one must travel while dragging the scroller view to actually trigger scrolling is 20 pixels.

              +
              +elm_config_scroll_thumbscroll_enabled_set(EINA_TRUE);
              +elm_config_scroll_thumbscroll_threshold_set(20);
              +
              +
            • +
            +
          • + +
          • To configure long press events: +

            Get the current timeout before a long press event is retrieved, and modify it. The following example increases the timeout by 1 second.

            +
            +double lp_timeout = elm_config_longpress_timeout_get();
            +elm_config_longpress_timeout_set(lp_timeout + 1.0);
            +
            +
          • + +
          • To configure tooltips: +

            Set the duration after which a tooltip is shown. The following example sets the delay to 2 seconds.

            + +
            +elm_config_tooltip_delay_set(2.0);
            +
            +
          • + +
          • To configure the password show last feature: +

            The password show last feature enables the user to view the last input entered for a few seconds before it is masked.

            + +
              +
            • Enable the password show last feature: +
              +elm_config_password_show_last_set(EINA_TRUE);
              +
              +
            • +
            • Set the visibility timeout (how many seconds the input is visible): +
              +elm_config_password_show_last_timeout_set(5.0);
              +
              +
            • +
            +
          • +
          • To set the Elementary engine: +

            You can define the rendering engine that Elementary uses to draw the windows. The following rendering engines are supported:

            + +
              +
            • "software_x11"
            • +
            • "fb"
            • +
            • "directfb"
            • +
            • "software_16_x11"
            • +
            • "software_8_x11"
            • +
            • "xrender_x11"
            • +
            • "opengl_x11"
            • +
            • "software_gdi"
            • +
            • "software_16_wince_gdi"
            • +
            • "sdl"
            • +
            • "software_16_sdl"
            • +
            • "opengl_sdl"
            • +
            • "buffer"
            • +
            • "ews"
            • +
            • "opengl_cocoa"
            • +
            • "psl1ght"
            • +
            + +
            +elm_config_engine_set("opengl_x11");
            +
            +
          • + +
          • To activate the access mode: +

            Set the access mode as active, so that information about an Elementary object is read when the object receives an EVAS_CALLBACK_MOUSE_IN event.

            +
          • + +
          • To configure the selection mode: +

            Set the selection mode so that the selection is cleared when the entry component is unfocused:

            +
            +elm_config_selection_unfocused_clear_set(EINA_TRUE);
            +
            +
          • + +
          • To enable mirroring: +

            Elementary allows UI mirroring both on a single object and on the entire UI. If mirroring is enabled, an Elementary UI component displays as if there was a vertical mirror in the middle of it. Only the controls and the disposition of the UI component are mirrored. Text is not mirrored.

            + +
            +elm_config_mirrored_set(EINA_TRUE);
            +
            +
          • + +
          • To set the frame rate: +

            Define the frames per second (FPS) value for the ecore_animator_frametime and edje_frametime calculations. This example sets the FPS 60.

            + +
            +elm_config_fps_set(60.0);
            +
            +
          • +
          + +

          Customizing Themes

          + +

          Elementary uses Edje to theme its UI components. Edje provides a default theme for each UI component in an application. You can change the theme using the ELM_THEME environment variable. You can also modify the theme globally with the elementary_config utility.

          + +

          For custom styles, use extensions. Extensions allow you to write styles for specific UI components. Add a new extension to the list of Elementary themes with the elm_theme_extension_add() function, and apply the new style to the UI component with the elm_object_style_set() function. Once set, the extension replaces the default theme of the UI component.

          + + + + + + + + + + +
          Note
          When developing an extension, to respect the signals emitted and the elements that need to be in place, you must know how the UI component is themed. If something is missing from the extension, it can break the UI component's behavior.
          + +

          To modify Elementary themes, you can also use overlays. An overlay can replace the look of all UI components by overriding the default styles. As with extensions, you must write the correct overlay theme for a UI component. When looking for a theme to apply, Elementary first checks the list of overlays, then the set theme, and finally the list of extensions. To add or remove an overlay, use the elm_theme_overlay_add() and elm_theme_overlay_del() functions.

          + + + + + + + + + + +
          Note
          With overlays, you can replace the default view and affect every UI component. This is very similar to setting the theme for the whole application, and probably clashes with end user options. Using overlays also runs the risk of non-matching styles across the application. Unless you have a very good reason to use them, avoid overlays.
          + +

          Managing Focus

          + +

          When an Elementary object has the focus, input events are directly passed to that object in the application window. The focused object can also change its decoration to show the user where the focus is. In an Elementary application, only one object can have the focus at a time.

          + +

          To set the focus to a new Elementary object and take the focus away from the previous focused object, use the elm_object_focus_set() function. You can make an object unfocusable with the elm_object_focus_allow_set() function.

          + + + + + + + + + + +
          Note
          Only visible objects can have the focus.
          + +

          Elementary supports focus chains that allow you to cycle through all the focusable objects in a window. By default, the focus chain is defined by the order in which the UI components are added to the code. It is also possible to define custom focus chains, when needed.

          + +

          For more information on focus, see Component Focus.

          + +

          To manage the focus:

          + +
            +
          • To define a custom focus chain, create an Eina_List, and add the Elementary objects to it in the desired focus order. Use the elm_object_focus_custom_chain_set() function to set the final list as the custom focus chain of the parent object (in the following example, container_object is the parent object). + +
            Eina_List *obj_list = NULL;
            +
            +list = eina_list_append(list, obj1); 
            +list = eina_list_append(list, obj4);
            +list = eina_list_append(list, obj2); 
            +list = eina_list_append(list, obj3);
            +
            +elm_object_focus_custom_chain_set(container_object, list);
            +
          • + +
          • To remove the custom focus chain and use the default focus chain instead, use the elm_object_focus_custom_chain_unset() function. +
          • + +
          • To programmatically cycle through the focus chain, use the elm_object_focus_next() function. +
          • + +
          • To show a highlight on the focused object: + +
            +elm_config_focus_highlight_enabled_set(EINA_TRUE);
            +
            +
          • + +
          • To activate an animation when the focus shifts from one object to another: + +
            +elm_config_focus_highlight_animate_set(EINA_TRUE);
            +
            +
          • +
          + +

          Scaling UI Components

          + +

          Elementary, through its configuration API (elm_config), provides a way to scale UI components with two different parameters. Finger size parameter is used when the interactive zones (clickable, editable) of the UI components need to be scaled in order to be comfortably used with a finger. Scale parameter is responsible for scaling readable parts of a UI component (text or icons for example), so that it is more visible in the user interface.

          + +

          Finger Size

          + +

          Finger size parameter scales UI components based on the user's finger size. This is useful when using a touchscreen with a finger rather than with a stylus. The finger size parameter is in pixels and determines the minimum size of a square on the screen that is reliably hittable with a finger. This parameter scales the input and interactive areas.

          + +

          The global finger size is set with the elm_config_finger_size_set() function. This adjusts the size and hit area of UI components so they are easy to hit with a finger. The current value is retrieved with the elm_config_finger_size_get() call. The finger size is always in pixel.

          + +

          To increase the current global finger size by 20px:

          + +
          +Evas_Coord finger_size;
          +
          +// Get the current finger size
          +finger_size = elm_config_finger_size_get();
          +
          +// Add 20px to finger size parameter and set it 
          +// to the global Elementary configuration
          +elm_config_finger_size_set(finger_size + 20);
          +
          + +

          Scale

          + +

          This parameter only scales the readable areas of the UI component (text, icons). Parts that must stay pixel-perfect like the highlights, shading, textures and decorations stay as they are.

          + +

          elm_config_scale_set() function is used to set the global scaling factor, that affects to all the UI components. It is also possible to use elm_object_scale_set() to set the scaling factor on a given Elementary UI component and all its children.

          + + + + + + + + + + +
          Note
          The scaling factor is multiplicative, if a child already has a scale size set, it is multiplied by its parent's scale size.
          + +

          The following example sets the global scaling factor to 2.0. Then, the scaling factor of an existing Elementary object is set to 2.0, meaning that this object appears as if it had a 4.0 scale factor, the rest of the application is displayed with a 2.0 scaling factor:

          + +
          +Evas_Object *button;
          +
          +// The button object is created and configured
          +
          +// Set the global scale factor to 2.0
          +elm_config_scale_set(2.0);
          +
          +// Set the scaling factor of the button component to 2.0, this component
          +// appears 4 times bigger than its initial size
          +elm_object_scale_set(button, 2.0);
          +
          + +

          Example

          + +

          This chapter shows the visual result of finger size and scaling factors modification.

          + +

          Figure: elementary_config application

          +

          elementary_config application

          + +

          The previous picture shows the elementary_config application that enables the user to set global scale factor and finger size parameter. As the user drags the sliders, the UI is updated, directly showing the result of the new parameter value.

          + +

          The next picture shows the behavior when the finger size parameter has been increased to 1.30. The text of the sliders and the text of the items in the toolbar are bigger.

          + +

          Figure: Scale increased (1.30)

          +

          Scale increased (1.30)

          + +

          A finger size increase is showed in the image below (increase from 50px to 90 px). Now, the buttons in the toolbar are bigger, so the user can more reliably hit them with a big finger.

          + +

          Figure: Finger size increased (90px)

          +

          Finger size increased (90px)

          + + + + + + + + + + +
          Note
          It is up to the theme (Edje file) to set the parts that are scalable. This is something that needs to be taken into account when developing a new Edje theme. This can be done in EDC with the scale parameter. For more information on how to do that, see Introduction to EDC Programming.
          + +

          Creating Scalable EDC Objects

          + +

          Scale Parameter

          + +

          This chapter explains how to make a scalable Edje object and give hints how to write an EDC file that is scalable. The example shows a basic button that is composed of a background image part and a swallow part that can receive some content.

          + +
          +group 
          +{ 
          +   name: "button";
          +   images 
          +   {
          +      image: "bg.png" COMP;
          +   }
          +   parts 
          +   {
          +      part 
          +      { 
          +         name: "bg";
          +         type: IMAGE;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            image.normal: "bg.png";
          +         }
          +      }
          +      part 
          +      { 
          +         name: "elm.swallow.content";
          +         type: SWALLOW;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            visible: 0;
          +         }
          +         description 
          +         { 
          +            state: "visible" 0.0;
          +            visible:1;
          +         }
          +      }
          +   }
          +}
          +
          + +

          To have a scalable object, set the scale parameter to 1 on the parts you want to be scalable. Here the bg and elm.swallow.content parts must be scalable.

          + +
          +group 
          +{ 
          +   name: "button";
          +   images 
          +   {
          +      image: "bg.png" COMP;
          +   }
          +   parts
          +   {
          +      part 
          +      { 
          +         name: "bg";
          +         type: IMAGE;
          +         scale: 1;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            image.normal: "bg.png";
          +         }
          +      }
          +      part 
          +      { 
          +         name: "elm.swallow.content";
          +         type: SWALLOW;
          +         scale: 1;
          +         description 
          +         { 
          +            state: "default" 0.0;
          +            visible: 0;
          +         }
          +         description 
          +         { 
          +            state: "visible" 0.0;
          +            visible:1;
          +         }
          +      }
          +   }
          +}
          +
          + +

          Image Set

          + +

          If your application needs to be used at different resolutions it is recommended to have 2 images for the background image bg.png. Here the bg_low.png is added to the application. It is used when the size of the image is under 500 px, and a bg_high.png image is for higher resolutions. Use a set on the bg.png image.

          + +
          +group 
          +{ 
          +   name: "button";
          +   images 
          +   {
          +      set 
          +      {
          +         name: "bg.png";
          +         image
          +         {
          +            image: "bg_low.png" COMP;
          +            size: 0 0 200 100;
          +         }
          +         image
          +         {
          +            image: "bg_high.png" COMP;
          +            size: 201 101 5000 5000;
          +         }
          +      }
          +   }
          +}
          +
          + +

          The image below shows three buttons with only a background part visible (the SWALLOW part is empty).

          + +

          Figure: Image set example

          +

          Image set example

          + +

          The first button's size is 100x50 pixels, the background image (bg_low.png) is the same size. The second button is twice bigger than the first one (200x100 pixels). The image is scaled and it does not render well, the borders are quite blurry.

          + +

          To prevent this, the image set has a bigger image to use when the size is bigger than 200x100 pixels (bg_high.png). The third button size is 201x101 pixels and it uses the new image, which has a better quality than the scaled image.

          + +

          Image Borders

          + +

          When the button is resized, the image part is also resized because it is marked as scalable. To get the image resized but to keep the image border as it is, use the border parameter. It specifies the border size which is not resized even if the image is.

          + +

          To add a 40 pixel border on the left and right part of the bg image and a 20 pixel border on top and bottom borders:

          + +
          +parts 
          +{
          +   part 
          +   { 
          +      name: "bg";
          +      type: IMAGE;
          +      scale: 1;
          +      description 
          +      { 
          +         state: "default" 0.0;
          +         image.normal: "bg.png";
          +         image.border: 40 40 20 20;
          +      }
          +   }
          +}
          +
          + +

          The image below shows that when resizing the button, the corners keep their initial ratio. Only the middle part of the button is resized.

          + +

          Figure: Border example

          +

          Border example

          + + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/ui_components_wn.htm b/org.tizen.ui.practices/html/native/efl/ui_components_wn.htm new file mode 100644 index 0000000..49b57f8 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ui_components_wn.htm @@ -0,0 +1,883 @@ + + + + + + + + + + + + + Wearable UI Components + + + + + +
          + +

          Wearable UI Components

          + +

          The EFL Elementary is a set of fast, finger-friendly, scalable, and themeable UI component libraries. The number of supported UI components is around 80, including both containers and non-containers. Originally, the Elementary was developed as part of the Window Manager development on Desktop devices. For the wearable profile, Tizen reused the proper UI components and created new UI styles for rectangular and circular wearable devices, and then enhanced and adjusted all of them for Tizen native applications.

          + +

          This feature is supported in wearable applications only.

          + +

          The UI components are wearable-friendly: for example, the Circle Datetime component extends the elm_date_time by visualizing the selected field, the Circle Genlist component provides a scrollbar with circular movement, and the Circle progress bar/scroller/slider components are adjusted to the circular design.

          +

          The wearable UI components were designed to allow the user to interact with small touch screen-equipped wearable devices with rotary component parts. Therefore, when developing wearable applications, you can easily use them through the wearable-related infrastructure in company with full notification and when reacting to touch and rotary events and the user finger size.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Available UI components +
          CategoryComponent nameDescription
          Navigation elementsIndexThe index component provides an index for fast access to another group of UI items.
          Presentation viewsWinThe win component is the root window component that will be often used in an application. It allows you to create some content in it, and it is handled by the window manager.
          BackgroundThe background component can be used to set a solid background decoration to a window or a container object. It works like an image, but has some background specific properties, such as setting it to tiled, centered, scaled, or stretched.
          GenlistThe genlist component displays a scrollable list of items. It can hold a lot of items while still being fast and memory-efficient (only the visible items are allocated memory).
          ListThe list component is a very simple list for managing a small number of items. If you need to manage a lot of items, use the genlist component instead.
          LabelThe label component displays text with simple HTML-like markup.
          ImageThe image component can load and display an image from a file or from memory.
          IconThe icon component inherits from the image component. It is used to display images in an icon context.
          ProgressbarThe progressbar component can be used to display the progress status of a given job.
          User inputButtonThe button component is a simple push button. It is composed of a label icon and an icon object, and has an auto-repeat feature.
          CheckThe check component toggles the value of a Boolean between true and false.
          RadioThe radio component can display 1 or more options, but the user can only select one of them. The UI component is composed of an indicator (selected/unselected), an optional icon, and an optional label. Even though it is usually grouped with 2 or more other radio components, it can also be used alone.
          EntryThe entry component is a box to which the user can enter text.
          SliderThe slider component is a draggable bar that is used to select a value from a range of values.
          DatetimeThe datetime component can display and input date and time values.
          Assist viewsPopupThe popup component shows a pop-up area that can contain a title area, a content area, and an action area.
          CtxpopupThe ctxpopup component is a contextual popup that can show a list of items.
          NotifyThe notify component displays a container in a specific region of the parent object. It can receive some content, and it can be automatically hidden after a certain amount of time.
          TransitionTransitThe transit component can apply several transition effects to an Evas object, such as translations and rotations.
          Hardware accelerationGLViewThe GLView component can render OpenGL in an Elementary object, hiding EvasGL complexity.
          MiscellaneousPlugThe plug component allows you to show an Evas object created by another process. It can be used anywhere like any other Elementary UI component.
          + +

          The following UI components were designed for specific circular wearable devices which have rotary component parts. In a circular device, you can draw round UI components, such as a slider, progressbar, and scroller. Generally, wearable UI components provide compatibility between the rectangular and circular wearable devices. However, use circular UI components for circular wearable devices only, because they have a dependency with the round UX and rotary events. For more information on the compatibility of the UI components between rectangular and circular, see the Wearable Design Guidelines.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Available circular UI components +
          Component nameDescription
          Circle DatetimeThe circle datetime extends elm_datetime by visualizing the selected field.
          Circle GenlistThe circle genlist provides a scrollbar with circular movement. It is also operated with rotary events to move to the next or previous item.
          Circle ObjectThe circle object extends elementary components in a form of circular design. Sometimes a circle object merely provides additional UI features to elementary component, and sometimes it works as an independent component with UI and functionalities. +

          Circular components can usually be added with the eext_circle_object_[component_name]_add() function, which returns a circle object handle. Circular components are shown in a form of an arch with radius, line width, and color. These properties can be set with the eext_circle_object_item* APIs. The circle object can also take a rotary event. Generally, a clockwise rotary event increases the value of the rotary event activated by the circle object, and a counter clockwise rotary event decreases the value.

          Circle ProgressbarThe circle progressbar aims to show the progress status of a given task with circular design. It visualizes the progress status within a range.
          Circle ScrollerThe circle scroller changes corresponding to the rotary events. It shows the whole scrollable area with a circular scroll bar.
          Circle SliderThe circle slider changes corresponding to rotary events. The circle slider not only extends the UI feature of the elm_slider, but also replaces the functionalities of the elm_slider in a circular design.
          Circle SurfaceThe circle surface manages and renders circle objects. Multiple circle objects can be connected to one circle surface as candidates of an object to be rendered.
          Rotary SelectorThe rotary selector shows multiple items around a selector, and can change pages through rotary events.
          More OptionThe more option contains a cue button, which, when clicked, reveals a rotary selector view.
          Circle SpinnerThe circle spinner shows a spinner value as a marker around the circular display.
          + +

          Wearable Rectangular UI Component Styles

          + +

          EFL can separate the GUI and logic of each UI component, resulting in each component having a different style of look. To change the styles of UI components, use the elm_object_style_get() and elm_object_style_set() functions to get and apply the style for a specific UI component.

          + +

          The following tables list the styles for each winset, including the names of the styles, and the name of the part where to set text or some other Evas_Object in the UI component. For more detailed information, see the Themes.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Button styles
          StyleSampleText partSwallow partNotes
          default elm.textelm.swallow.content
          greenelm.textelm.swallow.content
          orangeelm.textelm.swallow.content
          redelm.textelm.swallow.content
          nextdepth
          naviframe/title_iconelm.swallow.contentThe icon can be set with the elm_object_part_content_set(btn, "icon", ic) function.
          + + + +++ + + + + + + + + + + + + + +
          Table: Check styles
          StyleSample
          default
          on&off
          + + + + + + + + + + + + + + + +
          Table: Contextual popup (Ctxpopup) styles
          StyleSampleNotes
          defaultUse the elm_ctxpopup_item_append() function to add both text and an icon to the list.
          + + + +++ + + + + + + + + + + + + + +
          Table: Datetime styles
          StyleSample
          datepicker_layout
          timepicker_layout
          + + + + + + + + + + + + + + + + + + + +
          Table: Entry styles
          StyleSampleText partSwallow partNotes
          defaultelm.guide: for the guide text. +

          elm.text: for the main text.

          The guide text is automatically erased when the main text is entered.
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Genlist styles
          StyleSampleText partSwallow partNotes
          defaultelm.textelm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          group_indexelm.text: for the main text. +

          elm.text.1: for the sub text.

          elm.icon
          1textelm.text
          1text.1iconelm.textelm.icon
          2textelm.text: for the main text. +

          elm.text.1: for the sub text.

          2text.1elm.text: for the main text. +

          elm.text.1: for the sub text.

          1text.1icon.dividerelm.textelm.icon: for the icon. +

          elm.divider: for the icon divider.

          1text.1icon.1elm.textelm.icon
          2text.1icon.1elm.text: for the main text. +

          elm.text.1: for the sub text.

          elm.icon
          multiline/1textelm.text: for the multi-line text.
          multiline/2textelm.text: for the main text. +

          elm.text.1: for the multi-line sub text.

          + + + + + + + + + + + + + + + + + + +
          Table: Index styles
          StyleSample
          thumbnail
          tab
          + + + +++ + + + + + + + + + + + + + +
          Table: Popup styles
          StyleSample
          default
          toast
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Progressbar styles
          StyleSample
          default
          pending_list
          process
          process/groupindex
          + + + +++ + + + + + + + + + +
          Table: Radio styles
          StyleSample
          default
          + + + + + + + + + + + + + + + + +
          Table: Slider styles
          StyleSampleSwallow part
          horizontal/defaultelm.swallow.icon
          + + +

          Wearable Circular UI Component Styles

          + +

          EFL can separate the GUI and logic of each UI component, resulting in each component having a different style of look. To change the styles of UI components, use the elm_object_style_get() and elm_object_style_set() functions to get and apply the style for a specific UI component.

          + +

          The following tables list the styles for each winset, including the names of the styles, and the name of the part where to set text or some other Evas_Object in the UI component.

          + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Button styles
          StyleSampleText partSwallow partNotes
          default elm.textelm.swallow.content
          bottomelm.textelm.swallow.content
          + + + +++ + + + + + + + + + + + + + + + + + +
          Table: Check styles
          StyleSample
          default
          small
          on&off
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Contextual popup (Ctxpopup) styles
          StyleSampleNotes
          select_mode
          select_mode/topPair this style with select_mode/bottom.
          select_mode/bottomPair this style with select_mode/top.
          + + + +++ + + + + + + + + + + + + + +
          Table: Datetime styles
          StyleSample
          datepicker/circle
          timepicker/circle
          + + + + + + + + + + + + + + + + + + + +
          Table: Entry styles
          StyleSampleText partSwallow partNotes
          defaultelm.guide: for the guide text. +

          elm.text: for the main text.

          The guide text is automatically erased when the main text is entered.
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Genlist styles
          StyleSampleText partSwallow partNotes
          defaultelm.textelm.swallow.icon: for the icon on the left. +

          elm.swallow.end: for the icon on the right.

          titleelm.text
          groupindexelm.text
          1textelm.text
          1text.1iconelm.textelm.icon
          2textelm.text: for the main text. +

          elm.text.1: for the sub text.

          1text.1icon.dividerelm.textelm.icon: for the icon. +

          elm.divider: for the icon divider.

          1text.1icon.1elm.textelm.icon
          2text.1icon.1elm.text: for the main text. +

          elm.text.1: for the sub text.

          elm.icon
          editfieldelm.text
          + + + + + + + + + + + + + + + + + + +
          Table: Index styles
          StyleSample
          thumbnail
          circle
          + + + +++ + + + + + + + + + + + + + +
          Table: Popup styles
          StyleSample
          circle
          toast/circle
          + + + + + + + + + + + + + + + + + +
          Table: Progressbar styles
          StyleSample
          process
          process/small
          + + + +++ + + + + + + + + + +
          Table: Radio styles
          StyleSample
          default
          + + + + + + + + + + + + + + + + +
          Table: Slider styles
          StyleSampleSwallow part
          horizontal/defaultelm.swallow.icon
          + + + + + + + + + + + +
          Note
          Except as noted, this content is licensed under LGPLv2.1+.
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/ui_containers_n.htm b/org.tizen.ui.practices/html/native/efl/ui_containers_n.htm new file mode 100644 index 0000000..44bf030 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ui_containers_n.htm @@ -0,0 +1,131 @@ + + + + + + + + + + + + + UI Containers: Creating Layouts Using Container UI Components + + + + + +
          + +

          UI Containers: Creating Layouts Using Container UI Components

          + +

          All applications use containers to create the layout of the UI. The EFL and Elementary support several ways to create this layout. You can use predefined layouts or animated layouts, or you can create your own layouts. It is important to note that container UI components do not have their own visual identity - only logical structures for assignment or placement of the UI components.

          + +

          When you use container components, such as naviframe, conformant, button, and box, you need to understand certain APIs related to alignment, and EDC parts for, for example, the core layout and animated layout. For more information on the containers EDC parts, see Positioning and Laying out Parts Using the EDC File. The use of the container UI components only differs from the use of the UI components through their absence of a visual identity.

          + +

          Most of the time, your application has to manage multiple views. The easiest way to handle them with the EFL is to create a naviframe object. This object is a container. At first, it is used to contain the pages your application is composed of. Every Tizen application can use this top-layer object to facilitate navigation. More details can be found in Creating a Naviframe for Navigation.

          + +

          Another interesting object that has to be present in every application is the conformant object. Conformant is a container component that accounts for the space taken up by the indicator, virtual keyboard, and softkey windows. The conformant content will be resized and positioned based on the space available. When the virtual keyboard is displayed, the content does not change.

          + +

          Figure: Basic EFL application structure

          +

          Basic EFL application structure

          + +

          Container Components

          + +

          The following table lists the available UI container components.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Available container components +
          Container nameDescription
          BoxOne of the most simple containers in the EFL is a box.
          ConformantA conformant is a container component that accounts for the space taken by the indicator, virtual keyboard, and softkey windows.
          GridIn a grid, objects are placed at specific positions along a fixed grid.
          LayoutA layout is a container component that takes a standard Edje design file and wraps it very thinly in a UI component.
          MapbufA mapbuf is a container component that uses an Evas map to hold a content object. This UI component is used to improve the moving and resizing performance of complex UI components.
          NaviframeA naviframe component consists of a stack of views. New views are pushed on top of previous ones, and only the top-most view is displayed.
          Panes
          (in mobile applications only)
          A panes component adds a draggable bar between two sections of content. The sections are resized when the bar is dragged.
          ScrollerA scroller holds (and clips) a single object and allows you to scroll across it.
          TableA table is like a box but with 2 dimensions.
          + + + + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/efl/ui_scalability_n.htm b/org.tizen.ui.practices/html/native/efl/ui_scalability_n.htm new file mode 100644 index 0000000..5c5bca9 --- /dev/null +++ b/org.tizen.ui.practices/html/native/efl/ui_scalability_n.htm @@ -0,0 +1,70 @@ + + + + + + + + + + + + + Scaling: Handling Screen and Object Sizes + + + + + +
          + +

          Scaling: Handling Screen and Object Sizes

          + +

          Supporting UI scalability in a user interface toolkit means that container components and UI components are scaled properly when the resolution or screen size changes. The Elementary library allows you to manipulate scaling on a per-UI-component basis using a scale factor based on the screen resolution, size, and profile configurations.

          + +

          Tizen native applications can run on different types of devices, such as wearable, phone, tablets, and TVs. Tizen also supports various resolutions (WVGA - XQXGA) with the same layouts and resources. However, remember that you must always polish your work to create an optimal application for each device.

          + +

          The main scalability features are:

          +
            +
          • Multiple Screen Support

            Enables you to design applications for different kinds of screens.

          • +
          • Scalability Support

            Enables you to design applications so that their UI can be scaled for diverse devices without problems.

          • +
          • Resource Fallback Support

            Enables you to design applications which can use alternative resources for the device display state.

          • +
          + + + +
          + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/native/guides_n.htm b/org.tizen.ui.practices/html/native/guides_n.htm new file mode 100644 index 0000000..9aa849b --- /dev/null +++ b/org.tizen.ui.practices/html/native/guides_n.htm @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + Tizen Native UI Practices + + + + + + +
          +

          Tizen
          +Native UI Practices

          + +

          The UI framework features include various aspects of creating a visual outlook for the user application to ensure the best possible user experience.

          + +

          The UI framework is a universal, reusable software environment that provides the essential building blocks as part of the Tizen platform to facilitate the development of Tizen native applications. The framework provides the window, UI components, and scene-based graphic rendering architecture needed to manage your application user interface. In addition, the framework provides animations and effects needed to make your application more fresh and vivid, event handling and the main loop to interact with the user and system, and more features, such as scalability, and font setting.

          + +

          The Tizen platform provides the following native UI toolkit frameworks for developing a native application:

          + +
            +
          • EFL (Enlightenment Foundation Libraries) +

            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.

            +

            Generally, select 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.

          • +
          • DALi (Dynamic Animation Library) +

            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.

            +

            Select the DALi 3D UI toolkit if you are creating a high-performance rich UI application.

          • +
          + + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/scripts/common.js b/org.tizen.ui.practices/html/scripts/common.js new file mode 100644 index 0000000..60250b6 --- /dev/null +++ b/org.tizen.ui.practices/html/scripts/common.js @@ -0,0 +1,1752 @@ +$(document).ready(function(){ + $('#contents table').each(function(){ + if (!$(this).parent().hasClass('table')) { + $(this).wrap('
          '); + } + }); + + // Lnb Menu Initialize + if($('div#contents').find('.lnb').length){ + if($("ul li.events_news").size() > 0) { + $("ul.lnb").after("

          \"Samsung

          "); + } + initLnb(); + initScript(staticURL + "/js/fixednavbar.js", function(){}); + } + + //family site + if($('div#footer').find('dl#familySlider').length){ + fn_rollToEx('familySlider', 'sliderBanner', 1, true); + } + + // Svn Commit Test + + // Language Selection + if($('div#header').find('.util').length){ + var $lang = $('div#header').find('.util'); + $lang.find('a.lang').toggle(function(){ + $(this).css('background-image', $(this).css('background-image').replace('.gif','_.gif')).next('ul.language').show(); + },function(){ + $(this).css('background-image', $(this).css('background-image').replace('_.gif','.gif')).next('ul.language').hide(); + }); + + $lang.bind('mouseleave',function(){ + $(this).find('ul.language').hide(); + $lang.find('a.lang').css('background-image', $lang.find('a.lang').css('background-image').replace('_.gif','.gif')); + }); + + $lang.find('ul.language').children().last().on("keydown", function(e) { + if(e.which == 9 && e.shiftKey) { + return true; + } + + if(e.which == 9) { + e.preventDefault(); + $lang.find('ul.language').hide(); + $lang.find('a.lang').css('background-image', $lang.find('a.lang').css('background-image').replace('_.gif','.gif')); + setTimeout(function() { + $("#searchTop").focus(); + }, 1); + } + }); + } + + // Open the Sitemap + var $open = $('div#header').find('.bt-open'); + $open.bind('click',function(){ + var $self = $(this); + var $sitemap = $('div#wrapper').find('div#sitemap'); + //var source = $sitemap.is(':visible') ? $self.css('background-image').replace('_.gif','.gif') : $self.css('background-image').replace('.gif','_.gif'); + + if($sitemap.is(':visible')){ + var source = $self.css('background-image').replace('_.gif','.gif'); + //if($('body#main').length) $('#header .util').css('border-bottom','3px solid #e4e4e4'); + + $self.attr('title','open sitemap'); + }else{ + var source = $self.css('background-image').replace('.gif','_.gif'); + //if($('body#main').length) $('#header .util').css('border-bottom','3px solid #114196'); + + $self.attr('title','close sitemap'); + } + + $self.css('background-image',source); + $sitemap.slideToggle('fast'); + + $sitemap.find('ul').filter(':last').children().filter(':last').focusout(function(){ + var source = $self.css('background-image').replace('_.gif','.gif'); + $self.css('background-image',source); + $sitemap.slideToggle('fast'); + }); + + }); + + // Search Auto Complete + var $search = $('div#header').find('fieldset.search'); + var $searchList = $search.find('#topAutocomplete>ul'); + + if($search.length){ + $search.find('> input').each(function(){ + $(this).bind({ + keydown : function(e){ + + if(e.type=='keydown'&& $(this).val().length!=0){ + $search.find('#topAutocomplete').show(); + var hei = $searchList.outerHeight(); + if(hei>400){ + $searchList.css({'height':'400px','overflow-y':'auto'}); + } + } + if(e.keyCode==9){ + $search.unbind('focusout.search'); + } + if(e.keyCode==40){ + $search.find('#topAutocomplete>ul').children(':first').find('a').focus(); + //window.scrollTo(0,0); + } + }, + focusin : function(e){ + if($(this).val()==='Search'){ + $(this).val(''); + } + }, + focusout : function(e){ + if($(this).val().length==0) $(this).val('Search'); + } + }); + }); + + //$('#topAutocomplete>ul').children().find('a').bind('focusin',function(e){ + // if(e.keyCode==40){ + // $(this).parent().next().css('border','1px solid red').find('a').focus(); + // } + //}); + + $search.find('#topAutocomplete').bind('mouseleave',function(e){ + if($search.find('> input').val().length==0){ + $search.find('> input').val('Search'); + } + $search.find('#topAutocomplete').hide(); + }); + + $search.find('#topAutocomplete>ul').children().last().focusout(function(){ + $search.find('> input').val('Search'); + $search.find('#topAutocomplete').hide(); + + //$search.bind('focusout.search', function(){ + // $(this).find('> input').val('Search'); + // $(this).find('#topAutocomplete').hide(); + //}); + }); + } +}); + +// 비차단 동적 스크립트 로딩 +function initScript(url, callback){ + var script = document.createElement("script"); + script.type = "text/javascript"; + + if(script.readyState){ // 인터넷 익스플로러 + script.onreadystatechange = function(){ + if(script.readyState=="loaded" || script.readyState=="complete"){ + script.onreadystatechange = null; + callback(); + } + }; + }else{ // 다른 브라우저 + script.onload = function(){ + callback(); + }; + } + + script.src = url; + document.getElementsByTagName("head")[0].appendChild(script); +} + + +// lnb +function initLnb(){ + var sMenu = $('.lnb'); + var sItem = sMenu.find('>li'); + + sItem.each(function(){ + if($(this).find('a').hasClass('more')){ + if($(this).find('ul').is(":visible")) { + $('').insertAfter($(this).find('a').eq(0)); + } else { + $('').insertAfter($(this).find('a').eq(0)); + } + } + }); + + var setIcoArrText = function(obj) { + if(obj.next().is(":visible")) { + obj.text("close submenu"); + } else { + obj.text("open submenu"); + } + } + + sItem.find('.ico-arr').on("click", function() { + var $that = $(this); + var liBox = $that.parent(); + var ulBox = $that.next(); + + sItem.not(liBox).not(".on").find("a.more").next().next().hide(); + sItem.not(liBox).removeClass("active").find("a").removeClass("bov"); + + if(liBox.hasClass("on")) { + if(ulBox.is(":visible")) { + ulBox.hide(); + $that.addClass("ico-on"); + } else { + ulBox.show(); + $that.removeClass("ico-on"); + } + setIcoArrText($that); + return true; + } + + if(liBox.hasClass("active")) { + liBox.removeClass("active").find("a").eq(0).removeClass("bov"); + ulBox.hide(); + } else { + liBox.addClass("active").find("a").eq(0).addClass("bov"); + ulBox.show(); + } + setIcoArrText($that); + }); + + sItem.hover(function(){ + if($(this).hasClass('on')||$(this).hasClass('active')) return false; + $(this).find("a").eq(0).addClass("bov"); + },function(){ + if($(this).hasClass('on')||$(this).hasClass('active')) return false; + $(this).find("a").eq(0).removeClass("bov"); + + }); +} + +//footer rolling banner +function fn_rollToEx(container,objectId,step,auto){ + + // 롤링할 객체를 변수에 담아둔다. + var el = $('#'+container).find('#'+objectId); + var lastChild; + var speed = 3000; + var timer = 0; + var autoplay = false; + + el.data('prev', $('#'+container).find('.prev')); //이전버튼을 data()메서드를 사용하여 저장한다. + el.data('next', $('#'+container).find('.next')); //다음버튼을 data()메서드를 사용하여 저장한다. + el.data('size', el.children().outerWidth()); //롤링객체의 자식요소의 넓이를 저장한다. + el.data('len', el.children().length); //롤링객체의 전체요소 개수 + el.data('animating',false); + el.data('step', step); //매개변수로 받은 step을 저장한다. + el.data('autoStart', false); //매개변수로 받은 step을 저장한다. + + el.css('width',el.data('size')*el.data('len')); //롤링객체의 전체넓이 지정한다. + + if(arguments.length==4){ + el.data('autoStart', auto); + } + + if(el.data('autoStart')){ + if(timer==0){ + timer = setInterval(moveNextSlide, speed); + autoplay = true; + } + } + + el.bind({ + mouseenter:function(){ + if(!autoplay) return false; + + if(timer!=0 && el.data('autoStart')){ + clearInterval(timer); + timer=0; + } + }, + mouseleave:function(){ + if(!autoplay) return false; + + if(timer==0 && el.data('autoStart')){ + timer = setInterval(moveNextSlide, speed); + } + } + }); + + + //el에 첨부된 prev 데이타를 클릭이벤트에 바인드한다. + el.data('prev').bind({ + click:function(e){ + e.preventDefault(); + movePrevSlide(); + }, + mouseenter:function(){ + + $(this).find('img').addClass('btnOn'); + + if(!autoplay) return false; + + if(timer!=0 && el.data('autoStart')){ + clearInterval(timer); + timer=0; + } + }, + mouseleave:function(){ + + $(this).find('img').removeClass('btnOn'); + + if(!autoplay) return false; + + if(timer==0 && el.data('autoStart')){ + timer = setInterval(moveNextSlide, speed); + } + } + }); + + //el에 첨부된 next 데이타를 클릭이벤트에 바인드한다. + el.data('next').bind({ + click:function(e){ + e.preventDefault(); + moveNextSlide(); + }, + mouseenter:function(){ + + $(this).find('img').addClass('btnOn'); + + if(!autoplay) return false; + + if(timer!=0 && el.data('autoStart')){ + clearInterval(timer); + timer=0; + } + }, + mouseleave:function(){ + + $(this).find('img').removeClass('btnOn'); + + if(!autoplay) return false; + + if(timer==0 && el.data('autoStart')){ + timer = setInterval(moveNextSlide, speed); + } + } + }); + + function movePrevSlide(){ + if(!el.data('animating')){ + //전달된 step개수 만큼 롤링객체의 끝에서 요소를 선택하여 복사한후 변수에 저장한다. + var lastItem = el.children().eq(-(el.data('step')+1)).nextAll().clone(true); + lastItem.prependTo(el); //복사된 요소를 롤링객체의 앞에 붙여놓는다. + el.children().eq(-(el.data('step')+1)).nextAll().remove(); //step개수만큼 선택된 요소를 끝에서 제거한다 + el.css('left','-'+(el.data('size')*el.data('step'))+'px'); //롤링객체의 left위치값을 재설정한다. + + el.data('animating',true); //애니메이션 중복을 막기 위해 첨부된 animating 데이타를 true로 설정한다. + + el.animate({'left': '0px'},'normal',function(){ //롤링객체를 left:0만큼 애니메이션 시킨다. + el.data('animating',false); + }); + } + return false; + } + + function moveNextSlide(){ + if(!el.data('animating')){ + el.data('animating',true); + + el.animate({'left':'-'+(el.data('size')*el.data('step'))+'px'},'normal',function(){ //롤링객체를 첨부된 size와 step을 곱한 만큼 애니메이션 시킨다. + //전달된 step개수 만큼 롤링객체의 앞에서 요소를 선택하여 복사한후 변수에 저장한다. + var firstChild = el.children().filter(':lt('+el.data('step')+')').clone(true); + firstChild.appendTo(el); //복사된 요소를 롤링객체의 끝에 붙여놓는다. + el.children().filter(':lt('+el.data('step')+')').remove(); //step개수만큼 선택된 요소를 앞에서 제거한다 + el.css('left','0px'); ////롤링객체의 left위치값을 재설정한다. + + el.data('animating',false); + }); + } + return false; + } + +} + +function fn_slide(options){ + + var opts = jQuery.extend({},options); + + var $bt = $('#'+opts.container).find('#'+opts.bt).children(); //롤링버튼에 대한 선택자 + var $obj = $('#'+opts.container).find('#'+opts.obj); //objectId를 id로 갖는 롤링객체의 선택자 + var $prev = $('#'+opts.container).find('#'+opts.prev).hide(); //이전버튼에 대한 선택자 + var $next = $('#'+opts.container).find('#'+opts.next); //다음버튼에 대한 선택자 + var size = $obj.children().outerWidth(); //롤링객체의 각 이미지 넓이값 + var len = $obj.children().length; //롤링객체의 이미지 갯수 + var effect = false; //슬라이드효과를 위한 boolean변수 + var auto = false; + var current = 0; //현재 보여지는 이미지의 인덱스값을 저장하기 위한 변수 + var time; + + + $obj.css('width',size*len); //롤링객체의 전체넓이 지정 + effect = opts.effect; + auto = opts.auto; + + if(auto){ + time = setTimeout('slideShow()',3000); + } + + slideShow = function(){ + + if(current < len-1){ + current++; + }else{ + current=0; + } + + controllStatus(); + + moveControl('next'); + + time = setTimeout('slideShow()',3000); + } + + controllStatus = function(){ + //이미지의 인덱스값에 따라 이전,다음 버튼 활성여부 지정 + if(current>0||current=len-1){ + $prev.show(); + $next.hide(); + } + } + + moveControl = function(msg){ + if(opts.bt!=null){ + msg=='next'? $bt.eq(current-1).find('img').attr('src', $bt.eq(current-1).find('img').attr('src').replace('_.png','.png')) + :$bt.eq(current+1).find('img').attr('src', $bt.eq(current-1).find('img').attr('src').replace('_.png','.png')); //이전에 활성화된 롤링버튼을 비활성화 + $bt.eq(current).find('img').attr('src', $bt.eq(current).find('img').attr('src').replace('.png','_.png')); //현재 인덱스값을 가지는 롤링버튼을 활성화 + } + + if(effect!=true){ //action변수가 true가 아닐경우 슬라이드 효과없이 현재의 인덱스값을 갖는 이미지를 보여줌. + $obj.children().hide(); + $obj.children().eq(current).show(); + }else{ //action변수가 true일 경우 현재의 인덱스값을 갖는 이미지로 슬라이드됨 + $obj.animate({'left':'-'+size*current},'slow'); + } + } + + $obj.bind({ + mouseenter:function(){ + if(!auto) return false; + clearTimeout(time); + }, + mouseleave:function(){ + if(!auto) return false; + time = setTimeout('slideShow()',3000); + } + }); + + //롤링 버튼 클릭시 + $bt.bind({ + mouseenter:function(){ + if(!auto) return false; + clearTimeout(time); + }, + mouseleave:function(){ + if(!auto) return false; + time = setTimeout('slideShow()',3000); + }, + click:function(){ + var idx = $bt.index(this); //클릭한 롤링버튼의 인덱스값 저장 + + current = idx; //롤링버튼의 인덱스값을 이미지의 인덱스값으로 지정 + + controllStatus(); + + if(effect!=true){ //action변수가 true가 아닐경우 슬라이드 효과없이 현재의 인덱스값을 갖는 이미지를 보여줌. + $obj.children().hide(); + $obj.children().eq(current).show(); + }else{ //action변수가 true일 경우 현재의 인덱스값을 갖는 이미지로 슬라이드됨 + $obj.animate({'left':'-'+size*current},'slow'); + } + + // 모든 롤링 버튼을 비활성화 + $bt.each(function(){ + var source = $(this).find('img').attr('src').replace('_.png','.png'); + $(this).find('img').attr('src',source); + }); + + // 선택한 롤링버튼을 활성화 + var source = $(this).find('img').attr('src').replace('.png','_.png'); + $(this).find('img').attr('src',source); + + return false; + } + }); + + //이전 버튼 클릭시 + $prev.bind({ + mouseenter:function(){ + var source = $(this).find('img').attr('src').replace('.png','_.png'); + $(this).find('img').attr('src',source); + if(!auto) return false; + clearTimeout(time); + }, + mouseleave:function(){ + var source = $(this).find('img').attr('src').replace('_.png','.png'); + $(this).find('img').attr('src',source); + if(!auto) return false; + time = setTimeout('slideShow()',3000); + }, + click:function(){ + if(current==len-1) $next.show(); //이미지 인덱스값이 마지막이 아닐경우 비활성화된 다음버튼을 활성화 + current--; //이미지 인덱스값 1씩 감소 + + moveControl('prev'); + + if(current==0) $(this).hide(); //이미지 인덱스값이 0일 경우, 즉 현재 첫번째 이미지가 활성화될 경우 이전버튼을 비활성화 + + return false; + } + }); + + //다음 버튼 클릭시 + $next.bind({ + mouseenter:function(){ + var source = $(this).find('img').attr('src').replace('.png','_.png'); + $(this).find('img').attr('src',source); + if(!auto) return false; + clearTimeout(time); + }, + mouseleave:function(){ + var source = $(this).find('img').attr('src').replace('_.png','.png'); + $(this).find('img').attr('src',source); + if(!auto) return false; + time = setTimeout('slideShow()',3000); + }, + click:function(){ + current++; //이미지 인덱스값 1씩 증가 + + moveControl('next'); + + if(current>=len-1) $(this).hide(); //이미지인덱스값이 마지막일 경우, 즉 현재 마지막 이미지가 활성화될 경우 다음버튼을 비활성화 + if(current>0) $prev.show(); //이미지인덱스값이 0이 아닌경우 이전버튼 활성화 + + return false; + } + }); + +} + +// main rolling banner +function slideMotion1(){ + var $banner = $('#rolling .motionview'), + //$nav = $('#rolling ul.nav'), + banner = {prev:null, next:null}, + size = $banner.children().length; + index = 1, + speed = 3000, + timer = null, + auto = true, + width = parseInt(100/size), + rest = parseInt(100%size); + + var $nav = $('
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/animation_w.htm b/org.tizen.ui.practices/html/web/tau/animation_w.htm new file mode 100644 index 0000000..25f88a2 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/animation_w.htm @@ -0,0 +1,278 @@ + + + + + + + + + + + + + Animation: Supporting Animation for HTML Elements + + + +
        +
        +

        Mobile Web Wearable Web

        +
        + +
        +

        Content

        + +

        Related Info

        + +
        +
        + + +
        + +

        Animation: Supporting Animation for HTML Elements

        +

        TAU Animation is a module for animating target objects. It allows you to make and use animation without using any other animation library. TAU Animation provides good usability, high performance, and various functionalities.

        + +

        TAU Animation provides the following features:

        +
          +
        • Single or group animation +

          Provides usability from minimized parameters and APIs. You can easily make an animation or TimeLine.

        • +
        • Group effects +

          Provided by a stagger. Insert a stagger into the option, and all objects in the group are applied a sequential delay.

        • +
        • Time control +

          You can use ease, duration, and delay.

        • +
        • Effect +

          Provides predefined effects. This means that you can use a fancy effect just by sting instead of specifying an animation value. Predefined effects are fully controlled in TAU Animation. You can also stop the animation.

        • +
        • CSS animation +

          Target objects can be animated using CSS styles, such as backgroundColor, border, margin, padding, and shadow. A CSS animation can also be controlled by TAU Animation.

        • +
        • HTML element-based animation (in future) +

          You can set an animation in an element instead of JavaScript. If you are skilled in HTML, you can make the animation in HTML.

        • +
        • Custom KeyFrame (in future) +

          You can make an animation based on a custom KeyFrame.

        • +
        • Callback functions +

          Provides the onStart, onUpdate, and onComplete callback functions. CSS animations do not support the updateCallback and progress callbacks. TAU Animation provides these features.

        • +
        + +

        To use TAU Animation, you must load the tau.animation.min.js file, which can work with any other library or Web framework. There are no other prerequisites.

        + +

        Animation Fundamentals

        + +

        The tau.animation.js file has its own modules for animating target objects when animation functions are invoked.

        +

        The general idea of animating target objects is for several parts to interact with each other.

        +

        Figure: Animation parts

        +

        Animation parts

        +
          +
        • Ticker: Switches the requestAnimationFrame() function on and off. Ticker is operated based on events.
        • +
        • TweenAnimator: Runs the whole time logic. The TweenAnimator invokes the animation to play or stop, and it also updates the tween value per frame.
        • +
        • SimpleAnimation: Consists of the animation play logic. The animation makes the tween object and target object, and it also interacts with the TweenAnimator.
        • +
        • SimpleAnimationGroup: Group of simpleAnimation objects. It can include several objects for animation.
        • +
        • SimpleAnimation Extension: Provides the mixin functionality. Pure DOM can be a target object with the simpleAnimation extension.
        • +
        • DomObject: Target object that also has a render logic. If the tick is switched on, the TweenAnimator invokes the update function. And then, the render logic of DomObject is invoked, and the target objects are moved based on the animation option.
        • +
        • AnimationObject: Interface for various target objects. In this example, the DomObject is used as a reference.
        • +
        +

        To make and call several animations:

        + +
          +
        1. Make a target object for the animation. +

          After making the target object, you can make and call animations.

          + +

          Figure: Target object

          +

          Target object

          +
          +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px;">
          +</div>
          +
          +
          +var t = tau.animation.target,
          +        blueBox = document.getElementById('blueBox');
          +t('#blueBox');
          +/* Pure HTML element can be a target */
          +t(blueBox);
          +
          +
        2. +
        3. Create an animation with transform, CSS properties, effects, and ease. +

          Once the target object is made, you can create an animation. The animation consists of an animation value including transform, CSS properties, and effect. Basically, an animation option is inserted with the duration of 1 s (1000 ms) only as a default. If you want to add an ease function, delay, loop, or callback, create an object for an animation option.

          +
          +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px;">
          +</div>
          +
          +
          +var t = tau.animation.target;
          +t('#blueBox').tween({translateX: 1000}, {duration: 1000, delay: 500})
          +             .tween({scaleX: 1.2, scaleY: 1.2}, {duration: 1000})
          +             .tween({rotateZ: 30}, {duration: 1000})
          +             .tween({skewX: 30}, {duration: 1000});
          +
          +
        4. +
        5. Put the animations into an animation queue. +

          After making an animation, the animation is inserted into the animation queue automatically.

          + +

          Figure: Animation queue

          +

          Animation queue

          + +
        6. +
        7. After inserting the animation, send an event to the Ticker. +

          In the above queue, there are 4 animations in queue. When all animations are inserted, the animations are popped and animated sequentially by the TweenAnimator.

          +
        8. +
        9. The Ticker calls the requestAnimationFrame() function. +

          The TweenAnimator invokes the play and tick functions in the Ticker. The Ticker calls the on function, and the on function includes requestAnimationFrame(). The RAF() function is invoked until the TweenAnimator's tick time reaches the end of the duration.

          +
        10. +
        11. During the requestAnimationFrame() function call, the AnimationObject renders the target object and the TweenAnimator's time logic is operating. +

          The AnimationObject can get the time value using the calculating animation. The AnimationObject renders the target object based on the time value. If the duration is 1000 (ms), the TweenAnimator gives time 0 through 1000.

          +

          Figure: TweenAnimator

          +

          TweenAnimator

          +
        12. +
        + +

        Animation Functions

        + +

        To provide better functionality, various animation features have been implemented. You can easily increase and improve an animation effect. If you want to connect several animations, use chaining animations. Predefined effects and animations with CSS properties and stagger are also provided.

        + +

        Tween

        + +

        You can make an animation using the tween() function. If a tween animation is made, the animation is run right away. The tween() function consists of 2 parameters, {animation} and {option}:

        +
        +tween({animation}, {option});
        +
        +

        {animation} can be various animations, such as transform, CSS property, or predefined effect. Basically, {animation} indicates the destination of the animation. For example, {rotateZ: 90} indicates a rotation from the current value to 90 degrees. To do this, you must set the starting point of the animation, and for this, an additional animation form is provided. {rotateZ: [30, 90]} indicates the changing rotation value of the transform from 30 to 90.

        +
        +<div id="redBox" style="background-color: 'red'; position:absolute; width:100px; height:100px;"></div>
        +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px; left: 200px;"></div>
        +
        +
        var t = tau.animation.target;
        +t('#redBox').tween({translateX: 1000}, 1000); /* Translate from current position to 1000 */
        +t('#blueBox').tween({left: 200, top:[100, 300]}, 1000); /* Add left property from current to 200, add top property from 100 to 300 */
        +
        + +

        Chaining

        +

        The animation is inserted to the animation queue automatically before playing. At first, this feature does not seem important for making an animation, but if this function is supported, the LOC (Line Of Code) is decreased significantly.

        +
        +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px;"></div>
        +
        +
        var t = tau.animation.target;
        +t('#blueBox').tween({translateX: [500, 1000]}, 1000).tween({translateY: 500}, 1000)
        +             .tween({rotateZ: 120}, 1000).tween({skewX: [0, 30]}, 1000)
        +             .tween({opacity: [1, 0]}, 1000).tween({opacity: 0.5}, 1000);
        +
        + +

        Figure: Animation queue and chaining

        +

        Animation queue and chaining

        + +

        The chaining feature makes an intuitive sequence group animation.

        + +

        Predefined Effects

        +

        The following predefined effects are available:

        +

        bounce, flash, pulse, rubberBand, shake, swing, tada, wobble, jello, bounceIn, bounceInDown, bounceInLeft, bounceInRight, bounceInUp, bounceOut, bounceOutDown, bounceOutLeft, bounceOutRight, bounceOutUp, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, +fadeOut, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUp, flip, flipInX, flipInY, flipOutX, flipOutY, +lightSpeedIn, lightSpeedOut, rotateIn, rotateInDownLeft, rotateInDownRight, rotateInUpLeft, rotateInUpRight, +rotateOut, rotateOutDownLeft, rotateOutDownRight, rotateOutUpLeft, rotateOutUpRight, slideInUp, slideInDown, slideInLeft, slideInRight, +slideOutUp, slideOutDown, slideOutLeft, slideOutRight, zoomIn, zoomInDown, zoomInLeft, zoomInRight, zoomInUp, zoomOut, zoomOutDown, zoomOutLeft, zoomOutRight, zoomOutUp, hinge, rollIn, rollOut

        + + +

        To make an identical effect, you can make many single animations. The following example shows the shake effect:

        +
        +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px;"></div>
        +
        +
        +var t = tau.animation.target;
        +t('#blueBox').tween({translateX: -10}, 100);
        +t('#blueBox').tween({translateX: 10}, 100);
        +t('#blueBox').tween({translateX: -10}, 100);
        +t('#blueBox').tween({translateX: 10}, 100);
        +t('#blueBox').tween({translateX: -10}, 100);
        +t('#blueBox').tween({translateX: 10}, 100);
        +t('#blueBox').tween({translateX: -10}, 100);
        +t('#blueBox').tween({translateX: 10}, 100);
        +t('#blueBox').tween({translateX: -10}, 100);
        +t('#blueBox').tween({translateX: 0}, 100);
        +
        +

        Or instead, you can use a predefined animation:

        +
        +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px;"></div>
        +
        +
        +var t = tau.animation.target;
        +t('#blueBox').tween('shake', 1000);
        +
        + +

        Group

        +

        Sometimes, you need to animate all objects with the same animation. To make an animation group for this purpose, the target method is provided. If all classes of DOM are box, you can create a box group. Like a CSS selector, '.' means a class selector and '#' means an ID selector. Also, a pure HTML element can be a parameter of the target function.

        +
        +<div class="box"></div>
        +<div class="box"></div>
        +<div class="box"></div>
        +<div class="box"></div>
        +
        +
        +var t = tau.animation.target;
        +t('.box').tween({rotateZ: 120}, 1000);
        +/* All DOM are rotated */
        +
        + +

        Stagger

        +

        In case of handling an animation group, you can apply a different delay value to a group. The following example shows a delay with the zoomIn effect:

        +
        +<div class='box'></div>
        +<div class='box'></div>
        +<div class='box'></div>
        +<div class='box'></div>
        +<div class='box'></div>
        +
        +
        +var t = tau.animation.target;
        +t('.box').tween('zoomIn', {duration: 1000, stagger: 200});
        +/* Each box is animated with 200 ms time difference */
        +
        + +

        Callback

        +

        You can add some actions before and after an animation. If you add the onStart callback, it is invoked before the animation. The onComplete callback is invoked after the animation.

        +
        +<div id='blueBox'></div>
        +
        +
        var t = tau.animation.target;
        +t('#blueBox').tween({translateY: [0, 150], rotateZ: [0, 180]}, 
        +{
        +   duration: 1000,
        +   onStart: function ()
        +   {
        +      t('#blueBox').innerText = 'start';
        +   },
        +   onComplete: function () 
        +   {
        +      t('#blueBox').tween({backgroundColor: 'navy'}, {duration: 1000});
        +   }
        +});
        +
        +

        In the above animation, the box is translated by Y axis from 0 to 150 and rotated from 0 to 180. Before translating and rotating, the start text is inserted into the box. After translating and rotating, the box's background color is changed to navy.

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/circle_progressbar_ww.htm b/org.tizen.ui.practices/html/web/tau/circle_progressbar_ww.htm new file mode 100644 index 0000000..5cdf2a9 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/circle_progressbar_ww.htm @@ -0,0 +1,257 @@ + + + + + + + + + + + + + Creating Circle-shaped Progress Bars + + + +
        +
        +

        Wearable Web

        +
        + + +
        + +
        +

        Creating Circle-shaped Progress Bars

        + +

        You can create a circle-shaped progress bar component with the CircleProgressBar API.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the layout of the progress bar component in a rectangular and circular UI.

        + +

        Figure: Circle-shaped progress bar component in rectangular and circular devices

        +

        Circle-shaped progress bar component in a rectangular device Circle-shaped progress bar component in a circular device

        + +

        To implement the progress bar component:

        + +
          +
        1. Edit the HTML code to add the component to your application screen: + +
          +<div class="ui-page ui-page-active" id="pageCircleProgressBar" data-enable-page-scroll="false">
          +   <header class="ui-header">
          +      <h2 class="ui-title">Circle Progress</h2>
          +   </header>
          +   <div class="ui-content content-padding">
          +      <div class="result" id="result"></div>
          +   </div>
          +   <footer class="ui-footer ui-grid-col-2">
          +      <a href="#" class="ui-btn" id="minus">-10%</a>
          +      <a href="#" class="ui-btn" id="plus">+10%</a>
          +   </footer>
          +   <progress class="ui-circle-progress" id="circleprogress" max="100" value="20"></progress>
          +</div>
          +
          +
        2. + +
        3. Edit the CSS code to set the visual style of the progress bar: + +
          +.ui-progressbar-large 
          +{
          +   position: absolute;
          +   top: 50%;
          +   left: 50%;
          +   -webkit-transform: translate3d(-50%, -50%, 0);
          +}
          +.result 
          +{
          +   font-size:35px;
          +   text-align:center;
          +   top: 33%;
          +   left: 50%;
          +   -webkit-transform: translate3d(-50%, -50%, 0);
          +   position: absolute;
          +}
          +
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   .result 
          +   {
          +      top: 50%;
          +      margin: 0;
          +   }
          +   .ui-footer 
          +   {
          +      display: none;
          +   }
          +}
          +
          +
        4. + +
        5. Edit the JavaScript code to manage the progress bar events and other functionality: + +
          +(function()
          +{
          +   var page = document.getElementById("pageCircleProgressBar"),
          +       progressBar = document.getElementById("circleprogress"),
          +       minusBtn = document.getElementById("minus"),
          +       plusBtn = document.getElementById("plus"),
          +       resultDiv = document.getElementById("result"),
          +       isCircle = tau.support.shape.circle,
          +       progressBarWidget,
          +       resultText,
          +       i;
          +
          +   function printResult() 
          +   {
          +      resultText = progressBarWidget.value();
          +      resultDiv.innerHTML = resultText + "%";
          +   };
          +
          +   function clearVariables() 
          +   {
          +      page = null;
          +      progressBar = null;
          +      minusBtn = null;
          +      plusBtn = null;
          +      resultDiv = null;
          +   };
          +
          +   function unbindEvents() 
          +   {
          +      page.removeEventListener("pageshow", pageBeforeShowHandler);
          +      page.removeEventListener("pagehide", pageHideHandler);
          +      if (isCircle) 
          +      {
          +         document.removeEventListener("rotarydetent", rotaryDetentHandler);
          +      } 
          +      else 
          +      {
          +         minusBtn.removeEventListener("click", minusBtnClickHandler);
          +         plusBtn.removeEventListener("click", plusBtnClickHandler);
          +      }
          +   };
          +
          +   function minusBtnClickHandler() 
          +   {
          +      i = i - 10;
          +      if (i < 0) 
          +      {
          +         i = 0;
          +      }
          +      progressBarWidget.value(i);
          +      printResult();
          +   };
          +
          +   function plusBtnClickHandler() 
          +   {
          +      i = i + 10;
          +      if (i > 100) 
          +      {
          +         i = 100;
          +      }
          +      progressBarWidget.value(i);
          +      printResult();
          +   };
          +
          +   function rotaryDetentHandler() 
          +   {
          +      /* Get the rotary direction */
          +      var direction = event.detail.direction,
          +          value = parseInt(progressBarWidget.value());
          +
          +      if (direction === "CW") 
          +      {
          +         /* Right direction */
          +         if (value < 100) 
          +         {
          +            value++;
          +         } 
          +         else 
          +         {
          +            value = 100;
          +         }
          +      } 
          +      else if (direction === "CCW") 
          +      {
          +         /* Left direction */
          +         if (value > 0) 
          +         {
          +            value--;
          +         } 
          +         else 
          +         {
          +            value = 0;
          +         }
          +      }
          +
          +      progressBarWidget.value(value);
          +      printResult();
          +   }
          +
          +   function pageBeforeShowHandler() 
          +   {
          +      if (isCircle) 
          +      {
          +         /* Make the circular progressbar object */
          +         progressBarWidget = new tau.widget.CircleProgressBar(progressBar, {size: "full"});
          +         document.addEventListener("rotarydetent", rotaryDetentHandler);
          +      } 
          +      else 
          +      {
          +         progressBarWidget = new tau.widget.CircleProgressBar(progressBar, {size: "large"});
          +         minusBtn.addEventListener("click", minusBtnClickHandler);
          +         plusBtn.addEventListener("click", plusBtnClickHandler);
          +      }
          +
          +      i = parseInt(progressBarWidget.value());
          +      resultDiv.innerHTML = i + "%";
          +   };
          +
          +   function pageHideHandler() 
          +   {
          +      unbindEvents();
          +      clearVariables();
          +      /* Release the object */
          +      progressBarWidget.destroy();
          +   };
          +
          +   page.addEventListener("pagebeforeshow", pageBeforeShowHandler);
          +   page.addEventListener("pagehide", pageHideHandler);
          +}());
          +
          +
        6. +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/circular_ui_ww.htm b/org.tizen.ui.practices/html/web/tau/circular_ui_ww.htm new file mode 100644 index 0000000..3a26cb5 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/circular_ui_ww.htm @@ -0,0 +1,218 @@ + + + + + + + + + + + + + Applications for Circular UI: Developing UI on Circular Wearable Applications + + + + + +
        +

        Applications for Circular UI: Developing UI on Circular Wearable Applications

        + +

        TAU supports different types of wearable devices (rectangular and circular) in the same application. To support a circular UI along with a rectangular UI, a media query is required.

        + +

        This feature is supported in wearable applications only.

        + + +

        Applying the Circular UI

        + +

        To support the circular UI:

        + +
          +
        1. Include the link element for the latest tau.css file into the <head> element in HTML. Note that for the compatibility with the rectangular UI, you must use the latest version of the TAU library.
        2. + +
        3. Include the link element for the latest tau.circle.css file with the media query feature (-tizen-geometric-shape: circle) next to the link element for the tau.css. Note that adding the tau.circle.css file following the general tau.css file covers the additional circular UI.
        4. + +
        5. Include the link element for the latest tau.js script file at the end of <body> element in HTML.
        6. + +
        7. For writing a separate code for a circular UI in JavaScript, you can use the tau.support.shape.circle property for detecting the circular device.
        8. +
        + +
        +<head name="viewport" content="width=device-width, user-scalable=no">
        +   <title>Support for Circular UI</title>
        +   <link rel="stylesheet" href="tau.css">
        +   <!-- CSS media query on a link element -->
        +   <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="tau.circle.css">
        +   <link rel="stylesheet" href="css/style.css">
        +</head>
        +<body>
        +   <script type="text/javascript" src="tau.js"></script>
        +   <script>
        +      if (tau.support.shape.circle) 
        +      {
        +         /* Implement your code for the circular UI */
        +      } 
        +      else 
        +      {
        +         /* Implement your code for the rectangular UI */
        +      }
        +   </script>
        +</body>
        +
        + +

        The following figure shows how the media query -tizen-geometric-shape: circle works in a rectangular and circular UI.

        +

        Figure: Media query in a rectangular device and circular device

        +

        + Media query in a rectangular device and circular device +

        + +

        Overriding the Circular CSS Style with a Media Query

        + +

        For some styles to be applied selectively, you can use the -tizen-geometric-shape media query feature with a rectangle or circle value to distinguish the type difference. Note that the -tizen-geometric-shape feature is only available in Tizen devices.

        + + + + + + + + + + + + + + + + + + + + +
        Table: -tizen-geometric-shape feature description
        -tizen-geometric-shape
        Valuerectangle | circle
        Applied toVisual media types
        Accept min/max prefixesNo
        + +
        +.className 
        +{
        +   /* Implement the basic CSS style for all types of devices (rectangular and circular) */
        +}
        +
        +@media screen and (-tizen-geometric-shape: circle) 
        +{
        +   .className
        +   {
        +      /* Implement the CSS style to be overridden in circular */
        +   }
        +}
        +
        + +

        Writing JavaScript Selectively for the Circular UI

        +

        TAU provides the tau.support.shape.circle property that checks whether the device screen is a circle. If you want to implement code selectively for a circular UI and rectangular UI, you can use the property with a boolean value. Note that for developing in a browser environment, this property is always set to true when the tau.circle.css file is loaded.

        + +
        +if (tau.support.shape.circle) 
        +{
        +   /* Implement your code for the circular UI */
        +} 
        +else 
        +{
        +   /* Implement your code for the rectangular UI */
        +}
        +
        + +

        Supported UI Components

        +

        The following components can be used in both rectangular and circular devices.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: UI components supported by a rectangular and circular UI
        ComponentDescription
        Helper ScriptShows how to support some application components.
        Snap ListShows how to create a snap list component.
        Expandable HeaderShows how to create a header component.
        Circle-shaped Progress BarShows how to create a circle progress bar component.
        Full Size Processing ComponentShows how to create a processing component.
        Footer ButtonShows how to create a footer button component.
        ThumbnailShows how to create a thumbnail component.
        Popup ButtonShows how to create a popup component.
        Index Scroll BarShows how to create an index scroll bar component.
        More OptionsShows how to create a more options button component.
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/creating_animation_w.htm b/org.tizen.ui.practices/html/web/tau/creating_animation_w.htm new file mode 100644 index 0000000..3c90eea --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/creating_animation_w.htm @@ -0,0 +1,191 @@ + + + + + + + + + + + + + Creating Applications with Animation + + + +
        +
        +

        Mobile Web Wearable Web

        +
        + + +
        + + +
        + +

        Creating Applications with Animation

        +

        You can create a simple application using TAU Animation. With the following example, you can learn how to import TAU Animation into your application and create a basic simple application with animation.

        + +

        Loading a TAU Animation

        +

        You can import the TAU Animation with HTML:

        +
        +<head>
        +   <title>TAU Animation Sample</title>
        +   <script src="lib/tau/animation/tau.animation.min.js" type="text/javascript"></script>
        +</head>
        +
        +

        tau.animation is the namespace of the TAU Animation. You can call TAU Animation functions through this namespace.

        + + +

        Creating TAU Animations

        + +

        The following code snippet shows how to create a TAU Animation:

        + +
        +<div id="redBox" style="background-color: 'red'; position:absolute; width:100px; height:100px;"></div>
        +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px; left: 200px;"></div>
        +
        +
        var t = tau.animation.target;
        +t('#redBox').tween('swing', 1000);
        +t('#blueBox').tween({rotateZ: 120}, 1000).tween({translateX: 400}, 1000);
        +
        + +

        If you want to animate the HTML element directly, you can use mixin. You can animate any effect, transform, or CSS property. You can use the 'target' method. Like a CSS selector, '.' means class selector, '#' means ID selector. Also, a pure HTML element can be a parameter of the target function.

        + +

        Available animation methods:

        +
        • Predefined effects +

          When the first parameter of the tween() method indicates a string (such as 'swing' above) instead of an object, it is a predefined effect animation. Various predefined effects are available.

        • + +
        • Chaining +

          The blueBox animation above is a type of a connected animation. If animations are connected to the same target object, it is added to the queue. And if the play() function is invoked, all animations in the queue are called in the sequence order.

        • + +
        • Tween +

          tween() is a TAU Animation method. It animates a target object based on parameters. The following example shows the use of the tween() method:

          +
          +tween({animation}, {option})
          +
          +
            +
          • animation is the part moving, such as a transform, CSS, or predefined effect.
          • +
          • transform options: +

            translateX, translateY, translateZ, rotateX, rotateY, rotateZ, scaleX, scaleY, skewX, skewY

            +
          • +
          • css options: +

            left, top, width, height, background-color, color, border, border-width, border-color, margin, marginTop, marginRight, marginBottom, marginLeft, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, font-size, line-height, clip-path, background-position, background-size, box-shadow

            +
          • +
          +
          +<div id="redBox" style="background-color: 'red'; position:absolute; width:100px; height:100px;"></div>
          +
          +
          +var t = tau.animation.target;
          +t('#redBox').tween({rotateZ: 120}, 1000); /* Transform */
          +t('#redBox').tween({backgroundColor: 'red', border: '10px 10px 10px 3px white'}, 1000); /* CSS property */
          +t('#redBox').tween('swing', 1000).tween('tada', 1000); /* Pre-defined effect */
          +
        • + +
        • Option +

          An option consists of a duration, ease, delay, callback, and stagger. In order to provide better usage, if you want to use only duration, you can set the duration as a number value like in the previous examples. If any other options are needed, you must make an {option} object and insert the duration: value into the object. +

          +
          +<div id="redBox" style="background-color: 'red'; position:absolute; width:100px; height:100px;"></div>
          +<div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px; left: 200px;"></div>
          +<div class="box"></div>
          +<div class="box"></div>
          +<div class="box"></div>
          +<div class="box"></div>
          +
          +
          var t = tau.animation.target;
          +t('#redBox').tween({rotateZ: 120}, 1000);
          +t('#redBox').tween({rotateZ: 120}, {duration: 1000});
          +/* The result of this tween method is identical with the above method */
          +t('#blueBox').tween({rotateZ: 120}, {duration: 1000, ease: 'bounceInOut'});
          +t('#blueBox').tween({rotateZ: 120}, {duration: 1000, delay: 500}); /* After 500ms, blueBox is rotated */
          +t('#blueBox').tween({rotateZ: 120}, {duration: 1000, onStart: function()
          +   {
          +      t('#blueBox').style.innerText = 'start'; /* Before animation, the text is inserted into blueBox */
          +   },
          +   onComplete: function()
          +   {
          +      t('#blueBox').tween('swing', 1000); /* After animation, blueBox is animated with a pre-defined effect */
          +   }
          +});
          +/* All boxes that include the className 'box' are rotated sequentially with a 200ms time difference */
          +t('.box').tween({rotateZ: 120}, {duration: 1000, stagger: 200}); 
          +
        + + +

        The following code snippet shows the full code for the first animation example described above.

        +
        +<!DOCTYPE html>
        +<html>
        +<head>
        +   <style>
        +      .box 
        +      {
        +         position: absolute;
        +         width: 100px;
        +         height: 100px;
        +         background-color: red;
        +         left: 100px;
        +         top: 100px;
        +      }
        +   </style>
        +
        +   <title>TAU Animation Sample</title>
        +
        +   <!-- load TAU Animation -->
        +   <script src="lib/tau/animation/tau.animation.min.js" type="text/javascript"></script>
        +</head>
        +<body>
        +   <div id="redBox" style="background-color: 'red'; position:absolute; width:100px; height:100px;"></div>
        +   <div id="blueBox" style="background-color: 'blue'; position:absolute; width:100px; height:100px;"></div>
        +   <div class="box"></div>
        +   <div class="box"></div>
        +   <div class="box"></div>
        +   <div class="box"></div>
        +
        +   <script>
        +      var t = tau.animation.target;
        +      t('#redBox').tween('swing', 1000); /* Single animation */
        +      t('#blueBox').tween({rotateZ: 120}, 1000).tween({translateX: 400}, 1000); /* Single animation */
        +      t('.box').tween({translateY: 500}, {duration: 1000, stagger: 200}); /* Group animation */
        +   </script>
        +</body>
        +</html>
        +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/event_handling_w.htm b/org.tizen.ui.practices/html/web/tau/event_handling_w.htm new file mode 100644 index 0000000..92aeee9 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/event_handling_w.htm @@ -0,0 +1,185 @@ + + + + + + + + + + + + + Event Handling: Handling User Interactions + + + +
        +
        +

        Mobile Web Wearable Web

        +
        + + +
        + +
        +

        Event Handling: Handling User Interactions

        +

        The Tizen platform supports some device events for user interaction. To provide a full user experience for your application users, you must handle various events in your application.

        + +

        Hardware Key Events

        + +

        The Tizen platform supports hardware key events for user interaction on devices.

        + + +

        The following figures show the hardware keys and events for mobile (on the left) and wearable (on the right) devices.

        + +

        Figure: Hardware keys and events

        +

        Menu and Back keys in mobile Back event in wearable

        + + + + + + + + + + + + + + + + +
        Table: Hardware key events
        TypeDescriptionAttribute
        tizenhwkeyEvent is triggered when a device detects the user interaction through a special point of hardware. + event.keyName +
          +
        • back for wearable
        • +
        • back, menu for mobile
        • +
        +
        +

        To bind an event callback on the tizenhwkey events, use the following code:

        +
        +window.addEventListener("tizenhwkey", function(ev)
        +{
        +   if (ev.keyName == "back") 
        +   {
        +      /* Call window.history.back() to go to previous browser window */
        +      /* Call tizen.application.getCurrentApplication().exit() to exit application */
        +      /* Add script to add another behavior */
        +   }
        +});
        +
        + +

        Exiting the Application with the Back Key

        +

        When the application binds a tizenhwkey event, it checks the page ID and decides to go back or exit with several lines of app-side script.

        +

        The Tizen Device APIs provide an application exit method. Even if the application has many pages, it can handle the back/exit process.

        +

        With a TAU page, just remember the ID of the main page. In the following example, the ID of the main page is main.

        +
        (function()
        +{
        +   window.addEventListener("tizenhwkey", function(ev);
        +   {
        +      if(ev.keyName === "back")
        +      {
        +         var page = document.getElementsByClassName("ui-page-active")[0],
        +             pageid = page ? page.id: "";
        +         if(pageid === "main")
        +         {
        +            try
        +            {
        +               tizen.application.getCurrentApplication().exit();
        +            }
        +            catch(ignore)
        +            {
        +            }
        +         }
        +         else
        +         {
        +            window.history.back();
        +         }
        +      }
        +   });
        +}());
        + +

        Rotary Events

        + +

        The Tizen platform supports rotary events for user interaction on a wearable rotary device or sensor. The rotary device can rotate clockwise or counter-clockwise, and dispatch an event for each movement. The rotary device has points called detents. If the rotary device detects the detent point while rotating, it dispatches a separate new event about the point. The number of the available detent points depends on the device hardware.

        + + + + + + + + + + +
        Note
        This feature is supported in wearable applications only.
        + + +

        Figure: Rotary device

        +

        Rotary device

        +

        Rotary events are used to deliver the rotary device or sensor data to the application. The following table describes the rotary events.

        + + + + + + + + + + + + + + + +
        Table: Rotary events
        TypeDescriptionAttribute
        rotarydetentEvent is triggered when a device detects the detent point.detail.direction: rotation direction +
        • CW for clockwise rotation direction
        • +
        • CCW for counter-clockwise rotation direction
        + +

        To bind an event callback on rotary events, use the following code:

        +
        +document.addEventListener("rotarydetent", function(ev)
        +{
        +   var direction = ev.detail.direction;
        +   /* Add behavior for detent detected event with a direction value */
        +});
        +
        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/footerbutton_ww.htm b/org.tizen.ui.practices/html/web/tau/footerbutton_ww.htm new file mode 100644 index 0000000..faa34a9 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/footerbutton_ww.htm @@ -0,0 +1,182 @@ + + + + + + + + + + + + + Creating Footer Buttons + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        + +

        Creating Footer Buttons

        + +

        You can create a footer button component that is supported in both a rectangular and circular UI.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figures show the layout of the footer button component in a rectangular and circular UI.

        +

        Figure: Footer button component in rectangular and circular devices

        +

        Footer button in a rectangular device Footer button in a circular device

        + +

        Figure: Multiple footer buttons in rectangular and circular devices

        +

        Multiple footer buttons in a rectangular device Multiple footer buttons in a circular device

        +

        The footer button on the circular UI has the ui-bottom-button class. When there are multiple buttons, the other buttons except for the first button use the drawer component in the circular UI.

        + + +

        To implement footer buttons:

        + +
          +
        • To implement a single footer button: +

          Edit the HTML code to add the footer button component to your application screen.

          + +
          +<div class="ui-page ui-page-active" id="bottomButtonPage" >
          +   <header class="ui-header">
          +      <h2 class="ui-title">Bottom Button</h2>
          +   </header>
          +   <div class="ui-content content-padding">
          +      It was a real pleasure for me to finally get to meet you. My colleagues join me in sending you our holiday greetings.
          +   </div>
          +   <footer class="ui-footer ui-bottom-button">
          +      <a href="#" class="ui-btn">Button</a>
          +   </footer>
          +</div>
          +
          +
        • +
        • To implement multiple footer buttons: + + +
            +
          1. Edit the HTML code to add the footer button components to your application screen. +

            When there are multiple buttons, the buttons (except for the first button) use the drawer in the circular UI.

            + +
            +<div class="ui-page ui-page-active" id="bottomButtonWithMorePage" >
            +   <header class="ui-header">
            +      <h2 class="ui-title">Multiple Buttons</h2>
            +   </header>
            +   <div class="ui-content content-padding">
            +      It was a real pleasure for me to finally get to meet you. My colleagues join me in sending you our holiday greetings.
            +   </div>
            +
            +   <a class="drawer-handler"></a>
            +
            +   <!-- Circle profile -->
            +   <div id="moreoptionsDrawer" class="ui-drawer drawer-elem" data-drawer-target="#bottomButtonWithMorePage" data-position="right" data-enable="true" data-drag-edge="1">
            +      <div id="selector" class="ui-selector">
            +         <div class="ui-item show-icon" data-title="2"></div>
            +         <div class="ui-item human-icon" data-title="3"></div>
            +      </div>
            +   </div>
            +
            +   <footer class="ui-footer ui-grid-col-3 ui-bottom-button">
            +      <a href="#" class="ui-btn">1</a>
            +      <a href="#" class="ui-btn">2</a>
            +      <a href="#" class="ui-btn">3</a>
            +
            +   </footer>
            +</div>
            +
            +
          2. + +
          3. Edit the CSS code to set the visual style of the buttons: + +
            +.drawer-elem 
            +{
            +   display: none;
            +}
            +
            +@media all and (-tizen-geometric-shape: circle) 
            +{
            +   .drawer-handler 
            +   {
            +      width:24px;
            +      height: 115px;
            +      position: fixed;
            +      top: 122px;
            +      right: 0;
            +      color: transparent;
            +      background-color: #a4a4a4;
            +      -webkit-mask-image: url(/*path of the image*/);
            +      -webkit-mask-size: 18px 36px;
            +      -webkit-mask-repeat: no-repeat;
            +      -webkit-mask-position: 0 40px;
            +   }
            +   .ui-bottom-button a + a 
            +   {
            +       display: none;
            +   }
            +}
            +
            + +
          4. +
          5. Edit the JavaScript code to manage the footer button events and other functionalities: +
            +(function()
            +{
            +   var page = document.querySelector("#bottomButtonWithMorePage"),
            +       drawer = page.querySelector("#moreoptionsDrawer"),
            +       handler = page.querySelector(".ui-more");
            +
            +   page.addEventListener("pagebeforeshow", function() 
            +   {
            +      if (tau.support.shape.circle) 
            +      {
            +         tau.helper.DrawerMoreStyle.create(drawer, 
            +         {
            +            handler: ".drawer-handler",
            +
            +         });
            +      }
            +   });
            +})();
            +
            +
          6. +
          +
        • +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/globalization_w.htm b/org.tizen.ui.practices/html/web/tau/globalization_w.htm new file mode 100644 index 0000000..3074e51 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/globalization_w.htm @@ -0,0 +1,484 @@ + + + + + + + + + + + + + Globalization: Supporting Internationalization and Localization + + + + + + +
        +

        Globalization: Supporting Internationalization and Localization

        + +

        The TAU Globalize utility supports internationalization and localization. It wraps the Globalize functionality for easy access from Tizen Web applications, and it is extended to support the right-to-left (RTL) languages.

        + +

        jQuery and Globalize

        + +

        Globalize is a jQuery JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data. The library works both for the browser and as a Node.js module. jQuery and Globalize have dependencies with cldr.js, which is a CLDR low-level manipulation tool.

        + +

        Globalize:

        +
          +
        • Leverages the Unicode CLDR data and follows its UTS#35 specification.
        • +
        • Keeps the code separate from the i18n content. Does not host or embed any locale data in the library. Empowers you to control the loading mechanism of your choice.
        • +
        • Allows you to load as much or as little data as you need. Avoids duplicating data if using multiple i18n libraries that leverage CLDR.
        • +
        • Keeps the code modular. Allows you to load the i18n functionalities you need.
        • +
        • Runs in browsers and Node.js, and consistently across all of them.
        • +
        • Makes globalization as easy to use as jQuery.
        • +
        + +

        CLDR Data

        + +

        The Unicode CLDR provides the key building blocks for software to support the world's languages. It includes:

        +
          +
        • Locale-specific patterns for formatting and parsing dates, times, time zones, numbers, and currency values
        • +
        • Translations of names: languages, scripts, countries and regions, currencies, eras, months, weekdays, day periods, time zones, cities, and time units
        • +
        • Language and script information: characters used, plural cases, gender of lists, capitalization, rules for sorting and searching, writing direction, transliteration rules, rules for spelling out numbers, and rules for segmenting text into graphemes, words, and sentences
        • +
        • Country information: language usage, currency information, calendar preference and week conventions, and postal and telephone codes
        • +
        • ISO and BCP 47 code support (such as cross-mappings) and keyboard layouts
        • +
        + +

        CLDR uses the XML format provided by UTS #35: Unicode Locale Data Markup Language (LDML). LDML is a format used not only for CLDR, but also for the general interchange of locale data. For more information about CLDR, see CLDR release notes, and to download the JSON format file , see JSON Data from the Unicode CLDR Project.

        +

        The TAU Globalize utility uses the CLDR 26 release, and when you create a Tizen Web application project, you find CLDR in the <project>/lib/tau/<profile>js/cldr-data folder.

        + +

        Using the Globalize Utility

        + +

        To use the TAU Globalize utility in your application:

        +
          +
        1. Download the following dependency files for your application: + +
        2. +
        3. Create a folder structure, as shown in the following table. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Globalize folder structure +
          Folder structureDescription

          +

          Globalize folder structure

          +

          Globalize main folder

          cldr/: Copy the cldr.js library in this folder.
          cldr-data/: Copy the cldr-data files in this folder. +

          cldr-data/main: Copy the languages to be supported in this folder.

          + + + + + + + + + +
          Note
          Do not copy all languages, just the ones you need.
          globalize/: Copy the Globalize library in this folder.
          locale/: Make the custom locale string in this folder.
          script/: JavaScript files.
          style/: CSS, image, and other style related files.
          view/: HTML files
          +
        4. +
        5. Set the locale using the following example code: +
          +var globalize = tau.util.globalize,
          +   localeId  = "ko-KR";
          +
          +document.addEventListener('pageshow', function()
          +{
          +   globalize.setLocale(localeId)
          +   .done(function(ko)
          +   {
          +      /* "ko" is the Globalize utility instance */
          +      console.log(ko.getLocale()) /* "ko" */
          +   })
          +})
          +
          + +

          The setLocale() method is not synchronous, and it returns the deferred object with the methods then(), done(), and fail(). Use these methods to receive the Globalize utility instance.

          +

          You can specify locales in 2 ways using IETF language tags, such as en, pt-BR, or zh-Hant-TW:

          +
            +
          • Specify the locale ID in the lang attribute of the body element, such as <body lang="ko-KR">.
          • +
          • Use a string variable as an input argument of the setLocale() method (for example ko.setLocale("en")) to overwrite the body element setting.
          • +
          +

          If no lang attribute or setLocale() input argument is defined, the Globalize utility finds the locale by checking the window.navigator.language property. If the check result is false, the utility uses the default locale "en".

          +

          The following table illustrates the locale setting method order.

          + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: Locale setting methods +
          OrderLocale setting methods
          1setLocale(LocaleId)
          2<body lang="ko-KR">
          3window.navigator.language
          4Default locale "en"
          +
        6. +
        7. Make sure that you have all required CLDR files. +

          The setLocale() method automatically loads the basic CLDR data files which are match the given locale by local AJAX. During the method call, the Globalize utility also loads the basic CLDR JSON files:

          +
            +
          • cldr/main/locale/ca-gregorian.json
          • +
          • cldr/main/locale/numbers.json
          • +
          • cldr/main/locale/currencies.json
          • +
          • cldr/supplemental/likelySubtags.json
          • +
          • cldr/supplemental/scriptMetaData.json
          • +
          • cldr/supplemental/timeData.json
          • +
          • cldr/supplemental/weekData.json
          • +
          • cldr/supplemental/numberingSystems.json
          • +
          • cldr/supplemental/plurals.json (for cardinals)
          • +
          • cldr/supplemental/ordinals.json (for ordinals)
          • +
          +

          In addition to the basic files, each Globalize method requires a special set of CLDR portions. Determine which Globalize module functionalities you need, and make sure you have the required files, as defined in the following table.

          + + + + + + + + + + + + + + + + + + + + + + + + + +
          + Table: CLDR requirements +
          ModuleRequired CLDR JSON files
          Core modulecldr/supplemental/likelySubtags.json
          Date modulecldr/main/locale/ca-gregorian.json +

          cldr/main/locale/timeZoneNames.json

          +

          cldr/supplemental/timeData.json

          +

          cldr/supplemental/weekData.json

          +

          CLDR JSON files from the number module

          Number modulecldr/main/locale/numbers.json +

          cldr/supplemental/numberingSystems.json

          Plural modulecldr/supplemental/plurals.json (for cardinals) +

          cldr/supplemental/ordinals.json (for ordinals)

          +
          +
        8. +
        + +

        Using the Globalize Utility Methods

        +

        The following code snippets show how to use the TAU Globalize utility methods:

        +
          +
        • formatCurrency(): +
          +var globalize = tau.util.globalize,
          +    localeId  = "ko-KR",
          +    currency_unit = "KRW"; /* ISO 4217 */
          +
          +document.addEventListener('pageshow', function()
          +{
          +   globalize.setLocale(localeId)
          +   .done(function(ko)
          +   {
          +      console.log(ko.formatCurrency(69000, currency_unit)); /* ₩69,900 */
          +   })
          +})
          +
          +

          For more information, see the currency unit standard in ISO 4217.

          +
        • + +
        • formatDate(): +
          +var globalize = tau.util.globalize,
          +    localeId  = "ko-KR",
          +    currency_unit = "KRW"; /* ISO 4217 */
          +
          +document.addEventListener('pageshow', function()
          +{
          +   globalize.setLocale(localeId)
          +   .done(function(ko)
          +   {
          +      console.log(ko.formatDate(new Date(), {datetime:"medium"});
          +   })
          +})
          +
          +

          For more information, see date-formatter.

          +
        • + +
        • getCalendar(): +
          +var globalize = tau.util.globalize,
          +    localeId  = "ko-KR";
          +
          +document.addEventListener('pageshow', function()
          +{
          +   globalize.setLocale(localeId)
          +   .done(function(ko)
          +   {
          +      console.log(ko.getCalendar().months.format.wide, undefined, 4));
          +   })
          +})
          +
          +

          The calendar format is specified in the gregorian.json file in the CLDR data.

          +
        • + +
        • formatMessage(): +

          This method supports custom locale data.

          +
            +
          1. Create a directory for each locale that has localized content under the locales directory in the project root. The locale names are defined in the W3C IANA language subtag registry. +
            +index.html
            +locale
            +   en.json
            +   ko.json
            +
            +
          2. +
          3. Create a JSON file for the formatMessage strings (custom locale strings) in locales paths: +
            +{
            +   "en":
            +   {
            +      "like":
            +      [
            +         "{0, plural, offset:1",
            +         "=0 {Be the first to like this}",
            +         "=1 {You liked this}",
            +         "one {You and someone else liked this}",
            +         "other {You and # others liked this}",
            +         "}"
            +      ],
            +      "greeting":
            +      {
            +         "hello":"hello",
            +         "bye":"bye"
            +      },
            +      "longText":
            +      [
            +         "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non",
            +         "quis exercitationem culpa nesciunt nihil aut nostrum explicabo",
            +         "reprehenderit optio amet ab temporibus asperiores quasi cupiditate.",
            +         "Voluptatum ducimus voluptates voluptas?"
            +      ]
            +   }
            +}
            +
            +
          4. + +
          5. Call the setLocale() method to load the custom locale files automatically: +
            +var globalize = tau.util.globalize,
            +    localeId  = "ko-KR";
            +
            +document.addEventListener('pageshow', function()
            +{
            +   globalize.setLocale(localeId)
            +   .done(function(ko)
            +   {
            +      console.log(ko.formatMessage("greeting/hello"));
            +      console.log(ko.formatMessage("greeting/bye"));
            +      console.log(ko.formatMessage("longText"));
            +   })
            +})
            +
            +
          6. +
          +
        • + +
        • messageFormatter(): +

          This method returns a function that formats a message using the ICU message format pattern. For more information, see message-formatter.

          +
            +
          1. Create a locale resource in the locales path: +
            +{
            +   "en":
            +   {
            +      "formatter":
            +      {
            +         "welcome":"Hello Mr. {0}",
            +         "thankyou":"Bye Mr. {custom}."
            +      }
            +   }
            +}
            +
            +
          2. + +
          3. Use the messageFormatter() method: +
            +var globalize = tau.util.globalize,
            +    localeId  = "en-US";
            +
            +document.addEventListener('pageshow', function()
            +{
            +   globalize.setLocale(localeId)
            +   .done(function(en)
            +   {
            +      var welcomeFormatter = en.messageFormatter('formatter/welcome'),
            +          thankyouFormatter  = en.messageFormatter('formatter/thankyou'),
            +          welcomeMessageList = ["Tom"],
            +          thankyouMessageList = {custom:"Tom"};
            +
            +      console.log(welcomeFormatter(welcomeMessageList));
            +      console.log(thankyouFormatter(thankyouMessageList));
            +   })
            +})
            +
            +
          4. +
          +
        • +
        + +

        Right-to-left (RTL) Language Support

        + +

        TAU offers 2 ways to handle right-to-left (RTL) languages:

        +
          +
        • Locale-specific CSS
        • +
        • RTL property in a locale object
        • +
        +

        When the setLocale() method is called, it automatically applies a CSS class to the body element of your DOM if the given locale has an RTL direction.

        +

        The following examples show how to use the locale-specific CSS:

        + +
          +
        • The following example has ar-EG as the given locale, and the language has an RTL direction: +
          +var globalize = tau.util.globalize,
          +    localeId  = "ar-EG";
          +
          +document.addEventListener('pageshow', function()
          +{
          +   globalize.setLocale(localeId)
          +   .done(function(ar)
          +   {
          +      ...
          +   })
          +})
          +
          +
        • + +
        • The following example has a DOM of body with a locale-specific CSS named ui-script-direction-rtl: +
          +<body class="ui-script-direction-rtl">
          +
          +
        • + +
        • The following example uses the locale-specific CSS to switch on the RTL feature for a UI component: +
          +.ui-script-direction-rtl .ui-listview
          +{
          +   direction: rtl;
          +}
          +.ui-script-direction-rtl .ui-li.ui-li-static
          +{
          +   text-align: right;
          +   unicode-bidi: bidi-override;
          +}
          +
          +
        • +
        + +

        The following example shows how to use the RTL property in a locale object (the rtl variable). If a given locale has an RTL direction, the variable is true.

        +
        +var globalize = tau.util.globalize,
        +    localeId  = "ar-EG";
        +
        +document.addEventListener('pageshow', function()
        +{
        +   globalize.setLocale(localeId)
        +   .done(function(ar)
        +   {
        +      console.log(ar.rtl) /* true */
        +   })
        +})
        +
        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/guides_tau_w.htm b/org.tizen.ui.practices/html/web/tau/guides_tau_w.htm new file mode 100644 index 0000000..9d396ee --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/guides_tau_w.htm @@ -0,0 +1,131 @@ + + + + + + + + + + + + + TAU + + + +
        +
        +

        Mobile Web Wearable Web

        +
        + +
        + +

        Related Info

        + +
        +
        + +
        +

        TAU

        + +

        The Tizen Advanced UI Framework components allow you to create and manage various kinds of UI components. The components represent a visual UI element, such as a button or slider, which gives you interaction and manipulation features.

        +

        TAU is the standard Web UI library for Tizen platform, originated from the Tizen Web UI Framework Library (standard library for Tizen 2.2.1), which was mainly an extension to jQuery Mobile. The key features of the Web UI Framework Library were coding simplification and application creation speed. The purpose of TAU is to be the "framework advanced to the next level".

        + + + + + + + + + + +
        Note
        Tizen Advanced UI Framework is optional, but recommended for making Web applications for Tizen. +
        + +

        With TAU, you can take advantage of the following benefits in your code:

        +
          +
        • TAU is a standalone library, so no additional libraries are needed.
        • +
        • TAU can be used with jQuery, as it exposes a special API to the jQuery object identical to jQuery Mobile. Migration is painless.
        • +
        • TAU has been written with speed in mind, and all the code is tweaked for maximum performance.
        • +
        • Applications can be built to dramatically improve startup performance.
        • +
        • TAU is ECMAScript5- and HTML5-compliant.
        • +
        • TAU has a large and open API, TAU methods and core functions (event utility functions) are available and not hidden.
        • +
        • TAU is customizable and easy to extend (to create new UI components).
        • +
        • TAU is optimized for wearable, mobile, and TV devices.
        • +
        • TAU supports various profiles (mobile, wearable, and TV).
        • +
        + + + + + + + + + + +
        Note
        TAU (Tizen Advanced UI) is the new name of the tizen-web-ui-fw. In all documents and source code, TAU is used instead of tizen-web-ui-fw. +

        Since 2.3, tizen-web-ui-fw has been deprecated (including tizen-web-ui-fw.js, tizen-web-ui-fw-libs.js, and tizen-web-ui-fw.css). Since 2.4, tizen-web-ui-fw is fully deleted and not supported anymore.

        +
        + +

        To learn to use the TAU features in your application UI, see the following topics:

        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/header_ww.htm b/org.tizen.ui.practices/html/web/tau/header_ww.htm new file mode 100644 index 0000000..933828f --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/header_ww.htm @@ -0,0 +1,128 @@ + + + + + + + + + + + + + Creating Expandable Headers + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Creating Expandable Headers

        + +

        You can create an expandable header component for your application. The expandable header offers events to support interactivity with other components.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the layout of the header component in a rectangular and circular UI.

        + +

        Figure: Header component in rectangular and circular devices

        +

        Header component in a rectangular device Header component in a circular device

        + +

        To implement the header component, edit the HTML code to add the header component to your application screen:

        +
        +<div class="ui-page ui-page-active" id="headerPage" >
        +   <header class="ui-header" id="myHeader">
        +      <h2 class="ui-title">Long title with ExpandableHeader</h2>
        +   </header>
        +   <div class="ui-content content-padding">
        +      Header is expandable in Circular UI.
        +   </div>
        +</div>
        +
        + + +

        The header component supports the following events.

        + + + + + + + + + + + + + + + + + + + + +
        Event nameDescription
        headerexpandTriggered when the header starts to expand.
        headerexpandcompleteTriggered after the header has fully expanded.
        headercollapseTriggered when the header returns to the state before expanding.
        + +

        You can use the headerexpand and headercollapse events if you need to do something when the header expands and collapses.

        +

        The following examples show header events with Marquee.

        + +
        +var page = document.querySelector("#myPage");
        +
        +page.addEventListener("pagebeforeshow", function() 
        +{
        +   var textElement = page.querySelector(".ui-title"),
        +       marquee = new tau.widget.Marquee(textElement);
        +}, false);
        +
        +page.addEventListener("headercollapse", function() 
        +{
        +   if (marquee) 
        +   {
        +      marquee.reset();
        +   }
        +}, false);
        +
        +page.addEventListener("headerexpandcomplete", function() 
        +{
        +   if (marquee) 
        +   {
        +      marquee.start();
        +   }
        +}, false);
        +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/helloworld_w.htm b/org.tizen.ui.practices/html/web/tau/helloworld_w.htm new file mode 100644 index 0000000..06b8d3b --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/helloworld_w.htm @@ -0,0 +1,183 @@ + + + + + + + + + + + + + Hello World: Creating a Basic Hello World Page + + + + + +
        +

        Hello World: Creating a Basic Hello World Page

        + +

        You can import TAU into your application and create a basic Hello World page with TAU.

        + +

        The following example shows a basic TAU template:

        +
        +<!DOCTYPE html>
        +<html>
        +   <head>
        +      <meta name="viewport" content="width=device-width, user-scalable=no"/>
        +      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
        +      <link rel="stylesheet" href="myapp.css" />
        +      <title>Hello TAU</title>
        +   </head>
        +   <body>
        +      <!--HTML BODY CONTENT-->
        +      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
        +      <script src="myapp.js"></script>
        +   </body>
        +</html>
        +
        + + +

        Scaling the UI

        +

        The Tizen Advanced UI (TAU)-based template provides 2 scaling methods: device-width and fixed-width.

        +
          +
        • Device-width scaling +

          This scaling mode is suited for most mobile devices, such as Tizen, iPhone® and Android®. In this mode, the viewport width is set to device-width, enabling rem scaling using the Rem and Em units. These units calculate the size of a source element automatically based on the container font size (Em) or the base font size (Rem). In Tizen Web applications, a 320 px screen width is assumed.

          +
          <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
          +
        • +
        • Fixed-width scaling +

          This scaling mode is best suited for Tizen devices, since the entire screen can be scaled on the viewport level. In the viewport scaling mode, set the size of all resources to fit the 360 px screen width.

          +

          You can also use fixed-width scaling if you do not want to scale your application or if you want to set your own scale. In this case, declare a viewport but note that the default viewport scaling is overridden by the declared viewport. In the Tizen Web UI components, viewport scaling is set automatically to device-width:

          +
          <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
          +

          To enable fixed-width scaling, the header must contain the <meta name="viewport"> element:

          +
          <meta name="viewport" content="width=360, initial-scale=1, user-scalable=no">
          +
        • +
        + +

        Importing TAU

        +

        You can import TAU with HTML. For better performance, all CSS files must be included in the header and all script elements must be put before the body element's close tag:

        +
        +<!DOCTYPE html>
        +<html>
        +   <head>
        +      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
        +   </head>
        +   <body>
        +      <!-- HTML BODY CONTENT -->
        +      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
        +   </body>
        +</html>
        +
        +

        In HTML, use the <script> and <link> elements. These default elements are used to load the basic Tizen Advanced UI (TAU) libraries that must be included in Tizen Web applications. The loaded libraries are:

        +
          +
        • TAU library: tau(.min).js

          This element is mandatory, as it imports the TAU library, which you need to use the TAU JavaScript Interface.

        • +
        • TAU theme: tau(.min).css

          This element is also mandatory, as it imports the TAU theme.

        • +
        + +

        Running Custom JavaScript and CSS

        +

        You can add an additional <script src="<CUSTOM_LIBRARY>"> or <link rel="stylesheet" src="<CUSTOM_CSS>"> element to include your own scripts and style sheets. However, place them after the default <script> elements, as you can use any TAU APIs provided by the default libraries.

        +

        To load your JavaScript file, include the file in the <script> element in the HTML header. Since the TAU files are already loaded, you can use any APIs from these libraries as well.

        +
        <script src="{YOUR_SCRIPT_PATH}"></script>
        + +

        Creating a Page in the Body

        + +

        The body section of the HTML file contains 1 or more pages.

        +

        To create a page in <body>, you can use the "ui-page" class with the <div> element:

        +
        +<body>
        +   <div class="ui-page" id="main">
        +   </div>
        +</body>
        +
        + +

        Each page has a header, mandatory content, and a footer:

        +
        +<body>
        +   <div class="ui-page" id="main">
        +      <div class="ui-header">
        +         <h1>Hello World</h1>
        +      </div>
        +      <div class="ui-content">
        +         <p>Hello TAU!</p>  
        +      </div>
        +      <div class="ui-footer">
        +         <button>OK</button>  
        +      </div>
        +   </div>
        +</body>
        +
        + +

        The following example shows a basic sample code for Hello World :

        +
        +<!DOCTYPE html>
        +<html>
        +   <head>
        +      <meta name="viewport" content="width=device-width, user-scalable=no"/>
        +      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
        +      <link rel="stylesheet" href="myapp.css" />
        +      <title>Hello TAU</title>
        +   </head>
        +   <body>
        +      <div class="ui-page" id="main">
        +         <div class="ui-header">
        +            <h1>Hello World</h1>
        +         </div>
        +         <div class="ui-content">
        +            <p>Hello TAU!</p>  
        +         </div>
        +         <div class="ui-footer">
        +            <button>OK</button>  
        +         </div>
        +      </div>
        +      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
        +      <script src="myapp.js"></script>
        +   </body>
        +</html>
        +
        + + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/helper_ww.htm b/org.tizen.ui.practices/html/web/tau/helper_ww.htm new file mode 100644 index 0000000..c8dbcb7 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/helper_ww.htm @@ -0,0 +1,230 @@ + + + + + + + + + + + + + Using the Helper Script + + + + +
        +

        Using the Helper Script

        + +

        You can use the TAU helper script to support some components for the Web applications. SnapListMarqueeStyle allows you to create a marquee-able and expandable list style with the SnapListview.

        + +

        This feature is supported in wearable applications only.

        + +

        You can use the helper script as follows:

        + +
        +<script>
        +   var helperInstance = tau.helper.NameSpace
        +</script>
        +
        + +

        The SnapListMarqueeStyle helper provides a helper script to support creating some usable components for the list style. It supports making the list view more effective using the SnapListview and Marquee components.

        + + + + + + + + + + +
        Note
        This helper script is supported since Tizen 2.3.
        + +

        The following example shows how to create your own listview style with SnapListMarqueeStyle. In the example, the list item text scrolls horizontally and the sub text appears if the list item is placed in the middle of the screen.

        + +

        To create a SnapListMarqueeStyle:

        + +
          +
        1. Edit the HTML code to add the SnapListMarqueeStyle component to your application screen. +

          You can add a multiline style listview as follows.

          + +
          +<div class="ui-page ui-page-active" id="snaplistTest">
          +   <header class="ui-header">
          +      <h2 class="ui-title">Bottom Button</h2>
          +   </header>
          +   <div class="ui-content">
          +      <ul class="ui-listview ui-snap-listview expand-list" id="snapList">
          +         <li class="li-has-2line">
          +            <div class="ui-marquee ui-marquee-gradient">1.SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-2line">
          +            <div class="ui-marquee ui-marquee-gradient">2.SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-2line">
          +            <div class="ui-marquee ui-marquee-gradient">3.SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-2line">
          +            <div class="ui-marquee ui-marquee-gradient">4.SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +      </ul>
          +   </div>
          +</div>
          +
          +
        2. + +
        3. Edit the CSS code to set your list animation style: +
          .ui-listview.expand-list li.li-has-2line .ui-marquee
          +{
          +   -webkit-transform: translate3d(0, 16px, 0);
          +   -webkit-transition: all ease .5s;
          +}
          +.ui-listview.expand-list li.li-has-2line.ui-snap-listview-selected .ui-marquee
          +{
          +   -webkit-transform: translate3d(0, 0, 0);
          +   -webkit-transition: all ease 1s;
          +}
          +
          +.ui-listview.expand-list li.li-has-2line .ui-li-sub-text
          +{
          +   -webkit-transform: translate3d(0, -20px, 0);
          +   opacity: 0;
          +   -webkit-transition: all ease .5s;
          +}
          +.ui-listview.expand-list li.li-has-2line.ui-snap-listview-selected .ui-li-sub-text
          +{
          +   -webkit-transform: translate3d(0, 0, 0);
          +   opacity: 1;
          +   -webkit-transition: all ease 1s;
          +}
          +
          +
        4. + +
        5. Edit the JavaScript code to make your list into a SnapListMarqueeStyle component and manage the list events: +
          +<script>
          +var page = document.getElementById("snaplistTest"),
          +    list = document.getElementById("snapList"),
          +    listHelper;
          +
          +page.addEventListener("pageshow", function() 
          +{
          +   listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
          +});
          +
          +page.addEventListener("pagehide", function() 
          +{
          +   listHelper.destroy();
          +});
          +</script>
          +
          +
        6. +
        + +

        The following table shows the options you have in creating your SnapListMarqueeStyle component.

        + + + + + + + + + + + + + + + + + + +
        OptionInput typeDefault valueDescription
        marqueeDelaynumber0Sets the delay time (in milliseconds) for the marquee component.
        + +

        You can use the following methods with the SnapListMarqueeStyle:

        + +
          +
        • create() +

          Creates the related components for SnapListMarqueeStyle.

          +

          This method is supported since Tizen 2.3.

          +

          The following code example shows the use of the method:

          +
          +<ul class="ui-listview ui-snap-listview" id="snapList">
          +   <li>some element or text</li>
          +</ul>
          +
          +<script>
          +   var list = document.getElementById("snapList"),
          +       listHelper;
          +
          +   /* Create the helper */
          +   listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
          +</script>
          +
          +
        • +
        • destroy() +

          Destroys the related components for SnapListMarqueeStyle.

          +

          This method is supported since Tizen 2.3. It has no return value.

          +

          The following code example shows the use of the method:

          +
          +<ul class="ui-listview ui-snap-listview" id="snapList">
          +   <li>some element or text</li>
          +</ul>
          +
          +<script>
          +   var list = document.getElementById("snapList"),
          +       listHelper;
          +
          +   /* Create the helper */
          +   listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
          +
          +   /* Destroy the helper */
          +   listHelper.destroy();
          +</script>
          +
          +
        • +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/indexscrollbar_ww.htm b/org.tizen.ui.practices/html/web/tau/indexscrollbar_ww.htm new file mode 100644 index 0000000..72abb36 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/indexscrollbar_ww.htm @@ -0,0 +1,202 @@ + + + + + + + + + + + + + Creating Index Scroll Bars + + + + + +
        +

        Creating Index Scroll Bars

        + +

        You can create a circle- or rectangle-shaped index scroll bar component with the CircularIndexScrollBar and IndexScrollBar APIs.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the layout of the index scroll bar component in a rectangular and circular UI.

        + +

        Figure: Index scroll bar component in rectangular and circular devices

        +

        Index scroll bar component in a rectangular device Index scroll bar component in a circular device

        + + +

        To implement the index scroll bar component:

        + +
          +
        1. Edit the HTML code to add the component to your application screen: +
          <div class="ui-page ui-page-active" id="pageIndexScrollbar" >
          +   <header class="ui-header ui-header-small">
          +      <h2 class="ui-title ui-title-text-fadeout">Index Scroll Bar</h2>
          +   </header>
          +   <div id="indexscrollbar"></div>
          +   <section class="ui-content">
          +      <ul class="ui-listview ui-snap-listview" id="list1">
          +         <li class="ui-listview-divider">A</li>
          +         <li>Anton</li>
          +         <li class="ui-listview-divider">B</li>
          +         <li>Barry</li>
          +         <li>Bob</li>
          +         <li class="ui-listview-divider">C</li>
          +         <li>Carry</li>
          +         <li class="ui-listview-divider">D</li>
          +         <li>Daisy</li>
          +         <li class="ui-listview-divider">E</li>
          +         <li>Eric</li>
          +         <li class="ui-listview-divider">F</li>
          +         <li>Fay</li>
          +         <li class="ui-listview-divider">G</li>
          +         <li>Garry</li>
          +       </ul>
          +   </section>
          +</div>
          +
          +
        2. + +
        3. Edit the JavaScript code to manage the index scroll bar events and other functionality: +

          To create a component selectively:

          +
          +var indexScrollbarElement = document.getElementById("indexscrollbar");
          +
          +if (!tau.support.shape.circle) 
          +{
          +   /* Create IndexScrollbar */
          +   indexScrollbar = new tau.widget.IndexScrollbar(indexScrollbarElement);
          +} 
          +else 
          +{
          +   /* Create CircularIndexScrollbar */
          +   indexScrollbar = new tau.widget.CircularIndexScrollbar(indexScrollbarElement);
          +}
          +
          + +

          To use the callback:

          +
          +indexScrollbarElement.addEventListener("select", function(event) 
          +{
          +   var index = event.detail.index;
          +   /* Do something using the index */
          +   console.log(index);
          +});
          +
          + +

          In the following example, the list scrolls to the position of the list item defined using the ui-listview-divider class, selected by the index scroll bar.

          +

          Note that in a rectangular UI, touching the index generates the selection, but in a round UI, the selection occurs when using the rotary.

          + +
          +(function() 
          +{
          +   var page = document.getElementById("pageIndexScrollbar"),
          +       listviewElement = document.getElementById("list1"),
          +       isCircle = tau.support.shape.circle,
          +       scroller,
          +       indexScrollbar;
          +
          +   page.addEventListener("pageshow", function(ev) 
          +   {
          +      var indexScrollbarElement = document.getElementById("indexscrollbar"),
          +          listDividers = listviewElement.getElementsByClassName("ui-listview-divider"), /* List dividers */
          +          dividers = {}, /* Collection of list dividers */
          +          indices = [],	/* Index list */
          +          divider,
          +          i, idx;
          +
          +      /* For all list dividers */
          +      for (i = 0; i < listDividers.length; i++) 
          +      {
          +         /* Add the list divider elements to the collection */
          +         divider = listDividers[i];
          +         idx = divider.innerText;
          +         dividers[idx] = divider;
          +
          +         /* Add the index to the index list */
          +         indices.push(idx);
          +      }
          +
          +      scroller = tau.util.selectors.getScrollableParent(listviewElement);
          +
          +      if (!isCircle) 
          +      {
          +         indexScrollbar = new tau.widget.IndexScrollbar(indexScrollbarElement, {index: indices, container: scroller});
          +      }
          +      else 
          +      {
          +         /* Create IndexScrollbar */
          +         indexScrollbar = new tau.widget.CircularIndexScrollbar(indexScrollbarElement, {index: indices});
          +
          +         /* Add SnapListview item "selected" event handler */
          +         listviewElement.addEventListener("selected", function (ev) 
          +         {
          +            var indexValue = ev.target.textContent[0];
          +            indexScrollbar.value(indexValue);
          +         });
          +      }
          +
          +      /* Add IndexScrollbar index "select" event handler */
          +      indexScrollbarElement.addEventListener("select", function (ev) 
          +      {
          +         var divider,
          +             idx = ev.detail.index;
          +
          +         divider = dividers[idx];
          +         if (divider && scroller) 
          +         {
          +            /* Scroll to the ui-listview-divider element */
          +            scroller.scrollTop = divider.offsetTop - scroller.offsetTop;
          +         }
          +      });
          +   });
          +
          +   page.addEventListener("pagehide", function(ev) 
          +   {
          +      indexScrollbar.destroy();
          +   });
          +} ());
          +
          +
        4. +
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/list_ww.htm b/org.tizen.ui.practices/html/web/tau/list_ww.htm new file mode 100644 index 0000000..fd667cd --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/list_ww.htm @@ -0,0 +1,191 @@ + + + + + + + + + + + + + Creating Snap Lists + + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Creating Snap Lists

        + +

        You can create a snap list component with the marquee component using the SnapListview API and the helper script.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the layout of the list component in a rectangular and circular UI.

        +

        Figure: List component in rectangular and circular devices

        +

        List component in a rectangular device List component in a circular device

        + +

        To implement the list component:

        + +
          +
        1. Edit the HTML code to add the list component to your application screen: +
          +<div class="ui-page ui-page-active" id="snapListPage" >
          +   <header class="ui-header">
          +      <h2 class="ui-title">Snap List</h2>
          +   </header>
          +   <div class="ui-content">
          +      <ul class="ui-listview ui-snap-listview expand-list" id="snapList">
          +         <li class="li-has-3line">
          +         <div class="ui-marquee ui-marquee-gradient">1.3line SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-3line">
          +            <div class="ui-marquee ui-marquee-gradient">2.3line SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-3line">
          +            <div class="ui-marquee ui-marquee-gradient">3.3line SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-3line">
          +            <div class="ui-marquee ui-marquee-gradient">4.3line SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +         <li class="li-has-3line">
          +            <div class="ui-marquee ui-marquee-gradient">5.3line SnapListview with Marquee SnapListview with Marquee</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +            <div class="li-text-sub ui-li-sub-text">sub-text</div>
          +         </li>
          +      </ul>
          +   </div>
          +</div>
          +
          +
        2. + +
        3. Edit the CSS code to set the visual style of the list: +
          +.ui-listview li .li-text-sub 
          +{
          +   display: block;
          +   text-overflow: ellipsis;
          +   overflow: hidden;
          +   line-height: 32px;
          +   color: rgb(51, 51, 51);
          +}
          +
          +.ui-listview li.li-has-3line 
          +{
          +   padding-top: 0;
          +   padding-bottom: 0;
          +   height: 115px;
          +}
          +
          +.ui-listview.expand-list li.li-has-3line .ui-marquee
          +{
          +   -webkit-transform: translate3d(0, 30px, 0);
          +}
          +
          +.ui-listview.expand-list li.li-has-3line.ui-snap-listview-selected .ui-marquee
          +{
          +   -webkit-transform: translate3d(0, 0, 0);
          +   -webkit-transition: all ease 1s;
          +}
          +
          +.ui-listview.expand-list li.li-has-3line .ui-li-sub-text:nth-child(2)
          +{
          +   -webkit-transform: translate3d(0, -10px, 0);
          +   opacity: 0;
          +}
          +
          +.ui-listview.expand-list li.li-has-3line.ui-snap-listview-selected .ui-li-sub-text:nth-child(2)
          +{
          +   -webkit-transform: translate3d(0, 0, 0);
          +   opacity: 1;
          +   -webkit-transition: all ease 1s;
          +}
          +
          +.ui-listview.expand-list li.li-has-3line .ui-li-sub-text:last-child
          +{
          +   -webkit-transform: translate3d(0, -42px, 0);
          +   opacity: 0;
          +}
          +
          +.ui-listview.expand-list li.li-has-3line.ui-snap-listview-selected .ui-li-sub-text:last-child
          +{
          +   -webkit-transform: translate3d(0, 0, 0);
          +   opacity: 1;
          +   -webkit-transition: all ease 1s;
          +}
          +
          +
        4. + +
        5. Edit the JavaScript code to manage the list events and other functionality: +
          +var page = document.querySelector("#snapListPage"),
          +    listHelper;
          +
          +page.addEventListener( "pagebeforeshow", function() 
          +{
          +   var list = document.getElementById("snapList");
          +
          +   if (tau.support.shape.circle) 
          +   {
          +      listHelper = tau.helper.SnapListMarqueeStyle.create(list, {marqueeDelay: 1000});
          +   }
          +});
          +
          +page.addEventListener( "pagehide", function() 
          +{
          +   if (tau.support.shape.circle) 
          +   {
          +      if (listHelper) 
          +      {
          +         listHelper.destroy();
          +      }
          +   }
          +});
          +
          +
        6. +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/managing_page_w.htm b/org.tizen.ui.practices/html/web/tau/managing_page_w.htm new file mode 100644 index 0000000..e85eac3 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/managing_page_w.htm @@ -0,0 +1,262 @@ + + + + + + + + + + + + + Managing Pages: Creating and Routing a Page + + + + + +
        +

        Managing Pages: Creating and Routing a Page

        + +

        The basic building block of an application UI in the TAU library is the Page element, which includes all other elements. The element is optional and extendable, so you can have any element for grouping controls you want.

        + +

        Page Structure

        +

        The page consist of:

        +
          +
        • Header area +

          Shows the user which page is currently open. The header can contain buttons, menus, and toolbars. The header is optional.

        • +
        • Content area +

          Contains the main application content. The content area has an optional scroll bar.

        • +
        • Footer area +

          Contains a status line or buttons. The footer is optional.

        • +
        +

        All the page areas are specified by a corresponding class attribute.

        + +

        Figure: Page content

        +

        Application UI Schema

        + +

        If there is no Page element in the markup, TAU creates one. For example, if no Page element exists:

        +
        <span>I have no page</span>
        +

        TAU creates a page:

        +
        <div class="ui-page"><span>I have no page</span></div>
        +
        + + +

        Creating a Single Page

        + + +

        To create a page:

        +
          +
        1. Create a single page with the following code:

          +
          <div class="ui-page">
          +   Simple page
          +</div>
          +
          + +

          To create a page for your application, use the class attribute with the ui-page value. TAU uses that information to properly acquire the div element and bind the DOM element to its JavaScript component implementation.

          +
        2. +
        3. Create a header area by using the class="ui-header" attribute:

          +
          <div class="ui-page">
          +   <div class="ui-header">This is a header</div>
          +</div>
          +
        4. +
        5. Create a footer area by using the class="ui-footer" attribute:

          +
          <div class="ui-page">
          +   <div class="ui-footer">This is a footer</div>
          +</div>
          +
        6. + +
        7. Create the main content area by using the class="ui-content" attribute:

          +
          <div class="ui-page">
          +   <div class="ui-header">MyApplication header</div>
          +   <div class="ui-content">
          +      Hello world!
          +   </div>
          +   <div class="ui-footer">Application status line</div>
          +</div>
          +
          +

          The previous example shows a full page structure. The header and footer areas can contain multiple UI components, such as buttons or images.

          +

          The following example shows a title bar with a More Options button and an icon:

          +
          <div class="ui-page">
          +   <div class="ui-header">
          +      <h2 class="ui-title ui-icon" style="background-image: url(image.png);">Title</h2>
          +      <button type="button" class="ui-more ui-icon-overflow">More Options</button>
          +   </div>
          +   <div class="ui-content">MyApplication content</div>
          +</div>
          +
          +
        8. +
        9. +

          You can also create a popup for your page:

          +
          <div class="ui-page">
          +   <div class="ui-header">Popup Open Page</div>
          +   <div class="ui-content">
          +      <a href="#popup" class="ui-btn" data-rel="popup">Popup Open</a>
          +   </div>
          +
          +   <div id="popup" class="ui-popup">
          +      <div class="ui-popup-header">Popup Page</div>
          +      <div class="ui-popup-content">Popup Content</div>
          +   </div>
          +</div>
          +
          +

          The popup works because TAU opens (makes visible) the page whose id attribute corresponds to the #hashtag page. This is basic page routing; for more information, see Page Routing.

          +
        10. +
        + +

        Creating Multiple Pages in One HTML Code

        + + +

        You can implement a template containing multiple page containers in the application's index.html file.

        +

        In a multi-page layout, the main page is defined with the ui-page-active class. If no page has the ui-page-active class, the framework automatically sets up the first page in the source order as the main page. You can improve the launch performance by explicitly defining the main page to be displayed first. If the application has to wait for the framework to set up the main page, the page is displayed with some delay only after the framework is fully loaded.

        +
        +<body>
        +   <div class="ui-page ui-page-active" id="first">
        +      <div class="ui-content">
        +         <!--CONTENT-->
        +      </div>
        +   </div>
        +
        +   <div class="ui-page" id="two">
        +      <div class="ui-content">
        +         <!--CONTENT-->
        +      </div>
        +   </div>
        +</body>
        +
        + +

        Page Routing

        + +

        TAU is basically a UI framework, but since its purpose is to ease application building, it also provides basic functionality for changing pages in multi-page applications. The mechanics behind page routing are simple, and work without any additional JavaScript code. You can use the JavaScript API to get more powerful page routing functionalities.

        + +

        To manage page routing:

        + +
          +
        • To route without JavaScript: +

          TAU routing is based on URL hash changes, and it has a built-in mechanism for history tracking. The framework responds to #hashtag changes and tries to display the page that has the id attribute equal to the hashtag value. This approach works for pages defined inside the same HTML document.

          +

          TAU uses every <a> element in the page and binds routing methods for them. In addition, all button instances that are based on that tag and have a proper href attribute work with the framework router. The active page has a ui-page-active class assigned. Set that class yourself to be sure the correct page is displayed.

          +
          <!--pageOne.html-->
          +<div class="ui-page ui-page-active" id="first">
          +   <div class="ui-content">
          +      <a href="pageTwo.html">Go to page two</a>
          +   </div>
          +</div>
          +
          +<!--pageTwo.html-->
          +<div class="ui-page" id="two">
          +   <div class="ui-content">
          +      <a href="pageOne.html">Go to page one</a>
          +   </div>
          +</div>
          +
          +

          With multiple pages in one HTML code, you can use only the ID of the page in the href attribute:

          +
          +<div class="ui-page ui-page-active" id="first">
          +   <div class="ui-content">
          +      <a href="#two">Go to page two</a>
          +   </div>
          +</div>
          +
          +<div class="ui-page" id="two">
          +   <div class="ui-content">
          +      <a href="#first">Go to page one</a>
          +   </div>
          +</div>
          +
          +
        • +
        • To route using the API: +

          You can change pages through the TAU API by using the tau.changePage() method:

          +
          <!--pageTwo.html-->
          +<div class="ui-page ui-page-active" id="first">
          +   <div class="ui-content">
          +      You are viewing the first page of the example.
          +      <button id="first-button">Click here to change to page two</button>
          +   </div>
          +   <script>
          +      var el1 = document.getElementById("first-button");
          +      el1.addEventListener("click", function ()
          +      {
          +         tau.changePage("pageTwo.html");
          +      });
          +   </script>
          +</div>
          +
          +<!--pageTwo.html-->
          +<div class="ui-page" id="second">
          +   <div class="ui-content">
          +      This is the second page of the example.
          +      <button id="second-button">Click here to change to page one</button>
          +   </div>
          +   <script>
          +      var el2 = document.getElementById("second-button");
          +      el2.addEventListener("click", function ()
          +      {
          +         tau.changePage("pageOne.html");
          +      });
          +   </script>
          +</div>
          +
          +
        • + +
        • To load pages from external resources: +

          When an external page is supplied to the routing engine, TAU fetches that page and appends it to the current document, while changing the base element's href attribute to that page path. This ensures that all other resources, such as CSS, JS, or images, are loaded from the correct path without no real page reloads. Instead, TAU simply switches the current page to the new page.

          +

          To load pages from external resources, define the proper local address in the href attribute of the link:

          +
          <div class="ui-page">
          +   <div class="ui-content">
          +      <a href="external_text.html">Change to external</a>
          +   </div>
          +</div>
          +
          +

          To create an external link that is not supposed to be handled by the TAU router, use the rel="external", data-ajax="false", or target="_self" attribute:

          +
          <div class="ui-page">
          +   <div class="ui-content">
          +      <a href="external_text.html" target="_self">Change to external</a>
          +   </div>
          +</div>
          +
          +
        • +
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/moreoptions_ww.htm b/org.tizen.ui.practices/html/web/tau/moreoptions_ww.htm new file mode 100644 index 0000000..f25dbc1 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/moreoptions_ww.htm @@ -0,0 +1,184 @@ + + + + + + + + + + + + + Implementing More Options + + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Implementing More Options

        + + +

        In a rectangular UI, you can implement more options using the button and popup components. In a circular UI, the selector component provides the more options button. The following example shows how to create a more options button for the circular UI.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the more options component in a rectangular and circular UI.

        +

        Figure: More options component in rectangular and circular devices

        +

        More options component in a rectangular device More options component in a circular device

        + +

        To implement the more options component:

        +
          + +
        1. Edit the HTML code to add the more options component to your application screen: +
          <div id="moreoptionsPage" class="ui-page">
          +   <link rel="stylesheet"  href="./moreoptions.css">
          +   <header class="ui-header ui-has-more">
          +      <h2 class="ui-title">More Options</h2>
          +      <button type="button" class="ui-more ui-icon-overflow">More Options</button>
          +   </header>
          +   <div class="ui-content content-padding">
          +      It was a real pleasure for me to finally get to meet you. My colleagues join me in sending you our holiday greetings.
          +   </div>
          +
          +   <!-- Rectangular profile -->
          +   <div id="moreoptionsPopup" class="ui-popup" data-transition="slideup">
          +      <div class="ui-popup-header">Options</div>
          +      <div class="ui-popup-content">
          +         <ul class="ui-listview">
          +            <li><a href="#">1</a></li>
          +            <li><a href="#">2</a></li>
          +            <li><a href="#">3</a></li>
          +         </ul>
          +      </div>
          +   </div>
          +
          +   <!-- Circular profile -->
          +   <div id="moreoptionsDrawer" class="ui-drawer" data-drawer-target="#moreoptionsPage" data-position="right" data-enable="true" data-drag-edge="1">
          +      <div id="selector" class="ui-selector">
          +         <div class="ui-item show-icon" data-title="Show"></div>
          +         <div class="ui-item human-icon" data-title="Human"></div>
          +         <div class="ui-item delete-icon" data-title="Delete"></div>
          +         <div class="ui-item show-icon" data-title="Show"></div>
          +         <div class="ui-item human-icon" data-title="Human"></div>
          +         <div class="ui-item delete-icon" data-title="Delete"></div>
          +         <div class="ui-item x-icon" data-title="X Icon"></div>
          +         <div class="ui-item fail-icon" data-title="Fail"></div>
          +         <div class="ui-item show-icon" data-title="Show"></div>
          +         <div class="ui-item human-icon" data-title="Human"></div>
          +         <div class="ui-item delete-icon" data-title="Delete"></div>
          +         <div class="ui-item show-icon" data-title="Show"></div>
          +         <div class="ui-item human-icon" data-title="Human"></div>
          +      </div>
          +   </div>
          +</div>
          +
          +
        2. + +
        3. Edit the CSS code to set the visual style of the buttons: + +
          +#moreoptionsDrawer
          +{
          +   display: none;
          +}
          +
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   #moreoptionsDrawer
          +   {
          +      display: block;
          +      background-color: rgba(255, 255, 255, 0.1);
          +      border-radius: 100%;
          +   }
          +   #moreoptionsPopup
          +   {
          +      display: none;
          +   }
          +}
          +
          + +
        4. +
        5. Edit the JavaScript code to manage the option button events and other functionality: + +
          +(function()
          +{
          +   var page = document.querySelector("#moreoptionsPage"),
          +       popup = page.querySelector("#moreoptionsPopup"),
          +       handler = page.querySelector(".ui-more"),
          +       drawer = page.querySelector("#moreoptionsDrawer"),
          +       selector = page.querySelector("#selector"),
          +       helper,
          +       clickHandlerBound;
          +
          +   function clickHandler(event)
          +   {
          +      tau.openPopup(popup);
          +   }
          +
          +   page.addEventListener("pagebeforeshow", function()
          +   {
          +      if (tau.support.shape.circle)
          +      {
          +         helper = tau.helper.DrawerMoreStyle.create(drawer,
          +         {
          +            handler: ".drawer-handler"
          +         });
          +      }
          +      else
          +      {
          +         /* Shape is square */
          +         clickHandlerBound = clickHandler.bind(null);
          +         handler.addEventListener("click", clickHandlerBound);
          +      }
          +   });
          +
          +   page.addEventListener("pagebeforehide", function() 
          +   {
          +      if (tau.support.shape.circle)
          +      {
          +         handler.removeEventListener("click", clickHandlerBound);
          +         helper.destroy();
          +      }
          +   });
          +})();
          +
          +
        6. +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/notepad_w.htm b/org.tizen.ui.practices/html/web/tau/notepad_w.htm new file mode 100644 index 0000000..0c94eb8 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/notepad_w.htm @@ -0,0 +1,448 @@ + + + + + + + + + + + + + Creating a Notepad UI Application + + + +
        +
        +

        Mobile Web Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Creating a Notepad UI Application

        + +

        The notepad application shows all the notes in the main page, and allows the user to add new notes, edit existing notes, and delete notes by swiping them. The notes on the main page can be scrolled and edited, and a button is provided for adding a new note. After you click a note, it is displayed in the edit page for editing.

        + +

        To create a simple notepad application using the TAU library:

        + +
          +
        1. Generate an application from the Tizen SDK. +

          Create a simple basic application that can be used for further development:

          +
          1. In the IDE menu, go to + File > New > Tizen Web Project > WEARABLE-2.4 > Wearable UI > Basic Application.
          2. +
          3. Enter the application name as Notes and click Finish.
          +

          The IDE creates the application with a default file structure.

          +
        2. +
        3. Edit the section header for the index.html file. +

          Because the application runs on mobile or wearable devices, make sure that you have the correct tau.css styles for the corresponding profile:

          +
          • Mobile: +
            <link rel="stylesheet" type="text/css" href="lib/tau/mobile/theme/default/tau.min.css"/>
          • +
          • Wearable: +
            <link rel="stylesheet" type="text/css" href="lib/tau/wearable/theme/default/tau.min.css"/>
            +
          +

          Add also your own styles for the application:

          +
          <link rel="stylesheet" type="text/css" href="css/style.css"/>
          +
          + +

          The following example shows how the section header looks after editing:

          +
          +<head>
          +   <meta charset="utf-8" />
          +   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
          +   <meta name="description" content="Tizen basic template generated by Tizen Web IDE"/>
          +
          +   <title>Notepad</title>
          +
          +   <!--Use 'mobile' or 'wearable' to choose the device TAU profile-->
          +   <link rel="stylesheet" type="text/css" href="lib/tau/mobile/theme/default/tau.css"/>
          +   <link rel="stylesheet" type="text/css" href="css/style.css"/>
          +</head>
          +
        4. +
        5. Create the pages: the main page for displaying the notes and the editing page for adding and editing notes. +
            +
          1. The main page is the first page, defined with the div block with the ui-page class and main id. +
            1. Add the title header (Notes) for the page: +
              +<div id="main" class="ui-page">
              +   <header class="ui-header">
              +      <h1>Notes</h1>
              +   </header>
              +</div>
              +
            2. +
            3. Add content for the main page by adding a div element with + the _ui-content class. Add to this a ul element, which creates the list of notes. +

              Set the data-scroll="y" and data-handler="true" attributes.

              +

              The item in the list is represented as a li element. When a note on the main page is clicked, the application triggers the changepage event to the editor page and shows the item.

              +
              +<div class="ui-content" data-scroll="y" data-handler="true">
              +   <ul class="ui-listview" id="notesList"></ul>
              +</div>
              +
            4. +
            5. Add a navigation button to the application to change to the editor page. The button is placed in the footer, and it is created from an a element, + which has the id="newBtn" attribute. +
              +<div class="ui-footer">
              +   <a class="ui-btn" href="javascript:void()" id="newBtn">New note</a>
              +</div>
              +
            +

            The above examples apply to a wearable application. The following example shows the full code for the main page in a mobile application:

            +
            +<div class="ui-page" id="main">
            +   <div class"ui-header" data-position="fixed">
            +      <h1>Notes</h1>
            +   </div>
            +   <div class="ui-content" data-scroll="y" data-handler="true">
            +      <ul class="ui-listview" id="notesList"></ul>
            +   </div>
            +   <div class="ui-footer">
            +      <a class="ui-btn" href="javascript:void()" id="newBtn">New note</a>
            +   </div>
            +</div>
            +
            + + + + + + + + + +
            Note
            In mobile applications, pages are constructed using the data-role attribute, while the wearable applications use the class attribute. In addition, the value of the data-role attribute in mobile applications differs from the class attribute value in the wearable applications.
            +
          2. + +
          3. On the editing page, the header and footer are similar to the main page. +

            The only difference is that the action triggered after pressing the button adds an item to the items array and adds the item to the top of the visible list. The editing page is defined with a div block with the id="editor" and class="ui-page" attributes.

            +

            The editing page is needed for adding or editing a selected note. It has a textarea element to allow the user to edit the selected note.

            + +
            +<!--This code applies to wearable applications-->
            +<div class="ui-page" id="editor">
            +   <div class="ui-header">
            +      <h1>Editor</h1>
            +   </div>
            +   <div class="ui-content">
            +      <textarea id="editorField" placeholder="enter note"></textarea>
            +   </div>
            +   <div class="ui-footer">
            +      <a href="javascript:void()" id="saveBtn">Save</a>
            +   </div>
            +</div>
            +
        6. + +
        7. Link to the TAU library sources and add the script to the application: +
          +<script src="lib/jquery.js"></script>
          +<script type="text/javascript" src="lib/tau/mobile/js/tau.js" data-build-remove="false"></script>
          +<script src="js/main.js"></script>
          +
          + +

          The index.html file is now ready.

          +
        8. + +
        9. Add styles for the content: +
          +a
          +{
          +   color: #FFF;
          +}
          +
          +#notesList.ui-listview
          +{
          +   width: 100%;
          +}
          +
          +#notesList.ui-listview li
          +{
          +   margin: 0;
          +   white-space: nowrap;
          +}
          +
          +#notesList.ui-listview li .ui-inline
          +{
          +   position: absolute;
          +   right: 5px;
          +   top: 5px;
          +}
          +
          +#notesList.ui-listview li .ui-swipe-item-cover-inner
          +{
          +   text-overflow: ellipsis;
          +   overflow: hidden;
          +}
          +
          +#editor .ui-scrollview-view
          +{
          +   height: 100%;
          +}
          +
          +#editor textarea
          +{
          +   height: 95%;
          +   width: 100%;
          +}
          +
          +
        10. +
        11. Create the main.js file and create a function to close the application. +

          The application is started when the HTML content is ready.

          +
          +document.addEventListener("DOMContentLoaded", function ()
          +   {
          +      'use strict';
          +
          +      var newBtn = document.getElementById('newBtn'),
          +          saveBtn = document.getElementById('saveBtn'),
          +          editorField = document.getElementById('editorField'),
          +          notesList = document.getElementById('notesList'),
          +          editorPage = document.getElementById('editor'),
          +
          +          mainPageId = '#main',
          +          editorPageId = '#editor',
          +
          +          currentIndex = null,
          +
          +          EMPTY_CONTENT = '(empty)',
          +          STORAGE_KEY = 'notepad';
          +
          +      /**
          +      * Get data from local storage
          +      * @return {Array}
          +      */
          +      function getStorage(key)
          +      {
          +         return JSON.parse(window.localStorage.getItem(key)) || false;
          +      }
          +
          +      /**
          +      * Add data to local storage
          +      * @param {Array} data
          +      */
          +      function addStorage(data)
          +      {
          +         window.localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
          +      }
          +
          +      /**
          +      * Return current page ID
          +      * @returns
          +      */
          +      function getCurrentPageId()
          +      {
          +         return $('.ui-page:visible')[0].id;
          +      }
          +
          +      /* Refresh current page */
          +      function refreshCurrentPage()
          +      {
          +         $('#' + getCurrentPageId()).trigger('create');
          +      }
          +
          +      /**
          +      * Get notes from storage
          +      * @return {Array}
          +      */
          +      function getNotes()
          +      {
          +         return getStorage(STORAGE_KEY) || [];
          +      }
          +
          +      /* Clear list with notes */
          +      function clearNotesList()
          +      {
          +         notesList.innerHTML = '';
          +      }
          +
          +      /* Delete note from storage */
          +      function deleteNote(index)
          +      {
          +         var notes = getNotes();
          +
          +         if (notes[index] !== undefined)
          +         {
          +            notes.splice(index, 1);
          +            addStorage(notes);
          +         }
          +         else
          +         {
          +            console.error('deleteNote: note not found');
          +         }
          +
          +         showNotes();
          +         refreshCurrentPage();
          +         event.stopPropagation();
          +      }
          +
          +      /**
          +      * Edit note using array index
          +      * @param index
          +      */
          +      function editNote(index)
          +      {
          +         var notes = getNotes();
          +
          +         if (notes[index] !== undefined)
          +         {
          +            currentIndex = index;
          +            editorField.value = getNotes()[index];
          +            tau.changePage(editorPageId);
          +         }
          +         else
          +         {
          +            console.error('editNote: note not found');
          +            showNotes();
          +            refreshCurrentPage();
          +         }
          +      }
          +
          +      /* Show all notes extracted from local storage */
          +      function showNotes()
          +      {
          +         var notes = getNotes(),
          +             notesLen = notes.length,
          +             li = {},
          +             swipeCover = {},
          +             swipeItem = {},
          +             deleteBtn = {},
          +             i = 0,
          +             notesListInst;
          +
          +         clearNotesList();
          +
          +         for (i; i < notesLen; i += 1)
          +         {
          +            li = document.createElement('li');
          +            li.addEventListener('click', editNote.bind(this, i), false);
          +
          +            deleteBtn = document.createElement('button');
          +            deleteBtn.className('ui-btn');
          +            deleteBtn.setAttribute('data-inline', 'true');
          +            deleteBtn.innerText = 'Delete';
          +
          +            deleteBtn.addEventListener('click', deleteNote.bind(this, i), false);
          +
          +            li.innerText = notes[i].replace(/\n/g, ' ') || EMPTY_CONTENT;
          +            li.appendChild(deleteBtn);
          +            notesList.appendChild(li);
          +            notesListInst = tau.widget.getInstance(notesList);
          +            tau.widget.Button(deleteBtn);
          +            notesListInst.refresh();
          +         }
          +      }
          +
          +      /* Clear editor textarea */
          +      function clearEditor()
          +      {
          +         editorField.value = '';
          +      }
          +
          +      /* Save note to storage */
          +      function saveNote()
          +      {
          +         var notes = getNotes();
          +
          +         if (currentIndex !== null)
          +         {
          +            notes[currentIndex] = editorField.value;
          +         }
          +         else
          +         {
          +            notes.push(editorField.value);
          +         }
          +
          +         addStorage(notes);
          +
          +         clearEditor();
          +         showNotes();
          +         tau.changePage(mainPageId);
          +      }
          +
          +      /* New note button handler */
          +      function newNote()
          +      {
          +         currentIndex = null;
          +         clearEditor();
          +
          +         tau.changePage(editorPageId);
          +      }
          +
          +      /* On editor page show handler */
          +      function onEditorPageShow()
          +      {
          +         editorField.focus();
          +      }
          +
          +      /* Attach events */
          +      function events()
          +      {
          +         newBtn.addEventListener('click', newNote);
          +         saveBtn.addEventListener('click', saveNote);
          +
          +         editorPage.addEventListener('pageshow', onEditorPageShow);
          +
          +         window.addEventListener('tizenhwkey', function (e)
          +         {
          +            if (e.keyName === "back"
          +               && window.tizen
          +               && window.tizen.application)
          +            {
          +               switch (getCurrentPageId())
          +               {
          +                  case 'main':
          +                     window.tizen.application.getCurrentApplication().exit();
          +                     break;
          +                  default:
          +                     window.history.back();
          +                     break;
          +               }
          +               return false;
          +            }
          +         }, false);
          +      }
          +
          +      /* Initialize */
          +      function init()
          +      {
          +         showNotes();
          +         events();
          +      }
          +
          +      init();
          +   }, false);
          +
          +

          Now the application is ready and you can deploy it to a device or Emulator.

          +
        12. +
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/popup_ww.htm b/org.tizen.ui.practices/html/web/tau/popup_ww.htm new file mode 100644 index 0000000..95c2ce5 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/popup_ww.htm @@ -0,0 +1,114 @@ + + + + + + + + + + + + + Creating Popup Buttons + + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Creating Popup Buttons

        + +

        You can create bottom and side popup button components with the Popup API.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figures show the layout of the popup component in a rectangular and circular UI.

        + +

        Figure: Bottom popup component in rectangular and circular devices

        + +

        Bottom popup in a rectangular device Bottom popup in a circular device

        + +

        Figure: Side popup component in rectangular and circular devices

        + +

        Side popup component in a rectangular device Side popup component in a circular device

        + +

        To implement the popup button component:

        + +
          +
        • To implement a bottom popup button component: + +

          Edit the HTML code to add the bottom popup button component to your application screen. To add the bottom button to the circular UI, you must add the ui-bottom-button class to the popup footer. The popup can have only 1 bottom button.

          +
          +<div id="bottomBtnPopup" class="ui-popup">
          +   <div class="ui-popup-content">
          +      Turning on Power
          +      saving mode will
          +      limit the maximum
          +      power
          +   </div>
          +   <div class="ui-popup-footer ui-bottom-button">
          +      <button id="bottomBtn" class="ui-btn">Check</button>
          +   </div>
          +</div>
          +
          +
        • + +
        • To implement a side popup button component: +

          Edit the HTML code to add the side popup button component to your application screen. To add side buttons for the circular UI, you must add the ui-side-button class to the popup footer. The popup can have only 2 side buttons.

          +
          +<style>
          +   .btn-icon-cancel::before {-webkit-mask-image: url(./cancel.png)}
          +   .btn-icon-ok::before {-webkit-mask-image: url(./ok.png)}
          +</style>
          +<div id="sideBtnPopup" class="ui-popup">
          +   <div class="ui-popup-content">
          +      Turning on Power
          +      saving mode will
          +      limit the maximum
          +      power
          +   </div>
          +   <div class="ui-popup-footer ui-grid-col-2 ui-side-button">
          +      <button id="sideBtn-1" class="ui-btn btn-icon-cancel">Cancel</button>
          +      <button id="sideBtn-2" class="ui-btn btn-icon-ok">OK</button>
          +   </div>
          +</div>
          +
          +
        • +
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/processing_ww.htm b/org.tizen.ui.practices/html/web/tau/processing_ww.htm new file mode 100644 index 0000000..a9bfff7 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/processing_ww.htm @@ -0,0 +1,105 @@ + + + + + + + + + + + + + Creating Full Size Processing Components + + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Creating Full Size Processing Components

        + +

        You can create a full size processing component with the Processing API.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the layout of the processing component in a rectangular and circular UI.

        +

        Figure: Processing component in rectangular and circular devices

        + +

        Processing component in a rectangular device Processing component in a circular device

        + +

        To implement the processing component:

        +
          +
        1. Edit the HTML code to add the processing component to your application screen: +
          +<div class="ui-page ui-page-active" id="pageProcessing" data-enable-page-scroll="false">
          +   <header class="ui-header">
          +      <h2 class="ui-title">Processing</h2>
          +   </header>
          +   <div class="ui-content content-padding">
          +      <div class="ui-processing"></div>
          +      <div class="ui-processing-text">
          +         Description about progress
          +      </div>
          +   </div>
          +   <div class="ui-processing ui-processing-full-size"></div>
          +</div>
          +
          +
        2. + +
        3. Edit the CSS code to set the visual style of the processing component: +
          +.ui-processing-full-size 
          +{
          +   display: none;
          +}
          +
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   .ui-processing 
          +   {
          +      display: none;
          +   }
          +   .ui-processing.ui-processing-full-size 
          +   {
          +      display: block;
          +   }
          +}
          +
          +
        4. +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/tau_porting_w.htm b/org.tizen.ui.practices/html/web/tau/tau_porting_w.htm new file mode 100644 index 0000000..a78c928 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/tau_porting_w.htm @@ -0,0 +1,817 @@ + + + + + + + + + + + + + 2.4 Porting Guide: Changed APIs in 2.4 TAU + + + + + +
        +

        2.4 Porting Guide: Changed APIs in 2.4 TAU

        + +

        This guide describes the changes required to migrate a TAU element from 2.3 to 2.4.

        + +

        As the Tizen version number changes, TAU has been updated with new features. When migrating from 2.3 to 2.4, consider the following issues:

        +
          +
        • Selectors for defining the UI components
        • +
        • New and deprecated components in 2.4
        • +
        • Gesture event handling
        • +
        + +

        Backward Compatibility in TAU

        + +

        To support backward compatibility, TAU provides the tau.support-2.3.js and tau.support-2.3.css files.

        +

        If you want to use deprecated components, you can import those files. See the following example:

        + +
        +<html>
        +   <head>
        +      <script type="text/javascript" src="../lib/tau/mobile/js/tau.js"></script>
        +      <script type="text/javascript" src="../lib/tau/mobile/js/tau.support-2.3.js"></script>
        +      <link rel="stylesheet"  href="../lib/tau/mobile/theme/default/tau.css">
        +      <link rel="stylesheet"  href="../lib/tau/mobile/theme/default/tau.support-2.3.css">
        +      <link rel="stylesheet"  href="css/custom.css">
        +   </head>
        +</html>
        +
        + + + + + + + + + + + +
        Note
        The tau.support-2.3 file is only for backward compatibility. The above components are DEPRECATED since Tizen 2.4 and are deleted in Tizen 3.0.
        + +

        Component Definitions

        + +

        Since Tizen 2.4, it is strongly recommended to use the class selector to define the components in HTML files. The "data-role" selector has been deprecated and is no longer supported.

        + +

        The class selectors in TAU are composed with the "ui-" prefix and followed by the <COMPONENT_NAME>. For more information, see the UI Component API Reference (in mobile and wearable applications).

        +

        The following example shows how to define the UI components before and after:

        +
          +
        • Before: + +
          +<!-- Create Expandable component -->
          +<div data-role="expandable">
          +   <h1>Expandable head</h1>
          +   <div>Content</div>
          +</div>
          +
          +<!-- Create ToggleSwitch component -->
          +<select data-role="toggleswitch">
          +   <option value="off"></option>
          +   <option value="on"></option>
          +</select>
          +
          +<!-- Create SectionChanger component -->
          +<div data-role="section-changer">
          +   <div>
          +      <section>
          +         <h3>LEFT1 PAGE</h3>
          +      </section>
          +   </div>
          +</div>
          +
          + + + + + + + + + +
          Note
          The old selector with data-role can still be used in 2.4, but it is DEPRECATED and no longer supported in the next version.
          +
        • +
        • After: +
          +<!-- Create Expandable component -->
          +<div class="ui-expandable">
          +   <h1>Expandable head</h1>
          +   <div>Content</div>
          +</div>
          +
          +<!-- Create ToggleSwitch component -->
          +<select class="ui-toggleswitch">
          +   <option value="off"></option>
          +   <option value="on"></option>
          +</select>
          +
          +<!-- Create SectionChanger component -->
          +<div class="ui-section-changer">
          +   <div>
          +      <section>
          +         <h3>LEFT1 PAGE</h3>
          +      </section>
          +   </div>
          +</div>
          +
          +
        • +
        + + + +

        New Components in 2.4

        + +

        Some new mobile components are added in TAU since 2.4. Some are renamed from old components (such as Checkbox and Radio) and others are newly added with a new feature and theme (such as Colored ListView). The following table shows the new TAU components in 2.4.

        +

        For more information, see the Mobile UI Component API Reference.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: New TAU mobile components in 2.4
        UI componentDescription
        CheckboxThe checkbox component changes the default browser checkboxes to a form more adapted to the mobile environment.
        Colored List ViewThe colored list view component shows each list item with a gradient background color.
        Dropdown MenuThe dropdown menu component is used to select one option. It is created as a drop-down list form.
        ExpandableThe expandable component allows you to expand or collapse content when tapped.
        Floating ActionsThe floating actions component shows a floating action button that can be moved left and right.
        Grid ViewThe grid view component provides a grid-type list and presents content that are easily identified as images.
        Index ScrollbarThe index scrollbar component shows a shortcut list that is bound to its parent scrollbar and list view.
        Page IndicatorThe page indicator component presents as a dot-typed indicator.
        Panel ChangerThe panel changer and panel component provide a multi-page layout in a page component.
        RadioThe radio component changes the default browser radio button to a form more adapted to the mobile environment.
        Search InputThe search input component is used to search for page content.
        Section ChangerThe section changer component provides an application architecture, which has multiple sections on one page.
        TabsThe tabs component shows an unordered list of buttons on the screen wrapped together in a single group.
        Text EnveloperThe text enveloper component changes a text item to a button.
        + + +

        Deprecated Components

        + +

        Some mobile components are deprecated and no longer supported since 2.4. Instead of using deprecated components, see the following table and replace the components by new components or an HTML element.

        +

        For more information on deprecated components, see the Mobile Component API Reference.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: Deprecated TAU mobile components
        UI componentReplace with
        Autodividers-
        CheckboxRadioCheckbox component for the checkbox, radio component for the radio button.
        CollapsibleExpandable component.
        ControlGroupImplement your own customized application style.
        Fast ScrollIndex scrollbar component.
        GalleryImplement your own gallery with the section changer component.
        List DividerUse the ui-group-index class for a group index.
        NotificationPopup component with the ui-popup-toast class.
        Progress BarProgress component with the data-type="bar" option.
        Scroll Handler-
        Search BarSearch input component.
        Select MenuDropdown menu component.
        Swipe-
        Tab BarTabs component.
        Token Text AreaText enveloper component.
        + +

        If your application used the above deprecated components, see the following examples for successful migration:

        +
          +
        • CheckboxRadio +

          Before:

          +
          +<input type="checkbox" name="checkbox-1" id="checkbox-1"/>
          +<input type="radio" name="radio-1" id="radio-1"/>
          +
          +<script>
          +   var element1 = document.getElementById("checkbox-1"),
          +       element2 = document.getElementById("radio-1"),
          +       checkboxWidget = tau.widget.Checkboxradio(element1),
          +       radioWidget = tau.widget.Checkboxradio(element2);
          +
          +   checkboxWidget.enable();
          +   radioWidget.disable();
          +</script>
          +
          + +

          After:

          +
          +<input type="checkbox" name="checkbox-1" id="checkbox-1"/>
          +<input type="radio" name="radio-1" id="radio-1"/>
          +
          +<script>
          +   var element1 = document.getElementById("checkbox-1"),
          +       element2 = document.getElementById("radio-1"),
          +       checkboxWidget = tau.widget.Checkbox(element1),
          +       radioWidget = tau.widget.Radio(element2);
          +
          +   checkboxWidget.enable();
          +   radioWidget.disable();
          +</script>
          +
          +
        • +
        • Collapsible +

          Before:

          +
          +<ul data-role="listview">
          +   <li id="collapsible" data-role="collapsible" data-inset="false">
          +      <h2>Collapsible head</h2>
          +      <!--Sub list in collapsible li-->
          +      <ul data-role="listview">
          +         <li>sub list item1</li>
          +         <li>sub list item2</li>
          +      </ul>
          +   </li>
          +   <!--List item in 1st depth-->
          +   <li>other list item</li>
          +   <li>other list item</li>
          +</ul>
          +
          +<script>
          +   var collapsibleElement = document.getElementById("collapsible"),
          +       collapsible = tau.widget.Collapsible(collapsibleElement);l
          +</script>
          +
          + +

          After:

          +
          +<div id="expandable" class="ui-expandable" data-collapsed="false">
          +   <h1>Expandable head</h1>
          +   <div>Content</div>
          +</div>
          +
          +<script>
          +   var expandableEl = document.getElementById("expandable"),
          +       expandableWidget = tau.widget.Expandable(expandableEl);
          +</script>
          +
          +
        • +
        • Fast Scroll +

          Before:

          +
          +<div data-role="page" id="main">
          +   <div data-role="content">
          +      <ul id="list" data-role="listview" data-fastscroll="true">
          +         <li data-role="list-divider">A</li>
          +         <li>Anton</li>
          +         <li>Arabella</li>
          +         <li data-role="list-divider">B</li>
          +         <li>Barry</li>
          +         <li>Bily</li>
          +      </ul>
          +   </div>
          +</div>
          +
          +<script>
          +   var fastscroll = tau.widget.FastScroll(document.getElementById("list"));
          +</script>
          +
          + +

          After:

          +
          +<div class="ui-page" id="indexscrollbarPage">
          +   <div class="ui-indexscrollbar" id="indexscrollbar"></div>
          +   <div class="ui-content">
          +      <ul class="ui-listview" id="isbList">
          +         <li class="ui-group-index">A</li>
          +         <li class="ui-li-static">Anton</li>
          +         <li class="ui-li-static">Arabella</li>
          +         <li class="ui-group-index">B</li>
          +         <li class="ui-li-static">Barry</li>
          +         <li class="ui-li-static">Bibi</li>
          +      </ul>
          +   </div>
          +</div>
          +
          +<script>
          +   var isb = tau.widget.IndexScrollbar(document.getElementById("indexscrollbar"));
          +</script>
          +
          +
        • + +
        • Gallery +

          Before:

          +
          +<div data-role="content" data-scroll="none">
          +   <div data-role="gallery" id="gallery" data-vertical-align="middle"></div>
          +</div>
          +
          +<script>
          +   var galleryWidget = tau.widget.Gallery(document.getElementById("gallery"));
          +
          +   galleryWidget.add("./images/01.jpg");
          +   galleryWidget.add("./images/02.jpg");
          +   galleryWidget.add("./images/03.jpg");
          +   galleryWidget.refresh(1);
          +</script>
          +
          + +

          After:

          +
          +<div id="gallerySection" class="ui-content ui-section-changer" data-orientation="horizontal">
          +   <div>
          +      <section class="gallery-section">
          +         <img src="images/01.jpg" />
          +      </section>
          +      <section class="gallery-section">
          +         <img src="images/02.jpg" />
          +      </section>
          +   </div>
          +</div>
          +
          +<script>
          +   var sectionChangerElement = document.getElementById("gallerySection"),
          +       sectionChangerWidget = tau.widget.SectionChanger(sectionChangerElement),
          +       newSectionElement = document.createElement("section");
          +
          +   newSectionElement.innerHTML = "<img src='images/03.jpg'>";
          +   sectionsParentNode.appendChild(newSectionElement);
          +   sectionChangerWidget.refresh();
          +   sectionChangerWidget.setActiveSection(1);
          +</script>
          +
          +
        • + +
        • List Divider +

          Before:

          +
          +<ul data-role="listview">
          +   <li data-role="list-divider">Item styles</li>
          +   <li><a href="#">Normal lists</a></li>
          +   <li><a href="#">Normal lists</a></li>
          +   <li><a href="#">Normal lists</a></li>
          +</ul>
          +
          + +

          After:

          +
          +<ul class="ui-listview">
          +   <li class="ui-group-index">Item styles</li>
          +   <li class="ui-li-anchor"><a href="#">Normal lists</a></li>
          +   <li class="ui-li-anchor"><a href="#">Normal lists</a></li>
          +   <li class="ui-li-anchor"><a href="#">Normal lists</a></li>
          +</ul>
          +
          +
        • + +
        • Notification +

          Before:

          +
          +<div data-role="page" id="demo">
          +   <div data-role="notification" id="notification" data-type="popup">
          +      <p>Notification Demo TEST</p>
          +   </div>
          +   <div data-role="header" data-position="fixed">
          +      <h1>Notification</h1>
          +   </div>
          +   <div data-role="content">
          +      <div data-role="button" id="noti-demo">Show small popup</div>
          +   </div>
          +</div>
          +
          +<script>
          +   var notification = tau.widget.Notification(document.getElementById("notification")),
          +       buttonEl = document.getElementById("noti-demo");
          +
          +   buttonEl.addEventListener("vclick", function()
          +   {
          +      notification.open();
          +   });
          +</script>
          +
          + +

          After:

          +
          +<div data-role="content">
          +   <a class="ui-btn" id="open" data-inline="true">Button</a>   
          +   <div id="popup_toast" data-role="popup" class="ui-popup ui-popup-toast">
          +      <div class="ui-popup-content">
          +         Toast popup text Toast popup text
          +      </div>
          +   </div>
          +</div>
          +
          +<script>
          +   var btn = document.getElementById("open");
          +
          +   btn.addEventListener("vclick", function()
          +   {
          +      tau.openPopup("#popup_toast");
          +   });
          +</script>
          +
          +
        • + +
        • Progress Bar +

          Before:

          +
          +<div data-role="progressbar" id="progressbar"></div>
          +
          +<script>
          +   var progressbarWidget = tau.widget.ProgressBar(document.getElementById("progressbar"));
          +
          +   progressbarWidget.value(30);
          +</script>
          +
          + +

          After:

          +
          +<div class="ui-progress" data-type="bar" id="progressbar"></div>
          +
          +<script>
          +   var progressWidget = tau.widget.Progress(document.getElementById("progressbar"));
          +
          +   progressWidget.value(30);
          +</script>
          +
          +
        • + +
        • Search Bar +

          Before:

          +
          +<input type="search" name="search" id="search-bar"/>
          +
          +<script>
          +   var searchBarElement = document.getElementById("searchbar"),
          +       searchBarWidget = tau.widget.SearchBar(searchBarElement);
          +
          +   value = searchBarWidget.disable();
          +</script>
          +
          + +

          After:

          +
          +<input type="search" id="search-test" />
          +
          +<script>
          +   var searchEl = document.getElementById("search-test"),
          +       searchWidget = tau.widget.SearchInput(searchEl);
          +
          +   searchInputWidget.disable();
          +</script>
          +
          +
        • + +
        • Select Menu +

          Before:

          +
          +<select id="selectmenu" data-native-menu="false">
          +   <option value="1">Item1</option>
          +   <option value="2">Item2</option>
          +   <option value="3">Item3</option>
          +   <option value="4">Item4</option>
          +</select>
          +
          +<script>
          +   var element = document.getElementById("selectmenu"),
          +       widget = tau.widget.SelectMenu(element);
          +
          +   widget.open();
          +</script>
          +
          + +

          After:

          +
          +<select id="dropdownmenu" data-native-menu="false">
          +   <option value="1">Item1</option>
          +   <option value="2">Item2</option>
          +   <option value="3">Item3</option>
          +   <option value="4">Item4</option>
          +</select>
          +
          +<script>
          +   var element = document.getElementById("dropdownmenu"),
          +       widget = tau.widget.DropdownMenu(element);
          +
          +   widget.open();
          +</script>
          +
          +
        • + +
        • Tab Bar +

          Before:

          +
          +<div data-role="header">
          +   <div data-role="tabbar" id="tab-bar">
          +      <ul>
          +         <li><a href="#">Tabbar1</a></li>
          +         <li><a href="#">Tabbar2</a></li>
          +         <li><a href="#">Tabbar3</a></li>
          +      </ul>
          +   </div>
          +</div>
          +
          +<script>
          +   var tabBar = tau.widget.TabBar(document.getElementById("tab-bar"));
          +</script>
          +
          + +

          After:

          +
          +<!-- Tabs component is composed with Tabbar and SectionChanger -->
          +<div id="tabs" class="ui-tabs">
          +   <div class="ui-tabbar">
          +      <ul>
          +         <li><a href="#" class="ui-btn-active">Tab1</a></li>
          +         <li><a href="#">Tab2</a></li>
          +         <li><a href="#">Tab3</a></li>
          +      </ul>
          +   </div>
          +   <div class="ui-section-changer">
          +      <div>
          +         <section class="ui-section-active">
          +            <p>Tab1</p>
          +         </section>
          +         <section>
          +            <p>Tab2</p>   
          +         </section>
          +         <section>
          +            <p>Tab3</p>        
          +         </section>
          +      </div>
          +   </div>
          + </div>
          +
          +<script>
          +   var tabsElement = document.getElementById("tabs"),
          +       tabs = tau.widget.Tabs(tabsElement);
          +
          +   tabs.setIndex(1);
          +</script>
          +
          +
        • + +
        • Token Text Area +

          Before:

          +
          +<div data-role="tokentextarea" id="tokentext"></div>
          +
          +<script>
          +   var tokenWidget = tau.widget.TokenTextarea(document.getElementById("tokentext"));
          +
          +   tokenWidget.add("foobar");
          +</script>
          +
          + +

          After:

          +
          +<div class="ui-text-enveloper"></div>
          +
          +<script>
          +   var textEnveloperElement = document.getElementById("textenveloper"),
          +      textEnveloper = tau.component.TextEnveloper(textEnveloperElement);
          +
          +   textEnveloper.add("hello");
          +</script>
          +
          +
        • + +
        + + +

        Event Handling

        +

        Some events are changed. The following examples illustrate how to handle events:

        +
          +
        • Swipe event +

          In the previous version, the swipe event was triggered in every area in the page automatically, but since 2.4, for efficient trigger and handling, the swipe event is only triggered when the Gesture event is created.

          +

          To enable the swipe event, use the enableGesture() method. The following example shows how to enable the swipe event on the content area:

          +
          +<!-- HTML code -->
          +<div class="ui-page ui-page-active" id="pageSwipe">
          +   <header class="ui-header">
          +      <h2 class="ui-title">Swipe Event</h2>
          +   </header>
          +   <div id="content" class="ui-content></div>
          +</div>
          +
          +
          +(function()
          +{
          +   var page = document.getElementById("pageSwipe");
          +   page.addEventListener("pagebeforeshow", function()
          +   {
          +      var content = document.getElementById("content");
          +      tau.event.enableGesture(content, new tau.event.gesture.Swipe(
          +      {
          +         orientation: "horizontal"
          +      }));
          +   });
          +}());
          +
          +

          When the swipe event is enabled, the application can handle this event with some event detail data:

          +
          +(function()
          +{
          +   var content = document.getElementById("content");
          +
          +   content.addEventListener("swipe", function(e)
          +   {
          +      console.log("swipe direction = " + e.detail.direction);
          +   });
          +}());
          +
          + +

          For more information, see the Gesture Event API.

          + +
        • + +
        • Tap event +

          Since 2.4, the tap event has been deprecated. Use the click event instead.

          +

          If the application has one button in the content area:

          +
          +<div class="ui-content">
          +   <a id="btn" href="#" class="ui-btn">Click me</a>
          +</div>
          +
          +

          Before:

          +
          +var button = document.getElementById("btn");
          +
          +button.addEventListener("tap", eventHandler);
          +
          + +

          After:

          +
          +var button = document.getElementById("btn");
          +
          +button.addEventListener("click", eventHandler);
          +
          +
        • +
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/thumbnail_ww.htm b/org.tizen.ui.practices/html/web/tau/thumbnail_ww.htm new file mode 100644 index 0000000..06719e2 --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/thumbnail_ww.htm @@ -0,0 +1,158 @@ + + + + + + + + + + + + + Creating Thumbnails + + + +
        +
        +

        Wearable Web

        +
        + +
        +

        Related Info

        + +
        +
        + +
        +

        Creating Thumbnails

        + +

        You can create a thumbnail component with the SectionChanger API.

        + +

        This feature is supported in wearable applications only.

        + +

        The following figure shows the layout of the thumbnail component in a rectangular and circular UI.

        + +

        Figure: Thumbnail component in rectangular and circular devices

        + +

        Thumbnail component in a rectangular device Thumbnail component in a circular device

        + + +

        To implement the thumbnail component:

        +
          +
        1. Edit the HTML code to add the thumbnail component to your application screen: +
          +<div class="ui-page ui-page-active" id="sectionChangerPage" data-enable-page-scroll="false" >
          +   <div id="sectionChanger" class="ui-content ui-section-changer">
          +      <div id="scroller">
          +         <section class="ui-section-active">
          +            <div class="thumbnail">1</div>
          +         </section>
          +         <section>
          +            <div class="thumbnail">2</div>
          +         </section>
          +         <section>
          +            <div class="thumbnail">3</div>
          +         </section>
          +      </div>
          +   </div>
          +</div>
          +
          +
        2. + +
        3. Edit the CSS code to set the visual style of the thumbnail: +
          +section 
          +{
          +   padding: 0 10px 0 10px;
          +   height: 100%;
          +}
          +.thumbnail 
          +{
          +   height: 300px;
          +   width: 200px;
          +   background-color: #80482f;
          +   top: 50%;
          +   transform: translate3d(0, -50%, 0);
          +   position: relative;
          +   text-align: center;
          +   line-height: 300px;
          +}
          +.ui-section-active .thumbnail
          +{
          +   background-color: #000000;
          +   border: 1px solid #a06322;
          +}
          +
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   section 
          +   {
          +      padding: 0;
          +   }
          +   .thumbnail 
          +   {
          +      height: 200px;
          +      width: 200px;
          +      border-radius: 50%;
          +      background-color: #802532;
          +      top: 50%;
          +      position: relative;
          +      text-align: center;
          +      line-height: 200px;
          +      transform: scale(0.8) translate3d(0, -60%, 0);
          +      transition: transform 300ms;
          +   }
          +   .ui-section-active .thumbnail
          +   {
          +      transform: scale(1) translate3d(0, -50%, 0);
          +   }
          +}
          +
          +
        4. +
        5. Edit the JavaScript code to manage the thumbnail events and other functionalities: +
          +(function()
          +{
          +   var page = document.getElementById("sectionChangerPage"),
          +       sectionChanger = document.getElementById("sectionChanger");
          +
          +   page.addEventListener("pagebeforeshow", function() 
          +   {
          +      tau.widget.SectionChanger(sectionChanger, 
          +      {
          +         orientation: "horizontal",
          +         fillContent: false
          +      });
          +   });
          +})();
          +
          +
        6. +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/tau/ui_component_w.htm b/org.tizen.ui.practices/html/web/tau/ui_component_w.htm new file mode 100644 index 0000000..48fb58f --- /dev/null +++ b/org.tizen.ui.practices/html/web/tau/ui_component_w.htm @@ -0,0 +1,211 @@ + + + + + + + + + + + + + UI Components: Managing UI Components + + + + + +
        +

        UI Components: Managing UI Components

        + + +

        Each UI component in TAU has its own selector for autodetecting in an HTML file. The most popular selector is class. The old selector style is the data-role, which is deprecated. Some UI components have also simple HTML selectors, such as button (button component), or input[type=checkbox] (CheckboxRadio component).

        + + +

        Defining UI Components

        + +

        You can define UI components in 2 different ways using selectors:

        +
          +
        • With a class selector +

          It is recommended to use the class selector for each component. Class selectors in TAU are composed with a ui-prefix and <COMPONENT_NAME>.

          +

          The following example shows the creation of some components with a class selector:

          +
          +<!-- Create an Expandable component -->
          +<div class="ui-expandable" id="expandable-test">
          +   <h1>Expandable head</h1>
          +   <div>Content</div>
          +</div>
          +
          +<!-- Create a ToggleSwitch component -->
          +<select class="ui-toggleswitch">
          +   <option value="off"></option>
          +   <option value="on"></option>
          +</select>
          +
        • +
        • With a data-role selector +

          The data-role selector in TAU is composed with <COMPONENT_NAME> in lowercase.

          +

          The following example shows the creation of some components with a data-role selector:

          +
          +<!-- Create a TextEnveloper component -->
          +<div data-role="textenveloper"></div>
          +
          +<!-- Create a Drawer component -->
          +<div data-role="drawer">
          +   <ul data-role="listview">
          +      <li><a href="#">List item 1</a></li>
          +   </ul>
          +</div>
          +
        • +
        + +

        Setting UI Component Options

        + +

        TAU supports several ways of setting options for a UI component. For more information, see Mobile UI Components and Wearable UI Components.

        +

        To set the options:

        +
          +
        • Initializing options with the data- attribute +

          Various options can be set with data- attribute when the component is being created. You can set options this way only when the component is created. After creating the component, changing the data attributes on the HTML element does not change the component options.

          +

          The following example shows a SectionChanger code with a data- option:

          +
          <div id="hasSectionchangerPage" class="ui-page">
          +   <header class="ui-header">
          +      <h2 class="ui-title">SectionChanger</h2>
          +   </header>
          +   <div class="ui-section-changer" data-orientation="horizontal" data-circular="true" data-use-tab="true">
          +      <div>
          +         <section>
          +            <h3>LEFT1 PAGE</h3>
          +         </section>
          +         <section class="ui-section-active">
          +            <h3>MAIN PAGE</h3>
          +         </section>
          +         <section>
          +      </div>
          +   </div>
          +</div>
          +

          The data-circular and data-use-tab attributes are the initial options for creating a SectionChanger.

          +
        • + + +
        • Setting options with a manual constructor +

          Options can be set as arguments to the component constructor. When using options as arguments, you must use the camelCase name.

          +

          The following example shows the use of a manual constructor:

          +
          <div id="hasSectionchangerPage" class="ui-page">
          +   <header class="ui-header">
          +      <h2 class="ui-title">SectionChanger</h2>
          +   </header>
          +   <div class="ui-section-changer" id="sectionchanger">
          +      <div>
          +         <section>
          +            <h3>LEFT1 PAGE</h3>
          +         </section>
          +         <section class="ui-section-active">
          +            <h3>MAIN PAGE</h3>
          +         </section>
          +      </div>
          +   </div>
          +</div>
          +
          +<script>
          +   var sectionEl = document.getElementById("sectionchanger"),
          +       sectionChangerWidget = tau.widget.SectionChanger(sectionEl, 
          +   { 
          +      orientation: "horizontal",
          +      circular: true
          +      useTab: true
          +   });
          +</script>
          +
          +
        • + +
        • Setting options with a method call +

          To set options dynamically, use the option() method.

          +
          <div id="hasSectionchangerPage" class="ui-page">
          +   <header class="ui-header">
          +      <h2 class="ui-title">SectionChanger</h2>
          +   </header>
          +   <div class="ui-section-changer" data-orientation="horizontal" data-circular="true" data-use-tab="true">
          +      <div>
          +         <section>
          +            <h3>LEFT1 PAGE</h3>
          +         </section>
          +         <section class="ui-section-active">
          +            <h3>MAIN PAGE</h3>
          +         </section>
          +         <section>
          +      </div>
          +   </div>
          +</div>
          +
          +<script>
          +   var sectionEl = document.getElementById("sectionchanger"),
          +       sectionChangerWidget = tau.widget.SectionChanger(sectionEl);
          +
          +   sectionChangerWidget.option("circular", true);
          +</script>
          +
          +
        • +
        + +

        Managing UI Components with jQuery

        +

        You can use jQuery with TAU for convenience. Also for backward compatibility, TAU supports the jQuery interface for UI components. However, it is strongly recommended to use the new TAU style.

        +

        To manage the UI components if the jQuery library is loaded:

        +
          +
        1. Create the UI component: +
          <div class="ui-indexscrollbar" id="indexscrollbar"></div>
          +<script>
          +   $("#indexscrollbar").indexscrollbar();
          +</script>
          +
        2. +
        3. Use the call methods: +
          $(".selector").componentName("methodName", argument1, argument2, ...);
          +
          <div class="ui-indexscrollbar" id="indexscrollbar"></div>
          +<script>
          +   /* If the IndexScrollBar component is created */
          +   $("#indexscrollbar").indexscrollbar("destroy");
          +</script>
          +
        4. +
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/animation_w.htm b/org.tizen.ui.practices/html/web/w3c/animation_w.htm new file mode 100644 index 0000000..b2a5647 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/animation_w.htm @@ -0,0 +1,336 @@ + + + + + + + + + + + + + CSS Animations Module (Level 3): Creating Animations + + + + + + +
        +

        CSS Animations Module (Level 3): Creating Animations

        + +

        Animations (like transitions) change the presentational value of the CSS properties over time. The principal difference between animations and transitions is that while transitions are triggered implicitly when property values change, animations are explicitly executed when the animation properties are applied. This means that for animations, you must use animation keyframes to define explicit values for the properties being animated.

        + +

        When using the CSS animation properties, the Tizen browser requires the -webkit- prefix.

        + +

        Keyframes

        +

        The CSS animations work based on @-webkit-keyframes rules defined for specific elements. The rules can define various property changes complementing the simple running of a transition.

        +

        If the animation only has one set of changes over its whole iteration, the rule values can be assigned with a from {} to {} rule, where from is the beginning of the animation at 0% and to is the end at 100%. If there are multiple changes required, you can define their exact time periods using multiple <number>% {} rules that together cover the entire animation iteration from 0% to 100%.

        +

        The following code snippet demonstrates how to use keyframes. For a complete source code, see animation_keyframes.html

        +
        +<style type="text/css">
        +
        +   @-webkit-keyframes boxani 
        +   {
        +      from {left: 0; top: 0;}
        +      to {left: 100px; top: 100px;}
        +   }
        +   @-webkit-keyframes boxani_case01 
        +   {
        +      0% {left: 0; top: 0;}
        +      25% {left: 100px; top: 0;}
        +      50% {left: 100px; top: 100px;}
        +      75% {left: 0; top: 100px;}
        +      100% {left: 0; top: 0;}
        +   }
        +
        +</style>
        +
        + +

        Animation Properties

        + +

        You can define various properties for an animation to control how it is played:

        + +
          +
        • animation-name +

          This property uses the name defined in the @-webkit-keyframes rules to play the animation.

        • + +
        • animation-duration +

          This property defines how long one iteration of the animation takes.

        • + +
        • animation-iteration-count +

          This property defines how many times the animation is repeated. If the value is set as infinite, the repetitions are unlimited.

        • + +
        • animation-timing-function +

          This property defines the pace of the animation.

        • + +
        • animation-direction +

          This property defines the replay direction. The reverse value plays the animation from 100% keyframe to 0% keyframe, while the alternate value plays the animation normally during odd iterations, and from 100% keyframe to 0% keyframe during even iterations.

        • + +
        • animation-play-state +

          This property defines the replay status of the animation. The paused value temporarily stops the animation.

        • +
        • animation-delay +

          This property defines the delay time before the start of the animation.

        • + +
        • animation-fill-mode +

          This property defines the state of the animation before or after the animation is played. The forwards value maintains the last value of the keyframe rule when the animation is over, while the backwards value fills up the first value of the keyframe rule when the animation with the animation-delay property is in a standby state. The both value covers both the start and the end of the animation.

        + +

        The following code snippet demonstrates how to use animation properties. For a complete source code, see:

        + + +
        +<head>
        +   <style type="text/css">
        +      .box 
        +      {
        +         -webkit-animation-name: boxani;
        +         -webkit-animation-duration: 5s;
        +         -webkit-animation-iteration-count: infinite;
        +         -webkit-animation-timing-function: linear;
        +         -webkit-animation-direction: normal;
        +         -webkit-animation-delay: 1s;
        +         -webkit-animation-fill-mode: none;
        +      }
        +
        +      .box.case01: hover 
        +      {
        +         -webkit-animation-play-state: paused;
        +         -webkit-animation-fill-mode: forwards;
        +      }
        +   </style>
        +</head>
        +
        +<body>
        +   <h1>animation-name</h1>
        +   <div class="boxarea">
        +      <div class="box">
        +         <p>animate</p>
        +         <p>animation-name: boxani;</p>
        +      </div>
        +   </div>
        +   <div class="boxarea">
        +      <div class="box case01">
        +         <p>animate</p>
        +         <p>animation-name: boxani_case01;</p>
        +      </div>
        +   </div>
        +</body>
        +
        + + + + + + + + + +
        Note
        The hover pseudo class in Tizen maintains a mouseover state when an element is tapped, and becomes a mouseout state when another element is tapped.
        + +

        The animation property allows you to define all the animation properties in a shorthand mode in the order of animation-name | animation-duration | animation-timing-function | animation-delay | animation-iteration-count | animation-direction | animation-fill-mode. If you omit a property value, a default value is used instead.

        + +
        +<style type="text/css">
        +   .box 
        +   {
        +      width: 150px; height: 100px; background: Coral; position: relative;
        +      -webkit-animation: boxani 3s ease 1s infinite alternate backwards;
        +   }
        +</style>
        +
        + +

        Creating a Logo Animation

        + +

        To enhance the user experience of your application, you must learn to create a logo animation, where element properties can be assigned and changed for each element and keyframe. The logo animation is similar to the animation that appears when a Tizen device (or Emulator) is switched on:

        + +
          +
        1. No elements are initially shown on the screen.
        2. +
        3. The Tizen logo gradually appears in the middle of the screen, and as it moves to the right, it becomes smaller.
        4. +
        5. Each letter in the word "TIZEN" consecutively comes in from the left of the screen and moves to the right to its correct location.
        6. +
        +

        Figure: Logo animation (in mobile applications only)

        +

        Logo animation

        +

        To create a logo animation:

        +
          +
        1. Create the HTML layout for the animation. To be able to manage the movement of each animation part separately, you must define individual elements for each part. +
          +<div class="animation-holder">
          +   <span class="tizen-txt t"></span>
          +   <span class="tizen-txt i"></span>
          +   <span class="tizen-txt z"></span>
          +   <span class="tizen-txt e"></span>
          +   <span class="tizen-txt n"></span>
          +   <span class="tizen-txt tm"></span>
          +   <span class="tizen-logo"></span>
          +</div>
          +
          +
        2. +
        3. Define the basic style for the animation: +
          +.example-body {width: 320px; height: 480px; background: #000; margin: 0 auto; 
          +               position: relative; border: 2px solid #fff; overflow: hidden;}
          +.animation-holder {width: 280px; height: 88px; position: absolute; 
          +                   left: 50%; top: 50%; margin: -54px 0 0 -140px;} 
          +
          +.tizen-txt, .tizen-logo {position: absolute; display: block; 
          +                         background-repeat: no-repeat; background-position: 50% 50%}
          +.tizen-txt.t {width: 48px; height: 56px; background-image: url(images/txt_t.png);}
          +.tizen-txt.i {width: 15px; height: 56px; background-image: url(images/txt_i.png);}
          +.tizen-txt.z {width: 46px; height: 56px; background-image: url(images/txt_z.png);}
          +.tizen-txt.e {width: 45px; height: 56px; background-image: url(images/txt_e.png);}
          +.tizen-txt.n {width: 54px; height: 58px; background-image: url(images/txt_n.png);}
          +.tizen-txt.tm {width: 11px; height: 6px; background-image: url(images/txt_tm.png);}
          +.tizen-logo {width: 220px; height: 211px; left: 30px; top: -61px; 
          +             background-image: url(images/logo_tizen.png); background-size: 100% 100%;}
          +
          +
        4. +
        5. Create the animation: +
            +
          1. To ensure that all the animation elements are played within the same time frame, some common properties are defined for the animation. The animation movement time is 7 seconds, and the animation repeats infinitely. +

            When an animation that repeats itself is activated, it can look unnatural when it suddenly returns to its initial position after finishing an iteration. To make the repetition move naturally, set the animation-direction property to alternate. The alternate direction means that during the odd iterations the animation proceeds in the normal direction (from the 0% keyframe to the 100% keyframe), while during the even iterations the keyframes are played in the opposite direction from 100% to 0%.

            +
            +.tizen-txt, .tizen-logo 
            +{
            +   -webkit-animation-duration: 7s;
            +   -webkit-animation-iteration-count: infinite;
            +   -webkit-animation-direction: alternate;
            +}
            +
            +
          2. +
          3. Create the keyframes to implement the flow for the Tizen logo: +
              +
            • During the first 25% of the animation total playing time (7 seconds), the transparency disappears and the Tizen logo appears.
            • +
            • During the 25 - 50% of the playing time, the logo size becomes smaller as the width and height values are reduced, and due to the left and top value, the logo is positioned to the top right corner of the screen.
            • +
            • During the 50 - 100% of the playing time, the values do not change, and the logo remains in its new position.
            • +
            +

            +
            +@-webkit-keyframes tizen-logo 
            +{
            +   0% {width: 220px; height: 211px; left: 30px; top: -61px; opacity: 0;}
            +   25% {width: 220px; height: 211px; left: 30px; top: -61px; opacity: 1;}
            +   50% {left: 247px; top: 0px; width: 33px; height: 32px; opacity: 1;}
            +   100% {left: 247px; top: 0px; width: 33px; height: 32px; opacity: 1;}
            +}
            +
            + + + + + + + + + + +
            Note
            If the 100% keyframe is not defined, the animation is executed based on the original properties, and the logo size increases to its original size at the end.
          4. +
          5. Create the keyframes to implement the flow for each letter in the word "TIZEN": +
              +
            • To hide the letter initially, the property has been assigned outside the screen at the 0% keyframe. To allow the Tizen logo to appear first, the first letter is introduced at the 30% keyframe.
            • +
            • To create a slight collision animation, the letter element moves to -10 px of the final value at the 40% keyframe before reaching its final 0 px value at the 45% keyframe.
            • +
            • The animation-timing-function property can be changed for each keyframe point, and is used to determine the pace of the animation. When the letter is actually shown on the screen and moved to its final location, the ease in and out timing functions are used.
            • +
            + +

            To show the letters one at a time, the timing is pushed back a bit more for each consecutive letter:

            +
            +<!--Letter T-->
            +@-webkit-keyframes tizen-txt-t 
            +{
            +   0% {left: 340px; top: 31px;}
            +   30% {left: 340px; top: 31px; animation-timing-function: ease-in;}
            +   40% {left: -10px; top: 31px; animation-timing-function: ease-out;}
            +   45% {left: 0; top: 31px;}
            +   100% {left: 0; top: 31px;}
            +}
            +
            +<!--Letter I-->
            +@-webkit-keyframes tizen-txt-i 
            +{
            +   0% {left: 340px; top: 31px;}
            +   40% {left: 340px; top: 31px; animation-timing-function: ease-in;}
            +   50% {left: 47px; top: 31px; animation-timing-function: ease-out;}
            +   55% {left: 57px; top: 31px;}
            +   100% {left: 57px; top: 31px;}
            +}
            +
            +<!--Remaining letters-->
            +
          6. + +
          7. After creating all the keyframes, define the animation-name property for each element:

            +
            +.tizen-txt.t 
            +{
            +   -webkit-animation-name: tizen-txt-t;
            +}
            +.tizen-txt.i 
            +{
            +   -webkit-animation-name: tizen-txt-i;
            +}
            +
          8. + +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/background_w.htm b/org.tizen.ui.practices/html/web/w3c/background_w.htm new file mode 100644 index 0000000..30ba322 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/background_w.htm @@ -0,0 +1,188 @@ + + + + + + + + + + + + + CSS Backgrounds and Borders Module (Level 3): Specifying Background and Border Styles + + + + + + +
        +

        CSS Backgrounds and Borders Module (Level 3): Specifying Background and Border Styles

        + +

        You can manage the CSS properties for specifying the border style or background of any HTML element.

        + +

        When creating a background for an element, you can use the following properties:

        +
          +
        • background-color +

          Defines the color of the background.

        • +
        • background-image +

          Defines the image to be used. You can add images as separate layers to an element. To add multiple images, separate them by commas to add each image as a separate layer. The images are added in the order they are defined.

        • +
        • background-position +

          Defines the exact position of the image.

        • +
        • background-repeat +

          Defines whether the image is repeated to fill the entire background (in case the image is too small to do it otherwise).

        • +
        • background-origin +

          Defines the position of the initial background for the item.

        • +
        • background-size +

          Defines the size of the image in the background.

        • +
        • background-clip +

          Defines the area of the cropped background element.

        • +
        + +

        The border properties specify the line thickness, style, and color for the element border. You can define the border using 3 separate properties (border-width, border-style, and border-color), or by listing the values for all 3 properties together in 1 border property. To define rounded corners for the border, you can additionally use the border-radius property.

        + +

        To define shading for an element, you can define the horizontal and vertical offset, blur radius, and the spread distance values within the box-shadow property. To switch the shadow from outside to inside the element, add the inset keyword to the property too.

        + +

        The following image shows a simple background color (top left), a background image (top right), multiple images with a solid black border (bottom left), and an element with shading and a solid black border with rounded corners (bottom right). The background image at top right is automatically repeated to cover the entire background, while the images at bottom left are not repeated due to the background-repeat property value.

        + +

        Figure: Background examples

        +

        Background examples

        +

        The following code snippet demonstrates how to set the background color, images, borders, and shadings.

        + +
        +<!--Background color-->
        +#one 
        +{
        +   width: 180px;
        +   height: 40px;
        +   background-color: lightblue;
        +}
        +
        +<!--Background image--> 
        +#one 
        +{
        +   width: 200px;
        +   height: 100px;
        +   background-color: #00F;
        +   background-image: url(t3.png);
        +}
        +
        +<!--Multiple images--> 
        +#multi 
        +{
        +   width: 155px;
        +   height: 100px;
        +   border: 1px solid #000;
        +   background-color: #87CEFA;
        +   background-image: url(t1.png), url(t2.png), url(t3.png);
        +   background-position: center center, 20% 100%, top left;
        +   background-repeat: no-repeat;
        +}
        +
        +<!--Shading and border with rounded corners-->
        +#shading 
        +{
        +   width: 160px;
        +   height: 40px;
        +   border: 1px solid #000;
        +   border-radius: 20px;
        +   background-color: #88f;
        +   box-shadow: #888 10px 10px;
        +}
        +
        + +

        Creating Backgrounds

        + +

        To enhance the user experience of your application, you must learn to create a multilayer background with the parallax effect using the CSS box model. The background consists of 3 images on separate layers, and 2 of the layers can be moved over each other.

        + +

        Figure: Background with the parallax effect

        +

        Background with the parallax effect

        + +
        1. Prepare 3 images (tizen.png, tizen2.png, and dot.png), each with a transparent background. + +

          tizen.png, tizen2.png, and dot.png images

        2. + +
        3. Create a div element with id="parallelexample" and a slider input element with the minimum, maximum, and initial value: +
          +<div id="parallelexample"></div>
          +<input id="position" type="range" min="1" max="200" value="50">
          +
        4. + +
        5. Define the needed styles for the div element in the <head> section using the parallelexample ID. +

          Define a background using the prepared images in the correct order. The images are shown in the order they have been added, with the first image on the topmost layer. Use the same order when defining the background position for each image.

          +
          +#parallelexample
          +{
          +   width: 300px;
          +   height: 300px;
          +   background-image: url(tizen2_32.png), url(tizen3_32.png), url(dot.png);
          +   background-position: 6.25em 8em, 3.125em 4em, center top;
          +   background-repeat: repeat, repeat, repeat;
          +   border: 1px solid black;
          +   margin: 0px auto;
          +}
          +
        6. +
        7. To create the parallax effect, create a method that moves the background layers by changing the horizontal position values of the images in the div element. To determine the position value change, add an onchange event handler for the slider to determine the change based on the slider handle movement. +
          +function moveLayers() 
          +{
          +   /* Get slider value */
          +   var poz = document.getElementById('position');
          +   /* Get the div element */
          +   var example = document.getElementById('ParallaxExamle');
          +   /* Add the event handler */
          +   poz.onchange = function()
          +   {
          +      var layer1 = this.value/8, layer2 = this.value/16;
          +      example.style.backgroundPosition = layer1 +'em 8em, ' 
          +                                         + layer2 + 'em 4em, center top';
          +   }
          +}
          +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/basic_ui_w.htm b/org.tizen.ui.practices/html/web/w3c/basic_ui_w.htm new file mode 100644 index 0000000..68d5d4b --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/basic_ui_w.htm @@ -0,0 +1,201 @@ + + + + + + + + + + + + + CSS Basic User Interface Module (Level 3): Applying Styles to HTML Documents + + + + + + +
        +

        CSS Basic User Interface Module (Level 3): Applying Styles to HTML Documents

        + +

        You can apply styles to HTML documents.

        +

        The CSS3 version has caused changes in the Selector, Color, Web Form, and Fonts CSS modules. In addition, the CSS3 UI API also handles changes related to the following user interface items:

        +
          +
        • User interface selectors +

          The CSS Selector is an essential module for applying a CSS to HTML in order to enable the DOM element selection. The pseudo-element selectors can be used to assign the user interface state. With the selectors, you can change the Web form style according to the user input without using JavaScript.

        • + +
        • Box model properties +

          A box model refers to all DOM elements excluding design elements, such as <br> and <i>. The box model area is set as defined in the following figure.

          +
            +
          • Content: Content area
          • +
          • Padding: Gap between the content and boundary
          • +
          • Border: Boundary
          • +
          • Margin: Overall size of the box model
          • +
          +

          Figure: Box model structure

          +

          Figure: Box model structure

          + +

          You can use the box model properties to assign styles to the selected DOM elements:

          +
            +
          • The box-sizing property assigns the box size range.
          • +
          • The outline properties make the box outstanding.
          • +
          • The text-overflow property handles the text extending outside the box.
          +
        • +
        + +

        Using Pseudo-element Selectors

        + +

        To enhance the user experience of your application, you must learn how to use pseudo-element selectors:

        +
          +
        1. Use the pseudo-classes, such as :enabled and :disabled, to add different styles based on the state of the DOM elements:

          +
          input: enabled {border: 1px solid blue}
          +input: disabled {border: 1px solid red}
          + + + + + + + + + +
          Note
          In the versions prior to CSS3, pseudo-elements, such as :hover, :active, and :focus, were used, and required an attribute selector. Since the :enabled and :disabled classes are not influenced by the display and visibility attributes, they improve the accessibility.
        2. +
        3. To control the state of the HTML5 Web Forms (in mobile or wearable applications), use the :in-range and :out-of-range pseudo-classes. +

          They check for any values that have exceeded the inserted range. (The following figure applies to mobile applications only.)

          +
          +<!--HTML--> 
          +<input type="number" step="10" min="10" max="100">
          +
          +
          +<!--CSS-->
          +input[type="number"]: in-range {border: 3px solid blue; width: 90%}
          +input[type="number"]: out-of-range {border: 3px solid red; width: 90%}
          +
          +

          Element ranges (in mobile applications only)

        4. +
        5. To apply different styles to required input items and option items, use the :required and :optional pseudo-classes. (The following figure applies to mobile applications only.) +
          +<!--HTML-->
          +<fieldset>
          +   <legend>required and optional</legend>
          +   <label>email: <input type="email" required></label>
          +   <label>password: <input type="Password" placeholder="required area" required></label>
          +
          +   <label>date: <input type="date" placeholder="You know what to do, huh?"></label>
          +   <textarea placeholder="Comment"></textarea>
          +</fieldset>
          +
          +<!--CSS-->
          +input: required, textarea: required {border: 1px solid red}
          +input: optional, textarea: optional {border: 1px solid #777}
          +
          +

          Required and optional elements (in mobile applications only)

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + +

        Using Box Model Properties

        + +

        To enhance the user experience of your application, you must learn how to use box model properties:

        + + + + + + + + + +
        Note
        The properties dependent on mouse and keyboard functions are not discussed in this tutorial.
        +
          +
        1. To assign the area that is included in the width and height of the box automatically, use the box-sizing property. To assign the width without a margin, use the box-sizing: border-box property. +
          +div.content-box {box-sizing: content-box} <!--width (height) = content-->
          +div.border-box {box-sizing: border-box} <!--width (height) = content + padding + border-->
          +div.border-box: before {height: 40px}
          +
        2. + +
        3. To draw an outline without using up the area, use the outline property: +
          +.Test-Box {outline: 5px dashed red}
          +.outline: before {outline: 2px dashed red}
          +.outline-offset: before {outline-offset: 35px}
          +
        4. + +
        5. To handle text that exceeds the area of the box model, use the text-overflow property. The text-overflow: ellipsis property is used to indicate the text exceeded the padding area as '...'. +
          div 
          +{
          +   width: 250px;
          +   margin: 20px auto;
          +   padding: 20px 30px;
          +   background-color: #eee;
          +   color: #333;
          +   border: 5px solid #333;
          +   font-weight: bold;
          +   overflow: hidden;
          +   white-space: nowrap;
          +}
          +
          +.clip {text-overflow: clip}
          +.ellipsis {text-overflow: ellipsis}
        6. +
        + +

        The following figure illustrates the box model properties; from left to right, it shows the effects of the box sizing, outline, and text overflow properties.

        +

        Figure: Box model properties (in mobile applications only)

        +

        Box model properties (in mobile applications only)

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/clipboard_mw.htm b/org.tizen.ui.practices/html/web/w3c/clipboard_mw.htm new file mode 100644 index 0000000..10a0d7f --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/clipboard_mw.htm @@ -0,0 +1,288 @@ + + + + + + + + + + + + + Clipboard API and events: Transferring Content Between Applications + + + + + +
        +

        Clipboard API and events: Transferring Content Between Applications

        + + +

        The clipboard and events feature is used for cutting, copying, and pasting content to easily transfer it between Web applications.

        + +

        This feature is supported in mobile applications only.

        + +

        The main features of Clipboard API and events include:

        + + +

        Copying Content

        + +

        To enhance the user experience of your application with clipboard operations, you must learn to use the copy event:

        +
          +
        1. Add an event listener to detect the copy event: +
          +<script>
          +   document.addEventListener("copy", function(e)
          +   {
          +      copyHandler(e);
          +   }, false);
          +
        2. +
        3. When you start copying, the copy event is fired and the copyHandler() method is called.

          +

          Stop the system clipboard basic operation and set the range you want to copy:

          +
             function copyHandler(e) 
          +   {
          +      e.preventDefault();
          +
          +      var range = window.getSelection();
          + + + + + + + + + +
          Note
          If the current selection is not influenced and there is no selected range, the clipboard imports the setData() method. The copied content cannot be edited apart from adding a DataTransferItemList item.
          +
        4. +
        5. Store the data of the selected range: +
                e.clipboardData.setData("text/plain", range);
          +   };
          +</script>
          +
          +
        6. +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Cutting Content

        + +

        To enhance the user experience of your application with clipboard operations, you must learn to use the cut event:

        +
          +
        1. Add an event listener to detect the cut event: +
          +<script>
          +   document.addEventListener("cut", function(e) 
          +   {
          +      cutHandler(e);
          +   }, false);
          + +
        2. +
        3. When you start cutting, the cut event is fired and the cutHandler() method is called.

          +

          Stop the system clipboard basic operation and set the range you want to cut:

          +
             function cutHandler(e) 
          +   {
          +      e.preventDefault();
          +
          +      var range = window.getSelection();
          + +
        4. +
        5. Store the data of the selected range: +
                e.clipboardData.setData("text/plain", range);
          +   };   
          +</script>
          +
          + + + + + + + + + +
          Note
          Before the setData() method is imported, the basic motion of the system event must be cancelled using the preventDefault() method. Otherwise, the data to be allocated to the clipboard is overwritten by the system clipboard.
          +
        6. +
        + +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Pasting Content

        + +

        To enhance the user experience of your application with clipboard operations, you must learn to use the paste event:

        +
          +
        1. Add an event listener to detect the paste event: +
          +<script>
          +   document.addEventListener("paste", function(e)
          +   {
          +      pasteHandler(e);
          +   }, false);
          +
        2. +
        3. When you start pasting, the paste event is fired and the pasteHandler() method is called.

          +

          Stop the system clipboard basic operation:

          +
             function pasteHandler(e) 
          +   {
          +      e.preventDefault();
          +
        4. +
        5. Paste the clipboard data to the target using the getData() method: +
          +      pasteTarget.innerHTML = e.clipboardData.getData("text/plain");
          +   };              
          +</script>
          +
          +
        6. +
        + +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Copying and Pasting Content into an Editable Element

        + +

        To enhance the user experience of your application with clipboard operations, you must learn to copy content and paste it in an editable HTML element:

        + +
          +
        1. Define the editable element into which copied data is to be pasted:

          +
          +<head>
          +   <style>
          +      .log {border: 1px solid #d9d9d9; margin: 10px; padding: 5px;}
          +      .target {border: 1px solid #36c; margin: 10px; padding: 5px;}
          +   </style>
          +</head>
          +<body>
          +   <h1>Clipboard API</h1>
          +   <div style="width: 300px; height: 100px; border: 1px solid #d9d9d9" contenteditable>
          +      Edit Section
          +   </div>
          +   <div  class="target">
          +      <h4>Target Element</h4>
          +      <p id="target contenteditable">Paste content</p>
          +   </div>
          +   <div id="ev-log" class="log">Event log</div>
          +   <div contenteditable>
          +      This section is informative
          +      This specification defines the common clipboard operations of cutting, 
          +      copying and pasting, in such a way that they are exposed to Web Applications 
          +      and can be adapted to provide advanced functionalities. 
          +      Its goal is to provide for compatibility where possible with existing implementations.
          +   </div>
          +<body>
          +
          +
        2. + +
        3. Add event listeners to detect the copy and paste events:

          +
          +<script>
          +   var pasteTarget = document.getElementById("target");
          +   var evLogBox = document.getElementById("ev-log");    
          +
          +   document.addEventListener("copy", function(e)
          +   {
          +      copyHandler(e);
          +   }, false);
          +
          +   document.addEventListener("paste", function(e)
          +   {
          +      pasteHandler(e);
          +   }, false);
          +
          +
        4. + +
        5. When the copy event occurs, stop the system clipboard basic operation and set the range you want to copy: +
          +   function copyHandler(e) 
          +   {
          +      e.preventDefault();
          +
          +      var range = window.getSelection();
          +
        6. +
        7. Store the data of the selected range: +
                e.clipboardData.setData("text/plain", range);
          +      evLogBox.innerHTML = "Event log : copy";
          +   };
          +
        8. +
        9. When the paste event occurs, stop the system clipboard basic operation and paste the clipboard data to the target using the getData() method: +
             function pasteHandler(e) 
          +   {
          +      e.preventDefault();
          +
          +      pasteTarget.innerHTML = e.clipboardData.getData("text/plain");
          +      evLogBox.innerHTML = "Event log : paste";
          +   };  
          +</script>
          +
          +
        10. +
        + +

        Figure: Copying and pasting

        +

        Copying and pasting

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/color_w.htm b/org.tizen.ui.practices/html/web/w3c/color_w.htm new file mode 100644 index 0000000..c5cefcd --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/color_w.htm @@ -0,0 +1,222 @@ + + + + + + + + + + + + + CSS Color Module (Level 3): Specifying Color and Opacity + + + + + + +
        +

        CSS Color Module (Level 3): Specifying Color and Opacity

        + +

        You can manage the CSS properties for specifying the color and opacity of an HTML element, and the CSS color value type.

        + +

        You can specify the color of an element with the following formats:

        +
          +
        • Keyword values +

          You can use basic keywords, such as red, green, blue, or deepskyblue, as defined in Extended color keywords.

          +

          The currentColor keyword can be used with all properties that accept a color value (borders, box shadows, outlines, or backgrounds). The computed value of the currentColor keyword is the computed value of the color property. If the currentColor keyword is set on the color property itself, it is treated as color: inherit. +

          +

          You can use the transparent keyword with all properties that accept a color value (borders, box shadows, outlines, or backgrounds), to turn the element in question transparent (invisible).

          +
        • +
        • RGB values +
            +
          • In hexadecimal notation +

            The format is '#' followed by either 3 or 6 hexadecimal characters. The 3-digit RGB notation (#rgb) is converted into a 6-digit form (#rrggbb) by replicating digits. For example, #fc0 expands to #ffcc00.

          • +
          • In functional notation +

            The format is 'rgb(' followed by a comma-separated list of 3 numerical values (integer or percentage) followed by ')'. The integer value 255 corresponds to 100%, and to F or FF in a hexadecimal notation: rgb(255, 255, 255) = rgb(100%, 100%, 100%) = #FFF. White space characters are allowed around the numerical values. +

          • +
          +
        • +
        • RGBA values +

          The RGB color model is extended to include "alpha" to allow the color opacity to be specified. The RGBA values are defined using functional notation where the final value is the alpha (range from 0.1 to 1). For example: rgba(255, 0, 0, 0.7).

          +
        • +
        • HSL value +

          You can use numerical hue-saturation-lightness (HSL) colors as an alternative to numerical RGB colors. The HSL colors are encoded as a triple (hue, saturation, lightness). The hue is represented as the angle of the color circle, where by definition red=0°=360° and other colors are spread around the circle. The saturation and lightness are represented as percentages, where 100% is full saturation or black lightness, and 0% is a shade of gray or white lightness. 50% lightness is "normal". For example: hsl(0, 100%, 50%). +

        • +
        • HSLA value +

          The HSL color model is extended to include "alpha" to allow the color opacity to be specified. The HSLA values are defined using the HSL notation where a final alpha value is added (range from 0.1 to 1). For example: hsla(120, 100%, 50%, 0.8).

        • +
        + + + + + + + + + + +
        Note

        The CSS2 System Color values have been deprecated in favor of the CSS3 UI 'appearance' property.

        + +

        The following code snippet demonstrates how to specify a color for an element. For a complete source code, see:

        + +
        +<!--Keywords-->
        +#one
        +{
        +   color: blue;
        +   background: white;
        +   border: 1px solid springgreen;
        +}
        +#one span 
        +{
        +   background: currentColor;
        +}
        +#one span.hide
        +{
        +   color: transparent;
        +}
        +
        +<!--RGB-->
        +#two
        +{
        +    color: #ff0000;
        +}
        +
        +<!--RGBA-->
        +#three
        +{
        +   color: rgba(100%, 0, 0, 0.5);
        +}
        +
        +<!--HSL-->
        +#four
        +{
        +   color: hsl(0, 100%, 50%);
        +}
        +
        +<!--HSLA-->
        +#five
        +{
        +   color: hsla(0, 100%, 50%, 0.5);
        +}
        +
        + +

        Creating a Color Generator

        + +

        To enhance the user experience of your application, you must learn to create a HSLA color generator to set the color value for an element in the HSLA format.

        + +

        Figure: HSLA color generator

        +

        HSLA color generator

        + + + +
        1. To create the color generator, define 2 <div> elements for displaying the HSLA value as text and in a color box. You also need 4 slider inputs for defining the HSLA color: +
            +
          • The first input has a range of 0 - 360 and represents hue.
          • +
          • The second and third inputs have a range of 0 - 100 and represent saturation and lightness.
          • +
          • The last input has a range of 0 - 10 and represents alpha transparency. +

            The range should be 0.1 - 1, but the minimum value of the min attribute is 0 so the value can be divided by 10.

          + +
          +<div id="color-generator">
          +   <div id="text-box"></div>
          +   <div id="color-box"></div>
          +
          +   <label>Hue</label>
          +   <input id="hue" value="0" type="range" min="0" max="360">
          +
          +   <label>Saturation</label>
          +   <input id="saturation" value="100" type="range" min="0" max="100">
          +
          +   <label>Lightness</label>
          +   <input id="lightness" value="50" type="range" min="0" max="100">
          +
          +   <label>Alpha</label>
          +   <input id="alpha" value="10" type="range" min="0" max="10">
          +</div>
          +
        2. +
        3. Obtain the values from the slider inputs with the getElementById method. Remember to divide the alpha value by 10 to reach the correct range of 0.1 - 1. +
          +var h = document.getElementById('hue').value,
          +    s = document.getElementById('saturation').value,
          +    l = document.getElementById('lightness').value,
          +    a = document.getElementById('alpha').value / 10;
          +
        4. +
        5. Set the HSLA text and the color of the color box by defining the color from the inputs in the HSL and HSLA formats. +

          If the alpha is 1, the HSL format is displayed. Otherwise, the HSLA format is used.

          +
          +/* Define formats */
          +hsl = 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
          +hsla = 'hsla(' + h + ', ' + s + '%, ' + l + '%, ' + a + ')';
          +
          +/* Set the color of the box */
          +cBox = document.querySelector('#color-box'),
          +
          +/* Set the text */
          +tBox = document.querySelector('#text-box');
          +
        6. + +
        7. Add an event handler to the input sliders to change the displayed text and color box color when the slider values change. +
          +var inputs = document.querySelectorAll('#color-generator input[type=range]');
          +			
          +for (i = 0; i < inputs.length; i++)
          +{
          +   inputs[i].onchange = function()
          +   {
          +      /* Show color */
          +   }
          +}
          +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/drag_drop_mw.htm b/org.tizen.ui.practices/html/web/w3c/drag_drop_mw.htm new file mode 100644 index 0000000..bbf1db5 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/drag_drop_mw.htm @@ -0,0 +1,318 @@ + + + + + + + + + + + + + HTML5 Drag and Drop: Handling Drag and Drop Events + + + + + +
        +

        HTML5 Drag and Drop: Handling Drag and Drop Events

        + +

        HTML5 drag and drop activates through event-based JavaScript and added attributes. +

        + +

        This feature is supported in mobile applications only.

        +

        +The main features of the HTML5 Drag and drop API include: +

        +
          +
        • Using drag and drop +

          To make an element draggable, add the draggable="true" attribute to it. Only elements thus defined as draggable can generate drag and drop events.

          +

          A drag and drop requires a source, target, and data. It is used through the following events:

          +
          • dragstart
          • +
          • drag
          • +
          • dragleave
          • +
          • dragenter
          • +
          • dragover
          • +
          • drop
          • +
          • dragend
          +

          The dragstart and drop events send data through the DataTransfer interface.

          +
        • +
        • Transferring data +

          You can transfer data from the drag source to the drop target. The DataTransfer interface instance receives the dragstart event and fills itself with the data to be transferred. It then receives a drop event, and puts the data into the drop target.

        • +
        + + + + + + + + + + +
        Note
        To use drag and drop in a Tizen device, long-press the draggable element. When the context menu appears, select the Drag menu.
        + +

        Handling Drag and Drop Events

        + +

        Learning how to handle drag and drop events is a basic user interaction skill:

        + + +
          +
        1. Define the draggable elements by adding the draggable="true" attribute to them:

          +
          +<h1>Drag and drop tutorial</h1>
          +<div class="example_body">
          +   <div id="drag-list">
          +      <div class="drag-row" draggable="true">1</div>
          +      <div class="drag-row" draggable="true">2</div>
          +   </div>
          +   <div>Drag state: <span id="log"></span></div>
          +</div>
          +
          +
        2. + +
        3. Add event listeners for the various drag and drop events: +
          +<script>
          +   var cols = document.querySelectorAll('#drag-list_.drag-row');
          +   var colsLength = cols.length;
          +
          +   for (var i = 0; i < colsLength; i++) 
          +   {
          +      cols[i].addEventListener('dragstart', dragStart, false);
          +      cols[i].addEventListener('drag', dragIng, false);
          +      cols[i].addEventListener('dragenter', dragEnter, false);
          +      cols[i].addEventListener('dragover', dragOver, false);
          +      cols[i].addEventListener('dragleave', dragLeave, false);
          +      cols[i].addEventListener('drop', dragDrop, false);
          +      cols[i].addEventListener('dragend', dragEnd, false);
          +   };
          +</script>
          +
          +
        4. + +
        5. Define event handlers for the events. In this case, each event handler displays a text on the screen. +
          +function dragStart(e) 
          +{
          +   log.innerHTML = "dragStart"
          +};
          +
          +function dragIng(e) 
          +{
          +   log.innerHTML = "drag"
          +};
          +
          +function dragOver(e) 
          +{
          +   e.preventDefault();
          +   log.innerHTML = "dragOver"
          +};
          +
          +function dragEnter(e) 
          +{
          +   log.innerHTML = "dragEnter"
          +};	
          +
          +function dragLeave(e) 
          +{
          +   log.innerHTML = "dragLeave"
          +};
          +
          +function dragDrop(e) 
          +{
          +   e.stopPropagation();
          +   log.innerHTML = "dragDrop"	
          +};
          +	
          +function dragEnd(e) 
          +{
          +   log.innerHTML = "dragEnd"
          +};
          +
          +
        6. +
        + +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Transferring Data over Drag and Drop

        + +

        Learning how to transfer data in a simple drag and drop puzzle is a basic user interaction skill:

        + +
          +
        1. Define the draggable elements by adding the draggable="true" attribute to them. +

          In this example, the Tizen logo image has been divided and allocated randomly. Each imager part is defined as draggable, so that the user can rearrange the image parts in the correct order.

          +
          +<h1>Drag and drop tutorial</h1>
          +<div class="example_body">
          +   <div>Drag state: <span id="log"></span></div>
          +   <div class="holder">
          +      <div>
          +         <img src="images/logo.png">
          +         <p class="txt">Complete the puzzle to see a picture</p>
          +      </div>
          +      <ul id="puzzle">
          +         <li class="puzzle-piece" draggable="true">
          +            <img src="images/puzz_06.png">
          +         </li>
          +         <li class="puzzle-piece" draggable="true">
          +            <img src="images/puzz_02.png">
          +         </li>
          +         <li class="puzzle-piece" draggable="true">
          +            <img src="images/puzz_04.png">
          +         </li>
          +         <li class="puzzle-piece" draggable="true">
          +            <img src="images/puzz_05.png">
          +         </li>
          +         <li class="puzzle-piece" draggable="true">
          +            <img src="images/puzz_01.png">
          +         </li>
          +         <li class="puzzle-piece" draggable="true">
          +            <img src="images/puzz_03.png">
          +         </li>
          +      </ul>
          +   </div>
          +</div>
          +
          +
        2. + +
        3. Add event listeners for the dragover, dragleave, dragstart, and drop events: +
          +<script>
          +   var cols = document.querySelectorAll('#puzzle_.puzzle-piece');
          +   var colsLength = cols.length;
          +   for (var i = 0; i < colsLength; i++) 
          +   {
          +      cols[i].addEventListener('dragstart', dragStartHandler, false);
          +      cols[i].addEventListener('dragover', dragOverHandler, false);
          +      cols[i].addEventListener('dragleave', dragLeaveHandler, false);
          +      cols[i].addEventListener('drop', dragDropHandler, false);
          +   };
          +</script>
          +
          +
        4. + +
        5. Transfer data (in this case, image parts): +
            +
          1. Declare the dragElem variable, which is an empty object for the data exchange: +
            +var dragElem = null;
            +
            +
          2. + +
          3. Use the DataTransfer interface in the dragStartHandler() and dragDropHandler() event handlers to exchange image parts: +
            +function dragStartHandler(e) 
            +{
            +   /* Set data */
            +   dragElem = this;
            +   e.dataTransfer.effectAllowed = 'move';
            +   e.dataTransfer.setData('text/html', this.innerHTML);
            +   this.classList.add('over');
            +   for (var i = 0; i < colsLength; i++)
            +   {
            +      cols[i].classList.add('start');
            +   };
            +};
            +function dragDropHandler(e) 
            +{
            +   /* Get data */
            +   dragElem.innerHTML = this.innerHTML;
            +   this.innerHTML = e.dataTransfer.getData('text/html');
            +   for (var i = 0; i < colsLength; i++)
            +   {
            +      cols[i].className = "puzzle-piece";
            +   };
            +   /* Check key */
            +   puzzleCheck();
            +};
            +
            +
          4. + +
          5. Check the completion of the puzzle by making a user key using a simple array, and comparing the user key against the puzzle key (correct answer): +
            +var puzzleKey =  ["01", "02", "03", "04", "05", "06"];
            +var puzzleArray = [];
            +
            +function puzzleCheck() 
            +{
            +   /* Initialize the user key */
            +   puzzleArray = [];
            +   /* Insert the keys in the array */
            +   for (var i = 0; i < colsLength; i++) 
            +   {
            +      puzzleArray.push(cols[i].children[0].getAttribute('src').substring(12, 14));
            +   };
            +   originKey = puzzleKey.join();
            +   userKey = puzzleArray.join();
            +
            +   if (originKey === userKey)
            +   {
            +      alert("Success !");
            +   };
            +};
            +
            +
          6. +
          +
        6. +
        +

        Figure: Drag and drop puzzle

        +

        Drag and drop puzzle

        +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/flexible_w.htm b/org.tizen.ui.practices/html/web/w3c/flexible_w.htm new file mode 100644 index 0000000..6844969 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/flexible_w.htm @@ -0,0 +1,355 @@ + + + + + + + + + + + + + CSS Flexible Box Layout Module: Adjusting the Layout + + + + + +
        +

        CSS Flexible Box Layout Module: Adjusting the Layout

        + +

        CSS attributes, such as float, display, and position, can be used to adjust and align the screen layout according to various resolutions. However, operating the layout accurately among changing screen sizes is difficult.

        + +

        Tizen supports the CSS Flexible Box Layout Module API that enables you to create an easily manageable flexible layout, which fluidly adjusts the layout according to viewport size changes. When you create and use a flexible box layout, the alignment method or object (flex item) size within a specific area (flex container) can be adjusted.

        +

        The main components of the flexible box layout include:

        +
          +
        • Flex container, which refers to flex or inline-flex DOM elements assigned by the display.

          You can use the flex container to assign a flex area and the flex items included in it. The flex container properties are used to assign the indication area and alignment method.

        • +
        • Flex item, which refers to the child nodes of the flex container. +

          The flex item changes its size fluidly according to the area of the flex container. You can define flex item properties to assign the sizes of the respective items and the alignment method.

        • +
        +

        Figure: Flexible box layout

        +

        Flexible box layout

        + +

        Using the Flex Container

        +

        To enhance the user experience of your application, you must learn how to assign size and alignment to the flex container:

        + +
          +
        1. Assign the area (flex container) where the flexible box layout is applied by using the display: flex property: +
          <style>
          +   .flex_container {display: -webkit-flex}
          +</style>
          +
          +<div class="flex_container">
          +   <div class="flex_item">A</div>
          +   <div class="flex_item">B</div>
          +   <div class="flex_item">C</div>
          +   <div class="flex_item">D</div>
          +<div>
          + +

          The child nodes within the assigned flex container become flex items.

          +
        2. +
        3. Define the necessary properties for the flex container to assign the alignment of the flex items within it:

          +
            +
          • flex-direction property sets the alignment direction of the flex items: +
              +
            • row: Align from left to right.
            • +
            • row-reverse: Align from right to left.
            • +
            • column: Align from top to bottom.
            • +
            • column-reverse: Align from bottom to top.
            • +
          • + +
          • flex-wrap property sets the line changing of the flex items: +
              +
            • nowrap: Reduces the size of the flex items without changing lines.
            • +
            • wrap: The flex items reaching beyond the flex container area are divided into multiple lines using the cross axis direction of the current writing mode.
            • +
            • wrap-reverse: The flex items reaching beyond the flex container area are divided into multiple lines using the opposite cross axis direction than in the wrap value.
            • +
          • + +
          • justify-content property sets the handling of gaps between the flex items on the main axis: +
              +
            • flex-start: Gathers the items at the alignment starting point.
            • +
            • flex-end: Gathers the items at the alignment finishing point.
            • +
            • center: Gathers the items in the center.
            • +
            • space-between: Aligns the start and end item at both ends, and creates equal gaps in between the rest of the items.
            • +
            • space-around: Creates equal gaps between all items.
            • +
            + + + + + + + + + +
            Note
            This property is similar to text-align, but the alignment direction and the starting point are based on the flex-direction and flex-wrap properties.
          • + +
          • align-content property sets the handling of gaps between the flex items on the cross axis. It has the same values as the justify-content property, and 1 additional value: +
              +
            • stretch: Extends the size of the flex items and aligns them without gaps.
            • +
          • +
          • align-items property sets the relative location and size between the flex items on the cross axis: +
              +
            • flex-start: Aligns the items vertically to the top.
            • +
            • flex-end: Aligns the items vertically to the bottom.
            • +
            • center: Aligns the items vertically to the middle.
            • +
            • baseline: Aligns the items vertically to the baseline.
            • +
            • stretch: Extends the height of the flex items and aligns them without gaps.
            • +
            + + + + + + + + + +
            Note
            If the flex-wrap property is set to wrap-reverse, the start and end points of the alignment are reversed.
        +

        The following figure shows examples of flex containers and how their flex items have been aligned.

        +

        Figure: Flex container properties (in mobile applications only)

        +

        Flex container properties (in mobile applications only)

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + +

        Using the Flex Items

        + +

        To enhance the user experience of your application, you must learn how to assign size and alignment to the flex items:

        + +
          +
        1. Assign the area (flex container) where the flexible box layout is applied, and define the flex items for it: +
          <style>
          +   .flex_container {display: -webkit-flex}
          +</style>
          +
          +<div class="flex_container">
          +   <div class="flex_item">A</div>
          +   <div class="flex_item">B</div>
          +   <div class="flex_item">C</div>
          +<div>
          +
        2. + +
        3. Define the necessary properties for the flex items:

          +
            +
          • align-self property is similar as the align-items property of the flex container. + + + + + + + + + +
            Note
            If both the align-self and align-items properties are used simultaneously, the align-items property is ignored.
          • + +
          • flex property is a shorthand expression defining the flex item size handling: +
              +
            • flex-grow: Sets whether the spaces between flex items are filled.
            • +
            • flex-shrink: Sets whether the width of the flex items is reduced according to the size of the flex container.
            • +
            • flex-basis: Sets the default width of the relevant flex items.
            • +
        +

        The following figure shows examples of how flex items can be placed and sized within a flex container.

        +

        Figure: Flex items (in mobile applications only)

        +

        Flex items (in mobile applications only)

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + +

        Creating a Flexible Layout with CSS3

        + +

        To enhance the user experience of your application, you must learn how to create flexible box layout:

        +
          +
        1. Define the HTML content for the flexible layout. In this example, create 2 articles areas, 1 for a text list and 1 for an icon list: +
          <div class="container">
          +   <article class="events">
          +      <h2>UPCOMING EVENTS</h2>
          +      <ul>
          +         <li>
          +            <div class="date"><span>APR</span><br> 15</div>
          +            <p class="title">
          +               Linux Foundation Collaboration Summit <span class="local">San Francisco, CA</span>
          +            </p>
          +         </li>
          +         <!--Other text items-->
          +      </ul>
          +   </article>
          +   <article class="schedule">
          +      <h2>SCHEDULE</h2>
          +      <div class="img_list">
          +         <img src="folder.png" alt="folder">
          +         <img src="alert.png" alt="alert">
          +         <!--Other icons-->
          +      </div>
          +   </article>
          +</div>
        2. + +
        3. Define styles to decorate the article areas. (The following figure applies to mobile applications only.) +
          <!--Border for the article areas-->
          +.container article > * {border: 1px solid #ccc;}
          +
          +<!--Font style for the article area titles-->
          +.container .events > h2, .container .schedule > h2 
          +{
          +   padding: 10px 20px;
          +   text-shadow: 1px 1px 2px #fff, -1px -1px 2px #000;
          +}
          +
          +<!--List styles-->
          +.container .events > ul, .container .schedule .img_list  
          +{
          +   height: 100%; 
          +   padding: 10px;
          +}
          +
          +<!--Text style for the text list item title-->
          +.container .events > ul > li .title 
          +{
          +   color: #51809e;
          +   text-shadow: 1px 1px 2px #000;
          +}
          +
          +<!--Text style for the text list item location info-->
          +.container .events > ul > li .title .local 
          +{
          +   text-indent: 10px;
          +   text-shadow: 0 0 0 #fff;
          +}
          +
          +<!--Styles for the text list item date box-->
          +.container .events > ul > li .date 
          +{
          +   text-align: center;
          +}
          +.container .events > ul > li .date 
          +{
          +   background-color: #ddd;
          +   border-radius: 10px;
          +   box-shadow: inset -2px -2px 4px rgba(0, 0, 0, .5);
          +}
          +.container .events > ul > li .date > span 
          +{
          +   background-color: #fff;
          +   border-radius: 5px;
          +}
          +

          Article areas with styles defined (in mobile applications only)

        4. + + +
        5. Define a flexible alignment for the article areas to support screen orientation changes and ensure that the content fills up the entire available screen area regardless of the orientation: +
            +
          1. Define the text list items and the icon list as flex containers using the display: -webkit-flex; property: +
              +
            • For the text list items, align them vertically in the middle, define a 0 margin at the top for the first item, and center-align the text for the date box.
            • +
            • For the icon list, align the icon list so that the first and last icon are placed at the ends and the gaps between the rest of the icons are equal.
            +

            (The following figure applies to mobile applications only.)

            +
            <!--Flexible alignment of text list-->
            +.container .events > ul > li 
            +{
            +   display: -webkit-flex;
            +   -webkit-align-items: center;
            +}
            +.container .events > ul > li: first-child 
            +{
            +   margin-top: 0;
            +}
            +
            +.container .events > ul > li .date 
            +{
            +   -webkit-flex: 0 0 20%;
            +   text-align: center;
            +}
            +
            +<!--Flexible alignment of icon list-->
            +.container .schedule .img_list 
            +{
            +   display: -webkit-flex;
            +   -webkit-justify-content: space-between;
            +}
            +

            Article areas with a flexible box layout defined (in mobile applications only)

          2. + + +
          3. Special consideration can be given for some screen sizes. The following example defines a specific layout for small screens (where the screen width is less than 390 pixels). (The following figure applies to mobile applications only.) +
            +@media screen and (min-width: 390px) 
            +{
            +   .container .schedule .img_list 
            +   {
            +      display: -webkit-flex;
            +      -webkit-flex-wrap: wrap;
            +      -webkit-justify-content: space-between;
            +      -webkit-align-content: space-around;
            +   }
            +
            +   .container {display: -webkit-flex;}
            +   .container > * {-webkit-align-content: center;}
            +   .container article {height: 250px;}
            +}
            +

            Article areas with a flexible box layout for small screens (in mobile applications only)

            +

            For more information on defining screen-size-specific rules, see Media Queries.

            +
        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/font_w.htm b/org.tizen.ui.practices/html/web/w3c/font_w.htm new file mode 100644 index 0000000..afbaf7f --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/font_w.htm @@ -0,0 +1,214 @@ + + + + + + + + + + + + + CSS Fonts Module (Level 3): Manipulating Fonts + + + + + + +
        +

        CSS Fonts Module (Level 3): Manipulating Fonts

        + +

        You can change the text fonts easily.

        + +

        The new text features in CSS Fonts Module Level 3 API include:

        +
          +
        • Font properties +

          You can use CSS font properties, such as font-style, font-weight, font-variant, font-size, and font-family, to modify the appearance of text.

        • +
        + + +

        Manipulating Fonts

        + +

        To enhance the user experience of your application, you must learn to handle fonts using CSS font properties:

        + +
          +
        1. Define the font-style property within a <style> element in the <head> section of the Web page to apply different font styles:

          + +
          +<head>
          +   <style>
          +      p:nth-child(1) em{font-style: normal}
          +      p:nth-child(2) em{font-style: italic}
          +      p:nth-child(3) em{font-style: oblique}
          +   </style>
          +</head>
          +<body>
          +   <p>font-style: <em>normal</em></p>
          +   <p>font-style: <em>italic</em></p>
          +   <p>font-style: <em>oblique</em></p>
          +</body>
          +
          + +
        2. + +
        3. Define the font-weight property, +which controls the weight of the text:

          + +
          +<head>
          +   <style>
          +      p:nth-child(1) {font-weight: normal}
          +      p:nth-child(2) {font-weight: bold}
          +      p:nth-child(3) {font-weight: 300}
          +      p:nth-child(4) {font-weight: 500}
          +      p:nth-child(5) {font-weight: 700}
          +   </style>
          +</head>
          +<body>
          +   <p>font-weight: <em>normal</em></p>
          +   <p>font-weight: <em>bold</em></p>
          +   <p>font-weight: <em>300</em></p>
          +   <p>font-weight: <em>500</em></p>
          +   <p>font-weight: <em>700</em></p>
          +</body>
          +
          + +
        4. + +
        5. Define the font-variant property to +change the font to, for example, use small capital letters: +
          +<head>
          +   <style>
          +      p:nth-child(1) {font-variant: normal}
          +      p:nth-child(2) {font-variant: small-caps}
          +   </style>
          +</head>
          +<body>
          +   <p>font-variant: <em>normal</em></p>
          +   <p>font-variant: <em>small-caps</em></p>
          +</body>
          +
          + +
        6. + +
        7. Define the font-size property, which controls the size of the font: +
          +<head>
          +   <style>
          +      p:nth-child(1) {font-size: 150%}
          +      p:nth-child(2) {font-size: 1.2em}
          +   </style>
          +</head>
          +<body>
          +   <p>font-size: <em>150%</em></p>
          +   <p>font-size: <em>1.2em</em></p>
          +</body>
          +</html>
          +
          +
        8. + +
        9. Define the line-height property, which controls the height of a text line: +
          +<head>
          +   <style>
          +      p:nth-child(1) {line-height: 1}
          +      p:nth-child(2) {line-height: 1.5}
          +      p:nth-child(3) {line-height: 5}
          +   </style>
          +</head>
          +<body>
          +   <p>line-height: <em>1</em></p>
          +   <p>line-height: <em>1.5</em></p>
          +   <p>line-height: <em>5</em></p>
          +</body>
          +
          + +
        10. + +
        11. Define the font-family property, which assigns a specific font or its representative to an element. The list order within the <style> element determines the property priority. +

          If the assigned font is not installed on the target, a different font is obtained based on the user system.

          +
          +<head>
          +   <style>
          +      p:nth-child(1) {font-family: serif}
          +      p:nth-child(2) {font-family: sans-serif}
          +      p:nth-child(3) {font-family: monospace}
          +      p:nth-child(4) {font-family: cursive}
          +      p:nth-child(5) {font-family: fantasy}
          +      p:nth-child(6) {font-family: 'Arial Black', sans-serif}
          +      p:nth-child(7) {font-family: Tahoma, sans-serif}
          +      p:nth-child(8) {font-family: Verdana, sans-serif}
          +      p:nth-child(9) {font-family: Arial, sans-serif}
          +   </style>
          +</head>
          +<body>
          +   <p>font-family: <em>serif</em></p>
          +   <p>font-family: <em>sans-serif</em></p>
          +   <p>font-family: <em>monospace</em></p>
          +   <p>font-family: <em>cursive</em></p>
          +   <p>font-family: <em>fantasy</em></p>
          +   <p>font-family: <em>'Arial Black', sans-serif</em></p>
          +   <p>font-family: <em>Tahoma, sans-serif</em></p>
          +   <p>font-family: <em>Verdana, sans-serif</em></p>
          +   <p>font-family: <em>Arial, sans-serif</em></p>
          +</body>
          +</html>
          +
          +
        12. +
        + + +

        The following figure shows examples of manipulating the text font properties.

        +

        Figure: Font properties (in mobile applications only)

        +

        Font properties (in mobile applications only)

        + + + + + + + + + + +
        Note
        For a complete list of CSS Fonts Module Level 3 font properties (in mobile or wearable applications) and their possible values, see the Property index.
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/frame_flattening_mw.htm b/org.tizen.ui.practices/html/web/w3c/frame_flattening_mw.htm new file mode 100644 index 0000000..3fdec22 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/frame_flattening_mw.htm @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + Frame Flattening: Expanding Content According to Size + + + + + +
        +
        + +
        +
        +

        Mobile Web

        +
        + +

        Frame Flattening: Expanding Content According to Size

        + +

        In the Tizen WebKit, content placed within the <frame> and <iframe> tags is expanded automatically according to the content size. This enables users to view the whole content at once without scrolling.

        + +

        This feature is supported in mobile applications only.

        + +

        The Tizen WebKit supports this feature since scrolling through small subframes on small screen devices is a tedious task and, occasionally, causes confusion between scrolling subframes and scrolling the Web page itself.

        +

        To implement scrollable content in the Tizen WebKit, use the CSS overflow: scroll or webkit-overflow-scrolling: touch property instead of iframe.

        + + + +
        + +Go to top + + + + + + + + diff --git a/org.tizen.ui.practices/html/web/w3c/guides_w3c_w.htm b/org.tizen.ui.practices/html/web/w3c/guides_w3c_w.htm new file mode 100644 index 0000000..629c2e1 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/guides_w3c_w.htm @@ -0,0 +1,142 @@ + + + + + + + + + + + + + W3C + + + + + + +
        + +

        W3C/HTML5

        + +

        The W3C specifications provide HTML and CSS, which are the core technologies for building Web pages and Web applications.

        + +

        To learn how to use the W3C features in your application UI, see the following topics:

        + + + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/html5forms_w.htm b/org.tizen.ui.practices/html/web/w3c/html5forms_w.htm new file mode 100644 index 0000000..cba7328 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/html5forms_w.htm @@ -0,0 +1,432 @@ + + + + + + + + + + + + + HTML5 Forms: Implementing Web Forms for User Input Using HTML5 Elements + + + + + +
        + +

        HTML5 Forms: Implementing Web Forms for User Input Using HTML5 Elements

        + +

        The HTML5 forms provide a convenient way to create consistent screens in your application for accepting user input. In the past, the Web form allowed you to accept user input before transmitting it to a server. With HTML5, you can now improve the user experience without having to use JavaScript by adding simple features, for example, email validity checks and date pickers, and using more advanced functionality, such as security checks and input value pattern definitions.

        + +

        New HTML5 Elements

        +

        The following table lists the new elements available for your forms in HTML5. For a complete source code, see elements.html.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: New HTML5 elements
        ElementDescriptionExample
        datalist

        Defines a set of option elements that represent predefined options for other controls. The element is used together with the input element to predefine its value.

        +

        In Tizen, the value selected in the datalist element can be edited.

        +
        +<input type="text" list="search">
        +<datalist id="search">
        +   <option value="Tomato">Tomato</option>
        +   <option value="banana">banana</option>
        +   <option value="Watermelon">Watermelon</option>
        +</datalist>
        +
        +
        keygen

        Defines a control for generating a public-private key pair and for submitting the public key from that key pair. The element creates an encrypted key with the value of the name attribute, saves it in the user's computer and Web server, and activates the next procedure when the 2 values match.

        +
        +<label>user:<input type="text" name="user_name"></label>
        +<label>keygen:<keygen name="keygen"></label>
        +
        +
        meter

        Represents a scalar measurement within a known range (the distribution of the assigned range), or a fractional value.

        +
        +<meter value="75" min="0" max="100" low="60" high="80" optimum="81">
        +   75/100
        +</meter>
        +
        +
        output

        Represents the result of a calculation. The element generally shows the calculated result of the value that the user has entered, and is used within the form element.

        +
        +<fieldset onsubmit="return false"
        +          oninput="foobar.value = parseInt(foo.value) * parseInt(bar.value)">
        +   <input type="number" id="foo" name="foo"> *
        +   <input type="number" id="bar" name="bar"> =
        +   <output for="foo bar" name="foobar"></output>
        +</fieldset>
        +
        +
        progress

        Represents the progress of a task.

        +
        +<progress value="75" max="100">
        +   75/100
        +</progress>
        +
        + +

        New Input Element Types

        +

        The following table lists the new input element types available for your forms in HTML5. Many of the new elements activate a specific keyboard suitable for the type of value the user is expected to enter (for example, an email or URL). For a complete source code, see types.html.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: New input element types
        TypeDescriptionExample
        color

        Select an HSL color from the color picker. The value format is HEX (#0099ff).

        +
        +
        +<input type="color"
        +       value="#ff0000">
        +<input type="datetime"
        +       value="2012-12-12T03:30Z">
        +<input type="email"
        +       required>
        +<input type="number"
        +       step="3">
        +<input type="range"
        +       min="1" max="10">
        +<input type="tel">
        +<input type="url">
        +
        +
        date

        Enter a date with no time zone (yyyy-mm-dd).

        +
        datetime

        Enter a date and time with the (UTC) time zone (yyyy-mm-ddTtt:mmZ).

        + +
        datetime-local

        Enter a date and time with no time zone (yyyy-mm-ddTtt:mm).

        +
        email

        Enter an email address with the email keyboard.

        +

        If the required attribute is used, the system checks whether the input format is in line with the ABNF regular expression (1*(atext / ".") "@" ldh-str 1*("." ldh-str)).

        +
        month

        Enter a year and month with no time zone (yyyy-mm).

        +
        number

        Enter numbers with the number keyboard.

        +
        range

        Select a value from the slider.

        +
        search

        No specific functionality is defined for this element in the HTML5 specifications.

        +
        tel

        Enter a phone number with the number keyboard.

        +
        time

        Enter a time with no time zone (tt:mm:ss).

        +
        url

        Enter a URL with the URL keyboard.

        +
        week

        Enter a year and week with no time zone (yyyy-week).

        +
        + +

        New Input Element Attributes

        + +

        The following table lists the new input element attributes available for your forms in HTML5. For a complete source code, see attributes.html.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: New input element attributes
        AttributeDescriptionExample
        autocomplete

        Prefilling feature, which helps the users by, for example, prefilling the user's address based on earlier user input.

        +

        The text used by the user before (such as an input element) is listed in a datalist form. The attribute can be used in all form elements, and is activated if the value is "on" and deactivated if the value is "off".

        +
        +
        +<input type="range" min="1" max="10">
        +<input type="tel" pattern="[0-9]+" required>
        +<input placeholder="You know what to do, huh?">
        +<input type="number" step="3">
        +
        +
        min and max

        Allowed range of values for the element.

        +
        pattern

        Regular expression against which the control's value is checked.

        +

        The attribute can be used to check the validity of the form data. During service, a guide requiring the input format from the user is necessary.

        +
        placeholder

        Short hint intended to aid the user with the data entry.

        +

        The attribute can be used in the majority of form elements for various purposes, such as hint text or advertisement.

        +
        required

        Boolean attribute which, when specified, defines that the element is mandatory.

        +
        step

        Granularity expected of the value, limiting the allowed values.

        +
        + +

        Creating a Basic Login Form

        + +

        To create simple user input forms, you must learn to use the HTML5 features in Web forms:

        + +
          +
        1. Create a simple form where the user can enter their login details (email address and password):

          +
          +<form action="" method="">
          +   <label>email: <input type="text"></label>
          +   <label>password: <input type="password"></label>
          +    
          +   <input type="submit" value="Login">
          +</form>
          +
        2. +
        3. To check the validity of the entered email address automatically, add the required attribute to the input element with the email type:

          +
          +<label>email: <input type="email" required></label>
          +
        4. +
        5. Define the password field as mandatory by using the required attribute in that input element too:

          +
          +<label>password: <input type="password" required></label>
          +
        6. +
        7. Because a device has limited space on the screen, remove the field labels and replace them with hint texts using the placeholder attribute:

          +
          +<input type="email" placeholder="e-mail address" required>
          +<input type="password" placeholder="password" required>
          +
        + +

        The final form that checks the email validity and requires the mandatory password input is complete:

        +
        +<form action="" method="">
        +   <fieldset>
        +      <legend>Login</legend>
        +      <input type="email" placeholder="e-mail address" required>
        +      <input type="password" placeholder="password" required>
        +   </fieldset>
        +    
        +   <input type="submit" value="Login">
        +</form>
        +
        + +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Creating an Advanced Login Form

        + +

        To create advanced user input forms, you must learn to use the HTML5 features in Web forms:

        + +
          +
        1. Create a login form that checks the email validity and requires the mandatory password input:

          +
          +<form action="" method="">
          +   <fieldset>
          +      <legend>Login</legend>
          +      <input type="email" placeholder="e-mail address" required>
          +      <input type="password" placeholder="password" required>
          +   </fieldset>
          +    
          +   <input type="submit" value="Login">
          +</form>
          +
        2. + +
        3. When the form page is loaded on the screen, put the focus automatically to the email field by using the autofocus attribute:

          +
          +<input type="email" placeholder="e-mail address" required autofocus>
          +
        4. + +
        5. +

          To spare the user from filling in information that they have given previously, use the autocomplete attribute, which shows the previously successfully inserted entries in a datalist, from which the user can select and use them.

          +

          You can apply the autocomplete attribute to a specific field by adding it to the appropriate input element. If you add it to the form element, it applies to all child elements within the form.

          + +
          +<form action="" method="" autocomplete="on">
          +
          +
        6. +
        7. In general, apply the autocomplete attribute to the form element, and then separately set it to off for those fields that must not use it.

          +

          In the following example, the password field must not use autocomplete, to prevent unauthorized access by any user.

          +
          +<input type="password" placeholder="password" required autocomplete="off">
          +
          +
        8. +
        9. Protect the password with private and public key pair using the keygen element.

          +

          The element is used to transform the data sent from the connected form to a pair of encrypted keys using the RSA (Rivest Shamir Adleman) method. When the input data is sent from the form, the private key is saved in the local computer, and the public key is delivered to the server. Only if the keys match, the login process proceeds forwards.

          + +
          +<keygen name="keyvalue">
          +
        10. + +
        11. Use the pattern attribute to perform a validity check that ensures that the password field value matches the given regular expression. The required attribute is used to ensure that the field value must be entered and then the validity check can be performed.

          +

          In the following example, the password only accepts numbers and letters of the alphabet. If an invalid value is entered, the login cannot proceed.

          + +
          <input type="password" placeholder="password" required
          +       pattern="[a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z]+[a-zA-Z0-9]*" 
          +       autocomplete="off">
          +
        12. +
        13. Define the required length of the password within the pattern attribute.

          +

          In the following example, the password must be 6 to 12 characters long.

          + +
          +<input type="password" placeholder="password" required 
          +       pattern="(?=([a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z]+[a-zA-Z0-9]*)).{6,12}" 
          +       autocomplete="off">
          +
        14. +
        + +

        The final form with autofocus and autocomplete features, strengthened security, and password value requirements is complete:

        + +
        +<form action="" method="" autocomplete="on">
        +   <fieldset>
        +      <legend>Login</legend>
        +      <input type="email" placeholder="e-mail address" required autofocus>
        +      <input type="password" placeholder="password" required 
        +             pattern="(?=([a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z]+[a-zA-Z0-9]*)).{6,12}" 
        +             autocomplete="off">
        +   </fieldset>
        +
        +   <keygen name="keyvalue">
        +    
        +   <input type="submit" value="Login">
        +</form>
        +
        + + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/html_priority_w.htm b/org.tizen.ui.practices/html/web/w3c/html_priority_w.htm new file mode 100644 index 0000000..886a6d6 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/html_priority_w.htm @@ -0,0 +1,449 @@ + + + + + + + + + + + + + HTML Priorities: Understanding HTML Behavior + + + + + +
        + +

        HTML Priorities: Understanding HTML Behavior

        + +

        The HTML markup is not as important as before, because JavaScript APIs can be used to create various functionalities. For example, graphics APIs (in mobile or wearable applications) can be used for making games, media APIs (in mobile or wearable applications) for creating video chats, and communication APIs (in mobile or wearable applications) for various types of messaging. However, HTML remains the basis of Web applications, and it is useful to be familiar with its behavior.

        + +

        The structure of the HTML document can be classified into DOCTYPE and HTML DOM (Document Object Model). When an HTML document is loaded, the browser renders the contents in its screen as follows:

        +
          +
        1. HTML is parsed referring to the rules defined in the <!DOCTYPE> element.
        2. +
        3. HTML DOM tree is established.
        4. +
        5. DOM elements, including references to JavaScript, are arranged based on the information defined in the head element. This is called rendering.
        6. +
        7. The elements are painted on the screen based on CSS rules.
        8. +
        + +

        <!DOCTYPE> Element

        + +

        The <!DOCTYPE> element informs the browser of the HTML version and which rules it must follow. It is not a composition element of the HTML.

        + +

        The browser, based on the version defined in the <!DOCTYPE> element and DTD (Document Type Definition), decides how to handle the HTML before interpreting it. Therefore, the <!DOCTYPE> element must be declared at the beginning of an HTML document.

        + +
        <!--HTML5-->
        +<!DOCTYPE html>
        +
        +<!--Prior to HTML5-->
        +<!DOCTYPE html PUBLIC "{HTML Version Information}" "{DTD (Document Type Definition) file link defined by Rule in HTML DOM}">
        +
        + +

        HTML DOM Tree

        + +

        HTML DOM is a structured model to control Web elements. It is an official W3C standard to express the document regardless of platforms or languages, and the foundation of the HTML5 APIs.

        + +

        The <html> element is the top-level element of the HTML DOM tree that wraps the entire document, and it has the <head> and <body> elements as child nodes:

        + +
        <!DOCTYPE html>
        +<html>
        +   <head>
        +      <!--Content-->
        +   </head>
        +   <body>
        +      <!--Content-->
        +   </body>
        +</html>
        + +

        <head> element

        + +

        The <head> element contains the information that the browser refers to when rendering the body element to interpret information, such as the title of HTML document, CSS, JavaScript, and favicon:

        + +
        <!DOCTYPE html>
        +<html>
        +   <head>
        +      <meta charset="utf-8" />
        +      <title> Tizen (in mobile applications) or Tizen Wearable (in wearable applications) </title>
        +      <link rel="stylesheet" href="css/style.css" />
        +      <script src="/common/js/ui.js"></script>
        +   </head>
        +   <body>
        +      <!--Content-->
        +   </body>
        +</html>
        + +

        The <head> contains the following subelements:

        + +
          +
        • <title>: Defines the title of the document.
        • +
        • <meta>: Defines information, such as encoding, creator, and keywords of the document. + + + + + + + + + + +
          Note
          The viewport element, which sets the screen area, is included in the meta information.
        • +
        • <style>, <link>: Sets the styles of the document.
        • +
        • <script>, <noscript>: Adds functions to the document.
        • +
        + +

        <body> element

        + +

        The <body> element defines the area displaying content on the browser screen:

        + +
        <!DOCTYPE html>
        +<html>
        +   <head>
        +      <!--Content-->
        +   </head>
        +   <body>
        +      <section id="tizen_wrap">
        +         <header>
        +            <h1>Tizen Web App (in mobile applications) or Tizen Wearable Web App (in wearable applications)</h1>
        +         </header>
        +         <section id="contents">
        +            <!--Content-->
        +         </section>
        +         <footer>
        +            <p>&copy; All rights reserved.</p>
        +         </footer>
        +      </section>
        +   </body>
        +</html>
        + +

        CSS Rule Priorities

        +

        The basic rule of HTML, CSS, and JavaScript is that the code is applied from the top to the bottom of the document. Sometimes the lack of understanding of the CSS rule priorities can cause a result you do not expect.

        +

        The following figure illustrates this problem in mobile applications by applying a font color to a black background.

        + +

        Figure: Expected and actual result of applying a font color (in mobile applications only)

        +

        Expected and actual result of applying a font color (in mobile applications only)

        + +

        Basic CSS Rules

        + +

        When creating a CSS document, the following rules apply:

        + +
          +
        • When more than 1 overlapping styles are applied to the same element, only the last style is visible: + +
          p {color: red}
          +p {color: blue}
          +<!--Blue color is applied-->
          +
        • +
        • The style applied in the parent node at the DOM tree is inherited. For more information, see W3C inheritance documentation. +
        • +
        • The style that has the highest CSS specificity is applied. The specificity of different elements is defined as follows: +
            +
          • ID attribute = 100
          • +
          • Class attribute = 10
          • +
          • Element = 1
          • +
          + +
          <body>
          +   <p id="target" class="target">Hello World</p>
          +</body>
          +
          +<style>
          +   p#target {color: black} /* Specificity: 101 */
          +   p#target {color: red} /* Specificity: 101 */
          +   p.target {color: blue} /* Specificity: 11 */
          +   p {color: tomato} /* Specificity: 1 */
          +</style>
          +<!--Red color is applied-->
          +
        • +
        • When the !important attribute is used, it has the highest priority: +
          <body>
          +   <p id="target" class="target">Hello World</p>
          +</body>
          +
          +<style>
          +   p#target {color: black !important}
          +   p#target {color: red}
          +   p.target {color: blue}
          +   p {color: tomato}
          +</style>
          +<!--Black color is applied-->
          +
        • +
        + +

        Keeping these rules in mind, you can use any of the following ways to achieve the expected result illustrated in the figure above:

        +
        .contents {color: #999 !important;}
        +
        +section.contents {color: #999;}
        +
        +body .contents {color: #999;}
        +
        +#container > .contents {color: #999;}
        +
        + +

        Using CSS with HTML

        + +

        There are various ways to connect CSS with HTML. Creating a separate CSS file and managing it separately is convenient when it comes to applying changes in the future. The file is connected to the HTML file using a <link> tag in the <head> element.

        + +

        In the following example, the applied order of the CSS elements is as follows:

        +
          +
        1. <link> tag in the <head> element
        2. +
        3. <style> tag in the <head> element
        4. +
        5. @import attribute in the CSS area
        6. +
        7. style attribute in a HTML element
        8. +
        + +
        <!DOCTYPE html>
        +<html>
        +   <head>
        +      <!--Link in head-->
        +      <link rel="stylesheet" href="css/style.css"/>
        +
        +      <!--Style tag in head-->
        +      <style>
        +         p {color: tomato}
        +      </style>
        +
        +      <!--@import in CSS area-->
        +      <style>
        +         @import url("css/style.css");
        +      </style>
        +   </head>
        +
        +   <body>
        +      <!--Style attribute in HTML element-->
        +      <p style="color: red">Hello World</p>
        +   </body>
        +</html>
        +
        +

        However, the priority order of the elements is as follows:

        +
          +
        1. style attribute in a HTML element
        2. +
        3. <style> tag in the <head> element
        4. +
        5. @import attribute in the CSS area
        6. +
        7. <link> tag in the <head> element
        8. +
        + +

        The style attribute in the HTML element has the highest priority after the !important attribute.

        + +

        Using the order above, if all other color styles are applied to <p> elements, the style attribute is used to apply the red color that has been directly defined in the HTML. This rule differs from the CSS specificity rules.

        + +

        Generally, when the @import attribute is used, connect to the top of CSS file that has been linked externally, as illustrated in the figure below. If the attribute is applied in the middle of the CSS file, it is difficult to know the point where CSS has been applied, and to find the file connected to the source in the future. Therefore, group the CSS file at the top.

        + + + + + + + + + + +
        Note
        Using the @import attribute gives the same result as connecting an external file, but it does not function correctly in older browsers (IE 5.5 and below).
        +

        Figure: Using the @import attribute

        +

        Using the @import attribute

        + +

        The markup in the corresponding files is as follows:

        +
          +
        • In the HTML code: +
          <head>
          +   <link rel="stylesheet" href="css/style.css"/>
          +</head>
          +
        • +
        • In the style.css file: +
          @import url("priorities1.css");
          +
          +p: after {content: " : linked in head"}
          +
          +

          Figure: Result of linking the @import attribute

          +

          Result of linking the @import attribute

        • +
        • In the priorities1.css file: +
          p: after {content: " : Using @import in CSS area"}
          +
          +

          Figure: Result of using the @import attribute in the CSS area

          +

          Result of using the @import attribute in the CSS area

        • +
        + +

        JavaScript Behavior

        +

        With the advent of HTML5, numerous powerful HTML5 APIs have been introduced. Since the usage of JavaScript has increased, it has become important to use it accurately in accordance with optimized JavaScript performance.

        + +

        JavaScript used in Web applications can be divided into the core, ECMAScript, and DOM, which all manipulate HTML. ECMAScript is executed when a method is called, or it can be executed when an event is fired within a HTML document through a linkage with DOM.

        + +

        Using JavaScript with HTML

        +

        Used with HTML, JavaScript works as follows:

        +
          +
        1. During HTML parsing, the content of the <script> tag is parsed to JavaScript Interpreter.
        2. +
        3. The Interpreter parses the received script code.
        4. +
        5. Requests that need not be handled immediately are suspended.
        6. +
        7. The handled result is passed over to the browser, which continues to parse HTML.
        8. +
        + +

        The following example shows how you can use JavaScript with HTML either by linking to a JavaScript file, or embedding it directly in the HTML code:

        +
        /* Linking from HTML */
        +<script src="js/main.js"></script>
        +
        +/* Direct use in HTML */
        +<script>
        +   var obj = document.querySelector(".animated");
        +    
        +   function animate() 
        +   {
        +      /* Execute */
        +   };
        +    
        +   /* Call the animation function when the event is fired */
        +   webkitRequestAnimationFrame(animate);  
        +</script>
        +
        +
        +

        Both ways described above give the same result in behavior. However, the position of the JavaScript code affects the order in which the methods are called.

        + + + + + + + + + +
        Note
        Previously, adding JavaScript code within head tag was recommended because it is easy to maintain. Currently, adding it to the end of the body and executing it after parsing the HTML document is common.
        + +

        JavaScript Events

        + +

        JavaScript generally calls a method when a specific event is fired. More than 70 types of events, such as onload and onclick are available.

        + +

        The following example shows the use of a simple event:

        + +
        <!--HTML-->
        +<body onload="touchEventHandler()">
        +
        +<script>
        +   /* JavaScript */
        +   /* Directly assigning */  
        +   window.onload = touchEventHandler; /* Assigns the name of the subject method */
        +    
        +   /* Event listener (W3C standard) */
        +   document.addEventListener("touchstart", touchEventHandler, false);
        +</script>
        +

        Prefer using W3C standard event listener methods. The inline JavaScript code applied directly to an HTML tag is difficult to maintain. Assigning a method directly to an event is also difficult when passing parameters, as the method needs to be assigned for every event.

        + +

        JavaScript Priorities

        + +

        The rendering order of JavaScript code is based on the following rules:

        +
          +
        • JavaScript within the <head> element is temporarily saved, but not handled.
        • +
        • JavaScript within the <body> element is immediately handled when it is parsed.
        • +
        • When the temporarily saved JavaScript content is executed, the <head> element content is rendered first, and the <body> element content after it.
        • +
        + + +

        Using JavaScript Code within HTML

        + +

        To provide users with JavaScript-based features, you must learn to use JavaScript code within an HTML document:

        + +
          +
        • To use JavaScript code in the <head> element, place the relevant JavaScript content in a <script> tag: +
          +<head>
          +   <script src="js/jquery_1.9.0_min.js"></script>
          +   <script>       
          +      window.onload = function() 
          +      {
          +         testLog('head onload');
          +      };
          +
          +      $(document).ready(function() 
          +      {
          +         testLog('head ready');
          +      });
          +   </script>
          +</head>
          + +

          The JavaScript code within the <head> element is sent to Interpreter. As there are no methods to be handled immediately, its execution is suspended.

          +
        • +
        • To use JavaScript code in the <body> element, place the relevant JavaScript content in a <script> tag: +
          +<body>
          +   <script src="js/jquery_1.9.0_min.js"></script>
          +   <script>
          +      function testLog(txt) 
          +      {
          +         var logText = document.querySelector('.log');
          +         logText.innerHTML += '<li>JavaScript in HTML ' + txt + '</li>';
          +      };
          +    
          +      window.onload = function() 
          +      {
          +         testLog('body onload');
          +      };
          +
          +      $(document).ready(function() 
          +      {
          +         testLog('body ready');
          +      });
          +
          +      testLog('body');
          +
          +      (function() 
          +      {
          +         testLog('body anonymous function');
          +      }();
          +   </script>
          +</body>
          +
          +

          The JavaScript code within the <body> element is sent to Interpreter. The anonymous method is immediately executed, and the HTML DOM structure is set up. The methods in the $(document).ready method and in the onload event are executed in the stored order.

          +
        + + + + + + + + + + + +
        Note
        jQuery has to be called from both the <head> and <body> elements. The logText variable has to be called from the <body> element. The method connected to the onload event in the <head> element is not executed.
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/media_query_w.htm b/org.tizen.ui.practices/html/web/w3c/media_query_w.htm new file mode 100644 index 0000000..a8c6c41 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/media_query_w.htm @@ -0,0 +1,342 @@ + + + + + + + + + + + + + Media Queries: Labeling Output Devices in Style Sheets + + + + + +
        +

        Media Queries: Labeling Output Devices in Style Sheets

        + +

        Media queries allow you to apply the CSS differently according to the media type (type of device) and media features (viewport status). Previously, you were able to use the media type only and create Web services with fixed layouts. However, smart phones, tablets, and other devices with various resolutions require a liquid layout. HTML5 now makes various characteristics and conditional defining possible, and can be used to implement responsive Web design (RWD), which is a liquid layout that mainly reacts according to the device resolution.

        + +

        You can use media queries in 3 ways:

        + +
          +
        • In CSS +

          You can define attribute values depending on given conditions:

          +
          @media only screen and (max-width: 480px) {styles}
          +
          + + + + + + + + + +
          Note
          This approach is popular since it can reduce style overlapping; however, if all the styles are applied to 1 CSS, the maintenance work efficiency decreases.
          +
        • +
        • In an @import rule in CSS +

          You can import from CSS a file that matches the condition:

          +
          @import url(example.css) not screen and (min-width: 480px)
          +
          +
        • +
        • In HTML +

          You can directly import the CSS file that matches the condition:

          +
          <link rel="stylesheet" media="all and (max-width: 480px)" href="example.css">
          + + + + + + + + + +
          Note
          The disadvantage of this approach is that every time the condition is expanded, the HTML file must be edited. However, since this approach only imports the CSS files that match the condition, the file transmission amount can be reduced.
          +
        • +
        + +

        For more information on the CSS priorities when different media queries are used, see Media Query Priorities.

        + +

        Media Query Conditions

        + +

        You can define the following conditions for the media queries:

        + +
          +
        • Combination and relevancy +

          You can combine multiple conditions into 1 Boolean query with the and operator. To define a negative condition (something not being relevant), use the not operator.

          +
          @media not screen and (min-width: 320px), screen and (max-width: 480px) 
          +{
          +   .example: after {content: "width: 320px ~ 480px"}
          +}
          +
          +
        • +
        • Viewport width +

          You can define the query to match to a specific viewport width range using the min-width and max-width attributes.

          +
          @media all and (min-width: 320px) and (max-width: 480px) 
          +{
          +   .example: after {content: "width: 320px ~ 480px"}
          +}
          +
          +
        • +
        • Device and viewport height +

          The height attribute refers to restoring the viewport's height, and the device-height attribute refers to restoring the resolution set in the device.

          +

          The same difference applies to the width and aspect-ratio attributes, which can assign 'device-'.

          +
          @media screen and (min-device-height: 700px) 
          +{
          +   .example: after {content: "min-device-height"}
          +}
          +@media screen and (min-height: 550px) 
          +{
          +   .example: after {content: "min-height"}
          +}
          +
          +

          In the above example, a device with the width-height resolution of 480/720 has the {content: "min-height"} rule applied as a priority in a portrait screen, but the {content "min-device-height"} rule applied in a landscape screen.

          + +
        • +
        • Device aspect ratio +

          You can use the device-aspect-ratio attribute to check the width-length ratio (aspect ratio) of the printing device.

          +
          @media all and (device-aspect-ratio: 9/16) and (orientation: portrait),  
          +       all and (device-aspect-ratio: 2/3) and (orientation: portrait) 
          +{
          +   .example: after {content: "aspect-ratio, portrait"}
          +}
          +
          + + + + + + + + + +
          Note
          The device aspect ratio is a reliable way to distinguish the portrait and landscape modes of a smart phone. However, because the aspect ratio of all the devices has to be specified, a precise rule is hard to define. (Currently wildly used screen ratios are 15:9, 16:10, 16:9, 3:2, and 4:3, but devices with other screen ratios may be added in the future.)
          +
        • +
        + +

        Media Query Priorities

        + +

        When multiple media queries and conditions are defined, CSS is applied with the following priorities:

        +
          +
        • In case of the CSS reiteration declaration, the CSS that has been declared last is applied.
        • +
        • In case of specificity, the CSS with the highest specificity is applied. +

          The specificity is calculated as follows:

          • id attribute = 100
          • +
          • class attribute = 10
          • +
          • element = 1
          +

          Selectors, such as section#content > .title p, carry the specificity of 112.

        • +
        • In case of user override, the user CSS is applied instead of the creator CSS.
        • +
        • CSS is applied first based on the conditions in the @import rule, then based on the conditions in CSS, and finally based on the conditions in HTML.

        • +
        • In media queries, regardless of CSS priority, CSS which has not been imported still exists based on the conditions.

        • +
        + +

        To apply media query, consider an example with the following files:

        +
        +<!--example.html-->
        +<link rel="stylesheet" media="all and (max-width: 768px)" href="c.css">
        +<link rel="stylesheet" media="all and (max-width: 768px)" href="a.css">
        +<link rel="stylesheet" media="all and (min-width: 768px)" href="b.css">
        +<style>
        +   @media all and (max-width: 400px) 
        +   {
        +      .example: after {content: "In HTML head"}
        +   }
        +</style>
        +
        +<!--a.css-->
        +body {background-color: #ccc}
        +
        +@media screen and (max-width: 480px) 
        +{
        +   .example: after {content:"a.css : width: ~ 480px"}
        +}
        +@media screen and (min-width: 480px) and (max-width: 768px) 
        +{
        +   .example: after {content: "a.css : width: 480px ~ 768px"}
        +}
        +
        +<!--b.css-->
        +@import url("c.css");
        +
        +body {background-color: #333; color: #fff}
        +
        +@media screen and (min-width: 768px) and (max-width: 1024px) 
        +{
        +   .example: after {content: "b.css : width: 768px ~ 1024px"}
        +}
        +
        +<!--c.css-->
        +body {background-color: tomato}
        +
        +@media screen and (min-width: 768px) and (max-width: 1024px) 
        +{
        +   .example: after {content: "c.css : width: 768px ~ 1024px"}
        +}
        +@media screen and (min-width: 1024px) and (max-width: 1280px) 
        +{
        +   .example: after {content: "c.css : width: 1024px ~ 1280px"}
        +}
        +
        + +

        The CSS is applied based on the viewport:

        +
          +
        • If the viewport is 320 px: +
            +
          • The a.css file is applied (based on content: "a.css : width: ~ 480px").
          • +
          • The c.css and b.css files are not imported.
          • +
          • CSS is applied instead of the HTML <head> (the a.css file has higher priority than content: "In HTML head").
          • +
        • +
        • If the viewport is 700 px: +
          • The a.css file is applied (based on content: "a.css : width: 480px ~ 768px").

          • +
          • The c.css and b.css files are not imported.
        • +
        • If the viewport is 900 px: +
            +
          • The b.css file is imported.
          • +
          • c.css is applied (based on content: "c.css : width: 768px ~ 1024px").
          • +
          • The a.css file is not imported.
          • +
          • The b.css file is applied (based on content: "b.css : width: 768px ~ 1024px").
          • +
        • +
        + + +

        Creating a Liquid Layout

        +

        To enhance the user experience of your application, you must learn to define media queries to determine the styles to be used in the Web document. This example creates a simple Web document with a liquid layout that organically changes according to the device resolution to show the optimized layout on both portrait and landscape modes.

        + + +
          +
        1. Define a page with title and content elements: +
          +<header>
          +   <h1>Media queries tutorial</h1>
          +   <h1><img src="logo.png" alt="Tizen"></h1>
          +</header>
          +<div class="container">
          +   <section class="contents">
          +      <h2>Section Title</h2>
          +      <p class="desc">
          +         The quick brown fox jumps over a lazy dog.  The quick brown...
          +      </p>
          +   </section>
          +   <aside>
          +      Aside
          +   </aside>
          +</div>
          +
        2. +
        3. Define basic styles for the page, using a flexible box (in mobile or wearable applications) and multi-column (in mobile applications only) layout with 2 columns. (The following figure applies to mobile applications only.) +
          +.container 
          +{
          +   display: -webkit-flex;
          +}
          +.container aside 
          +{
          +   -webkit-flex: 1 0 20%;
          +}
          +.contents 
          +{
          +   -webkit-columns: 5em 3;
          +   -webkit-column-rule: 1px solid #999;
          +   -webkit-column-gap: 2em;
          +   -webkit-flex: 1 1 auto;
          +}
          +.contents h2 
          +{
          +   -webkit-column-span: all;
          +}
          +
          + +

          Fixed layout example (in mobile applications only)

          +

          The page is easy to view as long as the screen width is about 600 px; however, in a smaller screen below 400 px, the legibility rapidly decreases. You can edit the layout by reducing the number of columns to 1 and moving the Aside area at the bottom of the screen, but those changes then decrease legibility on a wider screen.

          + +
        4. +
        5. +

          To solve the problem, use a media query to define a liquid layout that changes according to the screen resolution:

          + +
          +@media all and (max-width: 480px) and (orientation: portrait) 
          +{
          +   .contents {-webkit-columns: 1;}
          +}
          +@media all and (min-width: 480px) and (max-width: 768px) 
          +{
          +   .contents {-webkit-columns: 2;}
          +   .container {display: -webkit-flex;}
          +}
          +
          +

          With the above media query, the normal resolution has 2 columns (shown on the right in the figure), while in a smaller resolution in a portrait mode only 1 column is used (shown on the left). (The following figure applies to mobile applications only.)

          +

          Liquid layout example (in mobile applications only)

          + +
        6. +
        7. If you need to define specific styles for a certain resolution range, simply add more media queries. However, too many conditions make the maintenance harder, so carefully consider what kind of resolution ranges you need. +

          + +

          The following conditions are generally used and cover all possibilities up to a Web browser in a PC:

          +
          +<!--Portrait mode of a smart phone-->
          +@media screen and (max-width: 480px) and (orientation: portrait) {<!--Specific layout-->}
          +
          +<!--Landscape mode of a smart phone and a small tablet-->
          +@media screen and (min-width: 480px) and (max-width: 768px) {<!--Specific layout-->}
          +
          +<!--Tablet and a small laptop-->
          +@media screen and (min-width: 768px) and (max-width: 1024px) {<!--Specific layout-->}
          +
          +<!--PC browser-->
          +@media screen and (min-width: 1024px) {<!--Specific layout-->}
          +@media print {<!--Specific layout-->}
          +
        8. + +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/multi_mw.htm b/org.tizen.ui.practices/html/web/w3c/multi_mw.htm new file mode 100644 index 0000000..0c5fc97 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/multi_mw.htm @@ -0,0 +1,611 @@ + + + + + + + + + + + + + CSS Multi-column Layout Module: Creating Multi-column Layouts + + + + + +
        +

        CSS Multi-column Layout Module: Creating Multi-column Layouts

        + + +

        You can arrange the screen content into columns. Using the CSS column- properties, the content elements can flow between columns when the column height or number changes. You can use the properties alone to create a basic layout, or add JavaScript code to make the layout dynamic.

        + +

        This feature is supported in mobile applications only.

        + +

        You can manage the following column-related features:

        + + + + + + + + + + + +
        Note
        Up to Tizen SDK version 2.2, most CSS properties and values used in Tizen required the -webkit- prefix. To ensure future compatibility, these properties can now be used with or without the prefix.
        + +

        Setting the Column Number and Width

        + +

        When the layout is set to a constant number of columns using the column-count (or -webkit-column-count) property, the column width is set to fill the available horizontal space.

        +

        In the following code snippet and figure, the column number is set to 4. As a result, on a 480 x 800 display (shown on the top), the column width is 116 px, whereas on a 720 x 1280 display (shown on the bottom), the column with is 143 px.

        +

        The following code snippet demonstrates how to use the column-count property. For a complete source code, see multi_column_column_count/renamed_index.html.

        +
        +article
        +{
        +   column-count: 4;
        +   -webkit-column-count: 4;
        +   margin: 10px;
        +}
        +
        + +

        Figure: 4 columns on different resolution displays

        +

        4 columns on different resolution displays

        + +

        The column-width (or -webkit-column-width) property sets the base column width.

        +

        In the following code snippet and figure, the column width is set to 153 px, but the effective column width is 288 px for a 480 x 800 display (shown on the left) and 154 px for a 720 x 1280 display (shown on the right). The parameter sets the column to at least the defined width, but not wider than the available display space or twice the defined width. The actual column width is calculated using a pseudo-algorithm.

        +

        The code snippet shows how the multi-column layout is implemented when the vertical space is limited. If there is more content than fits the available space, the next column is set outside the available space. Using the overflow: scroll property, the column can be scrolled horizontally.

        +

        The following code snippet demonstrates how to use the column-width property. For a complete source code, see multi_column_column_width/renamed_index.html.

        +
        +article
        +{
        +   width: 90vw;
        +   height: 90vh;
        +   column-width: 153px;
        +   -webkit-column-width: 153px;
        +   margin: 5vw;
        +   background: #c3c8ca;
        +   overflow: scroll;
        +}
        +
        + +

        Figure: Column width 153 px on different resolution displays

        +

        Column width 153 px on different resolution displays

        + +

        Setting the Column Gap

        +

        The column-gap (or -webkit-column-gap) property sets the distance between columns. The property affects the column width, as the column width, gap, and margins all take available space. In the following code snippet and figure, the column gap is set to 17 px.

        +

        The following code snippet demonstrates how to use the column-gap property. For a complete source code, see multi_column_column_gap/renamed_index.html.

        +
        +article 
        +{
        +   height: 303px;
        +   column-width: 153px;
        +   -webkit-column-width: 153px;
        +   column-gap: 17px;
        +   -webkit-column-gap: 17px;
        +   margin: 7px;
        +   padding: 3px;
        +   background: #c3c8ca;
        +}
        +
        + +

        Figure: Column gap

        +

        Column gap

        + +

        Setting the Column Rule

        +

        The column-rule (or -webkit-column-rule) property displays a vertical line in the middle of the column gap.

        +

        The rule has analogical parameters, such as width, line style, and color, but its size is not included in the available space, and it is a drawing similar to the background.

        + +

        Rules are only displayed in the content area. If the padding property is set in the same element, the rule appears shorter than the background. In the following code snippet and figure, the rule width is set to 5 px.

        +

        The following code snippet demonstrates how to use the column-rule property. For a complete source code, see multi_column_column_rule/renamed_index.html.

        +
        article 
        +{
        +   -webkit-column-rule-width: 5px;
        +   -webkit-column-rule-color: rgb(92, 203, 246);
        +   -webkit-column-rule-style: solid;
        +}
        +
        + +

        Figure: Column rule

        +

        Column rule

        + + + + + + + + + + +
        Note
        In Tizen SDK version 2.2, to avoid displaying the rules incorrectly, do not use the column-rule (or -webkit-column-rule) property with horizontal scrolling of the columns.
        + +

        Setting the Column Span

        +

        By default, all elements within the columns are no wider than the column width. The column-span (or -webkit-column-span) property can be used to display content across all columns.

        +

        When using this property with column elements which have the column-count or column-width property set, the following restrictions apply:

        +
          +
        • Column element height is not used and elements in columns take more vertical space than is set in height.
        • +
        • If the column element has the overflow property set to hidden, the column-span property is ignored.
        • +
        • An element using the column-span property does not have to be a direct child of the column element.
        • +
        +

        In the figure below, the blue arrow shows the order of the column elements. In the upper header area, the column-span property is not used, and in the lower header area, the column-span property is set to all, as in the following code snippet.

        +

        The following code snippet demonstrates how to use the column-span property. For a complete source code, see multi_column_column_span/renamed_index.html.

        +
        +article.left header 
        +{
        +   column-span: all;
        +   -webkit-column-span: all;
        +}
        +
        + +

        Figure: Column span

        +

        Column span

        + +

        Setting the Column Break

        +

        By default, column elements are broken to balance column height. The break-before (or -webkit-column-break-before), break-after (or -webkit-column-break-after), and break-inside (or -webkit-column-break-inside) properties can be used to define that an element cannot be broken between columns (set to avoid), or that an element must begin or end within a given column.

        + +

        The following code snippet and figure illustrate the use of the break- property. In the upper header area, the break- property is not used, and in the lower header area, the break-before property is set to always.

        +

        The following code snippet demonstrates how to use the column-break property. For a complete source code, see multi_column_column_break/renamed_index.html.

        +
        +article.lower section
        +{
        +   break-before: always;
        +   -webkit-column-break-before: always;
        +}
        +
        + +

        Figure: Column break

        +

        Column break

        + +

        Creating a Basic Layout

        + +

        To enhance the user experience of your application by providing a consistent behavior across a wide range of displays with different resolution and orientation, you must learn to create a basic layout using CSS:

        + +
          +
        1. +

          Create the HTML layout, defining separate sections for the column content and including an image file:

          +
          +<body>
          +   <article id="article">
          +      <section>
          +         <header>
          +            <h1>Section 1</h1>
          +         </header>
          +         <p>Lorem ipsum dolor (...), id.</p>
          +         <img src="images/pinwheel_green.png" alt="">
          +         <p>Maecenas at (...)tortor.</p>
          +      </section>
          +      <section>
          +         <header>
          +            <h1>Section 2</h1>
          +         </header>
          +         <img src="images/Tizen_Pinwheel_Secondary_Confetti.png" alt="">
          +         <p>Nullam bibendum (...) Curabitur.</p>
          +         <img src="images/Tizen_WhiteFold_4.png" alt="">
          +      </section>
          +      <section>
          +         <header>
          +            <h1>Section 3</h1>
          +         </header>
          +         <p>Sed sagittis, (...) Vivamus sed est sit amet.</p>
          +         <img id="figure" src="images/pinwheel_yellow.png" alt="">
          +         <p>Pellentesque habitant (...). Duis lobortis, nibh.</p>
          +      </section>
          +   </article>
          +</body>
          +
        2. + +
        3. Set the CSS column properties: +
            +
          1. +

            The article element acts as a multi-column container. Set the column-width (or -webkit-column-width) property to enable the multi-column layout:

            + +
            +article 
            +{
            +   width: 80vw;
            +   column-width: 119px;
            +   -webkit-column-width: 119px;
            +
            +   margin: 2vh 5vw;
            +   padding: 2vh 5vw;
            +   background: #c3c8ca;
            + +

            The column-width property defines the default column width but the visible width is not always similar. An algorithm calculates the width according to available space. Normally, a column has a different display width from the one set in the property because as the columns are sized to fill all available space.

            +

            For example, on a 480 x 800 display with portrait orientation, the device width is 123 px, whereas on a 720 x 1280 display with a landscape orientation, the width is 120 px. The space available for columns is the width attribute value reduced by padding, in this case 80vw - (2 * 5vw) = 70vw, which means 70/100 width of the device display.

            +
          2. +
          3. +

            Use the column-gap (or -webkit-column-gap) property to set the distance between columns:

            +
            +   column-gap: 10px;
            +   -webkit-column-gap: 10px;
            +
            +
          4. +
          5. + +

            Use the column-rule (or -webkit-column-rule) property to draw a vertical line between columns. Define the width, color, and style of the rule:

            + +
            +   -webkit-column-rule-width: 1px;
            +   -webkit-column-rule-color: #677784;
            +   -webkit-column-rule-style: solid;
            +   column-rule-width: 1px;
            +   column-rule-color: #677784;
            +   column-rule-style: solid;
            +}
            + +

            The rule width does not increase the distance between columns. It is drawn under the column gap and can be even wider than the gap.

            + +
          + +

          The figure below shows the layout with the column-rule width set to 40 px and the column-gap set to 10 px.

          + +

          Figure: Column settings

          +

          Column settings

          +
        4. +
        5. +

          Define the footer element with the display height set to 5/100 and padding set to 2 * 2vh:

          + +
          +footer 
          +{
          +   padding: 2vh;
          +   height: 5vh;
          +   background: rgba(103, 119, 132, 0.2);
          +}
          +
          +
        6. +
        7. +

          Define the section elements setting the border-bottom and vertical padding values. It is not necessary to define horizontal padding, as it has been defined for the article element.

          + +
          +article>section
          +{
          +   border-bottom: 1px solid #d8d9d4;
          +   padding: 4px 0;
          +   text-align: center;
          +}
          +
          +
        8. +
        9. +

          Set image elements to have an automatic margin to center them within the column.

          +

          In case of the image whose id attribute is set to figure, set it to be a floating element with text drawn around it.

          + +
          +img{
          +   display: block;
          +   margin: 4px auto;
          +}
          +
          +#figure
          +{
          +   float: right;	
          +   margin: 4px;
          +}
          +
          +
        + +

        The following figures illustrate the created layout in different display sizes and orientations.

        + +

        Figure: Basic layout on a 480 x 800 display

        +

        Basic layout on a 480 x 800 display

        + +

        Figure: Basic layout on a 720 x 1280 display

        +

        Basic layout on a 720 x 1280 display

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + +

        Creating a Layout with Dynamic Content

        + +

        To enhance the user experience of your application by providing a consistent behavior across a wide range of displays with different resolution and orientation, you must learn to create a layout displaying a varying amount of content using CSS:

        +
          +
        1. +

          Create the HTML layout. The article element displays the columns, and the nav element contains buttons to add and remove content in the columns.

          +
          +<body>
          +   <article id="article">
          +   </article>
          +   <nav>
          +      <a id="addSections" href="#">Add images</a> 
          +      <input type="number" id="howMany" value="3"> 
          +      <a id="removeGroup" href="#">Remove last Group</a>
          +   </nav>
          +   <footer> Multicolumn Layout Tutorial 02</footer>
          +</body>
          +
          +
        2. +
        3. Set the CSS properties: +
            +
          1. +

            Define the CSS display and column properties:

            +
            +body 
            +{
            +   display: flex;
            +   display: -webkit-flex;
            +   flex-direction: column;
            +   -webkit-flex-direction: column;
            +   background: #fefffa;
            +}
            +
            +
          2. +
          3. +

            Set the article, nav and footer elements in one column using the flexible box layout.

            +

            The nav element is also a flexible box layout container to set UI elements in.

            +
            +nav 
            +{
            +   height: 20vh;
            +   padding-left: 20%;
            +   padding-top: 10px;
            +   display: flex;
            +   display: -webkit-flex;
            +   flex-flow: row wrap;
            +   -webkit-flex-flow: row wrap;
            +   flex: none;
            +   -webkit-flex: none;
            +   justify-content: space-around;
            +   -webkit-justify-content: space-around;
            +   align-items: center;
            +   -webkit-align-items: center;
            +   background: url(../images/white_logo.png) no-repeat;
            +   background-position: 2%;
            +   background-size: auto 70%;
            +}
            +
            +
          4. +
          5. +

            Define the styles for the a elements within the nav element to make them appear as buttons:

            +
            +nav a 
            +{
            +   margin: 3px;
            +   border-radius: 5px;
            +   padding: 5px 15px;
            +   background: rgba(103, 119, 132, 0.2);
            +   text-align: center;
            +   font-weight: bold;
            +}
            +
            +

            When the user taps the Add images button, the images and their descriptions are displayed.

            +
          6. +
          7. +

            Define the input element (with the property type set to number) style with an increased height to match the buttons around it:

            +
            +nav input
            +{
            +   width: 50px;
            +   height: 2em;
            +}
            +
            +
          8. +
          9. +

            The article element contains the column properties. Use the -webkit-column-width property to set the column width. The real width is calculated based on available space.

            +
            +article 
            +{
            +   width: 90vw;
            +   column-width: 136px;
            +   -webkit-column-width: 136px;
            +   margin: 1vh 2vh;
            +   padding: 1vh;
            +   background: #c3c8ca;
            +}
            +
            +
          10. +
          11. +

            Set the images within the article element with a block display to separate them from text:

            +
            +article img 
            +{
            +   margin: 0 auto;
            +   display: block;
            +}
            +
            +
          12. +
          13. +

            Define the column-span property as all for the h1 elements:

            +
            +article>h1 
            +{
            +   background: rgba(103, 119, 132, 0.5);
            +   padding: 4px;
            +   text-align: center;
            +   color: #eed484;
            +   column-span: all;
            +   -webkit-column-span: all;
            +}
            +
            +

            As a result, the h1 elements are spread across the columns. When the column-span property is used, you cannot have more columns than can fit in the available horizontal space.

            +
          14. +
          15. +

            Define the break-inside property as avoid to avoid breaking elements between columns:

            +
            +article>section 
            +{
            +   break-inside: avoid;
            +   -webkit-column-break-inside: avoid;
            +   border-bottom: 1px solid #d8d9d4;
            +   padding: 4px 0;
            +   text-align: center;
            +}
            +
            +
          16. +
          17. +

            Set the footer size:

            +
            +footer 
            +{
            +   padding: 2vh;
            +   height: 5vh;
            +   background: rgba(103, 119, 132, 0.2);
            +}
            +
            +
          18. +
          +
        4. +
        5. Add the JavaScript code to make the content dynamic: +
            +
          1. +

            Declare a variable for the images. Elements included in the variable amount to data displayed in a column layout, such as a newsfeed:

            +
            +var images = ["images/pinwheel_green.png",
            +              "images/Tizen_Pinwheel_Secondary_Confetti.png", 
            +              "images/Tizen_WhiteFold_4.png", 
            +              "images/pinwheel_yellow.png"];
            +
            +
          2. +
          3. +

            Declare a variable for the input element for selecting the number of images added to the content:

            +
            +var howManyInput;
            +
            +
          4. +
          5. +

            Use the addGroup() method with the input parameter value to add random images to the column layout and initialize the button events:

            + +
            +window.onload = function() 
            +{
            +   addGroup(4);
            +   howManyInput = document.getElementById('howMany');
            +   var addBtn = document.getElementById('addSections');
            +   addBtn.onclick = function() 
            +   {
            +      addGroup(howManyInput.value);
            +
            +      return false;
            +   };
            +   var removeBtn = document.getElementById('removeGroup');
            +   removeBtn.onclick = function() 
            +   {
            +      removeGroup();
            +
            +      return false;
            +   };
            +};
            +
            +
          6. +
          7. +

            Declare the h1No variable containing the number of h1 elements included in the article elements, and one added to next lines.

            + +

            Declare the newHTML variable to add new content to the column layout. Each added element contains an h1 element as a header, and section elements. Include an img element with a text description in each section element to display a random image. The art variable is initialized, and new HTML code (newHTML) is concatenated with the existing one (innerHTML):

            +
            +function addGroup(howMany) 
            +{
            +   var h1No = document.querySelectorAll('article>h1').length + 1;
            +   var newHTML = "<h1>Group " + h1No + "</h1>";
            +   var i;
            +
            +   for (i = 0; i < howMany; ++i) 
            +   {
            +      newHTML += "<section><img alt='' src='";
            +      newHTML += images[Math.floor(Math.random() * 4)];
            +      newHTML += "'>Lorem ipsum dolor sit amet diam sodales rutrum.</section>";
            +   }
            +   var art = document.getElementById("article");
            +   art.innerHTML += newHTML;
            +}
            +
            +
          8. +
          9. +

            When the user taps the Remove last Group button, the removeGroup() method is called to remove the group of images that was added last. Use the all variable to select all h1 elements in the content using the querySelectorAll() method. If the last value is less than 0, there is no element to remove. Use the removeNextSibling() method to recursively delete the next sibling element, and the removeChild() method to remove the h1 elements from its parent.

            +
            +function removeGroup() 
            +{
            +   var all = document.querySelectorAll('article>h1');
            +   var last = all.length - 1;
            +   if (last < 0) 
            +   {
            +      return;
            +   }
            +   removeNextSibling(all[last].nextSibling);
            +   all[last].parentElement.removeChild(all[last]);
            +}
            +
            +
          10. +
          +
        +

        The following figures illustrate the created layout in different display sizes and orientations.

        + +

        Figure: Dynamic layout on a 480 x 800 display

        +

        Dynamic layout on a 480 x 800 display

        + +

        Figure: Dynamic layout on a 720 x 1280 display

        +

        Dynamic layout on a 720 x 1280 display

        +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/multiple_screens_mw.htm b/org.tizen.ui.practices/html/web/w3c/multiple_screens_mw.htm new file mode 100644 index 0000000..a6f9aa3 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/multiple_screens_mw.htm @@ -0,0 +1,372 @@ + + + + + + + + + + + + + Multiple Screen Support: Supporting Different Screen Sizes + + + + + +
        +

        Multiple Screen Support: Supporting Different Screen Sizes

        + +

        Tizen is available in various devices which support different screen sizes and resolutions. When developing Tizen Web applications, you must take this into account if you want your application to function well in various device models.

        + +

        This feature is supported in mobile applications only.

        + +

        Before implementing multiple screen support, make sure you are familiar with the key concepts of multiple screen support.

        +

        Tizen provides the UI scalability resolution feature, which allows you to create scalable applications.

        +

        To optimize images used in Web applications, images based on a single resource can be used in various resolutions.

        +

        Key Concepts

        +

        Before building a Web application for multiple resolutions, make sure you are familiar with the following W3C Web content scaling standards, which must be taken into account when developing Web applications:

        +
          +
        • Viewport meta tag
        • +
        • CSS media query
        • +
        +

        Viewport Meta Tag

        +

        A viewport defines the application area that displays the Web page content.

        +

        In a Web browser, the viewport size depends on the browser window size. If the viewport is smaller than the Web content size, horizontal and vertical scrollbars are displayed for page navigation. The Web browser viewport does not support the zoom feature. However, in a mobile Web browser, there are no window scrollbars and the viewport supports the zoom feature.

        +

        The viewport meta tag enables you to customize the viewport size and zoom levels in a majority of mobile Web browsers. Using this tag, you can set the width, height, initial scale, and scale range for Web pages.

        +

        To use the viewport meta tag while developing Web applications, you must note the following:

        +
          +
        • The device-height and device-width attributes defined in the viewport meta tag are not the same as the real device width and height in pixels.
        • +
        • Using the viewport meta tag, the Web browsers of different devices display the same content with different layout size and scale factor. The scale factor is calculated using the device pixel ratio (DPR).
        • +
        +

        CSS Media Query

        +

        The CSS media query enables you to set conditions for particular media features and types to apply different CSS files for the application content. For Web content scaling, you can use the CSS media query to, for example:

        +
          +
        • Define the image resource to be used based on the screen dots per inch (DPI) ratio.
        • +
        • Determine the CSS layout to be used based on the screen width.
        • +
        +

        +

        UI Scalability

        +

        With UI scalability, you can support multiple screen resolutions in a single Tizen Web application. Tizen automatically converts and translates the size and position values that are defined in the application's logical resolution to the physical resolution at runtime. The Tizen Advanced UI (TAU) uses the viewport meta tag to fit the Web page into the device screen, and the rem unit to determine the size of the Tizen Web UI components.

        +

        Setting the Viewport

        +

        Tizen devices support a variety of screen resolutions and dots per inch (DPI) values. If the viewport meta tag is not defined, TAU uses the default viewport width and scale factor. This ensures that Web content layout varies between different screen resolutions.

        +

        In the following example, the viewport width is set to device-width, which is determined by the width of the Tizen device. The device-width value is retrieved to set similar virtual DPI values and to display UI components with similar physical sizes across all devices. (TAU uses the example value by default, if no other viewport value is defined.)

        +
        <meta name="viewport"
        +      content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        +

        If the viewport width is set to device-width, the width and scale factor values are calculated by the Web browser. The following table shows different layout sizes and scale factors of the Tizen Web site (http://tizen.org) on different devices with the viewport width set to device-width.

        +
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + Table: Layout size and scale factor +
        Device screen resolutionReal screen DPIDevice DPIWeb browser pageViewport widthScale factor
        720 x 1280306320captured screen1360 px2.0
        480 x 800218240captured screen2320 px1.5
        +

        Working with Tizen Web Winsets

        +

        The default sizes of Tizen Web winsets (such as Popup, Button, and Checkbox) are designed based on the reference viewport DPI of 160. Therefore, these winsets are of similar sizes on any Tizen device if the viewport width is set to device-width.

        +

        If you manually set the viewport width of your application to a fixed value, the Tizen Web winsets may not fit appropriately in the application. To avoid the problem, Tizen Web winsets use the rem unit for the winset length, which depends on the base font size of the winset. Each Tizen Web winset theme has its own base font size, and the <html> element font size is also set to the base font size. If the viewport width is set to a fixed value, this base font size is recalculated and set to the <html> element to adjust the Tizen Web winset sizes accurately.

        +

        Creating Applications Supporting Multiple Screens

        +

        To create an application that supports multiple screen sizes, you must consider the following while coding your application:

        +
          +
        • Configuring the viewport
        • +
        • Optimizing resources
        • +
        • Creating screen resolution-independent UI
        • +
        +

        Configuring the Viewport

        +

        To use UI scalability in your application, set the viewport meta tag while creating a Web application project in IDE. To configure the viewport in the Tizen Web applications, add the viewport meta tag in the <head> section of the index.html file:

        +
        <meta name="viewport"
        +      content="width=device-width, initial-scale=1.0,
        +               minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
        +

        Optimizing Resources

        +

        By default, the Tizen Advanced UI (TAU) consists of the HD Web winsets. The winset scale is lowered for lower screen resolution devices. To optimize resources for different screen resolutions and devices, use the CSS media query for different resolutions available in Tizen. You can use CSS media queries in the HTML or CSS files.

        +

        In the HTML file:

        +
        <link media="only screen and (min-resolution: 320dpi)"
        +      href="high-quality-images.css" type= "text/css" rel="stylesheet">
        +

        In the CSS file:

        +
        @media screen and (max-resolution: 159dpi)
        +{
        +   <!--Set styles-->
        +}
        +
        +@media screen and (min-resolution: 160dpi and max-resolution: 239dpi)
        +{
        +   <!--Set styles-->
        +}
        +
        +@media screen and (min-resolution: 240dpi and max-resolution: 319dpi)
        +{
        +   <!--Set styles-->
        +}
        +
        +@media screen and (min-resolution: 320dpi)
        +{
        +   <!--Set styles-->
        +}
        +
        +

        You can also set different layout and resources for the portrait and landscape views in the CSS file:

        +
        @media screen and (orientation: portrait)
        +{
        +   <!--Set styles-->
        +}
        +
        +@media screen and (orientation: landscape)
        +{
        +   <!--Set styles-->
        +}
        +
        +

        Creating Screen Resolution-independent UI

        +

        The Tizen base font size is 22 px. This base font size value varies based on the device screen resolution. However, to create a screen resolution-independent UI, the Web browser engine renders the base font size as a logical pixel size instead of a physical pixel size.

        +

        Image Resolution Optimization

        + +

        In Web applications, optimization of applications for various platforms (regarding devices, OS, and resolution) is efficient.

        +

        Media Queries and Flexible Box Layout can be used to create flexible layouts, and to build the deployable package easily.

        + +

        Images can be used in Web applications in the following ways:

        + +

        When selecting an option from the list above, consider the type of the image resource you are going to use.

        +

        You can use the following types of image resources:

        + +

        Photos

        +

        An image can be added to an application using the HTML img tag, or CSS background property as shown in the following example:

        +
        <!--HTML-->
        +<img src="images/sample.jpg" alt="sample image" />
        +
        +<!--CSS-->
        +.photo
        +{
        +   background: url(../images/sample.jpg) 0 0 no-repeat;
        +   background-size: 100%;
        +   width: 100%;
        +   height: 200px;
        +}
        +
        +

        In terms of performance, there is no difference between the options.

        + +

        The image color is expressed based on pixels. Therefore, the higher resolution an image has, the better it looks on a large screen. For full HD display, a resolution bigger than the image size displayed on the screen is needed. However, since a high resolution image tends to have a large size, limit the image size as to fit the maximum screen size:

        +
        • 1024 x 768 px: 90 KB
        • 300 x 200 px: 39 KB
        • 300 x 200 px: 15 KB
        +

        Current full HD displays have a resolution that is 1.5 to 2 times bigger than the actual screen size. The image quality is guaranteed if you size images as 2 times bigger than their original size.

        +
        img
        +{
        +   max-width: 100%;
        +}
        +
        + +

        Figure: Enlarging a low-resolution image

        +

        Enlarging a low-resolution image

        +

        Icons

        +

        Icons generally have a fixed size. Size icon images as 2 times bigger than their original size. Using the CSS3 background-size property, you can add an image with the size of, for example, 40 x 40 px, compressed as 20 x 20 px.

        +
        .prev_icon, .next_icon
        +{
        +   padding-left: 30px;
        +   height: 30px;
        +   line-height: 30px;
        +   font-size: 1.2em;
        +   background-repeat: no-repeat;
        +   background-position: 0 50%;
        +   background-size: auto 20px;
        +}
        +
        +.prev_icon.icon1
        +{
        +   background-image: url(../images/page_navi_arrow_left_01.png);
        +}
        +
        + +

        When multiple icons are used on a page, all the image files are called separately. This slows down the loading speed and causes a large number of network roundtrips, as illustrated in the figure below.

        + +

        Figure: Network speed when calling each image separately

        +

        Calling each of image separately

        + +

        You can use the sprite image technique (grouping multiple images as one and showing the only desired images defined with the background-position property) to noticeably reduce the page loading speed without any loss in quality of the image, as the following example shows. +

        +
        .prev_icon, .next_icon
        +{
        +   background-size: 20px auto; <!--Full HD Display-->
        +   background-image: url(../images/page_navi_arrow.png);
        +}
        +
        +.prev_icon.icon1
        +{
        +   background-position: 0 0;
        +}
        +
        +.prev_icon.icon2
        +{
        +   background-position: 0 -50px;
        +}
        +
        +

        Figure: Network speed when using sprite images

        +

        Network speed when using sprite image

        +

        Animated Images

        +

        Animated images can be created in various formats and with many tools, such as GIF, JavaScript, Canvas, and SVG.

        + +

        To create a simple and repetitive animation effect as below as effectively as possible, use GIF images, JavaScript, or the CSS3 animation attribute.

        +

        Figure: JAVA mascot character in GIF (source: http://lea.verou.me)

        +

        JAVA mascot character  in GIF


        + +

        Below, the network capacity usage and timeline using the following animation types are compared using the Web Inspector:

        + + +

        GIF Animation

        + +

        Using GIF animation, the resource usage is as follows:

        +
        • Events: Fires only the painting event
        • +
        • Memory: 3 ~ 4 MB
        • +
        • Network: 10 ~ 25 ms
        • +
        + +

        Figure: Events for a GIF image

        +

        Events


        +

        Figure: Memory usage of a GIF image

        +

        Memory


        +

        Figure: Network capacity usage of a GIF image

        +

        Network


        + +

        GIF animation can be created in various resolutions without quality loss, when you use the option introduced in Photos. This, however, increases memory occupancy.

        + +

        JavaScript Animation

        + +

        JavaScript animation is less affected by enlarging or reducing its screen size. However, it uses a lot of device resources compared to using CSS3 animations:

        +
        • +Events: Event is fired every 100 ms, the interval of setInterval().
        • +Memory: Increases in proportion to time, from the initial size 90 KB.
        • +Network: Used until the animation is stopped.
        +

        Figure: Events for a JavaScript animation

        +

        Events


        +

        Figure: Memory usage of a JavaScript animation

        +

        Memory


        +

        Figure: Network capacity usage of a JavaScript animation

        +

        Network


        +

        The following example shows how JavaScript animation can be implemented:

        +
        <script>
        +   var obj = document.querySelector(".animated img"), flag = 0;
        +   function animate()
        +   {
        +      obj.src = './images/sprite_' + ((flag++) % 10) + '.png';
        +   };
        +   setInterval(animate, 100);
        +</script>
        +
        + +

        You can use the requestAnimationFrame() method of the Timing control for script-based animations API to prevent animation freezes that occur occasionally:

        + +
        <script>
        +   var obj = document.querySelector(".animated img"), flag = 0, i = 0;
        +   function animate()
        +   {
        +      if (!(i % 6)) obj.src = './images/sprite_' + ((flag++) % 10) + '.png';
        +         i++;
        +      -webkit-RequestAnimationFrame(animate);
        +   };
        +   -webkit-RequestAnimationFrame(animate);
        +</script>
        +
        + +

        CSS3 Animation

        + +

        CSS3 animation has a low usage of events, memory, and network capacity. It is efficient for animations that have a fixed size. However, since CSS3 animation is pixel-based, it is difficult to use for animations that need to be enlarged or reduced, in which case JavaScript is a better option:

        +
        • +Events: Fires only rendering and painting events
        • +Memory: 50 ~ 90 KB
        • +Network: 9 ~ 21 ms
        + +

        Figure: Events for a CSS3 animation

        +

        Events


        +

        Figure: Memory usage of a CSS3 animation

        +

        Memory


        +

        Figure: Network capacity usage of a CSS3 animation

        +

        Network


        + +

        The following example shows how CSS3 animation can be implemented:

        +
        <style>
        +   .css_animation
        +   {
        +      width: 50px;
        +      height: 70px;
        +      background-image: url(../images/sprite.png);
        +      -webkit-animation: cssAni .8s steps(10) infinite;
        +   }
        +
        +   @-webkit-keyframes cssAni
        +   {
        +      from {background-position: 0px;}
        +      to {background-position: -500px;}
        +   }
        +</style>
        +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/selector_w.htm b/org.tizen.ui.practices/html/web/w3c/selector_w.htm new file mode 100644 index 0000000..6c4057c --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/selector_w.htm @@ -0,0 +1,214 @@ + + + + + + + + + + + + + Selectors API (Level 1 and 2): Selecting DOM Elements + + + + + +
        +

        Selectors API (Level 1 and 2): Selecting DOM Elements

        + +

        The selectors allow you to select element nodes in the DOM tree by matching them against a group of selectors, and testing whether the element matches a particular selector. Using selectors makes searching and selecting complex elements faster.

        + +

        You can use the querySelector() and querySelectorAll() methods to retrieve the element nodes. Both methods accept a single parameter, a string selector. The string selector is a selector or a group of selectors that can be surrounded by whitespace. If you use a selector group as the string selector with the querySelector() method, the method returns the first element (if any) that matches any of the selectors in the group.

        + +

        The main features of the Selectors API Level 1 and Level 2 include:

        + +

        You can also create an accordion menu.

        + +

        Selecting a Single Node

        +

        To enhance the user experience of your application, you must learn to use selectors to handle page elements, and to select a single node:

        +
          +
        1. To select the first matching element found in the child nodes, use the querySelector() method with CSS selectors. You get the same result as when using the getElementById(), getElementsByTagName(), and getElementsByClassName() methods. +
          var obj1 = document.getElementsByTagName('td')[0]; /* First <td> element in the document */
          +var obj2 = document.getElementById('foo'); /* Element with the ID #foo */
          +var obj3 = document.getElementsByClassName('bar')[0]; /* First element in the bar class */
          +  
          +var obj4 = document.querySelector('td'); /* Same as obj1 */
          +var obj5 = document.querySelector('#foo'); /* Same as obj2 */ 
          +var obj6 = document.querySelector('.bar'); /* Same as obj3 */
          +

          The querySelector() method returns the first matching element node within the subtrees of the context node. If no matching element is found, the method returns null.

        2. +
        3. You can use the CSS selectors to ensure that elements with complex structures can be easily selected. +

          For example, the following example selects the last element among the child nodes of the second <tr> element, which is a child of the <tbody> element in the second <table> element of the document.

          +
          var obj = document.querySelector('table:nth-child(2) tbody > tr:nth-child(2) :last-child');
        4. +
        5. You can use method chaining to select an element: +
          var obj = document.querySelector('table:nth-child(2)');
          +var targetObj = obj.querySelector('tbody > tr:nth-child(2) :last-child')
        6. +
        + +

        Figure: Single node selection (in mobile applications only)

        +

        Single node selection (in mobile applications only)

        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Selecting Multiple Nodes

        +

        To enhance the user experience of your application, you must learn to use selectors to handle page elements, and to select multiple nodes in a node list:

        +
          +
        1. Select an element in the node list using the querySelector() method: +
          var obj = document.querySelector('table:nth-child(2)');
          +

          The querySelector() method returns the first matching element node within the subtrees of the context node. If no matching element is found, the method returns null. The query above selects the second <table> element in the document as a single element.

          +
        2. + +
        3. Select multiple elements in the node list using the querySelectorAll() method, and define a variable to represent the length of the targetObj node list: +
          var targetObj = obj.querySelectorAll('thead th, tbody td');
          +var i = targetObj.length;
          +

          The querySelectorAll() method returns an array containing all of the matching element nodes within the subtrees of the context node, in the document order, and saves the elements in a node list. If there are no matching nodes, the method returns an empty array. The query above selects the <th> elements in the table head and the <td> elements in the table body.

          +
        4. +
        5. Apply a defined style to all elements stored in the targetObj node list: +
          while (0 < i) 
          +{
          +   i--;
          +   targetObj[i].style.backgroundColor = 'orange';
          +   targetObj[i].textContent = 'Exam 3' + i;
          +}
        + +

        Figure: Multiple node selection (in mobile applications only)

        +

        Multiple node selection (in mobile applications only)

        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Creating an Accordion Menu

        + +

        To enhance the user experience of your application, you must learn to retrieve element nodes from the DOM tree to create a simple accordion menu.

        +

        The accordion menu is created using the CSS3 Basic User Interface Module Level 3 API (in mobile or wearable applications). When a title is touched, the relevant content is shown, and other content is hidden.

        +
          +
        1. Create the HTML layout: +
          <ul class="accordion">
          +   <li>
          +      <p class="title current">Title 1<p>
          +      <div>contents 1</div>
          +   </li>
          +   <li>
          +      <p class="title">Title 2</p>
          +      <div>contents 2</div>
          +   </li>
          +   <!--Other list elements-->
          +</ul>
        2. + +
        3. Use CSS transitions to add sliding effects when content appears: +
          .accordion  > li  > div 
          +{
          +   padding: 0 15px;
          +
          +   <!--Assign time for CSS transformation-->
          +   -webkit-transition: all .5s;
          +   opacity: 0;
          +   height: 0;
          +   box-shadow: inset 1px 1px 4px rgba(0, 0, 0, .5);
          +   line-height: 2;
          +}
          +<!--Assign styles to be applied in case the current class is added to p.title-->
          +.accordion  > li  > p.current 
          +{
          +   background: -webkit-linear-gradient(top, #666, #000);
          +   color: #fff;
          +}
          +.accordion > li > p.current + div 
          +{
          +   opacity: 1;
          +   height: 200px;
          +}
        4. +
        5. Use the querySelector() and querySelectorAll() methods to change the class of the subject in the elements where the event is fired: +
          var testAccordion = function(obj) 
          +{
          +   var targetObj = document.querySelector(obj);
          +   var targetLength = document.querySelectorAll(obj + 'li').length;
          +
          +   /* In case the elements are not selected */
          +   if (targetLength <= 0) 
          +      return false;
          +
          +   targetObj.onclick = function(e) 
          +   {
          +      var that = e.target;
          +
          +      /* In case the e.target class is not title */
          +      if ((that.className !== 'title')) return false;
          +
          +      for (var i = 0; i < targetLength; i++) 
          +      {
          +         /* Change all classes of the 'li p' elements at the bottom of .accordion to title */
          +         targetObj.querySelectorAll('li p')[i].className = 'title';
          +      }
          +      /* Define the e.target class as current */
          +      that.className += 'current';
          +   }
          +}
          +
        6. +
        7. Define the elements that use the accordion menu: +
          testAccordion('.accordion');
        + +

        Figure: Accordion menu (in mobile applications only)

        +

        Accordion menu (in mobile applications only)

        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/session_history_w.htm b/org.tizen.ui.practices/html/web/w3c/session_history_w.htm new file mode 100644 index 0000000..f31132c --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/session_history_w.htm @@ -0,0 +1,204 @@ + + + + + + + + + + + + + HTML5 Session History: Managing the Device Browsing History + + + + + +
        + + +

        HTML5 Session History: Managing the Device Browsing History

        + +

        You can manage the session history of browsing contexts.

        +

        The history interface is used to save in the session history the page information that has been read by the user. You can also use the state object to directly store the page information which has already been analyzed in the URL, or general information which is not stored in the URL (such as location, or the scroll state of the page or a certain DOM element).

        + + +

        The main features of the HTML5 session history of browsing contexts API include:

        +
          +
        • Adding entries to the session history +

          You can use the pushState() method of the history interface to add an entry to the session history. With the replaceState() method, you can update the session history details. +

        • +
        • Detecting session history status changes +

          The popstate event is fired when the user navigates to a page stored in the session history. The popstate event +references the information stored with the pushState() or replaceState() methods, and enables you to change the status of the page based on the stored session history (such as moving focus to a certain DOM element).

          +
        • +
        + +

        Managing Session History Entries

        + +

        Learning how to manage the session history enhances the user browsing experience in your application:

        + +
          +
        1. To add an entry to the session history, use the pushState() method of the history interface: +
          +<script>
          +   history.pushState({index: currentIndex}, document.title);
          +</script>
          +
          + + + + + + + + + +
          Note
          The pushState() method accepts the data, title, and url (optional) parameters. The title parameter refers to the key value used to search for entries saved in the session history, and is currently ignored in all browsers.
          +
        2. + +
        3. To update the entry details, use the replaceState() method: +
          +<script>
          +   history.replaceState({index: currentIndex}, document.title, '#page' + currentIndex);
          +</script>
          +
          +

          The replaceState() method uses the same parameters as the pushState() method. The history_sample.html is the url parameter, which refers to the address of the page that is to be changed.

          +
        4. + +
        5. To use the session history information: +
            +
          1. Implement a page with the Prev and Next buttons: +
            +<nav class="paging">
            +   <a href="#">Prev</a>
            +   <a href="#">Next</a>
            +</nav>
            +<p>Current Index: <output> </output></p>
            +
            +<a href="http://tizen.org/">Tizen.org</a>
            +
            +
          2. +
          3. When the user clicks the buttons, the current index value (representing page numbers) is changed and stored in the state object of the history interface: +
            +var currentIndex = 0;
            +var prev = document.querySelector('.paging > a:nth-child(1)');
            +var next = document.querySelector('.paging > a:nth-child(2)');
            +
            +/* Prev button click event */ 
            +prev.onclick = function() 
            +{
            +   currentIndex -= 1;   
            +   setState(currentIndex);
            +    
            +   return false;
            +};
            +    
            +/* Next button click event */ 
            +next.onclick = function() 
            +{
            +   currentIndex += 1;  
            +   setState(currentIndex);
            +    
            +   return false;
            +};
            +
            +
          4. + +
          5. If the state object has data in it, use the replaceState() method to change the previously stored information. Otherwise, add new info with the pushState() method. +
            +function setState(currentIndex) 
            +{
            +   if (history.state) 
            +   {
            +      history.replaceState({index: currentIndex}, document.title, '#page' + currentIndex);
            +   } 
            +   else 
            +   {
            +      history.pushState({index: currentIndex}, document.title);
            +   }
            +   output.textContent = currentIndex;
            +}
            +
            +
          6. +
          +
        6. +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Detecting Session History Changes

        + +

        Learning how to track session history changes enhances the user browsing experience in your application:

        + +
        1. A page with data stored in the session history fires a popstate event when the page is loaded (for example, because it is refreshed or moved to from the previous page). +

          Register the event listener:

          + +
          +window.addEventListener("popstate", foo, false);
          +
        2. + +
        3. Define the event handler for the event. You can use the data stored in the state object to retrieve the correct location on the page to be loaded. +
          +var output = document.querySelector('output');
          +
          +window.onpopstate = function() 
          +{
          +   currentIndex = history.state.index;
          +   output.textContent = currentIndex;
          +}
          +
          +

          In the snippet above, when a popstate event is fired, it saves the index value stored in the state object to the currentIndex variable, and outputs the <output> element from the correct index location. +

          + +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + + + +
        + +Go to top + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/text_module_w.htm b/org.tizen.ui.practices/html/web/w3c/text_module_w.htm new file mode 100644 index 0000000..cdea394 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/text_module_w.htm @@ -0,0 +1,244 @@ + + + + + + + + + + + + + CSS Text Module (Level 3): Manipulating Text + + + + + + +
        +

        CSS Text Module (Level 3): Manipulating Text

        + +

        You can apply various text effects easily.

        + +

        The new text features in CSS Text Module Level 3 include:

        +
          + +
        • Text properties +

          You can use CSS text properties, such as text-transform, text-align, text-indent, letter-spacing, and word-spacing, to manipulate and transform text.

        • +
        + +

        Manipulating Text

        + +

        To enhance the user experience of your application, you must learn to handle line breaking, justification, alignment, white space handling, and text transformations using CSS text properties:

        + +
          +
        1. Define the text-transform property within a <style> element in the <head> section of the Web page to control the text capitalization: + +
          +<head>
          +   <style>
          +      p:nth-child(1) {text-transform: none;}
          +      p:nth-child(2) {text-transform: capitalize;}
          +      p:nth-child(3) {text-transform: uppercase;}
          +      p:nth-child(4) {text-transform: lowercase;}
          +      p:nth-child(5) {text-transform: full-width;}
          +   </style>
          +</head>
          +<body>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +</body>
          +
          + +
        2. + +
        3. Define the text-align property, which controls the text alignment: + +
          +<head>
          +   <style>
          +      p:nth-child(1) {text-align: start;}
          +      p:nth-child(2) {text-align: end;}
          +      p:nth-child(3) {text-align: left;}
          +      p:nth-child(4) {text-align: right;}
          +      p:nth-child(5) {text-align: center;}
          +      p:nth-child(6) {text-align: justify;}
          +   </style>
          +</head>
          +
          + +
        4. + +
        5. Define the text-indent property, which controls the text indentation: + +
          +<head>
          +   <style>
          +      p:nth-child(1) {text-indent: 0}
          +      p:nth-child(2) {text-indent: 1em}
          +      p:nth-child(3) {text-indent: -1em}
          +      p:nth-child(4) {text-indent: 5%}
          +      p:nth-child(5) {text-indent: -5%}
          +   </style>
          +</head>
          +
          + +
        6. + +
        7. Define the letter-spacing property, which controls the letter spacing: +
          +<head>
          +   <style>
          +      p:nth-child(1) {letter-spacing: .5em}
          +      p:nth-child(2) {letter-spacing: -.1em}
          +   </style>
          +</head>
          +
          + +
        8. + +
        9. Define the word-spacing property, which controls the space between words: +
          +<head>
          +   <style>
          +      p:nth-child(1) {word-spacing: 1em}
          +      p:nth-child(2) {word-spacing: -.1em}
          +   </style>
          +</head>
          +
          + +
        10. + +
        11. Define the word-break property, which determines the line breaking rules for non-CJK (Chinese, Japanese, and Korean) scripts: +
          +<head>
          +   <style>
          +      p:nth-child(1) {word-break: normal}
          +      p:nth-child(2) {word-break: keep-all}
          +      p:nth-child(3) {word-break: break-all}
          +   </style>
          +</head>
          +
          + +
        12. + +
        13. Define the white-space property, which determines the handling of empty space within an element: +
          +<head>
          +   <style>
          +      p:nth-child(1) {white-space: normal}
          +      p:nth-child(2) {white-space: pre}
          +      p:nth-child(3) {white-space: nowrap}
          +      p:nth-child(4) {white-space: pre-wrap}
          +      p:nth-child(5) {white-space: pre-line}
          +   </style>
          +</head>
          +<body>
          +   <p>The quick brown fox jumps
          +   over a lazy dog.</p>
          +   <p>The quick brown fox jumps
          +   over a lazy dog.</p>
          +   <p>The quick brown fox jumps
          +   over a lazy dog.</p>
          +   <p>The quick brown fox jumps
          +   over a lazy dog.</p>
          +   <p>The quick brown fox jumps
          +   over a lazy dog.</p>
          +</body>
          +</html>
          +
          + +
        14. + +
        15. Define the text-shadow property, which adds a shadow effect to text: +
          +<head>
          +   <style>
          +      p:nth-child(1) {text-shadow: 0.1em 0.1em 0.2em rgba(0, 0, 0, .7)}
          +      p:nth-child(2) {text-shadow: -0.2em 0.2em 0.2em #000, 0.2em -0.2em 0.2em #f00}
          +      p:nth-child(3) {color: #fff; text-shadow: 0 0 .7em #000;}
          +      p:nth-child(4) {color: #fff; text-shadow: 0 0 1px #f00;}
          +   </style>
          +</head>
          +
          + +
        16. + +
        17. Define the word-wrap and overflow-wrap properties, which control forced line breaks when the length of a word is longer than the area where it is displayed: +
          +<head>
          +   <style>
          +      p:nth-child(1) {word-wrap: normal}
          +      p:nth-child(2) {word-wrap: break-word}
          +      p:nth-child(3) {overflow-wrap: normal}
          +      p:nth-child(4) {overflow-wrap: break-word}
          +   </style>
          +</head>
          +<body>
          +   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
          +   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
          +   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
          +   <p>The quick brown foxxxxxxxxxxxxxxxxxxxxxxxx jumps over a lazy dog.</p>
          +</body>
          +
          + +
        18. + +
        + + +

        The following figure shows examples of manipulating the text properties.

        +

        Figure: Text properties (in mobile applications only)

        +

        Text properties (in mobile applications only)

        + + + + + + + + + + +
        Note
        For a complete list of CSS Text Module Level 3 text properties (in mobile or wearable applications) and their possible values, see the Property index.
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/transform_w.htm b/org.tizen.ui.practices/html/web/w3c/transform_w.htm new file mode 100644 index 0000000..4bc2dba --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/transform_w.htm @@ -0,0 +1,772 @@ + + + + + + + + + + + + + CSS Transforms: Manipulating Elements + + + + + + +
        +

        CSS Transforms: Manipulating Elements

        + +

        Transforms allow you to modify the coordinate space where each element is positioned. The elements can be translated, rotated, and scaled in 2- or 3-dimensional space. According to the API, the coordinate system is a visual formatting model, and positions and sizes in the coordinate space are expressed in pixels, starting in the origin of point with positive values proceeding to the right and down.

        + +

        To enhance the rendering performance and user experience, you can use hardware acceleration and create fade effects.

        + +

        When using the CSS transform properties, the Tizen browser requires no prefix, the Firefox browser requires the -moz- prefix, the Chrome and Safari browsers require the -webkit- prefix, and the Opera browser requires the -o- prefix.

        + +

        Transform Properties

        + +

        You can define various properties to control the elements within the coordinate space:

        + +
          +
        • transform-origin +

          This property changes the location of the transformed element. It can only be used with elements for whom the transform property has been declared.

        • + +
        • transform-style +

          This property defines the rendering of the inherited element in the 3D space. Animation property has been added in the example for easier comprehension.

        • + +
        • perspective +

          This property changes the perspective of the element being expressed. A 3D transform element must be used together with this property to emphasize the expression of the X axis.

        • + +
        • perspective-origin +

          This property defines the location facing the element.

        • +
        • backface-visibility +

          This property defines whether the backface of the transformed element is expressed.

        • +
        + +
        +<head>
        +   <style type="text/css">
        +      .box 
        +      {
        +         transform: rotate(30deg);
        +         transform-origin: 30% 30%;
        +         perspective: 220;
        +         animation: trans-ani 10s infinite linear;
        +         backface-visibility: visible;
        +
        +         /* Chrome and Safari browsers */
        +         -webkit-transform: rotate(30deg);
        +         -webkit-transform-origin: 30% 30%;
        +         -webkit-perspective: 220;
        +         -webkit-animation: trans-ani 10s infinite linear;
        +         -webkit-backface-visibility: visible;
        +      }
        +      .box.case01 
        +      {
        +         transform-style: preserve-3d;
        +         perspective-origin: 30% 30%;
        +
        +         /* Chrome and Safari browsers */
        +         -webkit-transform-style: preserve-3d;
        +         -webkit-perspective-origin: 30% 30%;
        +      }
        +   </style>
        +</head>
        +<body>
        +   <h1>transform-origin</h1>
        +   <div class="boxarea">
        +      <div class="box">
        +         <p>transform</p>
        +         <p>transform-origin: 30% 30%;</p>
        +      </div>
        +      <div class="box case01">
        +         <p>box</p>
        +      </div>
        +   </div>
        +</body>
        +
        + +

        In addition to transform properties, you can also use various 2D and 3D transform functions.

        + +

        2D and 3D Transform Functions

        + +

        The CSS Transforms API supports various transform functions in 2D and 3D.

        + +

        In 2D transforms, all transform functions are expressed based on a matrix. The X and Y values of the translate(), scale(), and skew() functions can be expressed in individual functions. For example, the X and Y values of the translate() function can be expressed with the translateX(number) and translateY(number) functions.

        + +
        +<head>
        +   <style type="text/css">
        +      .box-translate 
        +      {
        +         transform: translate(30px, 30px);
        +         -webkit-transform: translate(30px, 30px);
        +      }
        +
        +      .box-scale 
        +      {
        +         transform: scale(1.2, 1.2);
        +         -webkit-transform: scale(1.2, 1.2);
        +      }
        +
        +      .box-rotate 
        +      {
        +         transform: rotate(45deg);
        +         -webkit-transform: rotate(45deg);
        +      }
        +
        +      .box-skew 
        +      {
        +         transform: skew(20deg, 20deg);
        +         -webkit-transform: skew(20deg, 20deg);
        +      }
        +
        +      .box-matrix 
        +      {
        +         transform: matrix(0.8, 0.5, 0.9, 0.9, 0, 0);
        +         -webkit-transform: matrix(0.8, 0.5, 0.9, 0.9, 0, 0);
        +      }
        +   </style>
        +</head>
        +<body>
        +   <h1>2d transform</h1>
        +   <h2>translate</h2>
        +   <div class="boxarea">
        +      <div class="box no-transform">
        +         <p>Original</p>
        +      </div>
        +      <div class="box transformed box-translate">
        +         <p>transform</p>
        +         <p>transform: translate(30px, 30px);</p>
        +      </div>
        +   </div>
        +</body>
        +
        + +

        In 3D transforms, the Z axis has been added (for example, translateZ(number) and scale3dZ(number)). When handling 3D transforms, pay attention to the following:

        +
          +
        • If a transform function is used together with the perspective property, the z axis is emphasized.
        • +
        • The X, Y, and Z values of the translate3d(), scale3d(), and rotate3d() functions can be expressed in individual functions.
        • +
        • In the rotate3d(number, number, number, angle) function, the element rotates according to the assigned parameter (angle) with the X, Y, and Z directional vectors as the center. Each vector can be expressed as an individual function: for example, the rotateX(<angle>) and rotate3d(1, 0, 0, <angle>) functions perform the same task.
        • +
        +

        The following code snippet demonstrates how to implement a 3D transform. For a complete source code, see 3d_transform.html.

        +
        +<head>
        +   <style type="text/css">
        +      .first-transform {opacity: .5; background: #3399cc;}
        +      .transformed {opacity: .8;}
        +      /* translate3d */
        +      .box-translate3d: hover .first-transform 
        +      {
        +         transform: translate3d(-5px, -5px, -60px) rotateY(70deg);
        +         -webkit-transform: translate3d(-5px, -5px, -60px) rotateY(70deg);
        +      }
        +      .box-translate3d: hover .transformed 
        +      {
        +         transform: translate3d(15px, 15px, 60px) rotateY(70deg);
        +         -webkit-transform: translate3d(15px, 15px, 60px) rotateY(70deg);
        +      }
        +      /* scale3d */
        +      .box-scale3d: hover .first-transform 
        +      {
        +         transform: scale3d(1, 1, 1) rotateY(70deg);
        +         -webkit-transform: scale3d(1, 1, 1) rotateY(70deg);
        +      }
        +      .box-scale3d: hover .transformed 
        +      {
        +         transform: scale3d(0.6, 0.6, 2) rotateY(70deg);
        +         -webkit-transform: scale3d(0.6, 0.6, 2) rotateY(70deg);
        +      }
        +      /* rotate3d */
        +      .box-rotate3d: hover .first-transform 
        +      {
        +         transform: rotate3d(-1, -1, -1, 110deg);
        +         -webkit-transform: rotate3d(-1, -1, -1, 110deg);
        +      }
        +      .box-rotate3d: hover .transformed 
        +      {
        +         transform: rotate3d(1, 1, 1, 110deg);
        +         -webkit-transform: rotate3d(1, 1, 1, 110deg);
        +      }
        +      /* matrix3d */
        +      .box-matrix3d: hover .first-transform 
        +      {
        +         transform: matrix3d(0.3, 0.2, -0.9, 0, 0.2, 0.8, 0.2, 0, 0.6, 0, 0.4, 0, 0, 0, 0, 1);
        +         -webkit-transform: matrix3d(0.3, 0.2, -0.9, 0, 0.2, 0.8, 0.2, 0, 0.6, 0, 0.4, 0, 0, 0, 0, 1);
        +      }
        +      .box-matrix3d: hover .transformed 
        +      {
        +         transform: matrix3d(0.4, -0.5, 0.8, 0, 0.2, 0.8, 0.2, 0, -0.6, 0, 0.4, 0, 0, 0, 0, 1);
        +         -webkit-transform: matrix3d(0.4, -0.5, 0.8, 0, 0.2, 0.8, 0.2, 0, -0.6, 0, 0.4, 0, 0, 0, 0, 1);
        +      }
        +   </style>
        +</head>
        +<body>
        +   <h1>3D transform</h1>
        +   <h2></h2>
        +   <p><strong>First box value:</strong> transform: translate3d(-5px, -5px, -60px) rotateY(70deg);</p>
        +   <p><strong>Second box value:</strong> transform: translate3d(15px, 15px, 60px) rotateY(70deg);</p>
        +   <div class="boxarea box-translate3d">
        +      <div class="box first-transform">
        +         First box
        +      </div>
        +      <div class="box transformed">
        +         <p>Second Box</p>
        +         Mouse over or tab here to animate
        +      </div>
        +   </div>
        +</body>
        +
        + + +

        Creating an Animation with Transforms

        + +

        To enhance the user experience of your application, you must learn to use transforms with animations. This example uses the animation from the Creating a Logo Animation use case as a basis, and adds a more diverse visual effect to it with the transform property. In the modified animation:

        + +
          +
        • As in the original animation, no elements are initially shown on the screen.
        • +
        • The Tizen logo gradually appears in the middle of the screen, and as it moves to the right, it becomes smaller. With the transform property, the logo is made to rotate.
        • +
        • Each letter in the word "TIZEN" consecutively comes in from the left of the screen and moves to the right to its correct location. With the transform property, the letters are translated in the 3D space and rotated around the Y axis.
        • +
        + +

        Figure: Tizen logo to be transformed

        +

        Tizen logo to be transformed

        + + +
          +
        1. Create the HTML layout to control the movement of each individual animation element: +
          +<div class="animation-holder">
          +   <span class="tizen-txt t"></span>
          +   <span class="tizen-txt i"></span>
          +   <span class="tizen-txt z"></span>
          +   <span class="tizen-txt e"></span>
          +   <span class="tizen-txt n"></span>
          +   <span class="tizen-txt tm"></span>
          +   <span class="tizen-logo"></span>
          +</div>
          +
          +
        2. +
        3. Define the basic style of the animation elements. Add the perspective property to increase the Z axis effect of the 3D transform. +
          +.animation-holder 
          +{
          +   -webkit-perspective: 1000px;
          +   height: 88px;
          +   left: 50%;
          +   margin: -54px 0px 0px -140px;
          +   position: absolute;
          +   top: 50%;
          +   width: 280px;
          +}
          +.tizen-txt,
          +.tizen-logo 
          +{
          +   background-position: 50% 50%;
          +   background-repeat: no-repeat;
          +   display: block;
          +   position: absolute;
          +}
          +.tizen-txt.t 
          +{
          +   background-image: url("images/txt_t.png");
          +   height: 56px;
          +   left: 0px;
          +   top: 31px;
          +   width: 48px;
          +}
          +
          +
        4. +
        5. Create the animation: +
            +
          1. +

            Assign keyframes for the logo element to transform it. In order to rotate the logo, use the -webkit-transform: rotate() function, which defines the angle of the rotation. +

            +
            +@-webkit-keyframes tizen-logo 
            +{
            +   0% 
            +   {
            +      -webkit-animation-timing-function: ease-in;
            +      height: 211px;
            +      left: 30px;
            +      opacity: 0;
            +      top: -61px;
            +      -webkit-transform: rotate(0deg);
            +      width: 220px;
            +   }
            +   30% 
            +   {
            +      -webkit-animation-timing-function: ease-out;
            +      height: 211px;
            +      left: 30px;
            +      opacity: 1;
            +      top: -61px;
            +      -webkit-transform: rotate(720deg);
            +      width: 220px;
            +   }
            +   50% 
            +   {
            +      height: 32px;
            +      left: 247px;
            +      opacity: 1;
            +      top: 0;
            +      -webkit-transform: rotate(1440deg);
            +      width: 33px;
            +   }
            +   100% 
            +   {
            +      height: 32px;
            +      left: 247px;
            +      opacity: 1;
            +      top: 0;
            +      -webkit-transform: rotate(1440deg);
            +      width: 33px;
            +   }
            +}
            +
            + + + + + + + + + +
            Note
            For a rotation, the image has to be carefully created to ensure the correct end result. The rotation occurs with the center of the element as the center. If the rotation center must be moved because the image center is not aligned, use the transform-origin property to adjust the rotation location.
          2. +
          3. Create the keyframes for the first letter in the word "TIZEN". In the animation, due to the translate3d() and rotateY() methods, each letter transforms slightly from the right to the left as it comes in. + +

            Animation

            + +
            +@-webkit-keyframes tizen-txt-t 
            +{
            +   0% 
            +   {
            +      opacity: 0;
            +      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
            +   }
            +   30% 
            +   {
            +      opacity: 0;
            +      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
            +   }
            +   35% 
            +   {
            +      opacity: 1;
            +      -webkit-transform: translate3d(0, 0, 0) rotateY(0deg);
            +   }
            +   100% {}
            +}
            +
          4. +
          5. To emphasize the fact that the letters are being created on the right, change the location of the transform. If the transform-origin property is declared for the entire animation element, the logo rotation changes. Consequently, you must only declared it for the letters. +
            +.tizen-txt 
            +{
            +   -webkit-transform-origin: 100% 50%;
            +}
            +
          6. + +
          7. Create the keyframes for the other letters similarly:

            +
            +@-webkit-keyframes tizen-txt-i 
            +{
            +   0% 
            +   {
            +      opacity: 0;
            +      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
            +   }
            +   32% 
            +   {
            +      opacity: 0;
            +      -webkit-transform: translate3d(20px, 0, -200px) rotateY(90deg);
            +   }
            +   37% 
            +   {
            +      opacity: 1;
            +      -webkit-transform: translateX(0) rotateY(0deg);
            +   }
            +    100% {}
            +}
            +
          + +
        6. +
        + +

        The following figure shows the full Tizen logo animation with the transform properties.

        +

        Figure: Full Tizen logo animation

        +

        Full Tizen logo animation

        + +

        Source Code

        +

        For the complete source code related to this use case, see the following files:

        + + +

        Creating Fade Animation Effects

        + + +

        To enhance the user experience of your application, you must learn to use fade animation effects.

        +

        The modal layer pop-up can be used to, for example, show enlarged thumbnail images or notice messages. The modal layer pop-up has the following basic properties:

        +
          +
        • If an event is fired, it gradually becomes visible. This is known as the Fade In effect.
        • +
        • The existing background is covered with a translucent layer to make the user focus on the pop-up.
        • +
        • When the pop-up is closed, it gradually becomes transparent. This is known as the Fade Out effect.
        • +
        + +

        Figure: Fade effect

        +

        Fade effect

        + +

        You can control UI events and change the DOM elements in the following ways:

        +
          +
        • Events can be controlled with JavaScript, and DOM elements can be devised with CSS.
        • +
        • You can use JavaScript frameworks, such as jQuery, Prototype, and Dojo.
        • +
        + +

        To create fade effects:

        + +
          +
        • Create a modal layer pop-up using jQuery: + +
          +(function($) 
          +{
          +   function showModalPopup(url) 
          +   {
          +      $('body').append('<div class="mask"></div>'); /* Mask in body appended */
          +      $('.mask').css({'height': $(window).height()}); /* Mask area set */
          +
          +      /* Target layer position set */
          +      $(url).css(
          +      {
          +         'top': ($(window).height()/2 + $(document).scrollTop() - $(url).height()/2) + 'px', 
          +         'left': ($(window).width()/2 + $(document).scrollLeft() - $(url).width()/2) + 'px'
          +      });
          +
          +      /* Fade effect */
          +      $('.mask').fadeTo('slow', 0.7);
          +      $(url).fadeTo('slow', 1);
          +   };
          +
          +   $('.layerpopupActive a').on('click', function()
          +   {
          +      var targetUrl = $(this).attr('href');
          +
          +      showModalPopup(targetUrl);
          +
          +      return false;
          +   });
          +  
          +   /* End processing - Fade Out effect */
          +    
          +   $('body').on('click', function(e) 
          +   {
          +      if (e.target.className === 'mask') 
          +      {
          +         $('.layerpop').fadeOut();
          +         $('.mask').fadeOut(400, function() 
          +         {
          +            $('.mask').remove();
          +         });
          +      };
          +   });
          +})(jQuery);
          + +

          If the animation effect is created by using JavaScript, the browser executes the following tasks:

          +
            +
          1. A structure layer is created and added to the document. This is a CPU task.
          2. +
          3. The added layer is painted as a default value. This is a GPU task.
          4. +
          5. The layer is painted once again according to the change of value. This is a CPU operation.
          6. +
          + +

          Steps a and c incur CPU tasks, which affect performance the most.

          +

          In case of step a, only 2 layers are created, but as the number of layers created increases, the efficiency of page rendering work drops. In case of step c as well, the more steps it undergoes, the slower the rendering becomes.

          +

          In certain browsers, even if the style of just 1 layer is changed, the entire document is repainted. As the repainting takes only a moment, any animation effects that are supposed to happen cannot be executed in such a short time. This issue occurs frequently in Android™ with severe fragmentation.

          + + + + + + + + + + +
          Note
          If a new layer is created in Android 4.0X version, and if the fade effect is used, it only shows the initial value and the result value of the layer style.
          + +

          To avoid such a situation to the maximum possible extent, CPU tasks must be reduced to the minimum, and it is better to use transition or animation that uses the internal timer of the browser.

          + + + + + + + + + + +
          Note
          In case of using 3D effects, -webkit-transform: translateZ(0); can be used to accelerate the hardware. However, since hardware acceleration support varies between the OS and devices, the actual resulting effects can vary too. Moreover, in the case of version Android™ 2.1, iOS™3.X and below, note that transition and animation may not be realized.
          +
        • +
        • Create a modal layer pop-up using CSS3: +
          +<!--CSS-->
          +.mask 
          +{
          +   opacity: 0;
          +   z-index: -1;
          +   -webkit-transition: all 400ms ease-in-out;
          +}
          +
          +.mask.active 
          +{
          +   opacity: .7;
          +   z-index: 498;
          +}
          +
          +<!--Layer pop-up public styles-->
          +.layerpop 
          +{
          +   opacity: 0;
          +   z-index: -1;
          +   -webkit-transition: all 300ms ease-in-out;
          +}
          +
          +.layerpop.active 
          +{
          +   opacity: 1;
          +   z-index: 499;
          +}
          +/* JavaScript */
          +function showModalPopup(url) 
          +{
          +   url.className += 'active';
          +}
          +
        • +
        +

        Performance Differences

        + +

        There can be a difference in performance depending on how the modal layer pop-up is used.

        +

        The following figures illustrate the difference in event performance, when using JavaScript and CSS3.

        +

        Figure: Event performance using JavaScript

        +

        Events using JavaScript

        + +

        Figure: Event performance using CSS3

        +

        Events using CSS3

        + +

        The following figures illustrate the difference in memory performance, when using JavaScript and CSS3.

        +

        Figure: Memory performance using JavaScript

        +

        Memory when using JavaScript

        + +

        Figure: Memory performance using CSS3

        +

        Memory when using CSS3

        + +

        When the styles are applied using JavaScript, the UI thread is used to create the pop-up. The UI thread increases the usage of CPU memory in proportion to the number of pop-ups used.

        + + + + + + + + + + +
        Note
        Tizen provides remote debugging through the JavaScript Debugger tool.
        + + + + + + + + + + +
        Note

        If CSS is used, the handling of JavaScript events and UI DOM operations becomes unnecessary, so the load of the UI thread decreases, and the usage of CPU memory decreases as well. However, CSS3 transitions cannot be applied to versions below Android™ 2.3 and for versions above iOS™ 4.3, which are still widely used, so attention is needed when distributing it to various devices.

        + +

        Using Hardware Acceleration

        + +

        The rendering performance of a Web application depends on both the Tizen platform and application design.

        +

        In hardware acceleration, GPU is used to perform a function faster than is possible if the application is running on the CPU. It enhances the rendering performance in the dynamic objects used in Web applications.

        + +

        Using CSS Transition and 3D Transform

        +

        To improve the rendering performance, separate moving elements to independent layers as much as possible. You can use CSS transition with the -webkit-transition CSS attribute, or 3D transform with the -webkit-transform attribute. For the best performance, set the -webkit-transform attribute to the 3D type.

        +

        In all the following examples, a blue box moves from top left to bottom right for a second.

        +

        Figure: Blue box

        +

        Blue box

        + +
          +
        • Use CPU painting: +

          JavaScript performs CPU painting for a moving element for each frame at 16 ms interval using the setTimeout() method over the changing top-left coordinate. This approach does not use hardware acceleration, but only running on the CPU.

          +
            +
          1. Construct the blue box and set its position on the screen: +
            <!DOCTYPE html>
            +<html xmlns="http://www.w3.org/1999/xhtml">
            +   <head>
            +      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            +      <title>JavaScript transition sample</title>
            +      <style>
            +         #box 
            +         {
            +            position: absolute;
            +            width: 100px;
            +            height: 100px;
            +            background-color: blue;
            +            left: 0px;
            +            top: 50px;
            +         }
            +      </style>
            +
          2. +
          3. +

            Perform CPU painting for a moving element at a rate of 1 frame per 16 ms (62.5 frames per second) using the setTimeout() method:

            +
                  <script>
            +         var delta = 0;
            +         function startTransition() 
            +         {
            +            process();
            +         }
            +         function process ()
            +         {
            +            document.getElementById('box').style.left = delta + "px";
            +            document.getElementById('box').style.top = delta + 50 + "px";
            +            delta += 4;
            +            if (delta <= 200)
            +               setTimeout(function() {process();}, 16);
            +         }
            +      </script>
            +   </head>
            +   <body>
            +      <div id='box' onclick='startTransition()'>click me!</div>
            +   </body>
            +</html>
        • +
        • Use CSS transition: +

          Separate a moving element to an independent layer with the -webkit-transition CSS attribute. This approach uses hardware acceleration, and can enhance performance while an element is moving.

          +
          <!DOCTYPE html>
          +<html xmlns="http://www.w3.org/1999/xhtml">
          +   <head>
          +      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          +      <title>-webkit-transition sample</title>
          +      <style>
          +         #box 
          +         {
          +            position: absolute;
          +            width: 100px;
          +            height: 100px;
          +            left: 0px;
          +            top: 50px;
          +            background-color: blue;
          +            -webkit-transition-duration: 1s;
          +            -webkit-transition-timing-function: linear;
          +         }
          +      </style>
          +      <script>
          +         function startTransition()
          +         {
          +            document.getElementById('box').style.webkitTransform = "translate(200px, 200px)";
          +         }
          +      </script>
          +   </head>
          +   <body>
          +      <div id='box' onclick='startTransition()'>click me!</div>
          +   </body>
          +</html>
          +
        • +
        • Use 3D transform: +

          Use the -webkit-transform: translate3d 3D transform attribute. The element is separated to an independent layer and uses hardware acceleration irrespective of its movement:

          +
          <!DOCTYPE html>
          +<html xmlns="http://www.w3.org/1999/xhtml">
          +   <head>
          +      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          +      <title>-webkit-transition with translate3d sample</title>
          +      <style>
          +         #box 
          +         {
          +            position: absolute;
          +            width: 100px;
          +            height: 100px;
          +            left: 0px;
          +            top: 50px;
          +            background-color: blue;
          +            -webkit-transform: translate3d(0, 0, 0);
          +            -webkit-transition-duration: 1s;
          +            -webkit-transition-timing-function: linear;
          +         }
          +      </style>
          +      <script>
          +         function startTransition() 
          +         {
          +            document.getElementById('box').style.webkitTransform = "translate3d(200px, 200px, 0px)";
          +         }
          +      </script>
          +   </head>
          +   <body>
          +      <div id='box' onclick='startTransition()'>click me!<p></div>
          +   </body>
          +</html>
          +
        • +
        +

        Using Accelerated Overflow Scroll

        +

        If a page has an overflow scroll, use the -webkit-overflow-scrolling attribute. It separates overflow scroll to an independent layer and enhances rendering performance:

        +
        #scroll_area 
        +{
        +   overflow: scroll;
        +   -webkit-overflow-scrolling: touch;
        +}
        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/transition_w.htm b/org.tizen.ui.practices/html/web/w3c/transition_w.htm new file mode 100644 index 0000000..a8de2d7 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/transition_w.htm @@ -0,0 +1,382 @@ + + + + + + + + + + + + + CSS Transitions Module (Level 3): Changing Element Styles + + + + + + +
        +

        CSS Transitions Module (Level 3): Changing Element Styles

        + +

        Transitions allow you to enable implicit transitions, which describe how the CSS properties can be made to change smoothly from one value to another over a given duration. To enhance the rendering performance, you can use hardware acceleration.

        + +

        When using the CSS transition properties, the Tizen browser requires the -webkit- prefix.

        + +

        Transition Properties

        + +

        You can define various properties to control the element transitions:

        + +
          +
        • transition-property +

          This property defines the element property that is changed during the transition. In the following code snippet, both the width and height of the element change when the mouse hovers over it, but the transition effect is applied to the width property only.

        • + +
        • transition-duration +

          This property defines the duration of the transition. You must define as many instances of the property as you have elements in the transition-property property.

        • + +
        • transition-timing-function +

          This property defines the pace of the transition. The value of the property is defined as a stepping function or a cubic Bézier curve. The ease stepping function equals cubic-bezier(0.25, 0.1, 0.25, 1), and the linear stepping function equals cubic-bezier(0, 0, 1, 1).

        • + +
        • transition-delay +

          This property defines the delay time before the start of the transition.

        • + +
        + +

        The following code snippet demonstrates how to use transition properties. For a complete source code, see transition_property.html.

        + +
        +<head>
        +   <style type="text/css">
        +      body{font-size: 12px}
        +
        +      .box 
        +      {
        +         -webkit-transition-property: width;
        +         -webkit-transition-duration: 2s;
        +         -webkit-transition-timing-function: ease;
        +         -webkit-transition-delay: 0.5s;
        +      }
        +
        +      .box: hover 
        +      {
        +         width: 300px;
        +         height: 200px;
        +         background: CornflowerBlue;
        +      }
        +   </style>
        +</head>
        +<body>
        +   <h1>CSS transitions tutorial</h1>
        +   <div class="box">
        +      <p>Mouse over or tap here to animate</p>
        +      <p>transition-property: width, height, background</p>
        +   </div>
        +</body>
        +
        + + + + + + + + + +
        Note
        The hover pseudo class in Tizen maintains a mouseover state when an element is tapped, and becomes a mouseout state when another element is tapped.
        + +

        The transition property allows you to define all the transition properties in a shorthand mode in the order of transition-property | transition-duration | transition-timing-function | transition-delay. If you omit a property value, a default value is used instead.

        + +
        +<style type="text/css">
        +   .box 
        +   {
        +      -webkit-transition: width 1s ease 1s;
        +   }
        +</style>
        +
        + +

        The transition property connects movement more naturally than the more generally used the pseudo classes, such as :hover or :active. The smooth effect can be achieved more conveniently and easily with the transition property than with JavaScript or Flash, and the transition property also supports the browser side to provide excellent performance.

        + + +

        Modifying Element Properties

        + +

        To enhance the user experience of your application, you must learn to use transitions to change element property values naturally. This example uses a partial section of the http://tizen.org Web site, where the current "UPCOMING EVENTS" area only has the text-decoration: underline property in a mouseover state (the text gets underlined when the mouse hovers over it). To improve the effects, the example adds various transitions properties in this area.

        + + +

        Figure: Tizen site section to be transitioned

        +

        Tizen site section to be transitioned

        + + +
        1. Add a background color change to the "UPCOMING EVENTS" area during a mouseover state:

          + +
          1. Originally, the area on the site is defined as follows:

            + +
            +<h2 class="block-title">Upcoming Events</h2>
            +
            + + +

            Additionally, a transition property is declared in the block-title class:

            + +
            +.block-title 
            +{
            +   -webkit-transition: all 2s ease;
            +}
            +
            +

            The all value in the transition property means that the transition effect applies to all CSS properties of the element.

            +
          2. + +
          3. Define the mouseover state for the block-title class: + +
            +.block-title: hover {background: #eaeaea;}
            +
            + +

            Due to the CSS characteristics, adding a class through an event allows immediate rendering in the screen.

          + +

          When the mouse is moved over the "UPCOMING EVENTS" area, the background color changes.

          + +

          Background color change

        2. + +
        3. + +

          Apply the transition effect in other elements:

          + +
          1. To avoid unnecessary repetition, tie a list of transition elements together into groups a and span: + +
            +.location, .date, .location .anibg, h3 > a, .day > span 
            +{
            +   -webkit-transition: all 1s ease;
            +}
            +
          2. + +
          3. When the mouse hovers over the date element, change the background of the date and the font size of all the elements tied into the span group. When the mouse hovers over the title element, change the color of all elements tied into the a group.

            +
            +.date: hover {background: #d2ecff !important;}
            +.date: hover .day > span {font-size: 1.9em;}
            +
            +.event-info: hover h3 > a {color: #ec4986;}
            +
          + +

          Before mouseover +

        4. +
        5. + +

          Emphasize the location phrase by adding an empty element. The emphasis is made by filling the background with black from left to right, and changing the font color to an appropriate value for the black background.

          +
            +
          1. Add the empty element:

            + +
            +<div class="location">San Francisco, CA<span class="anibg"></span></div>
            +
          2. +
          3. Create the effect using the width value of the added element:

            +
            +.location {position: relative; z-index: 3; margin-top: 3px;}
            +.location .anibg 
            +{
            +   position: absolute; 
            +   left: -3px; top: 0; 
            +   display: block; 
            +   width: 0; height: 100%; 
            +   background: #000; 
            +   z-index: -1;
            +}
            +
            + +

            The effect is defined by using the position property. The location element position is declared relative, while the anibg child element position is declared as absolute. The width of the child element basic state is set as 0. Since the child element layer covers the location text, the child element has been defined to come out from the back of the text in the z-index value of the child.

          4. +
          5. Define the state to be changed:

            +
            +.location, .date, .location .anibg, h3 > a, .day > span 
            +{
            +   -webkit-transition: all 1s ease;
            +}
            +
            +.event-info: hover .location {color: #fff;}
            +.event-info: hover .location .anibg {width: 100%; color: #fff;}
            +
            + +

            The transition takes place when the property in question is at the front on the screen. The event-info class is used as the subject for the change, and it has been defined so that the transition occurs simultaneously in the .location and .anibg elements when the mouse hovers over any of the elements tied together as group a. +

          6. + +

          Location phrase emphasis

          +
        +

        Source Code

        +

        For the complete source code related to this use case, see the following file:

        + + +

        Using Hardware Acceleration

        + +

        The rendering performance of a Web application depends on both the Tizen platform and application design.

        +

        In hardware acceleration, GPU is used to perform a function faster than is possible if the application is running on the CPU. It enhances the rendering performance in the dynamic objects used in Web applications.

        + +

        Using CSS Transition and 3D Transform

        +

        To improve the rendering performance, separate moving elements to independent layers as much as possible. You can use CSS transition with the -webkit-transition CSS attribute, or 3D transform with the -webkit-transform attribute. For the best performance, set the -webkit-transform attribute to the 3D type.

        +

        In all the following examples, a blue box moves from top left to bottom right for a second.

        +

        Figure: Blue box

        +

        Blue box

        + +
          +
        • Use CPU painting: +

          JavaScript performs CPU painting for a moving element for each frame at 16 ms interval using the setTimeout() method over the changing top-left coordinate. This approach does not use hardware acceleration, but only running on the CPU.

          +
            +
          1. Construct the blue box and set its position on the screen: +
            <!DOCTYPE html>
            +<html xmlns="http://www.w3.org/1999/xhtml">
            +   <head>
            +      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            +      <title>JavaScript transition sample</title>
            +      <style>
            +         #box 
            +         {
            +            position: absolute;
            +            width: 100px;
            +            height: 100px;
            +            background-color: blue;
            +            left: 0px;
            +            top: 50px;
            +         }
            +      </style>
            +
          2. +
          3. +

            Perform CPU painting for a moving element at a rate of 1 frame per 16 ms (62.5 frames per second) using the setTimeout() method:

            +
                  <script>
            +         var delta = 0;
            +         function startTransition() 
            +         {
            +            process();
            +         }
            +         function process ()
            +         {
            +            document.getElementById('box').style.left = delta + "px";
            +            document.getElementById('box').style.top = delta + 50 + "px";
            +            delta += 4;
            +            if (delta <= 200)
            +               setTimeout(function() {process();}, 16);
            +         }
            +      </script>
            +   </head>
            +   <body>
            +      <div id='box' onclick='startTransition()'>click me!</div>
            +   </body>
            +</html>
        • +
        • Use CSS transition: +

          Separate a moving element to an independent layer with the -webkit-transition CSS attribute. This approach uses hardware acceleration, and can enhance performance while an element is moving.

          +
          <!DOCTYPE html>
          +<html xmlns="http://www.w3.org/1999/xhtml">
          +   <head>
          +      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          +      <title>-webkit-transition sample</title>
          +      <style>
          +         #box 
          +         {
          +            position: absolute;
          +            width: 100px;
          +            height: 100px;
          +            left: 0px;
          +            top: 50px;
          +            background-color: blue;
          +            -webkit-transition-duration: 1s;
          +            -webkit-transition-timing-function: linear;
          +         }
          +      </style>
          +      <script>
          +         function startTransition()
          +         {
          +            document.getElementById('box').style.webkitTransform = "translate(200px, 200px)";
          +         }
          +      </script>
          +   </head>
          +   <body>
          +      <div id='box' onclick='startTransition()'>click me!</div>
          +   </body>
          +</html>
          +
        • +
        • Use 3D transform: +

          Use the -webkit-transform: translate3d 3D transform attribute. The element is separated to an independent layer and uses hardware acceleration irrespective of its movement:

          +
          <!DOCTYPE html>
          +<html xmlns="http://www.w3.org/1999/xhtml">
          +   <head>
          +      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          +      <title>-webkit-transition with translate3d sample</title>
          +      <style>
          +         #box 
          +         {
          +            position: absolute;
          +            width: 100px;
          +            height: 100px;
          +            left: 0px;
          +            top: 50px;
          +            background-color: blue;
          +            -webkit-transform: translate3d(0, 0, 0);
          +            -webkit-transition-duration: 1s;
          +            -webkit-transition-timing-function: linear;
          +         }
          +      </style>
          +      <script>
          +         function startTransition() 
          +         {
          +            document.getElementById('box').style.webkitTransform = "translate3d(200px, 200px, 0px)";
          +         }
          +      </script>
          +   </head>
          +   <body>
          +      <div id='box' onclick='startTransition()'>click me!<p></div>
          +   </body>
          +</html>
          +
        • +
        +

        Using Accelerated Overflow Scroll

        +

        If a page has an overflow scroll, use the -webkit-overflow-scrolling attribute. It separates overflow scroll to an independent layer and enhances rendering performance:

        +
        #scroll_area 
        +{
        +   overflow: scroll;
        +   -webkit-overflow-scrolling: touch;
        +}
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/ui_layout_ww.htm b/org.tizen.ui.practices/html/web/w3c/ui_layout_ww.htm new file mode 100644 index 0000000..7c1e098 --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/ui_layout_ww.htm @@ -0,0 +1,706 @@ + + + + + + + + + + + + + Multiple UI Layouts: Designing Applications for Multiple Devices + + + + + +
        +

        Multiple UI Layouts: Designing Applications for Multiple Devices

        + +

        To ensure the largest possible market for your application, you have to design your application layout so that your application can run on multiple Tizen devices.

        + +

        This feature is supported in wearable applications only.

        + +

        Although the Web was originally designed to structure documents for large-scaled Internet world, with CSS (Cascading Style Sheet), JavaScript, and various device APIs, it is quickly evolving to a complete runtime environment for applications. In addition, its W3C open development model and the flexibility of its CSS-based presentation make it every developer's choice as the next development platform. CSS is the key technology for flexible presentation, and it is used to describe the look and formatting of HTML documents. The role of CSS is to determine how the logical structure of the document is displayed to the user.

        + +

        The Tizen Web engine provides the basic mechanisms for fitting the application content to the target screen. However, to ensure that the application runs well on multiple devices, you must understand those mechanisms in detail. In general, select a relative layout rather than a fixed layout, because a relative layout helps to maintain usability even when the application runs on unexpected devices. To enhance usability even further, use different layouts for each device category.

        + +

        Using some CSS techniques and Tizen Web engine mechanisms, you can design your application UI layout so that it displays properly on multiple devices:

        +
        • You can use a single layout and take advantage of the auto-fitting mechanism of the Tizen Web engine to ensure that a single layout covers multiple devices.
        • +
        • You can use multiple layouts to define a separate optimal layout for each device category.
        + +

        Single Layout for Multiple Devices

        +

        A typical application developer designs an optimized UI for a target device with a fixed layout and high-quality resources. This approach usually results in a nice look for the end user, but can sometimes result in an ugly layout, which makes the application unusable. And this unfortunate result can occur merely due to a change in the device form factor.

        +

        Since the presentation and business logic are strictly separated in a Web application, it handles the device form factor change better than native applications. One single layout, taking advantage of Web technology, can ensure usability even on multiple devices with different form factors.

        + +

        To design applications with a single layout, you must consider the following issues:

        + + + +

        For a complete application layout that considers all the above issues, see Single Layout Example.

        + +

        Viewport and Other Meta Tags

        + +

        The viewport is a screen area that the Web engine displays in the UI and, in the Web world, the viewport meta tag is used to inform the Web engine that this content is written for a specific form factor, such as device width. The viewport meta tag was introduced by Apple to fill the screen resolution gap between initial Smartphone (for example, 320 px) and PC (for example, 980 px). Basically, the viewport meta tag helps the Web engine to determine the scale factor for the content on the current device.

        + +

        To use the tag in an HTML file, set its name and content:

        +
        +<meta name="viewport" content="XXX">
        +
        + +

        As shown in the following code snippet, use the viewport meta tag to tell the Web engine which device width is targeted by the application. The Web engine can estimate the scale factor based on the target content size and the real screen width. For example, usually almost all wearable applications have the following viewport meta tag, which sets the viewport width to the appropriate size based on each device:

        +
        +<meta name="viewport" content="width=device-width, user-scalable=no">
        +
        + +

        If you want to set your content layout to the target width of 320 px on every wearable device, use the following meta tag:

        +
        +<meta name="viewport" content="width=320">
        +
        + +

        The viewport meta tag has other properties, such as height, initial-scale, minimum-scale, maximum-scale, and user-scalable. However, do not use those properties unless you understand their exact meaning. Wrong values can cause the Web engine to incorrectly fit the application content to the current device.

        + +

        Relative Layout

        + +

        The relative layout concept means that the element size of all content is set as a relative unit (such as percentage), and not as absolute values (such as pixels or points). In responsive Web design, this concept is also known as fluid grid (for more information, search for responsive web design in your Web browser). To achieve a layout that works on multiple devices, you only need to know about relative layout, not all the other concepts of responsive Web design.

        +

        To implementing a relative layout, you only have to set the width and height of each element as a percentage, as shown in the following example and figure. In the example, the width and height of the number_pad element is set to 100% and 70%, not 320 px and 224 px.

        + +

        Figure: 320x320 calculator

        +

        number_pad {width: 100%; height: 70%;}

        +

        320x320 calculator

        + +

        An application with this relative layout is auto-fitted when it runs on an unexpected device, such as the device with a 360x480 resolution shown in the following figure. Even though this adjusted layout may not be as good as the original, it is good enough, since it shows a usable application UI.

        + + +

        Figure: 360x480 calculator with a relative layout

        +

        360x480 calculator with a relative layout

        + +

        The following figure shows what happens if you use an absolute 320x320 layout. The presentation is definitely ugly (with an empty white space at the bottom) and usability reduced, although the calculation logic itself still works.

        +

        Figure: 360x480 calculator with an absolute 320x320 layout

        +

        number_pad {width: 320px; height: 224px;}

        + + +

        360x480 calculator with an absolute 320x320 layout

        + + + +

        While the content layout itself becomes the application UI layout on a Web page, a typical wearable application layout consists of a header area, content area, and footer area. With this trend, many wearable Web applications are designed by separating the 3 areas explicitly.

        +

        Figure: Typical wearable Web application layout

        +

        Typical wearable Web application layout

        + +

        Not setting the place of the header and footer areas clearly can easily cause problems for your layout. In case of the header, the side-effect is relatively small. However, a wrongly defined footer area can be quite visible and lead to poor usability. The following figure shows the original layout of a pedometer application that consists of a header, content, and footer, with a Stop button set in the footer area.

        +

        Figure: 320x320 sample Web application

        +

        320x320 sample Web application

        + +

        In this case, if the position of the footer is not defined explicitly or if the position and bottom properties do not have proper values, an ugly layout can be displayed on an unexpected device, such as the 360x480 screen shown in the following figure.

        +

        Figure: Layout on 360x480

        +

        Layout on 360x480

        + +

        To make the layout correct, define the position property as fixed and set the bottom property explicitly as 0 px:

        + +
        +.footer {position: fixed; bottom: 0px;}
        +
        + +

        The following figure shows the same Web application running on the unexpected device after the footer properties are defined properly. With the correct values, the Web application is usable even on a new target, not planned during the development phase. Note that if a relative layout is also applied to the content area, the result is an even better layout and further improved usability.

        +

        Figure: Usable layout on 360x480

        +

        Usable layout on 360x480

        + +

        Flexible Media

        + +

        One of key elements used in the content area is a media element, including image and video. As all other elements, the media elements also must be placed within a relative layout to allow the application flexibly handle resolution changes. When such relative sizing is applied to a media element, it is called flexible media in responsive Web design.

        +

        The main issue when making a media element size relative is to ensure that the usable ratio does not change. The following figure shows a video element that works on both 320x320 and 360x480 resolutions, even though the aspect ratio of the screen is changed and scaled up. Basically, when handling media elements, you want to keep the size or ratio of the element the same as in the initially targeted device, even when displayed using a different resolution and aspect ratio. To achieve this, set the width and height properties of the media element with percentage and the auto keyword.

        + +

        Figure: Flexible media on 320x320 and 360x480

        +

        .video iframe {width: 100%; height: auto;}

        +

        Flexible media on 320x320 and 360x480

        + + +

        The following figure shows an example of wrong usage, where usability decreases as the video element is simply scaled up based on the aspect ratio change. If you set the video element size using a fixed size like this, you get no benefit from the increased resolution, and the layout on the whole screen becomes inharmonious, decreasing usability.

        + + +

        Figure: Fixed size media element

        +

        .video iframe {width: 320px; height: 240px;}

        +

        Fixed size media element

        + +

        Single Layout Example

        + +

        This section illustrates a complete application layout that takes advantage of the issues discussed in previous sections. In particular, it shows how to set the viewport properly to help the Web engine scaling mechanism and how to create a CSS-based layout.

        + + +

        First of all, set the targeted size of the content area as 320 px in the viewport meta tag, and disable the user-scalable property, as shown in the following code snippet.

        + +
        +<html>
        +   <head>
        +      <link href="css/style.css" rel="stylesheet" type="text/css">                                             
        +      <meta name="viewport" content="width=320px, user-scalable=no" />                                                 
        +   </head>                                                                                                           
        +   <body>
        +      <main>
        +         <div class="tile left">
        +            <div id="box1" class="box"></div>
        +         </div>            
        +         <div class="tile right">
        +            <div id="box2" class="box"></div>
        +         </div> 
        +         <div class="tile left">
        +            <div id="box3" class="box"></div>                                                                       
        +         </div>
        +         <div class="tile right">
        +            <div id="box4" class="box"></div>                                                                       
        +         </div> 
        +      </main>
        +   </body> 
        +</html>
        +
        + +

        In the above HTML code, the content area consists of 4 <div> box elements, and their UI layout is described in the style.css file. The following CSS code programs the layout and the specific box element styles that were defined in the HTML file.

        +

        The code snippet shows that the content size is set to be same as the viewport size. Each box is filled with a different color and placed so that it fills a quarter of the content area. Because each box size is defined with the width and height of 100%, the relative size of each box element remains the same even if the viewport size changes.

        + +
        +<!--Default, used for all-->
        +* {box-sizing: border-box;}
        +body, div, h1 {margin: 0px; padding: 0px;}
        +html, body {width: 100%; height: 100%; overflow-x: hidden;}
        +
        +#box1 {background-color: rgb(255, 255, 141);}
        +#box2 {background-color: rgb(165, 241, 238);}
        +#box3 {background-color: rgb(248, 179, 179);}
        +#box4 {background-color: rgb(192, 161, 246);}
        +.tile 
        +{
        +   width: 50%;
        +   height: 50%;
        +   float: left;
        +}
        +.left {padding: 10px 5px 5px 10px;}
        +.right {padding: 10px 10px 5px 5px;}
        +
        +.box 
        +{
        +   width: 100%;
        +   height: 100%;
        +}
        +
        + + +

        The following figure shows a final view when the 320 px is set as a target device in the HTML file. As defined in the CSS file, the content area fills the whole screen, 320x320 pixels, and the 4 box elements equally divide the area.

        + +

        Figure: Original layout on a target device

        +

        Original layout on a target device

        +

        The following figure shows that the relative layout and scaling are correctly applied even when the same application is run on a mobile device with the aspect ratio of 16:9.

        +

        Figure: Scaled layout on a 16:9 mobile device

        +

        Scaled layout on a 16:9 mobile device

        +

        The following code snippet shows an example where the background color is replaced with an image while the layout is exactly same as in the 4 box example. The following figures show how the layout including media elements (such as images) functions exactly like the basic box layout.

        + +
        +<!--Default, used for all-->
        +* {box-sizing: border-box;}
        +body, div, h1 {margin: 0px; padding: 0px;}
        +html, body {width: 100%; height: 100%; overflow-x: hidden;}
        +
        +#box1 {background-color: rgb(255, 255, 141);}
        +#box2 {background-color: rgb(165, 241, 238);}
        +#box3 {background-color: rgb(248, 179, 179);}
        +#box4 {background-color: rgb(192, 161, 246);}
        +.tile 
        +{
        +   width: 50%;
        +   height: 50%;
        +   float: left;
        +}
        +.left {padding: 10px 5px 5px 10px;}
        +.right {padding: 10px 10px 5px 5px;}
        +
        +.box 
        +{
        +   width: 100%;
        +   height: 100%;
        +   padding: 20px;
        +   background: no-repeat center;
        +   background-size: 100% 100%;
        +}
        +
        +#box1 {background-image: url('../a.png');}
        +#box2 {background-image: url('../b.png');}
        +#box3 {background-image: url('../c.png');}
        +#box4 {background-image: url('../d.png');}
        +
        + + + +

        Figure: Image-based layout on a target device

        +

        Image-based layout on a target device

        + +

        Figure: Image-based scaled layout on a 16:9 mobile device

        +

        Image-based scaled layout on a 16:9 mobile device

        + + +

        Multiple Layouts for Multiple Devices

        + +

        In many cases, the desired end result for your application can be achieved using scaling and a relative layout within a single layout. However, this approach does not always provide the best quality for the end user.

        +

        You can support the best possible layout and usability with some additional development efforts. For instance, you can create an application which, on a tablet, shows the main information (clock face) and also delivers more meaningful information (calendar), while on a watch device the same application only displays the main information (clock face). This kind of end result, as shown in the following figure, cannot be achieved by only scaling up the whole layout of the watch device.

        +

        Figure: Application for a watch and tablet

        +

        Application for a watch and tablet

        + +

        W3C CSS3 Media Queries already support the majority of techniques needed to provide category-based layouts. To support the optimal layout using CSS techniques and design applications with multiple layouts, you must consider the following issues:

        + + + + +

        Since the 2.3.1 version, Tizen also supports a special media query feature to provide device shape-based layouts. If you want to create an application for both square-shaped and circular-shaped devices, you can easily migrate your application to support both shapes.

        +

        Figure: Application for a square and circular device

        +

        Application for a square and circular device

        + + +

        Viewport Setting for Multiple Layouts

        +

        The difference between multiple and single layouts is that, in the multiple layouts, the content width of the viewport meta tag is set to "device-width". This sets the layout viewport width to the ideal viewport width and tells the Web engine that the application adapts to the device width. In short, the "device-width" setting is needed to create an adaptive and responsive Web application.

        + +

        To use the meta tag in an HTML file, set its name and content:

        +
        +<meta name="viewport" content="width=device-width, user-scalable=no">
        +
        + +

        Category Classification

        + +

        When creating multiple layouts, you must first configure the layout categories. In other words, a classifying category is needed to fit the layout on the current executable environment. Media queries are supported in CSS3 to give Web application information to the executable environment.

        + +

        W3C Media Queries

        +

        Media queries consist of a media type and expressions of media features.

        + +

        The media types indicate the media on which the current Web application is running. They are defined in HTML4. The following media types are supported:

        +
        • aural
        • +
        • braille
        • +
        • handheld
        • +
        • print
        • +
        • projection
        • +
        • screen
        • +
        • tty
        • +
        • tv
        • +
        + +

        You can declare that sections apply to certain media types inside a CSS style sheet. As in the following example, you can declare screen as a media type and describe its layout inside {...}. That code applies the layout inside {...} when the Web application is run on the screen type executable context.

        + +
        +@media screen {...}
        +
        + +

        Several media queries can be combined in a media query list to configure the executable environment and define the detailed layout configuration, as needed. The following example shows a case in which the Web application runs on the executable environment having a screen media type and a 500 pixel minimum width. Its final view shows the layout inside {...} to the end user.

        + +
        +@media screen and (min-width: 500px) {...}
        +
        + +

        The following table lists the CSS media features, which you can use to specify the layout utilizing the media queries.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: Media features
        FeatureValueMin/MaxDescription
        colorintegeryesNumber of bits per a color component
        color-indexNumber of entries in the color lookup table
        device-aspect-ratiointeger/integerAspect ratio
        device-heightlengthOutput device height
        device-widthOutput device width
        gridintegernoSet to true for a grid-based device
        heightlengthyesRendering surface height
        monochromeintegerNumber of bits per pixel in a monochrome frame buffer
        resolutionresolution (dpi or dpcm)Resolution
        scanprogressive or interlacednoScanning process of the tv media types
        widthlengthyesRendering surface width
        + +

        Tizen Specialized Media Query

        +

        Tizen supports a special media query feature for a circular device shape. The following table lists the supported media features.

        + + + + + + + + + + +
        Note
        This feature is supported since 2.3.1.
        + + + + + + + + + + + + + + + + + + + +
        Table: Tizen specialized media feature
        FeatureValueMin/MaxDescription
        -tizen-geometric-shape"rectangle" | "circle"NoDevice shape
        + +

        You can combine this media query feature with the W3C type in your code. The final view shows the layout inside {...} to the end user:

        +
        +@media all and (-tizen-geometric-shape: circle) {...}
        +
        + + +

        Classification for Display Modes

        + +

        The display mode can be classified as portrait or landscape for a rectangle-shaped device, or circular for a circular device.

        + +

        Portrait and Landscape

        + +

        You can configure the device landscape and portrait mode using the device-aspect-ratio attribute in media queries. This approach is already commonly used in creating mobile Web applications. The following example shows how the max-device-aspect-ratio feature is used.

        +

        If you use the orientation:portrait/landscape feature, the layout can change unexpectedly when the virtual keypad is displayed. To avoid the problem, use the device-aspect-ratio to configure the portrait and landscape mode.

        +
        +@media screen and (max-width: 320px) and (max-device-aspect-ratio: 1/1) 
        +{
        +   <!--For portrait mode-->
        +}
        +@media screen and (max-width: 640px) and (min-device-aspect-ratio: 11/10) 
        +{
        +   <!--For landscape mode-->
        +}
        +
        + +

        Circular Device

        + +

        You can configure the device circular mode using the -tizen-geometric-shape attribute in the Tizen environment. The following example shows how to use the -tizen-geometric-shape feature.

        + + + + + + + + + + +
        Note
        This feature is supported since 2.3.1.
        + + +
        +@media all and (-tizen-geometric-shape: circle) 
        +{
        +   <!--For a circular device-->
        +}
        +
        + +

        Application Migration to a Circular Device

        + +

        This section illustrates an example for how you can migrate a basic application from a rectangular device (such as Gear 2 or Gear S) to a circular device. Use this example as the best practice to improve your layout.

        + +

        The example uses the following HTML and CSS code for the sample application and its layout.

        + +
        +<!--HTML code-->
        +<section id="main">
        +   <header>HEADER</header>
        +   <article id="content">
        +      lt;ul>
        +         <li>List Item 1</li>
        +         <li>List Item 2</li>
        +         <li>List Item 3</li>
        +         <li>List Item 4</li>
        +         <li>List Item 5</li>
        +         <li>List Item 6</li>
        +         <li>List Item 7</li>
        +         <li>List Item 8</li>
        +         <li>List Item 9</li>
        +         <li>List Item 10</li>
        +      </ul>
        +   </article>
        +   <footer>FOOTER</footer>
        +</section>
        +
        +<!--CSS code-->
        +html, body 
        +{
        +   height: 100%;
        +   width: 100%;
        +   padding: 0;
        +   margin: 0;
        +   font-size: 24px;
        +   overflow: hidden;
        +}
        +
        +section 
        +{
        +   width: 100%;
        +   height: 100%;
        +   overflow: auto;
        +   padding: 70px 0;
        +}
        +
        +header, footer 
        +{
        +   width: 100%;
        +   height: 70px;
        +   min-height: 70px;
        +   line-height: 70px;
        +   font-size: 30px;
        +   text-align: center;
        +   position: fixed;
        +}
        +
        +header 
        +{
        +   top: 0;
        +}
        +
        +footer 
        +{
        +   bottom: 0;
        +}
        +
        +article ul li 
        +{
        +   border-top: 1px solid rgba(52, 52, 52, 1);
        +   padding: 15px 20px;
        +   color: rgba(209, 209, 209, 1);
        +   font-size: 40px;
        +}
        +
        +article ul li:first 
        +{
        +   border-top: 0 none;
        +}
        + +

        To migrate the application, use the following steps:

        + +
          +
        1. Use a relative layout. + +

          To achieve a responsive layout for different devices, implement a relative layout. Simply set the width: 100% attribute to the layout elements in the CSS code:

          +
          +section 
          +{
          +   width: 100%;
          +   height: 100%;
          +   ...
          +}
          +
          +header, footer 
          +{
          +   width: 100%;
          +   ...
          +} 
          + + + + + + + + + +
          Note
          The relative layout concept is described in more detail in Relative Layout.
          +
        2. +
        3. Set extra spaces both at the top and bottom. + +

          During the migration, you can see how a certain portion of the rectangle view is covered over by the circular view, especially the header and the footer. To make them fully and consistently visible in the circular view, provide a "padding" space at the top and bottom of the page. In the following example migrating to a circular gear device from a rectangular Gear S, extra 77 px padding is used:

          +
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   section {padding: 77px 0;}
          +}
          +
          + +

          Figure: Top and bottom padding

          +

          Top and bottom padding

          +
        4. +
        5. Set the header and footer position. + +

          After setting the top and bottom padding, set the header and footer position for scrolling in the circular view.

          +

          For a rectangular device with a lengthwise screen, especially Gear S, the best option is to make only the content area scrollable.

          + +

          Figure: Scrolling with a rectangular screen

          +

          Scrolling with a rectangular screen

          +

          In a circular screen, it is better to make the whole page scrollable, including the top and bottom space.

          +

          Figure: Scrolling with a circular screen

          +

          Scrolling with a circular screen

          + +

          To implement the header and footer position, use the CSS position attribute:

          +
          +<!--Rectangular device-->
          +header, footer 
          +{
          +   position: fixed;
          +}
          +
          +<!--Circular device-->
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   header, footer 
          +   {
          +      position: static;
          +   }
          +}
          +
          + +
        6. +
        7. Move the display to the initial position. + +

          To provide a better user experience, show the entire display at the beginning, including the "top padding" space. A few seconds after the application launch, move the display back to its initial position, where the header is placed on the top without any space between itself and the edge of the screen. When the display moves like this, the users can perceive the existence of the top space.

          + +

          Figure: Moving to the initial position

          +

          Moving to the initial position

          + +

          The scroll move requires several lines of JavaScript code. In the following sample, the few (N) seconds is set to 1500 ms, but you can change the value as needed.

          +
          +(function initScrollPosition() 
          +{
          +   var SCROLL_DELAY_TIME = 1500,
          +       page = document.getElementById("main"),
          +       scrollPosition = window.parseInt(window.getComputedStyle(page)["padding-top"]),
          +       initScrollTimeoutId = null,
          +       mql = window.matchMedia("(-tizen-geometric-shape: circle)");;
          +
          +   /* The effect is applied to a circular device only, so use mediaquery */
          +   if (mql.matches) 
          +   {	
          +      page.addEventListener("scroll", function clearInitScrollCallback() 
          +      {
          +         window.clearTimeout(initScrollTimeoutId);
          +         page.removeEventListener("scroll", clearInitScrollCallback, false);
          +      }, false);
          +
          +      initScrollTimeoutId = window.setTimeout(function() 
          +      {
          +         page.scrollTop = scrollPosition;
          +      }, SCROLL_DELAY_TIME);
          +   }
          +}());
          +
          + +
        8. +
        9. Set extra attributes for a better view. + +

          Extra attributes are not mandatory in the migration process, but they can be helpful for a better application view.

          +

          Sometimes changing the layout of the basic elements is not enough to achieve a user-friendly view, and changes in other elements' layout are needed too. For example, consider setting the text-align: center attribute for the header and list items in the circular view (this attribute is already defined in the above circular screenshots). If the list is aligned to left in a circular view, the list items may not be all visible when placed out of the middle space.

          + +
          +<!--Common style for header and footer text-->
          +header, footer 
          +{
          +   text-align: center;
          +}
          +
          +<!--In a circular screen, list item has a center position-->
          +@media all and (-tizen-geometric-shape: circle) 
          +{
          +   article ul li 
          +   {
          +      text-align: center;
          +      line-height: 60px;
          +   }
          +}
          +
          +
        10. +
        + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/html/web/w3c/woff_w.htm b/org.tizen.ui.practices/html/web/w3c/woff_w.htm new file mode 100644 index 0000000..601a51c --- /dev/null +++ b/org.tizen.ui.practices/html/web/w3c/woff_w.htm @@ -0,0 +1,132 @@ + + + + + + + + + + + + + WOFF File Format (1.0): Changing Fonts Using WOFF + + + + + + +
        +

        WOFF File Format (1.0): Changing Fonts Using WOFF

        + +

        You can decode and restore font data easily.

        + +

        The new text features in WOFF File Format 1.0 include:

        +
          + +
        • WOFF file format 1.0 +

          WOFF (Web Open Font Format) is a packaging format used to decode and restore font data according to the @font-face rule to display it identically with the input font. The @font-face rule is a CSS rule that allows linking to fonts and finding a suitable font to display if the original font is not available. You can use WOFF within a Web page.

        • +
        + +

        Using the WOFF File Format

        + +

        To enhance the user experience of your application, you must learn to use the WOFF (Web Open Font Format) file format 1.0, which is a W3C standard font packaging format used in Web pages:

        + +
          +
        1. Download and use fonts installed on the Web server by creating @font-face rules. Within the rules, you can define the following properties: +
            +
          • font-family +

            Defines a name for the font. This property is mandatory.

          • +
          • src +

            Defines the URL of the font file on the server. This property is mandatory. If the local attribute is defined, the font resource is not downloaded from the server if it already exists in the local storage.

          • +
          • font-stretch +

            Defines the way the font is stretched. This property is optional.

          • +
          • font-style +

            Defines the font style. This property is optional.

          • +
          • font-weight +

            Defines the font weight. This property is optional.

          • +
          +

          Define the rules with in a <style> element in the <head> section of a Web page:

          +
          +<head>
          +   <style>
          +   @font-face
          +   {
          +      font-family: MuseoSans;
          +      src: local('MuseoSans'),
          +           url('https://www.tizen.org/sites/all/themes/tizen_theme/webfonts/244CBE_1_0.woff') format('woff');
          +   }
          +
          +   @font-face
          +   {
          +      font-family: MuseoSans;
          +      font-weight: bold;
          +      src: local('MuseoSans'),
          +           url('https://www.tizen.org/sites/all/themes/tizen_theme/webfonts/244CBE_0_0.woff') format('woff');
          +   }
          +
          +   @font-face
          +   {
          +      font-family: MuseoSans;
          +      font-weight: 900;
          +      src: local('MuseoSans'),
          +           url('https://www.tizen.org/sites/all/themes/tizen_theme/webfonts/244CBE_2_0.woff') format('woff');
          +   }
          +
          +   p:nth-child(2) {font-family: MuseoSans}
          +   p:nth-child(3) {font-family: MuseoSans; font-weight: bold;}
          +   p:nth-child(4) {font-family: MuseoSans; font-weight: 900;}
          +   </style>
          +</head>
          +
        2. +
        3. In the <body> section, create <p> elements containing text in which the font rules are implemented: +
          <body>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +   <p>The quick brown fox jumps over a lazy dog.</p>
          +</body>
          +</html>
          +
          +
        4. +
        +

        Figure: Implementing the @font-face rules (in mobile applications only)

        +

        Implementing the @font-face rules (in mobile applications only)

        + + + + +
        + +Go to top + + + + + + + \ No newline at end of file diff --git a/org.tizen.ui.practices/index.xml b/org.tizen.ui.practices/index.xml new file mode 100644 index 0000000..1590dab --- /dev/null +++ b/org.tizen.ui.practices/index.xml @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.ui.practices/plugin.xml b/org.tizen.ui.practices/plugin.xml new file mode 100644 index 0000000..90140e5 --- /dev/null +++ b/org.tizen.ui.practices/plugin.xml @@ -0,0 +1,8 @@ + + + + + + + +